agent-infra-sdk 0.2.1

Unified Rust SDK for Gateway-backed and local Agent Infra APIs
Documentation

Agent Infra SDK

Rust SDK for Agent Infra APIs. Applications configure one Gateway URL and one credential provider, then use typed clients for Agent Registry, context, workspace, trace, runtime identity, model, deployment, and evaluation APIs. Platform consoles and operations tools use the typed AdminClient, whose resource methods all stay inside the Gateway-owned /admin/api namespace. Workspace file operations go through Environment Space APIs. Other APIs remain Gateway-backed.

use agent_infra_sdk::InfraClient;

let client = InfraClient::new("http://127.0.0.1:5200")?;
let agents = client.agents();
let context = client.context();
let admin = client.admin();
# Ok::<(), agent_infra_sdk::InfraClientError>(())

Feature flags can be used to include only the required typed clients.

The unified administrator facade covers Agent IDs, Context search, and Runtime IDs:

use agent_infra_sdk::agent_contract::ListAgentsRequest;

let agents = client.admin().list_agents(&ListAgentsRequest {
    limit: Some(100),
    ..Default::default()
}).await?;
let runtimes = client.admin().list_runtime_identities(&Default::default()).await?;

Model streaming returns raw SSE bytes as soon as they arrive. The streaming methods set stream=true; chunks preserve wire order but are not guaranteed to align with SSE event boundaries:

use agent_infra_sdk::CallOptions;
use serde_json::json;

let mut stream = client
    .model()
    .responses_stream(
        &json!({"model": "model-1", "input": "hello"}),
        CallOptions::default(),
    )
    .await?;
while let Some(chunk) = stream.next_chunk().await {
    forward_sse_bytes(chunk?).await?;
}