Ai

interface Ai

Gateway to AI functionality in the context of an operation. This includes both LLM and embedding models.

Functions

Link copied to clipboard
@ApiStatus.Experimental
open fun classifications(): ServiceSelector<ClassificationService>

Returns the selector for classification services. Decision services are also classification services, so this family includes them.

Link copied to clipboard
@ApiStatus.Experimental
open fun decisions(): ServiceSelector<DecisionService>

Returns the selector for decision services.

Link copied to clipboard

Get a configurable PromptRunner for this context using automatic model selection criteria. This may consider prompt and tools, so is not the same as default.

Link copied to clipboard

Get a configurable PromptRunner for this context using the default model selection criteria.

Link copied to clipboard

Return an embedding service matching the given criteria.

Return an embedding service with the given name

Link copied to clipboard
Link copied to clipboard
abstract fun withLlm(llm: LlmOptions): PromptRunner

Get a configurable PromptRunner for this context using the given LLM. Allows full control over LLM options.

open fun withLlm(model: String): PromptRunner

Get a configurable PromptRunner for this context choosing the given model by name and the default LLM options. Does not allow for any other LLM options to be set.

Link copied to clipboard

Get a configurable PromptRunner for this context choosing the given model by role and the default LLM options. Does not allow for any other LLM options to be set. Users must configure roles, for example in application.properties.

Link copied to clipboard
open fun withLlmService(llmService: LlmService<*>): PromptRunner

Get a configurable PromptRunner using a pre-resolved LLM service. Bypasses ModelProvider resolution — useful for BYOK (bring your own per-user key) scenarios, testing, or dynamic provider selection.