pub struct AgentState {
pub agent_model: AgentModel,
pub messages: Vec<ChatMessage>,
pub tools: Option<Vec<Tool>>,
pub llm_input: Option<LLMInput>,
pub llm_output: Option<LLMOutput>,
pub metadata: Option<HashMap<String, Value>>,
}Fields§
§agent_model: AgentModel§messages: Vec<ChatMessage>§tools: Option<Vec<Tool>>§llm_input: Option<LLMInput>§llm_output: Option<LLMOutput>§metadata: Option<HashMap<String, Value>>Implementations§
Source§impl AgentState
impl AgentState
pub fn new( agent_model: AgentModel, messages: Vec<ChatMessage>, tools: Option<Vec<Tool>>, ) -> Self
pub fn set_messages(&mut self, messages: Vec<ChatMessage>)
pub fn set_tools(&mut self, tools: Option<Vec<Tool>>)
pub fn set_agent_model(&mut self, agent_model: AgentModel)
pub fn set_llm_input(&mut self, llm_input: Option<LLMInput>)
pub fn set_llm_output( &mut self, new_message: LLMMessage, new_usage: Option<LLMTokenUsage>, )
pub fn append_new_message(&mut self, new_message: ChatMessage)
Trait Implementations§
Source§impl Clone for AgentState
impl Clone for AgentState
Source§fn clone(&self) -> AgentState
fn clone(&self) -> AgentState
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 AgentState
impl Debug for AgentState
Source§impl Default for AgentState
impl Default for AgentState
Source§fn default() -> AgentState
fn default() -> AgentState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AgentState
impl RefUnwindSafe for AgentState
impl Send for AgentState
impl Sync for AgentState
impl Unpin for AgentState
impl UnwindSafe for AgentState
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,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request