Expand description
§rpc-agent
This crate provides a modular framework for building RPC-based AI agent servers.
It exposes core components for agent management, tool integration, error handling,
and provider abstraction. Use the AgentServerBuilder to configure and launch
your own agent server with custom tools and providers.
§Example
Here is a minimal example of how to set up and run an Ollama RPC agent:
ⓘ
use rpc_agent::Providers;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let builder = rpc_agent::AgentServerBuilder::new(
5500,
Providers::Ollama,
"You're a friendly assistant",
"gpt-oss:20b",
);
let server = builder.build()?;
server.run().await?;
Ok(())
}§Feature Flags
tracing: Enables tracing instrumentation for request/response traces.
Modules§
Structs§
- Agent
Server - Main agent server type, responsible for handling requests and managing tools/providers.
- Agent
Server Builder - Builder for configuring and launching an
AgentServer. Builder for creating anAgentServer. - Tool
Wrapper - Wrapper type for integrating tools into the agent server.
A wrapper around a
Toolthat implementsClone.