pub struct Agent { /* private fields */ }Expand description
Main Agent struct
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn builder() -> AgentBuilder
pub fn builder() -> AgentBuilder
Create a new agent builder
Sourcepub async fn create_session(&self) -> Result<SessionId>
pub async fn create_session(&self) -> Result<SessionId>
Create a new conversation session
Sourcepub async fn get_session(
&self,
session_id: &SessionId,
) -> Result<Option<Session>>
pub async fn get_session( &self, session_id: &SessionId, ) -> Result<Option<Session>>
Get a session by ID
Sourcepub async fn end_session(&self, session_id: &SessionId) -> Result<()>
pub async fn end_session(&self, session_id: &SessionId) -> Result<()>
End a conversation session
Sourcepub async fn add_guideline(
&mut self,
guideline: Guideline,
) -> Result<GuidelineId>
pub async fn add_guideline( &mut self, guideline: Guideline, ) -> Result<GuidelineId>
Add a guideline to the agent
Sourcepub async fn add_journey(&mut self, journey: Journey) -> Result<JourneyId>
pub async fn add_journey(&mut self, journey: Journey) -> Result<JourneyId>
Add a journey to the agent
Sourcepub async fn start_journey(
&self,
session_id: &SessionId,
journey_id: &JourneyId,
) -> Result<JourneyState>
pub async fn start_journey( &self, session_id: &SessionId, journey_id: &JourneyId, ) -> Result<JourneyState>
Start a journey for a session
Sourcepub async fn get_journey_state(
&self,
session_id: &SessionId,
) -> Result<Option<JourneyState>>
pub async fn get_journey_state( &self, session_id: &SessionId, ) -> Result<Option<JourneyState>>
Get current journey state for a session
Sourcepub async fn process_journey_step(
&self,
session_id: &SessionId,
message: &str,
) -> Result<JourneyStep>
pub async fn process_journey_step( &self, session_id: &SessionId, message: &str, ) -> Result<JourneyStep>
Process a journey step with user message
Sourcepub async fn end_journey(&self, session_id: &SessionId) -> Result<()>
pub async fn end_journey(&self, session_id: &SessionId) -> Result<()>
End a journey for a session
Sourcepub async fn process_message(
&self,
session_id: SessionId,
user_message: String,
) -> Result<AgentResponse>
pub async fn process_message( &self, session_id: SessionId, user_message: String, ) -> Result<AgentResponse>
Process a user message and generate a response
Auto Trait Implementations§
impl Freeze for Agent
impl !RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl !UnwindSafe for Agent
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