Class: OpenAI::Models::Realtime::RealtimeSessionCreateResponse

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/realtime_session_create_response.rb

Defined Under Namespace

Modules: Include, MaxOutputTokens, OutputModality, Tracing Classes: Audio, Tool, TurnDetection

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #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(group_id: nil, metadata: nil, workflow_name: nil) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration for more details.

Granular configuration for tracing.

Parameters:

  • group_id (String) (defaults to: nil)

    The group id to attach to this trace to enable filtering and

  • metadata (Object) (defaults to: nil)

    The arbitrary metadata to attach to this trace to enable

  • workflow_name (String) (defaults to: nil)

    The name of the workflow to attach to this trace. This is used to



# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 112

Instance Attribute Details

#audioOpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio?

Configuration for input and output audio for the session.



17
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 17

optional :audio, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio }

#expires_atInteger?

Expiration timestamp for the session, in seconds since epoch.

Returns:

  • (Integer, nil)


23
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 23

optional :expires_at, Integer

#idString?

Unique identifier for the session that looks like ‘sess_1234567890abcdef`.

Returns:

  • (String, nil)


11
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 11

optional :id, String

#includeArray<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Include>?

Additional fields to include in server outputs.

  • ‘item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription.



32
33
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 32

optional :include,
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeSessionCreateResponse::Include] }

#instructionsString?

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.

Returns:

  • (String, nil)


49
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 49

optional :instructions, String

#max_output_tokensInteger, ...

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`.

Returns:

  • (Integer, Symbol, :inf, nil)


57
58
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 57

optional :max_output_tokens,
union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::MaxOutputTokens }

#modelString?

The Realtime model used for this session.

Returns:

  • (String, nil)


64
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 64

optional :model, String

#objectString?

The object type. Always ‘realtime.session`.

Returns:

  • (String, nil)


70
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 70

optional :object, String

#output_modalitiesArray<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::OutputModality>?

The set of modalities the model can respond with. To disable audio, set this to [“text”].



77
78
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 77

optional :output_modalities,
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeSessionCreateResponse::OutputModality] }

#tool_choiceString?

How the model chooses tools. Options are ‘auto`, `none`, `required`, or specify a function.

Returns:

  • (String, nil)


85
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 85

optional :tool_choice, String

#toolsArray<OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool>?

Tools (functions) available to the model.



91
92
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 91

optional :tools,
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::RealtimeSessionCreateResponse::Tool] }

#tracingSymbol, ...

Configuration options for tracing. 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.



102
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 102

optional :tracing, union: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Tracing }

#turn_detectionOpenAI::Models::Realtime::RealtimeSessionCreateResponse::TurnDetection?

Configuration for turn detection. Can be set to ‘null` to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.



110
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 110

optional :turn_detection, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::TurnDetection }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 388

.variantsArray(Symbol, :auto, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration)



# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 404