synth_ai_core/api/mod.rs
1//! Synth API client.
2//!
3//! This module provides a client for interacting with the Synth AI API.
4//!
5//! # Example
6//!
7//! ```ignore
8//! use synth_ai_core::api::{SynthClient, GepaJobRequest, PolicyConfig};
9//!
10//! #[tokio::main]
11//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
12//! let client = SynthClient::from_env()?;
13//!
14//! // Submit a GEPA job
15//! let job_id = client.jobs().submit_gepa(GepaJobRequest {
16//! task_app_url: "http://localhost:8000".into(),
17//! env_name: "default".into(),
18//! policy: PolicyConfig::default(),
19//! ..Default::default()
20//! }).await?;
21//!
22//! // Poll until complete
23//! let result = client.jobs().poll_until_complete(&job_id, 3600.0, 15.0).await?;
24//! println!("Best score: {:?}", result.best_score);
25//!
26//! Ok(())
27//! }
28//! ```
29
30pub mod types;
31pub mod client;
32pub mod jobs;
33pub mod eval;
34pub mod graphs;
35
36// Re-export main types for convenience
37pub use client::SynthClient;
38pub use types::{
39 // Job status
40 PolicyJobStatus,
41 EvalJobStatus,
42 // Config types
43 PolicyConfig,
44 GepaConfig,
45 MiproConfig,
46 // Request types
47 GepaJobRequest,
48 MiproJobRequest,
49 EvalJobRequest,
50 // Response types
51 JobSubmitResponse,
52 PromptLearningResult,
53 EvalResult,
54 // Graph types
55 GraphCompletionRequest,
56 GraphCompletionResponse,
57 VerifierOptions,
58 VerifierResponse,
59 RlmOptions,
60 Usage,
61};
62pub use jobs::JobsClient;
63pub use eval::EvalClient;
64pub use graphs::GraphsClient;