Skip to main content

atomr_agents_agent/
lib.rs

1//! `Agent<I, T, Ms, Ml, Sk>` and the per-turn pipeline.
2//!
3//! The agent holds an `InferenceClient` (an abstraction over a
4//! `ModelRunner` from atomr-infer); strategies are generic so the
5//! hot path is monomorphized. [`BoxedAgent`] (object-erased form)
6//! and [`AgentRef`] (Arc-wrapped handle) provide config-driven
7//! instantiation; see [`AgentSpec::into_agent`].
8
9mod boxed;
10mod inference;
11mod middleware;
12mod pipeline;
13mod spec;
14mod r#trait;
15
16pub use boxed::BoxedAgent;
17pub use inference::{InferenceClient, LocalRunnerClient, TurnResult};
18pub use middleware::{
19    AgentMiddleware, LoggingMiddleware, MiddlewareStack, RateLimitMiddleware, RedactionMiddleware,
20    ToolErrorRecoveryMiddleware,
21};
22pub use pipeline::{Agent, AgentBudgets};
23pub use r#trait::AgentRef;
24pub use spec::AgentSpec;
25
26pub use atomr_agents_tool::Provider;
27
28/// Provider runtime back-ends, gated by per-provider features.
29/// Wrap any of these `Runner` types in `LocalRunnerClient` to use them
30/// as an `InferenceClient`.
31pub mod providers {
32    #[cfg(feature = "provider-anthropic")]
33    pub mod anthropic {
34        pub use atomr_infer_runtime_anthropic::{
35            classify_anthropic_error, AnthropicConfig, AnthropicPricing, AnthropicRunner,
36        };
37    }
38    #[cfg(feature = "provider-openai")]
39    pub mod openai {
40        pub use atomr_infer_runtime_openai::{
41            classify_openai_error, OpenAiConfig, OpenAiPricing, OpenAiRunner, OpenAiVariant,
42        };
43    }
44    #[cfg(feature = "provider-gemini")]
45    pub mod gemini {
46        pub use atomr_infer_runtime_gemini::{
47            classify_gemini_error, GeminiConfig, GeminiPricing, GeminiRunner, GeminiVariant, SafetySetting,
48        };
49    }
50}