LlmEntityExtractor

data class LlmEntityExtractor(llmOptions: <Error class: unknown class>, ai: <Error class: unknown class>, template: String = "suggest_entities") : EntityExtractor

LLM-based entity extractor.

Uses structured output to extract entities from text based on the schema defined in the com.embabel.dice.common.SourceAnalysisContext.

Example usage:

val extractor = LlmEntityExtractor
.withLlm(llmOptions)
.withAi(ai)

val entities = extractor.suggestEntities(chunk, context)

Parameters

llmOptions

LLM configuration (model, temperature, etc.)

ai

The Embabel AI instance for LLM calls

template

Template name for entity extraction prompt (default: "suggest_entities")

Constructors

Link copied to clipboard
constructor(llmOptions: <Error class: unknown class>, ai: <Error class: unknown class>, template: String = "suggest_entities")

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun suggestEntities(chunk: <Error class: unknown class>, context: SourceAnalysisContext): SuggestedEntities

Suggest entities from a chunk based on the provided schema.

Link copied to clipboard

Set a custom template for entity extraction.