Class: OpenAI::Models::Realtime::CallAcceptParams

Inherits:
RealtimeSessionCreateRequest show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/openai/models/realtime/call_accept_params.rb,
sig/openai/models/realtime/call_accept_params.rbs

Overview

See Also:

  • OpenAI::Resources::Realtime::Calls#accept

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from RealtimeSessionCreateRequest

#audio, #include, #instructions, #max_output_tokens, #model, #output_modalities, #parallel_tool_calls, #prompt, #reasoning, #tool_choice, #tools, #tracing, #truncation, #type

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from RealtimeSessionCreateRequest

values, variants

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(call_id:, audio: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, parallel_tool_calls: nil, prompt: nil, reasoning: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: :realtime, request_options: {}) ⇒ Object

Parameters:

  • audio (defaults to: nil)

    Configuration for input and output audio.

  • include (defaults to: nil)

    Additional fields to include in server outputs.

    item.input_audio_transcription.logprobs: Include logprobs for input audio transcription.

  • instructions (defaults to: nil)

    The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.

    Note that the server sets default instructions which will be used if this field is not set and are visible in the session.created event at the start of the session.

  • max_output_tokens (defaults to: nil)

    Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or inf for the maximum available tokens for a given model. Defaults to inf.

  • model (defaults to: nil)

    The Realtime model used for this session.

  • output_modalities (defaults to: nil)

    The set of modalities the model can respond with. It defaults to ["audio"], indicating that the model will respond with audio plus a transcript. ["text"] can be used to make the model respond with text only. It is not possible to request both text and audio at the same time.

  • parallel_tool_calls (defaults to: nil)

    Whether the model may call multiple tools in parallel. Only supported by reasoning Realtime models such as gpt-realtime-2.

  • prompt (defaults to: nil)

    Reference to a prompt template and its variables. Learn more.

  • reasoning (defaults to: nil)

    Configuration for reasoning-capable Realtime models such as gpt-realtime-2.

  • tool_choice (defaults to: nil)

    How the model chooses tools. Provide one of the string modes or force a specific function/MCP tool.

  • tools (defaults to: nil)

    Tools available to the model.

  • tracing (defaults to: nil)

    Realtime API can write session traces to the Traces Dashboard. Set to null to disable tracing. Once tracing is enabled for a session, the configuration cannot be modified.

    auto will create a trace for the session with default values for the workflow name, group id, and metadata.

  • truncation (defaults to: nil)

    When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs.

    Clients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost.

    Truncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate.

    Truncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit.

  • type (defaults to: :realtime)

    The type of session to create. Always realtime for the Realtime API.



# File 'lib/openai/models/realtime/call_accept_params.rb', line 16

Instance Attribute Details

#call_idString

Parameters:

  • _ (String)

Returns:

  • (String)


14
# File 'lib/openai/models/realtime/call_accept_params.rb', line 14

required :call_id, String

Instance Method Details

#to_hash{

Returns:

  • ({)


123
# File 'sig/openai/models/realtime/call_accept_params.rbs', line 123

def to_hash: -> {