Expand description
ObjectiveAI SDK for Rust.
This crate provides data structures, validation, and client-side compilation for the ObjectiveAI API - a platform for scoring, ranking, and simulating preferences using swarms of agents.
§Core Concepts
- Agent: A configured instance of a single upstream language model
- Swarm: A collection of Agents used together for voting
- Vector Completion: Runs multiple agents to vote on responses, producing weighted scores
- Function: A composable scoring pipeline built from Vector Completions
- Profile: Learned weights for a Function, trained on example data
§Features
http(default): Enables the HTTP client for making API requests
§Modules
auth- API authentication typesagent- Agent definitions, configuration, and completion APIsswarm- Swarm definitions and validationerror- Error typesfunctions- Function definitions, execution, and client-side compilationprefixed_uuid- UUID utilitiesvector- Vector completion APIs
When the http feature is enabled:
HttpClient- HTTP client for API requestsHttpError- HTTP error types
Re-exports§
pub use http::*;
Modules§
- agent
- Agent definitions, configuration, and completion API types.
- arbitrary_
util - Arbitrary helpers for types that don’t natively implement
Arbitraryor that need bounded generation to avoid extreme values. - auth
- Authentication types for the ObjectiveAI API.
- binary_
frame - The binary wire frame:
[u32 BE header length][JSON header][raw payload bytes], all in ONE WebSocket binary message. - cli
- client_
objectiveai_ mcp - Client-side ObjectiveAI MCP envelopes — the shapes the API pushes down the reverse-attach channel from #193 (stage 2+).
- daemon
- data_
url - Data-URL parsing utility shared across the SDK.
- error
- Error types for the ObjectiveAI SDK.
- functions
- Function definitions, profiles, and execution types.
- http
- HTTP client for the ObjectiveAI API.
- identity
- The caller IDENTITY: who originated a request — agent coordinates,
response routing, the plugin caller trio, task provenance. Root-
level and feature-free: every wire surface that names its caller
(command-execution env/headers,
/listenframes, channel offers) embeds this ONE struct. - laboratories
- Laboratories: completion-wide client-side MCP servers.
- machine
- mcp
- net
- Socket-level policy shared by every ObjectiveAI server and long-lived client connection: TCP keepalive.
- prefixed_
uuid - Prefixed UUID type for ObjectiveAI identifiers.
- process
- Process-management helpers that pair with [
crate::lockfile]’s owner lookups: given a pid (e.g. from [crate::lockfile::owners] / [crate::lockfile::owners_in_tree]), ask the OS to terminate it — plus the repo-wideno_windowspawn hygiene. - swarm
- Swarm definitions and validation.
- vector
- Vector completion API types.
Structs§
- Weights
Entry - An entry in weights with an explicit weight and optional invert flag.
Enums§
- Remote
- The remote source where a function, profile, or agent is hosted.
- Remote
Path - Remote
Path Commit Optional - Weights
- Weights for a swarm’s agents.
Functions§
- flatten_
schema - Schema helper: produces a
$reftoTfor use with#[schemars(schema_with)]on#[serde(flatten)]fields, preventing schemars from merging the inner type’s schema into the parent. - json_
schemas - Returns JSON Schemas for all public types that derive
JsonSchema. - ref_
wrapper_ object - Schema transform (for
#[schemars(transform = ...)]): inserts a top-level"type": "object"alongside whatever the schema already holds.