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
//! `OpenAI` Responses wire codec.
//!
//! Builds an `OpenAI` Responses upstream request from a
//! [`crate::wire::canonical::CanonicalRequest`], parses the buffered reply into
//! a [`crate::wire::canonical::CanonicalResponse`], and maps Responses SSE
//! bytes to [`crate::wire::canonical::CanonicalEvent`]s.
//!
//! Every public function here is a pure codec over [`serde_json::Value`] or a
//! byte stream; transport, auth, and HTTP status handling stay in the gateway
//! adapter that calls these. The `request` submodule owns the request build,
//! `response` the buffered-reply parse, `streaming` the SSE-to-event pipeline,
//! and `slot` the per-output-item slot state machine the streaming pass tracks.
//!
//! Copyright (c) systemprompt.io — Business Source License 1.1.
//! See <https://systemprompt.io> for licensing details.
use crateCanonicalStopReason;
// Why: Responses has no finish-reason field: tool use is signalled by a
// `function_call` output item, truncation by `incomplete_details.reason`.
pub use build_request_body;
pub use parse_response_object;
pub use sse_to_canonical_events;