Module openai

Module openai 

Source
Expand description

OpenAI model capability and endpoint routing helpers.

Gestura supports both the legacy Chat Completions endpoint and the modern Responses endpoint for OpenAI. This module centralizes the model-id heuristics that determine whether a model is suitable for agent sessions and which endpoint should be used.

Enums§

OpenAiApi
OpenAI inference API selected for a given model.

Functions§

is_agent_capable_openai_model
Returns true when the model is suitable for Gestura agent sessions.
is_known_openai_legacy_completion_model
Returns true when the model id is a known legacy completion / non-agent model.
is_openai_model_incompatible_with_agent_session
Returns true when the model should be rejected for agent sessions.
is_openai_responses_api_model
Returns true when a model should be routed to /v1/responses.
looks_like_openai_model
Returns true when the model id is obviously part of the OpenAI family.
openai_agent_session_model_message
Build a user-facing error describing why the model cannot be used for sessions.
openai_api_for_model
Select the OpenAI inference API to use for the supplied model id.