pub struct ToolCallingRound {
pub assistant_message: UnifiedMessage,
pub tool_results: Vec<ToolResult>,
}Expand description
State for a tool calling round in multi-turn conversations.
When using tool calling, conversations often have multiple rounds:
- User asks a question
- Assistant requests tool calls
- Tools execute and return results
- Assistant uses results to form final response
ToolCallingRound captures the assistant’s tool requests and the corresponding
results, allowing providers to properly format multi-turn tool conversations.
§Example Flow
use multi_llm::{ToolCallingRound, ToolResult, UnifiedMessage};
// After receiving tool calls from the LLM
let round = ToolCallingRound {
assistant_message: assistant_response, // The message with tool calls
tool_results, // Results from executing those calls
};
// Pass to execute_llm for the next turn
// provider.execute_llm(request, Some(round), config).await?;Fields§
§assistant_message: UnifiedMessageThe assistant message that initiated tool calls.
This message contains the tool call content variants that the assistant generated.
tool_results: Vec<ToolResult>Results from executing the requested tools.
Each result’s tool_call_id should match an ID from the assistant message.
Trait Implementations§
Source§impl Clone for ToolCallingRound
impl Clone for ToolCallingRound
Source§fn clone(&self) -> ToolCallingRound
fn clone(&self) -> ToolCallingRound
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ToolCallingRound
impl RefUnwindSafe for ToolCallingRound
impl Send for ToolCallingRound
impl Sync for ToolCallingRound
impl Unpin for ToolCallingRound
impl UnwindSafe for ToolCallingRound
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