create_tool_result

Function create_tool_result 

Source
pub fn create_tool_result<T: Serialize>(
    tool_call_id: impl Into<String>,
    content: &T,
) -> Result<ToolResult, Error>
Expand description

Creates a ToolResult from a tool call ID and a serializable payload.

This is a convenience function to correctly format a tool result. It serializes the provided content into a JSON string.