Skip to main content

ToolState

Trait ToolState 

Source
pub trait ToolState {
    type ParamType: for<'a> Deserialize<'a> + Display + JsonSchema;
    type ResultType: for<'a> Deserialize<'a> + Serialize + Display;
}
Expand description

Connects a tool to its parameter and result types.

This exists so CallableTool is forced to use the correct types (when using the tool! macro). It is separate from CallableTool because the macro implements this, and the user implements the latter.

Required Associated Types§

Source

type ParamType: for<'a> Deserialize<'a> + Display + JsonSchema

Associated parameter type.

Source

type ResultType: for<'a> Deserialize<'a> + Serialize + Display

Associated return type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§