Expand description
ZAP client implementation
Provides a high-level async client for connecting to ZAP servers and gateways.
Uses Cap’n Proto RPC over the twoparty VatNetwork.
§Example
ⓘ
use zap::{Client, Result};
use serde_json::json;
#[tokio::main]
async fn main() -> Result<()> {
let client = Client::connect("zap://localhost:9999").await?;
// Initialize connection
let server_info = client.init("my-client", "1.0.0").await?;
println!("Connected to: {} v{}", server_info.name, server_info.version);
// List and call tools
let tools = client.list_tools().await?;
let result = client.call_tool("search", json!({"query": "hello"})).await?;
Ok(())
}Structs§
- Client
- ZAP client for connecting to ZAP gateways
- Client
Info - Client info sent during initialization
- Prompt
- Prompt definition
- Prompt
Argument - Prompt argument
- Prompt
Message - Prompt message
- Resource
- Resource definition
- Resource
Content - Resource content
- Resource
Stream - Resource stream for subscription-based updates
- Server
Capabilities - Server capabilities
- Server
Info - Server info received during initialization
- Tool
- Tool definition
Enums§
- Content
- Content types
- LogLevel
- Log level for server logging
- Message
Content - Message content
- Role
- Message role