Skip to main content

causa_protocol/
lib.rs

1//! Wire-protocol translation for LLM providers.
2//!
3//! `causa-protocol` renders `ContextFrame` → provider wire bodies and
4//! parses wire responses → kernel `ModelOutput`.
5//! `translation::context_frame` is the shared policy walk; the three
6//! renderers (`translation::anthropic`, `openai_chat`,
7//! `openai_responses`) are thin emitters over it. The crate serves the
8//! `causa_kernel::ModelGateway` seam and is consumed by `causa-provider`'s
9//! gateways. It is transport-free.
10//!
11//! Layering:
12//!
13//! ```text
14//! causa-kernel (facts, ModelGateway seam)
15//!   <- causa-protocol (render/parse)   <- causa-provider
16//! ```
17//!
18//! `causa-protocol` must not depend on reqwest, Axum, or any concrete
19//! provider SDK.
20
21#![deny(unsafe_code)]
22#![deny(missing_docs)]
23
24pub mod protocol;
25pub mod translation;
26
27pub use protocol::Protocol;
28pub use translation::sse_parser::{SseEvent, SseParser};