1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! Cloud client module for third-party API integrations.
//!
//! This module provides a unified interface for cloud API calls that abstracts
//! away the execution method (gateway or direct API).
//!
//! ## Architecture
//!
//! ```text
//! +-------------------------------------------------------------+
//! | Client Application |
//! | |
//! | cloud::complete(request) ---------------------------------|
//! +-------------------------------------------------------------+
//! |
//! v
//! +-------------------------------------------------------------+
//! | Cloud Router |
//! | +----------------------------+---------------------------+ |
//! | | Gateway | Direct | |
//! | | (default) | (dev/testing) | |
//! | +----------------------------+---------------------------+ |
//! +-------------------------------------------------------------+
//! | |
//! v v
//! Xybrid Gateway OpenAI/Anthropic
//! (OpenAI-compat) (direct)
//! ```
//!
//! ## Usage
//!
//! ```no_run
//! # fn _example() -> Result<(), Box<dyn std::error::Error>> {
//! use xybrid_core::cloud::{Cloud, CompletionRequest};
//!
//! // Create client (routes through gateway by default)
//! let cloud = Cloud::new()?;
//!
//! // Simple completion
//! let response = cloud.complete(CompletionRequest::new("Hello, world!"))?;
//! println!("{}", response.text);
//!
//! // With options
//! let response = cloud.complete(
//! CompletionRequest::new("Explain Rust in one sentence")
//! .with_system("You are a helpful programming tutor.")
//! .with_max_tokens(100)
//! )?;
//! # let _ = response;
//! # Ok(())
//! # }
//! ```
//!
//! ## Note
//!
//! For local/on-device inference, use `target: device` in your pipeline YAML,
//! which routes to [`crate::execution::TemplateExecutor`] instead.
pub use parse_gateway_usage;
pub use Cloud;
pub use ;
pub use ;
pub use CloudError;