dasein_agentic_llm/lib.rs
1//! # agentic-llm
2//!
3//! LLM adapters for the Agentic Framework.
4//!
5//! Supports multiple providers:
6//! - `OpenAI` (GPT-4, GPT-4o, o1)
7//! - Ollama (local models)
8//! - Anthropic (Claude Sonnet, Haiku, Opus)
9//! - Google Gemini (Gemini 2.0 Flash, 1.5 Pro)
10//!
11//! ## Example
12//!
13//! ```rust,no_run
14//! use agentic_llm::{LLMAdapter, OpenAIAdapter, LLMMessage};
15//!
16//! #[tokio::main]
17//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
18//! let adapter = OpenAIAdapter::new("sk-...", "gpt-4o");
19//!
20//! let messages = vec![
21//! LLMMessage::system("You are a helpful assistant."),
22//! LLMMessage::user("Hello!"),
23//! ];
24//!
25//! let response = adapter.generate(&messages).await?;
26//! println!("{}", response.content);
27//!
28//! Ok(())
29//! }
30//! ```
31
32mod error;
33mod traits;
34
35#[cfg(feature = "openai")]
36mod openai;
37
38#[cfg(feature = "ollama")]
39mod ollama;
40
41#[cfg(feature = "anthropic")]
42mod anthropic;
43
44#[cfg(feature = "gemini")]
45mod gemini;
46
47pub use error::LLMError;
48pub use traits::{
49 FinishReason, LLMAdapter, LLMMessage, LLMResponse, Role, StreamChunk, TokenUsage,
50};
51
52#[cfg(feature = "openai")]
53pub use openai::OpenAIAdapter;
54
55#[cfg(feature = "ollama")]
56pub use ollama::OllamaAdapter;
57
58#[cfg(feature = "anthropic")]
59pub use anthropic::AnthropicAdapter;
60
61#[cfg(feature = "gemini")]
62pub use gemini::GeminiAdapter;