struct

AI::OpenAI::OpenAIChatProviderOptions

Inherits JSON::Serializable < Struct < Value < Object

Provider-specific options for OpenAI chat language models.

These options can be passed via provider_options["openai"] in the language model call options.

Constructors

new(logit_bias : Hash(String, Int32) | Nil = nil, logprobs : Bool | Int32 | Nil = nil, parallel_tool_calls : Bool | Nil = nil, user : String | Nil = nil, reasoning_effort : String | Nil = nil, max_completion_tokens : Int32 | Nil = nil, store : Bool | Nil = nil, metadata : Hash(String, String) | Nil = nil, prediction : Hash(String, JSON::Any) | Nil = nil, service_tier : String | Nil = nil, strict_json_schema : Bool | Nil = nil, text_verbosity : String | Nil = nil, prompt_cache_key : String | Nil = nil, prompt_cache_retention : String | Nil = nil, safety_identifier : String | Nil = nil, system_message_mode : String | Nil = nil, force_reasoning : Bool | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

force_reasoning

Force treating this model as a reasoning model.

Source
logit_bias

Modify the likelihood of specified tokens appearing in the completion. Maps token IDs to bias values from -100 to 100.

Source
logprobs

Return the log probabilities of the tokens. true = return logprobs, number = return top n logprobs.

Source
max_completion_tokens

Maximum number of completion tokens to generate.

Source
metadata

Metadata to associate with the request.

Source
parallel_tool_calls

Whether to enable parallel function calling during tool use.

Source
prediction

Parameters for prediction mode.

Source
prompt_cache_key

A cache key for prompt caching.

Source
prompt_cache_retention

The retention policy for the prompt cache. Valid values: "in_memory", "24h"

Source
reasoning_effort

Reasoning effort for reasoning models. Valid values: "none", "minimal", "low", "medium", "high", "xhigh"

Source
safety_identifier

A stable identifier used to help detect users violating usage policies.

Source
service_tier

Service tier for the request. Valid values: "auto", "flex", "priority", "default"

Source
store

Whether to enable persistence in responses API.

Source
strict_json_schema

Whether to use strict JSON schema validation.

Source
system_message_mode

Override the system message mode for this model. Valid values: "system", "developer", "remove"

Source
text_verbosity

Controls the verbosity of the model's responses. Valid values: "low", "medium", "high"

Source
user

A unique identifier representing your end-user.

Source