2025-10-11 14:58:37 -07:00
|
|
|
//! API transformation modules
|
|
|
|
|
//!
|
|
|
|
|
//! This module provides organized transformations between the two main LLM API formats:
|
|
|
|
|
//! - `/v1/chat/completions` (OpenAI format)
|
|
|
|
|
//! - `/v1/messages` (Anthropic format)
|
|
|
|
|
//!
|
|
|
|
|
//! Provider-specific transformations (Bedrock, Groq, etc.) are handled internally
|
|
|
|
|
//! by the gateway, but the external API surface remains these two standard formats.
|
|
|
|
|
//! The transformations are split into logical modules for maintainability.
|
|
|
|
|
|
2025-10-21 16:31:29 -07:00
|
|
|
pub mod lib;
|
2025-10-11 14:58:37 -07:00
|
|
|
pub mod request;
|
|
|
|
|
pub mod response;
|
|
|
|
|
|
|
|
|
|
// Re-export commonly used items for convenience
|
2025-10-21 16:31:29 -07:00
|
|
|
pub use lib::*;
|
2025-10-11 14:58:37 -07:00
|
|
|
pub use request::*;
|
|
|
|
|
pub use response::*;
|
|
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
|
// CONSTANTS
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
/// Default maximum tokens when converting from OpenAI to Anthropic and no max_tokens is specified
|
|
|
|
|
pub const DEFAULT_MAX_TOKENS: u32 = 4096;
|