Skip to main content

ToolHtmlRenderer

Trait ToolHtmlRenderer 

Source
pub trait ToolHtmlRenderer: Send + Sync {
    // Required methods
    fn render_call(
        &self,
        tool_call_id: &str,
        tool_name: &str,
        arguments: &Value,
    ) -> Option<String>;
    fn render_result(
        &self,
        tool_call_id: &str,
        tool_name: &str,
        result: &[ToolResultContent],
        details: Option<&Value>,
        is_error: bool,
    ) -> Option<RenderedResult>;
}
Expand description

Renderer seam for extension-defined tools.

Required Methods§

Source

fn render_call( &self, tool_call_id: &str, tool_name: &str, arguments: &Value, ) -> Option<String>

Render a custom tool call, or return None to use the generic viewer.

Source

fn render_result( &self, tool_call_id: &str, tool_name: &str, result: &[ToolResultContent], details: Option<&Value>, is_error: bool, ) -> Option<RenderedResult>

Render a custom tool result, or return None to use the generic viewer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§