Skip to main content

Module openai

Module openai 

Source
Expand description

OpenAI-compatible provider engine.

Ported from the openai-runtime prototype. Translates between Anthropic-shaped messages/tools/content-blocks (the internal synaps representation) and OpenAI chat/completions SSE wire.

Re-exports§

pub use types::ChatMessage;
pub use types::ChatOptions;
pub use types::ChatRequest;
pub use types::FunctionCall;
pub use types::FunctionDefinition;
pub use types::OaiEvent;
pub use types::ProviderConfig;
pub use types::StreamOptions;
pub use types::ToolCall;
pub use types::ToolChoice;
pub use types::ToolDefinition;
pub use wire::StreamDecoder;

Modules§

catalog
Normalized model catalog types and provider-specific parsers.
ping
Model ping / health check.
reasoning
Provider-aware thinking/reasoning request helpers.
registry
Provider registry — catalog of known OpenAI-compatible endpoints.
stream
Streaming path for OpenAI-compatible providers.
translate
Anthropic ↔ OpenAI translation layer.
types
OpenAI-compatible wire types. Ported from the prototype openai-runtime crate.
wire
SSE wire decoder for OpenAI-compatible streams. Ported from openai-runtime::stream, with StreamEvent renamed to OaiEvent.

Enums§

Provider
Routing decision for a given model id.

Functions§

clear_extension_manager_for_routing
extension_manager_for_routing
resolve_route
Decide which backend a model should route to.
set_extension_manager_for_routing
try_route
Try to route a request through an OpenAI-compatible provider.