reagent-rs 0.2.5

A Rust library for building AI agents with MCP & custom tools
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{invoke_without_tools, Agent, AgentError, Message, NotificationHandler};


pub async fn reply_without_tools_flow(agent: &mut Agent, prompt: String) -> Result<Message, AgentError>{
    agent.history.push(Message::user(prompt));
    let response = invoke_without_tools(agent).await?;
    agent
        .notify_done(
            true, 
            response.message.content.clone()
        )
        .await;
    Ok(response.message)
}