pub struct LlmRequest {
pub system_prompt: String,
pub messages: Vec<AgentMessage>,
pub tools: Vec<ToolSchema>,
}
Expand description
Minimal request structure passed to a language model.
Fields§
§system_prompt: String
§messages: Vec<AgentMessage>
§tools: Vec<ToolSchema>
Available tools that the LLM can invoke
Implementations§
Source§impl LlmRequest
impl LlmRequest
Sourcepub fn new(
system_prompt: impl Into<String>,
messages: Vec<AgentMessage>,
) -> LlmRequest
pub fn new( system_prompt: impl Into<String>, messages: Vec<AgentMessage>, ) -> LlmRequest
Create a new LLM request
Sourcepub fn with_tools(self, tools: Vec<ToolSchema>) -> LlmRequest
pub fn with_tools(self, tools: Vec<ToolSchema>) -> LlmRequest
Add tools to the request
Trait Implementations§
Source§impl Clone for LlmRequest
impl Clone for LlmRequest
Source§fn clone(&self) -> LlmRequest
fn clone(&self) -> LlmRequest
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 moreSource§impl Debug for LlmRequest
impl Debug for LlmRequest
Source§impl<'de> Deserialize<'de> for LlmRequest
impl<'de> Deserialize<'de> for LlmRequest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LlmRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LlmRequest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for LlmRequest
impl Serialize for LlmRequest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for LlmRequest
impl RefUnwindSafe for LlmRequest
impl Send for LlmRequest
impl Sync for LlmRequest
impl Unpin for LlmRequest
impl UnwindSafe for LlmRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.