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.

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.

Structs§

ChatMessage
ChatOptions
ChatRequest
FunctionCall
FunctionDefinition
ProviderConfig
StreamDecoder
StreamOptions
ToolCall
ToolDefinition

Enums§

OaiEvent
Provider
Routing decision for a given model id.
ToolChoice

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.