pub enum CompletionResponse {
Text(String),
ToolUse {
blocks: Vec<ToolUseBlock>,
assistant_content: String,
},
}Expand description
The result of a complete_with_tools call.
Either the LLM produced a final text answer or it wants to call one or more tools.
Variants§
Text(String)
The LLM produced a final text response (stop_reason “end_turn” / finish_reason “stop”).
ToolUse
The LLM wants to invoke tools (stop_reason “tool_use” / finish_reason “tool_calls”).
Carries both the parsed tool-use blocks and the raw assistant content string.
The dispatch loop must push an Assistant message with assistant_content into
history BEFORE appending tool result messages — both Anthropic and OpenAI require
the assistant’s tool-call turn to precede the corresponding tool_result messages.
Fields
§
blocks: Vec<ToolUseBlock>Parsed tool-use blocks to dispatch.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompletionResponse
impl RefUnwindSafe for CompletionResponse
impl Send for CompletionResponse
impl Sync for CompletionResponse
impl Unpin for CompletionResponse
impl UnsafeUnpin for CompletionResponse
impl UnwindSafe for CompletionResponse
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