struct AI::OpenAI::OpenAIChatProviderOptions

Overview

Provider-specific options for OpenAI chat language models.

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

Included Modules

Defined in:

ai/openai/chat/openai_chat_options.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.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) #

[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]

Instance Method Detail

def force_reasoning : Bool | Nil #

Force treating this model as a reasoning model.


[View source]
def logit_bias : Hash(String, Int32) | Nil #

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


[View source]
def logprobs : Bool | Int32 | Nil #

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


[View source]
def max_completion_tokens : Int32 | Nil #

Maximum number of completion tokens to generate.


[View source]
def metadata : Hash(String, String) | Nil #

Metadata to associate with the request.


[View source]
def parallel_tool_calls : Bool | Nil #

Whether to enable parallel function calling during tool use.


[View source]
def prediction : Hash(String, JSON::Any) | Nil #

Parameters for prediction mode.


[View source]
def prompt_cache_key : String | Nil #

A cache key for prompt caching.


[View source]
def prompt_cache_retention : String | Nil #

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


[View source]
def reasoning_effort : String | Nil #

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


[View source]
def safety_identifier : String | Nil #

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


[View source]
def service_tier : String | Nil #

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


[View source]
def store : Bool | Nil #

Whether to enable persistence in responses API.


[View source]
def strict_json_schema : Bool | Nil #

Whether to use strict JSON schema validation.


[View source]
def system_message_mode : String | Nil #

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


[View source]
def text_verbosity : String | Nil #

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


[View source]
def user : String | Nil #

A unique identifier representing your end-user.


[View source]