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. A `BoxedAgent` form is provided for
6//! config-driven instantiation.
7
8mod inference;
9mod middleware;
10mod pipeline;
11mod spec;
12mod r#trait;
13
14pub use inference::{InferenceClient, LocalRunnerClient, TurnResult};
15pub use middleware::{
16    AgentMiddleware, LoggingMiddleware, MiddlewareStack, RateLimitMiddleware, RedactionMiddleware,
17    ToolErrorRecoveryMiddleware,
18};
19pub use pipeline::Agent;
20pub use r#trait::AgentRef;
21pub use spec::AgentSpec;
22
23pub use atomr_agents_tool::Provider;
24
25/// Provider runtime back-ends, gated by per-provider features.
26/// Wrap any of these `Runner` types in `LocalRunnerClient` to use them
27/// as an `InferenceClient`.
28pub mod providers {
29    #[cfg(feature = "provider-anthropic")]
30    pub mod anthropic {
31        pub use atomr_infer_runtime_anthropic::{
32            classify_anthropic_error, AnthropicConfig, AnthropicPricing, AnthropicRunner,
33        };
34    }
35    #[cfg(feature = "provider-openai")]
36    pub mod openai {
37        pub use atomr_infer_runtime_openai::{
38            classify_openai_error, OpenAiConfig, OpenAiPricing, OpenAiRunner, OpenAiVariant,
39        };
40    }
41    #[cfg(feature = "provider-gemini")]
42    pub mod gemini {
43        pub use atomr_infer_runtime_gemini::{
44            classify_gemini_error, GeminiConfig, GeminiPricing, GeminiRunner, GeminiVariant,
45            SafetySetting,
46        };
47    }
48}