Skip to main content

tool_span_ex

Function tool_span_ex 

Source
pub fn tool_span_ex(
    tool_name: &str,
    call_id: &str,
    description: Option<&str>,
) -> Span
Expand description

Build an execute_tool {tool} span with the full OTel GenAI tool attribute set: name, call id, description, a fixed "function" tool type (the only kind executed through this in-process loop — mirrors Python’s get_function_span_attributes, observability.py:1284-1302), and placeholders for the content-capture-gated call arguments/result (fill with record_tool_arguments / record_tool_result) and the error/status fields (fill with record_error).

tool_span is the source-compatible two-argument form used today by client.rs’s FunctionInvokingChatClient; it delegates here with description = None. New call sites — and that eventual migration — should call this directly to get a real tool description and light up the content-capture-gated attributes.