this for fluent chaining.
Methods
setCompletion(text: string): this
Set the LLM completion/response text.
Alias for FiddlerSpan.setOutput — writes to gen_ai.llm.output.
The completion content.
return
this for chaining.setContext(context: string): this
Set the LLM context (e.g. retrieved RAG context) for this generation.
Context string provided to the LLM.
return
this for chaining.setMessages(messages: Record<string, unknown>[]): this
Set the full input message history sent to the model.
Array of chat messages in OpenAI/Anthropic format.
return
this for chaining.setModel(model: string): this
Set the model identifier (e.g. "gpt-4o", "claude-3-opus").
Model name or identifier string.
return
this for chaining.setOutputMessages(messages: Record<string, unknown>[]): this
Set the output messages returned by the model.
Array of assistant response messages.
return
this for chaining.setSystem(system: string): this
Set the LLM provider/system (e.g. "openai", "anthropic").
Provider identifier string.
return
this for chaining.setSystemPrompt(text: string): this
Set the system prompt text.
The system prompt content.
return
this for chaining.setToolDefinitions(definitions: Record<string, unknown>[]): this
Set the tool/function definitions available to the model.
Array of tool definition objects.
return
this for chaining.setUsage(usage: TokenUsage): this
Set token usage statistics for this generation.
If totalTokens is not provided it is computed as
inputTokens + outputTokens.
Token counts for input, output, and total.
return
this for chaining.setUserPrompt(text: string): this
Set the user prompt text.
Alias for FiddlerSpan.setInput — writes to gen_ai.llm.input.user.
The user prompt content.
return
this for chaining.