pub struct AgentSession { /* private fields */ }Implementations§
Source§impl AgentSession
impl AgentSession
pub fn new(id: SessionId) -> Self
pub fn id(&self) -> Option<SessionId>
pub fn messages(&self) -> &[Message]
pub fn chat_messages(&self) -> &[ChatMessage]
pub fn is_action_allowed(&self, action_key: &str) -> bool
pub fn allow_action(&mut self, action_key: impl Into<String>)
pub fn push_message(&mut self, role: MessageRole, content: impl Into<String>)
pub fn push_user_message_with_images( &mut self, content: impl Into<String>, images: Vec<ImageAttachment>, )
pub fn push_assistant_tool_call( &mut self, tool_call_id: &str, tool_name: &str, arguments_json: &str, )
pub fn push_assistant_tool_calls( &mut self, tool_calls: &[(String, String, String)], )
pub fn push_tool_result( &mut self, tool_call_id: &str, content: impl Into<String>, )
Trait Implementations§
Source§impl Clone for AgentSession
impl Clone for AgentSession
Source§fn clone(&self) -> AgentSession
fn clone(&self) -> AgentSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AgentSession
impl Debug for AgentSession
Source§impl Default for AgentSession
impl Default for AgentSession
Source§fn default() -> AgentSession
fn default() -> AgentSession
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AgentSession
impl<'de> Deserialize<'de> for AgentSession
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentSession
impl RefUnwindSafe for AgentSession
impl Send for AgentSession
impl Sync for AgentSession
impl Unpin for AgentSession
impl UnsafeUnpin for AgentSession
impl UnwindSafe for AgentSession
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