Expand description
OpenAI JSON codec surface: decode, encode, streaming, and shared shapes.
Re-exports§
pub use encode::encode_openai_responses_response;pub use shapes::ChatTranscript;pub use streaming::GatewayEventData;pub use streaming::OpenAiSseSurface;pub use streaming::StreamSink;pub use streaming::encode_gateway_events_sse;pub use streaming::gateway_event_data_from_packet;pub use streaming::gateway_event_data_kind;pub use streaming::gateway_event_data_packets;
Modules§
- decode
- Decoding of OpenAI request/response JSON into SIM transcript expressions.
- encode
- Encoding of SIM transcript expressions into OpenAI request/response JSON.
- shapes
- Validated transcript and codec-option shapes for the OpenAI codec.
- streaming
- Server-sent-event streaming of gateway events on OpenAI surfaces.
Structs§
- Open
AiCodec - Runtime codec for OpenAI-compatible chat-completion JSON.
- Open
AiCodec Lib - Host-registered lib for
codec:openai. - Open
AiCodec Options - Options for OpenAI-compatible provider request JSON generation.
Functions§
- decode_
openai_ request - Decodes OpenAI request JSON into a validated chat-transcript expression.
- decode_
openai_ response - Decodes an OpenAI chat-completion response body into a model-response transcript, optionally embedding the raw provider JSON.
- encode_
openai_ request - Encodes a model-request transcript into OpenAI chat-completion JSON.
- encode_
openai_ response - Encodes a model-response transcript into OpenAI chat-completion JSON.
- install_
openai_ codec - Registers the OpenAI codec with the linker, resolving its expression and options shapes and installing it as a runtime codec value.
- openai_
codec_ symbol - Returns the codec symbol
codec:openai.
Type Aliases§
- Open
AiRequest Options - Alias for
OpenAiCodecOptionswhen used for provider request generation.