pub struct LLMResult {
pub content: String,
pub model: String,
pub token_usage: Option<TokenUsage>,
pub tool_calls: Option<Vec<ToolCall>>,
pub thinking_content: Option<String>,
}Expand description
LLM result containing response content and metadata.
Fields§
§content: String§model: String§token_usage: Option<TokenUsage>§tool_calls: Option<Vec<ToolCall>>§thinking_content: Option<String>Trait Implementations§
Source§impl BaseLanguageModel<Vec<Message>, LLMResult> for RouterLLM
impl BaseLanguageModel<Vec<Message>, LLMResult> for RouterLLM
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Returns the model name.
Source§fn with_temperature(self, _temp: f32) -> Self
fn with_temperature(self, _temp: f32) -> Self
Sets the temperature parameter.
Source§fn with_max_tokens(self, _max: usize) -> Self
fn with_max_tokens(self, _max: usize) -> Self
Sets the max tokens limit.
Source§fn temperature(&self) -> Option<f32>
fn temperature(&self) -> Option<f32>
Returns the temperature parameter.
Source§fn max_tokens(&self) -> Option<usize>
fn max_tokens(&self) -> Option<usize>
Returns the max tokens limit.
Source§impl<'de> Deserialize<'de> for LLMResult
impl<'de> Deserialize<'de> for LLMResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Runnable<Vec<Message>, LLMResult> for RouterLLM
impl Runnable<Vec<Message>, LLMResult> for RouterLLM
Source§type Error = RouterError
type Error = RouterError
Error type.
Source§fn invoke<'life0, 'async_trait>(
&'life0 self,
input: Vec<Message>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<LLMResult, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: Vec<Message>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<LLMResult, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transforms single input to output. Read more
Source§fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Batch processing - transforms multiple inputs to outputs. Read more
Source§fn stream<'life0, 'async_trait>(
&'life0 self,
input: Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Output, Self::Error>> + Send>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
input: Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Output, Self::Error>> + Send>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streaming output - for real-time responses (LLM, etc). Read more
Auto Trait Implementations§
impl Freeze for LLMResult
impl RefUnwindSafe for LLMResult
impl Send for LLMResult
impl Sync for LLMResult
impl Unpin for LLMResult
impl UnsafeUnpin for LLMResult
impl UnwindSafe for LLMResult
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