Wrapper for LLM generation spans with semantic convention helpers. Initialize LLM generation wrapper.Documentation Index
Fetch the complete documentation index at: https://handbook.fiddler.ai/llms.txt
Use this file to discover all available pages before exploring further.
enter()
Enter context and set LLM type. Return type: FiddlerGenerationset_model()
Set the LLM model name (gen_ai.request.model). Return type: Noneset_system()
Set the LLM system/provider (gen_ai.system). Return type: Noneset_system_prompt()
Set the system prompt (gen_ai.llm.input.system). Return type: Noneset_user_prompt()
Set the user prompt (gen_ai.llm.input.user). Return type: Noneset_completion()
Set the LLM completion/output (gen_ai.llm.output). Return type: Noneset_usage()
Set token usage information (gen_ai.usage.*). Return type: Noneset_context()
Set additional context (gen_ai.llm.context). Return type: Noneset_messages()
Set input messages in OpenAI chat format (gen_ai.input.messages). Accepts simple format:[{\"role\": \"user\", \"content\": \"...\"}]. Auto-converts to OTel format: [{\"role\": \"user\", \"parts\": [{\"type\": \"text\", \"content\": \"...\"}]}]
Return type: None
set_output_messages()
Set output messages in OpenAI chat format (gen_ai.output.messages). Accepts simple format:[{\"role\": \"assistant\", \"content\": \"...\"}]. Auto-converts to OTel format: [{\"role\": \"assistant\", \"parts\": [{\"type\": \"text\", \"content\": \"...\"}]}]
Return type: None