aix-core 0.1.0

Core abstractions and types for the AIX library
Documentation
//! AIX Core Library
//!
//! This is the core library that provides unified abstractions and types
//! for interacting with multiple AI providers. It includes:
//!
//! - Common types and error handling
//! - Provider traits and capabilities
//! - Retry logic with exponential backoff
//! - Streaming utilities and abstractions
//!
//! # Example
//!
//! ```rust
//! use aix_core::{AiProvider, ChatRequest, ChatMessage};
//!
//! # async fn example<P: AiProvider>(provider: P) -> Result<(), Box<dyn std::error::Error>> {
//! let request = ChatRequest::simple("gpt-4", "Hello, world!");
//! let response = provider.chat(request).await?;
//! println!("Response: {}", response.content);
//! # Ok(())
//! # }
//! ```

pub mod error;
pub mod retry;
pub mod streaming;
pub mod traits;
pub mod types;

// Re-export commonly used types for convenience
pub use error::{AixError, AixResult};
pub use retry::{RetryConfig, RetryStrategy};
pub use streaming::{StreamExt, TokenStream};
pub use traits::{AiProvider, AiProviderExt, ModelCapabilities};
pub use types::{
    ChatMessage, ChatRequest, ChatResponse, ModelConfig, Role, StreamChunk, Usage,
};

#[cfg(test)]
mod tests {
    use super::*;
    use crate::types::ChatMessage;

    #[test]
    fn test_library_imports() {
        // Test that all commonly used types are available
        let _msg = ChatMessage::user("test");
        let _config = ModelConfig::new();
        let _capabilities = ModelCapabilities::basic_text(4096, 8192);
        let _retry_config = RetryConfig::default();
        
        // Test error creation
        let _error = AixError::config("test error");
        
        // Test result type
        let _result: AixResult<String> = Ok("test".to_string());
    }
}