ai_workbench_lib/lib.rs
1//! # AI Workbench Library
2//!
3//! A comprehensive library for AI workbench operations including:
4//! - File discovery and S3 operations
5//! - Intelligent file splitting with type-aware chunking
6//! - Model runner for AWS Bedrock integration
7//! - Job processor for orchestrating the entire workflow
8//!
9//! ## Example Usage
10//!
11//! ```rust
12//! use ai_workbench_lib::{JobProcessor, JobConfig, FileDiscovery};
13//! use aws_config::BehaviorVersion;
14//! use aws_sdk_s3::Client as S3Client;
15//! use aws_sdk_bedrockruntime::Client as BedrockClient;
16//! use std::sync::Arc;
17//!
18//! #[tokio::main]
19//! async fn main() -> anyhow::Result<()> {
20//! // Initialize AWS clients
21//! let config = aws_config::load_defaults(BehaviorVersion::latest()).await;
22//! let s3_client = Arc::new(S3Client::new(&config));
23//! let bedrock_client = Arc::new(BedrockClient::new(&config));
24//!
25//! // Create job configuration
26//! let job_config = JobConfig {
27//! job_id: "test-job".to_string(),
28//! prompt: "Analyze this file: {{file}}".to_string(),
29//! workspace_bucket: "my-workspace-bucket".to_string(),
30//! input_spec: "path/to/file.txt".to_string(),
31//! output_prefix: "outputs/".to_string(),
32//! model_id: "amazon.nova-micro-v1:0".to_string(),
33//! workspace_id: "ws-123".to_string(),
34//! user_id: "user-123".to_string(),
35//! chunk_size_mb: Some(5.0),
36//! max_parallel: Some(4),
37//! include_file_context: Some(true),
38//! };
39//!
40//! // Create and run job processor
41//! let processor = JobProcessor::new(s3_client, bedrock_client, job_config);
42//! let (output_key, metrics) = processor.run().await?;
43//!
44//! println!("Job completed! Output: {}", output_key);
45//! println!("Processed {} files with {} tokens", metrics.files_processed, metrics.total_tokens);
46//!
47//! Ok(())
48//! }
49//! ```
50
51// Include the modules from the modules directory
52#[path = "../modules/mod.rs"]
53pub mod modules;
54
55// Re-export everything from modules for easy access
56pub use modules::*;
57
58// Re-export commonly used external types for convenience
59pub use anyhow::{Result, Context};
60pub use aws_sdk_s3::Client as S3Client;
61pub use aws_sdk_bedrockruntime::Client as BedrockClient;
62pub use serde::{Serialize, Deserialize};
63pub use tokio;
64pub use tracing;
65
66/// Version information for the library
67pub const VERSION: &str = env!("CARGO_PKG_VERSION");
68
69/// Library information
70pub const DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION");