agixt_sdk/
lib.rs

1//! # AGiXT Rust SDK
2//! 
3//! This is the official Rust SDK for AGiXT, providing a type-safe way to interact with the AGiXT API.
4//! 
5//! ## Features
6//! 
7//! - Full API coverage for AGiXT
8//! - Async/await support
9//! - Type-safe request and response handling
10//! - Comprehensive error handling
11//! 
12//! ## Example
13//! 
14//! ```rust,no_run
15//! use agixt_sdk::AGiXTSDK;
16//! 
17//! #[tokio::main]
18//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
19//!     // Create a new SDK instance
20//!     let client = AGiXTSDK::new(
21//!         Some("http://localhost:7437".to_string()),
22//!         Some("your-api-key".to_string()),
23//!         false,
24//!     );
25//! 
26//!     // Get list of available providers
27//!     let providers = client.get_providers().await?;
28//!     println!("Available providers: {:?}", providers);
29//! 
30//!     // Create a new agent
31//!     let agent_name = "my_agent";
32//!     client.add_agent(agent_name, None, None, None).await?;
33//! 
34//!     // Start a new conversation
35//!     let conversation = client.new_conversation(agent_name, "test_conversation", None).await?;
36//!     println!("Created conversation: {:?}", conversation);
37//! 
38//!     Ok(())
39//! }
40//! ```
41//! 
42//! ## Authentication
43//! 
44//! ```rust,no_run
45//! use agixt_sdk::AGiXTSDK;
46//! 
47//! #[tokio::main]
48//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
49//!     let client = AGiXTSDK::new(None, None, false);
50//! 
51//!     // Register a new user
52//!     let otp_uri = client.register_user(
53//!         "user@example.com",
54//!         "John",
55//!         "Doe"
56//!     ).await?;
57//!     println!("Registration successful. OTP URI: {}", otp_uri);
58//! 
59//!     // Login with email and OTP
60//!     if let Some(token) = client.login("user@example.com", "123456").await? {
61//!         println!("Login successful! Token: {}", token);
62//!     }
63//! 
64//!     Ok(())
65//! }
66//! ```
67
68pub mod error;
69pub mod models;
70pub mod client;
71
72pub use client::AGiXTSDK;
73pub use error::Error;
74
75// Re-export commonly used types
76pub use client::{
77    Agent,
78    AgentRequest,
79    ConversationHistory,
80    Message,
81    ProviderResponse,
82    ProviderSettings,
83};