Struct DefaultResultFormatter
pub struct DefaultResultFormatter;Expand description
Default formatter that wraps results in a status object.
Produces JSON like:
{ "status": "running", "tool": "search" }
{ "status": "completed", "tool": "search", "result": { ... } }
{ "status": "error", "tool": "search", "error": "..." }
{ "status": "cancelled", "call_id": "abc123" }Trait Implementations§
§impl ResultFormatter for DefaultResultFormatter
impl ResultFormatter for DefaultResultFormatter
§fn format_running(&self, call: &FunctionCall) -> Value
fn format_running(&self, call: &FunctionCall) -> Value
Format the immediate acknowledgment sent when a background tool starts.
§fn format_result(
&self,
call: &FunctionCall,
result: Result<Value, ToolError>,
) -> Value
fn format_result( &self, call: &FunctionCall, result: Result<Value, ToolError>, ) -> Value
Format the final result after tool completes or fails.
§fn format_cancelled(&self, call_id: &str) -> Value
fn format_cancelled(&self, call_id: &str) -> Value
Format a cancellation response.
Auto Trait Implementations§
impl Freeze for DefaultResultFormatter
impl RefUnwindSafe for DefaultResultFormatter
impl Send for DefaultResultFormatter
impl Sync for DefaultResultFormatter
impl Unpin for DefaultResultFormatter
impl UnwindSafe for DefaultResultFormatter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more