Capturing Prompt Executor
A PromptExecutor that accumulates the LLMConsumption of the calls it intercepts and hands it back via collectAndClear. The training infrastructure creates one per leaf prompt call (via the session's capturingExecutorFactory) and reads its consumption between retry attempts; the concrete provider-aware extraction lives in the app.
Inheritors
Functions
Link copied to clipboard
Returns the consumption accumulated since the previous call (or since construction), then resets the accumulator. Returns null when nothing was captured.
Link copied to clipboard
fun executeBlocking(prompt: Prompt, resolvedModel: ResolvedModel, tools: List<ToolDescriptor>): Message.Assistant
Link copied to clipboard
open suspend fun executeMultipleChoices(prompt: Prompt, resolvedModel: ResolvedModel, tools: List<ToolDescriptor>): LLMChoice
open suspend fun executeMultipleChoices(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): LLMChoice
Link copied to clipboard
fun executeMultipleChoicesBlocking(prompt: Prompt, resolvedModel: ResolvedModel, tools: List<ToolDescriptor>): LLMChoice
fun executeMultipleChoicesBlocking(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): LLMChoice
Link copied to clipboard
open fun executeStreaming(prompt: Prompt, resolvedModel: ResolvedModel, tools: List<ToolDescriptor>): Flow<StreamFrame>
abstract fun executeStreaming(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): Flow<StreamFrame>
Link copied to clipboard
fun executeStreamingBlocking(prompt: Prompt, resolvedModel: ResolvedModel, tools: List<ToolDescriptor>): Flow.Publisher<StreamFrame>
fun executeStreamingBlocking(prompt: Prompt, model: LLModel, tools: List<ToolDescriptor>): Flow.Publisher<StreamFrame>
Link copied to clipboard
inline suspend fun <OutputStructT> PromptExecutor.executeStructuredOrThrow(prompt: Prompt, model: LLModel): OutputStructT
Executes prompt against model, requesting a structured response of type OutputStructT, and returns the parsed data.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open suspend fun resolveModel(model: LLModel, promptExecutorOperation: PromptExecutorOperation): ResolvedModel
Link copied to clipboard
fun resolveModelBlocking(requestedModel: LLModel, promptExecutorOperation: PromptExecutorOperation): ResolvedModel