LlmDecisionServiceFactory

@ApiStatus.Experimental
class LlmDecisionServiceFactory @ApiStatus.Internal constructor(llmOperations: LlmOperations, modelProvider: ModelProvider, retry: RetryProperties, observationRegistry: <Error class: unknown class> = ObservationRegistry.NOOP) : DecisionModelProvider

Builds decision and classification services that ask a chat model.

Each service records one embabel.ai.decision or embabel.ai.classification observation per call. A model named here is looked up once, when the service is built. To use a model the caller already holds, such as one built for a user's own API key, pass the LlmService instead.

As a DecisionModelProvider, it serves every chat model the ModelProvider lists, so a decision default or role can name a chat model directly and the registry builds the prompted service on first use.

Applications inject the LlmDecisionServiceFactory bean from the Spring context.

Constructors

Link copied to clipboard
@ApiStatus.Internal
constructor(llmOperations: LlmOperations, modelProvider: ModelProvider, retry: RetryProperties, observationRegistry: <Error class: unknown class> = ObservationRegistry.NOOP)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val provider: String

Name of this provider, for diagnostics.

Functions

Link copied to clipboard

Builds a classification service for a model the caller already holds.

Builds a classification service for the model with this name.

Link copied to clipboard

Builds a decision service for a model the caller already holds.

Builds a decision service for the model with this name.

Link copied to clipboard
open override fun decisionServiceNamed(name: String): DecisionService?

Builds a prompted decision service for a chat model.

Link copied to clipboard
open override fun modelNames(): List<String>

Returns the names of the chat models the model provider lists.