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
Source§impl Hook<AgentState> for FileScratchpadContextHook
impl Hook<AgentState> for FileScratchpadContextHook
fn name(&self) -> &str
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut HookContext<AgentState>,
event: &'life2 LifecycleEvent,
) -> Pin<Box<dyn Future<Output = Result<HookAction, HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl Hook<AgentState> for InlineScratchpadContextHook
impl Hook<AgentState> for InlineScratchpadContextHook
fn name(&self) -> &str
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut HookContext<AgentState>,
event: &'life2 LifecycleEvent,
) -> Pin<Box<dyn Future<Output = Result<HookAction, HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl Hook<AgentState> for TaskBoardContextHook
impl Hook<AgentState> for TaskBoardContextHook
fn name(&self) -> &str
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut HookContext<AgentState>,
event: &'life2 LifecycleEvent,
) -> Pin<Box<dyn Future<Output = Result<HookAction, HookError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
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> 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