pub struct AgentState {
pub system_prompt: String,
pub model: ModelSpec,
pub tools: Vec<Arc<dyn AgentTool>>,
pub messages: Vec<AgentMessage>,
pub is_running: bool,
pub stream_message: Option<AgentMessage>,
pub pending_tool_calls: HashSet<String>,
pub error: Option<String>,
pub available_models: Vec<ModelSpec>,
}Expand description
Observable state of the agent.
Fields§
§system_prompt: StringThe system prompt sent to the LLM.
model: ModelSpecThe model specification.
tools: Vec<Arc<dyn AgentTool>>Available tools.
messages: Vec<AgentMessage>Full conversation history.
is_running: boolWhether the agent loop is currently executing.
stream_message: Option<AgentMessage>The message currently being streamed (if any).
pending_tool_calls: HashSet<String>Tool call IDs that are currently executing.
error: Option<String>Last error from a run, if any.
available_models: Vec<ModelSpec>Available model specifications for model cycling.
Trait Implementations§
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