pub struct LLMResponse<C>{
pub content: C,
pub tool_calls: Vec<ToolCall>,
pub is_complete: bool,
}Expand description
Response from an LLM including generated content and tool calls.
This struct represents a complete response from an LLM, which may include generated text content and/or requests to call tools.
§Examples
use runtime::llm::{LLMResponse, ToolCall};
let response = LLMResponse {
content: "Let me calculate that for you".to_string(),
tool_calls: vec![
ToolCall {
name: "calculator".to_string(),
input: serde_json::json!({"operation": "add", "a": 2, "b": 2}),
}
],
is_complete: false,
};Fields§
§content: CThe generated content from the LLM
tool_calls: Vec<ToolCall>Tool calls requested by the LLM (supports multiple calls)
is_complete: boolWhether the response is complete (false if tool calls need to be executed)
Trait Implementations§
Source§impl<C> Clone for LLMResponse<C>
impl<C> Clone for LLMResponse<C>
Source§fn clone(&self) -> LLMResponse<C>
fn clone(&self) -> LLMResponse<C>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C> Debug for LLMResponse<C>
impl<C> Debug for LLMResponse<C>
Source§impl<C> Default for LLMResponse<C>
impl<C> Default for LLMResponse<C>
Source§fn default() -> LLMResponse<C>
fn default() -> LLMResponse<C>
Returns the “default value” for a type. Read more
Source§impl<C> LLMResponseTrait<C> for LLMResponse<C>
impl<C> LLMResponseTrait<C> for LLMResponse<C>
Auto Trait Implementations§
impl<C> Freeze for LLMResponse<C>where
C: Freeze,
impl<C> RefUnwindSafe for LLMResponse<C>where
C: RefUnwindSafe,
impl<C> Send for LLMResponse<C>
impl<C> Sync for LLMResponse<C>where
C: Sync,
impl<C> Unpin for LLMResponse<C>where
C: Unpin,
impl<C> UnwindSafe for LLMResponse<C>where
C: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more