helios_engine/
lib.rs

1//! # Helios - LLM Agent Framework
2//!
3//! Helios is a powerful and flexible Rust framework for building LLM-powered agents
4//! with tool support, chat capabilities, and easy configuration management.
5//!
6//! ## Quick Start
7//!
8//! ### Using as a Library (Direct LLM Calls)
9//!
10//! ```no_run
11//! use helios::{LLMClient, ChatMessage};
12//! use helios::config::LLMConfig;
13//!
14//! #[tokio::main]
15//! async fn main() -> helios::Result<()> {
16//!     let llm_config = LLMConfig {
17//!         model_name: "gpt-3.5-turbo".to_string(),
18//!         base_url: "https://api.openai.com/v1".to_string(),
19//!         api_key: std::env::var("OPENAI_API_KEY").unwrap(),
20//!         temperature: 0.7,
21//!         max_tokens: 2048,
22//!     };
23//!
24//!     let client = LLMClient::new(llm_config);
25//!     let messages = vec![
26//!         ChatMessage::system("You are a helpful assistant."),
27//!         ChatMessage::user("What is the capital of France?"),
28//!     ];
29//!
30//!     let response = client.chat(messages, None).await?;
31//!     println!("Response: {}", response.content);
32//!     Ok(())
33//! }
34//! ```
35//!
36//! ### Using with Agent System
37//!
38//! ```no_run
39//! use helios::{Agent, Config, CalculatorTool};
40//!
41//! #[tokio::main]
42//! async fn main() -> helios::Result<()> {
43//!     let config = Config::from_file("config.toml")?;
44//!     
45//!     let mut agent = Agent::builder("MyAgent")
46//!         .config(config)
47//!         .system_prompt("You are a helpful assistant.")
48//!         .tool(Box::new(CalculatorTool))
49//!         .build()?;
50//!     
51//!     let response = agent.chat("What is 15 * 7?").await?;
52//!     println!("Agent: {}", response);
53//!     Ok(())
54//! }
55//! ```
56//!
57//! ## Features
58//!
59//! - **Direct LLM Access**: Use `LLMClient` for simple, direct calls to LLM models
60//! - **Agent System**: Create intelligent agents with tools and persistent conversation
61//! - **Tool Support**: Extensible tool system for adding custom functionality
62//! - **Multi-Provider**: Works with OpenAI, Azure OpenAI, local models, and any OpenAI-compatible API
63//! - **Type-Safe**: Leverages Rust's type system for reliability
64//! - **Async**: Built on Tokio for high-performance async operations
65
66pub mod config;
67pub mod agent;
68pub mod llm;
69pub mod tools;
70pub mod chat;
71pub mod error;
72
73// Re-export core types for convenient access
74pub use config::{Config, LLMConfig};
75pub use agent::{Agent, AgentBuilder};
76pub use llm::{LLMClient, LLMProvider, LLMRequest, LLMResponse, StreamChunk, StreamChoice, Delta};
77pub use tools::{Tool, ToolRegistry, ToolParameter, ToolResult, CalculatorTool, EchoTool};
78pub use chat::{ChatMessage, ChatSession, Role};
79pub use error::{HeliosError, Result};