pub struct AgentState {
pub active_model: Model,
pub messages: Vec<ChatMessage>,
pub tools: Option<Vec<Tool>>,
pub llm_input: Option<LLMInput>,
pub llm_output: Option<LLMOutput>,
pub metadata: Option<Value>,
}Fields§
§active_model: ModelThe active model to use for inference
messages: Vec<ChatMessage>§tools: Option<Vec<Tool>>§llm_input: Option<LLMInput>§llm_output: Option<LLMOutput>§metadata: Option<Value>Metadata for checkpoint persistence (context trimming state, etc.) Loaded from checkpoint on session resume and saved back after inference
Implementations§
Source§impl AgentState
impl AgentState
pub fn new( active_model: Model, messages: Vec<ChatMessage>, tools: Option<Vec<Tool>>, metadata: Option<Value>, ) -> Self
pub fn set_messages(&mut self, messages: Vec<ChatMessage>)
pub fn set_tools(&mut self, tools: Option<Vec<Tool>>)
pub fn set_active_model(&mut self, model: Model)
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 UnsafeUnpin 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