pub trait LLMResponseTrait<C: for<'de> Deserialize<'de> + Default + Send> {
// Required methods
fn new(content: C, tool_calls: Vec<ToolCall>, is_complete: bool) -> Self;
fn is_complete(&self) -> bool;
fn tool_calls(&self) -> Vec<ToolCall>;
fn content(&self) -> C;
}Expand description
Trait for LLM response types with tool calling support.
This trait defines the interface for LLM responses, supporting both content generation and tool calling capabilities.
Required Methods§
Sourcefn new(content: C, tool_calls: Vec<ToolCall>, is_complete: bool) -> Self
fn new(content: C, tool_calls: Vec<ToolCall>, is_complete: bool) -> Self
Creates a new LLM response.
Sourcefn is_complete(&self) -> bool
fn is_complete(&self) -> bool
Returns whether the response is complete.
Sourcefn tool_calls(&self) -> Vec<ToolCall>
fn tool_calls(&self) -> Vec<ToolCall>
Returns the tool calls requested by the LLM.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.