Functions
FUNC get_model_id_str
backend: Backend instance
- String representation of the model_id
FUNC get_system_name
backend: Backend instance
- System name (e.g., ‘openai’, ‘ollama’, ‘huggingface’)
FUNC get_context_size
ctx: Context object
- Number of items in context, or 0 if cannot be determined
FUNC instrument_generate_from_context
backend: Backend instanceaction: Action componentctx: Contextformat: Response format (BaseModel subclass or None)tool_calls: Whether tool calling is enabled
- Context manager for the trace span
FUNC start_generate_span
backend: Backend instanceaction: Action componentctx: Contextformat: Response format (BaseModel subclass or None)tool_calls: Whether tool calling is enabled
- Span object or None if tracing is disabled
FUNC instrument_generate_from_raw
backend: Backend instancenum_actions: Number of actions in the batchformat: Response format (BaseModel subclass or None)tool_calls: Whether tool calling is enabled
- Context manager for the trace span
FUNC record_token_usage
span: The span object (may be None if tracing is disabled)usage: Usage object or dict from the LLM response (e.g., OpenAI usage object)
FUNC record_response_metadata
span: The span object (may be None if tracing is disabled)response: Response object or dict from the LLMmodel_id: Model ID used for the response (if different from request)