LlmCandidateBakeoff

data class LlmCandidateBakeoff(llmOptions: <Error class: unknown class>, ai: <Error class: unknown class>, promptStrategy: BakeoffPromptStrategy = BakeoffPromptStrategies.COMPACT) : CandidateBakeoff

Uses an LLM to select the best match from multiple candidates.

This is more efficient than evaluating candidates one-by-one, and allows the LLM to compare and contrast options. Uses structured output for reliable parsing.

Two built-in prompt strategies are available in BakeoffPromptStrategies:

Custom strategies can be implemented for domain-specific prompt requirements.

Returns the best matching candidate, or null if none match.

Example usage (Java-friendly builder):

var bakeoff = LlmCandidateBakeoff
.withLlm(llmOptions)
.withAi(ai)
.withPromptStrategy(BakeoffPromptStrategies.FULL);

Parameters

llmOptions

LLM configuration (model, temperature, etc.)

ai

The Embabel AI instance for LLM calls

promptStrategy

Strategy for building prompts (default: COMPACT)

Constructors

Link copied to clipboard
constructor(llmOptions: <Error class: unknown class>, ai: <Error class: unknown class>, promptStrategy: BakeoffPromptStrategy = BakeoffPromptStrategies.COMPACT)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun selectBestMatch(suggested: SuggestedEntity, candidates: List<<Error class: unknown class><<Error class: unknown class>>>, sourceText: String?): <Error class: unknown class>?

Select the best matching candidate from a list.

Link copied to clipboard

Set the prompt strategy.