Interface EntityExtractionOptions

Options for entity extraction from text.

interface EntityExtractionOptions {
    text: string;
    entitySchema: JSONSchema;
    taskName: string;
    instructions?: string;
    examples?: {
        input: string;
        output: unknown;
    }[];
    providerId?: string;
    modelId?: string;
    extractAll?: boolean;
}

Properties

text: string

Text to extract entities from

entitySchema: JSONSchema

Schema defining the entities to extract

taskName: string

Name for the extraction task

instructions?: string

Additional context or instructions

examples?: {
    input: string;
    output: unknown;
}[]

Examples of expected extractions

Type declaration

  • input: string
  • output: unknown
providerId?: string

LLM provider to use

modelId?: string

Model ID to use

extractAll?: boolean

Whether to extract all occurrences or just first