yera.models.interfaces.llms._openai_responses
Shared wire helpers for OpenAI-compatible Responses transports.
Symbols
build_openai_structured_text
build_openai_structured_text() → dictBuild a strict Responses structured-output definition.
Parameters
Struct class defining the required output.
Returns
The Responses API text configuration.
is_openai_rate_limit
is_openai_rate_limit(
exc: Exception,
) → boolReturn whether an OpenAI-compatible error indicates rate limiting.
Parameters
Provider exception to inspect.
Returns
Whether the exception represents a rate-limit or overload response.
openai_retry_wait
openai_retry_wait(
message: str,
) → floatExtract a provider-requested retry delay from an error message.
Parameters
Provider error text.
Returns
The parsed delay in seconds, or the default retry delay when absent.
stream_openai_response
stream_openai_response(
client: OpenAI,
kws: dict,
) → Iterator[LLMToken]Stream thinking and response tokens from a Responses API call.
Parameters
OpenAI-compatible client exposing the Responses API.
Responses API request parameters.
to_openai_wire
to_openai_wire(
messages: list[Message],
) → list[dict]Render workspace messages into the Responses input format.
Parameters
The workspace conversation history.
Returns
Input items in the Responses API wire format.
Raises
If a message cannot be represented in Responses format.