AI::OpenAI::OpenAIConfig
Configuration for OpenAI API models.
This struct holds the configuration needed to make API calls to OpenAI or OpenAI-compatible providers.
Constructors
Instance methods
file_id_prefixes
File ID prefixes used to identify file IDs in Responses API.
When nil, all file data is treated as base64 content.
Examples:
- OpenAI: ["file-"] for IDs like "file-abc123"
- Azure OpenAI: ["assistant-"] for IDs like "assistant-abc123"
generate_id
Optional proc that generates unique IDs.
Used for generating tool call IDs and other identifiers.
headers
Proc that returns the headers for API requests.
This is called for each request, allowing for dynamic header generation (e.g., token refresh).
url
Proc that builds the full URL for an API endpoint.
Receives a NamedTuple with:
- model_id: The model identifier
- path: The API endpoint path (e.g., "/chat/completions")
Returns the complete URL string.