Skip to main content

Module codec_openai

Module codec_openai 

Source
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§

OpenAiCodec
Runtime codec for OpenAI-compatible chat-completion JSON.
OpenAiCodecLib
Host-registered lib for codec:openai.
OpenAiCodecOptions
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§

OpenAiRequestOptions
Alias for OpenAiCodecOptions when used for provider request generation.