atoti_ai_openai.ChatOptions#

final class atoti_ai_openai.ChatOptions#

Chat options for OpenAI.

Warning

This feature is experimental, its key is "ai".

See the corresponding Javadoc for more details.

See also

The other ChatOptions implementations.

completions_path: str | None = None#

The path to append to the base URL.

extra_body: Mapping[str, object] | None = None#

Additional parameters for OpenAI-compatible servers.

frequency_penalty: float | None = None#

Penalty for token frequency.

Positive values discourage repetition.

http_headers: Mapping[str, str] | None = None#

Custom HTTP headers.

internal_tool_execution_enabled: bool | None = None#

Handle tool calls internally vs proxy to client.

logit_bias: Mapping[int, int] | None = None#

Token probability biases.

Maps token IDs to bias values from -100 to 100.

max_completion_tokens: int | None = None#

Maximum number of tokens to generate for reasoning models (e.g. o1, o3).

Mutually exclusive with max_tokens.

max_tokens: int | None = None#

Maximum number of tokens to generate in the response.

For non-reasoning models. Mutually exclusive with max_completion_tokens.

metadata: Mapping[str, str] | None = None#

Developer-defined tags for dashboard filtering.

model: str#

The ID of the model to use, for example "gpt-4o".

n: int | None = None#

Number of completion choices to generate.

output_audio_format: str | None = None#

Audio format (e.g. "mp3", "opus", "aac", "flac", "wav", "pcm16").

output_audio_voice: str | None = None#

Voice for audio output (e.g. "alloy", "echo", "nova").

output_modalities: Sequence[str] | None = None#

Output types to generate (e.g. "text", "audio").

parallel_tool_calls: bool | None = None#

Enable parallel function calling during tool use.

presence_penalty: float | None = None#

Penalty for token presence.

Positive values encourage topic diversity.

prompt_cache_key: str | None = None#

Cache key for optimizing prompt cache.

response_format: str | None = None#

Response format type (e.g. "json_object", "json_schema").

response_format_name: str | None = None#

Schema name for json_schema response format type.

response_format_schema: str | None = None#

JSON schema definition for response format.

response_format_strict: bool | None = None#

Enforce strict adherence to JSON schema.

retry_backoff_initial_interval: int | None = None#

Initial sleep duration (in seconds) for the exponential backoff policy.

retry_backoff_max_interval: int | None = None#

Maximum backoff duration (in seconds).

retry_backoff_multiplier: float | None = None#

Backoff interval multiplier.

retry_exclude_on_http_codes: Sequence[int] | None = None#

List of HTTP status codes that should not trigger a retry.

retry_max_attempts: int | None = None#

Maximum number of retry attempts.

retry_on_client_errors: bool | None = None#

If False, throw a NonTransientAiException and do not attempt retry for 4xx client error codes.

retry_on_http_codes: Sequence[int] | None = None#

List of HTTP status codes that should trigger a retry.

safety_identifier: str | None = None#

Hashed user identifier for safety tracking.

seed: int | None = None#

Seed for deterministic sampling (Beta).

service_tier: str | None = None#

Processing type (e.g. "auto", "default").

stop_sequences: Sequence[str] | None = None#

Sequences that will stop generation when encountered.

store: bool | None = None#

Whether to store output for model distillation.

stream_usage: bool | None = None#

Include token usage stats in streaming responses.

temperature: float | None = None#

Controls randomness in responses from 0.0 (deterministic) to 2.0 (creative).

tool_choice: str | None = None#

Tool/function calling behavior ("none", "auto", or a specific function name).

tool_names: Sequence[str] | None = None#

List of tool names to enable.

top_p: float | None = None#

Nucleus sampling parameter.

Controls diversity via cumulative probability.

user: str | None = None#

End-user identifier for abuse monitoring.