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.
net
Error classification for the OpenAI-compat / Codex provider routes.
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
Credential-free routing data for one provider/model pair. Deliberately has no API-key field: credentials are broker-owned and applied broker-side at request time (see agent_core::auth::broker).
ResolvedRoute
StreamDecoder
StreamOptions
ToolCall
ToolDefinition

Enums§

AuthPolicy
OaiEvent
ToolChoice
WireProtocol

Functions§

clear_extension_manager_for_routing
extension_manager_for_routing
resolve_route
Resolve typed credential and wire dimensions. Unknown explicit prefixes fail closed.
set_extension_manager_for_routing
try_route
Try to route a request through an OpenAI-compatible provider.