Skip to content

Keyword Extraction Task

openaivec.task.nlp.keyword_extraction

Keyword extraction task definition.

Classes

Keyword

Bases: BaseModel

Single keyword or keyphrase entry.

KeywordExtraction

Bases: BaseModel

Keyword extraction output.

Functions

keyword_extraction

keyword_extraction() -> PreparedTask[KeywordExtraction]

Create a keyword extraction task.

Source code in src/openaivec/task/nlp/keyword_extraction.py
def keyword_extraction() -> PreparedTask[KeywordExtraction]:
    """Create a keyword extraction task."""
    return PreparedTask(
        instructions=_build_instructions(),
        response_format=KeywordExtraction,
    )