objectiveai_sdk/agent/mod.rs
1//! Agent definitions, configuration, and completion API types.
2//!
3//! An **Agent** is a fully-specified configuration of a single upstream
4//! language model. It encapsulates:
5//!
6//! - Model identity (which LLM to use)
7//! - Prompt structure (prefix/suffix messages)
8//! - Decoding parameters (temperature, top_p, etc.)
9//! - Provider preferences and routing
10//! - Output mode, reasoning settings, and verbosity
11//!
12//! # Content-Addressed Identity
13//!
14//! Agents use **content-addressed identifiers** - their ID is derived
15//! deterministically from their full definition using XXHash3-128. This ensures:
16//!
17//! - Two identical definitions always produce the same ID
18//! - IDs can be computed anywhere (server, client, browser via WASM)
19//! - No hidden mutation or "latest version" ambiguity
20//!
21//! # Normalization
22//!
23//! Before computing an ID, definitions are normalized via [`InlineAgentBase::prepare`]:
24//!
25//! - Default values are removed (e.g., `temperature: 1.0` becomes `None`)
26//! - Empty collections are removed
27//! - Collections are sorted for deterministic ordering
28
29mod agent;
30pub mod claude_agent_sdk;
31pub mod codex_sdk;
32pub mod completions;
33mod continuation;
34mod mcp;
35pub mod mock;
36pub mod openrouter;
37mod output_mode;
38pub mod request;
39pub mod response;
40mod upstream;
41
42pub use agent::*;
43pub use continuation::*;
44pub use mcp::*;
45pub use output_mode::*;
46pub use upstream::*;
47
48#[cfg(feature = "http")]
49mod http;
50
51#[cfg(feature = "http")]
52pub use http::*;