Skip to content

Aganium/agenium-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agenium

Rust SDK for the agent:// protocol.

Quick Start

[dependencies]
agenium = { path = "." }

Client

use agenium::AgentClient;

#[tokio::main]
async fn main() -> agenium::Result<()> {
    let client = AgentClient::new("agent://my-bot.agent");
    let response = client.send("agent://target.agent", "Hello!").await?;
    println!("{:?}", response.messages);
    Ok(())
}

Server

use agenium::{AgentServer, ProtocolFrame, Message, Role};

#[tokio::main]
async fn main() -> agenium::Result<()> {
    AgentServer::builder()
        .name("echo")
        .api_key("dom_<your_key>")
        .endpoint("https://your-server.com")
        .port(4000)
        .handler(|frame: ProtocolFrame| async move {
            Ok(ProtocolFrame {
                from: frame.to,
                to: frame.from,
                conversation_id: frame.conversation_id,
                messages: vec![Message {
                    role: Role::Agent,
                    content: "Hello back!".into(),
                    metadata: None,
                }],
            })
        })
        .build()?
        .run()
        .await
}

Feature Flags

Flag Default Description
client AgentClient, Resolver, Registrar (reqwest)
server AgentServer (axum)

License

MIT

Bug Reporting

This project includes optional bug reporting to the Agenium monitoring server.

Configuration

Set the following environment variables to enable bug reporting:

BUG_REPORT_URL=http://130.185.123.153:3100
BUG_REPORT_TOKEN=your_token_here

Bug reporting is disabled by default — it only activates when BUG_REPORT_TOKEN is set. Reports are sent asynchronously (fire and forget) and never block the main application.

About

Rust SDK for the `agent://` protocol.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages