openai 0.88.0 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/lib/openai/client.rb +4 -0
- data/lib/openai/models/beta/beta_response_input_item.rb +91 -1
- data/lib/openai/models/beta/beta_response_item.rb +93 -1
- data/lib/openai/models/beta/beta_response_output_item.rb +91 -1
- data/lib/openai/models/conversations/conversation_item.rb +91 -1
- data/lib/openai/models/live/audio_format.rb +109 -0
- data/lib/openai/models/live/built_in_voice.rb +38 -0
- data/lib/openai/models/live/client_config.rb +22 -0
- data/lib/openai/models/live/client_delegation.rb +22 -0
- data/lib/openai/models/live/client_event.rb +54 -0
- data/lib/openai/models/live/commentary_append_event.rb +59 -0
- data/lib/openai/models/live/commentary_appended_event.rb +65 -0
- data/lib/openai/models/live/custom_voice.rb +17 -0
- data/lib/openai/models/live/data_channel_config.rb +81 -0
- data/lib/openai/models/live/delegation_created_event.rb +140 -0
- data/lib/openai/models/live/error.rb +60 -0
- data/lib/openai/models/live/error_event.rb +52 -0
- data/lib/openai/models/live/fork_client_event.rb +53 -0
- data/lib/openai/models/live/fork_server_event.rb +295 -0
- data/lib/openai/models/live/fork_session_config.rb +107 -0
- data/lib/openai/models/live/fork_session_start_event.rb +48 -0
- data/lib/openai/models/live/function_tool.rb +60 -0
- data/lib/openai/models/live/info_event.rb +60 -0
- data/lib/openai/models/live/initial_item.rb +419 -0
- data/lib/openai/models/live/input_audio_append_event.rb +50 -0
- data/lib/openai/models/live/input_audio_mute_event.rb +33 -0
- data/lib/openai/models/live/input_audio_muted_event.rb +42 -0
- data/lib/openai/models/live/input_audio_unmute_event.rb +33 -0
- data/lib/openai/models/live/input_audio_unmuted_event.rb +42 -0
- data/lib/openai/models/live/input_transcript_delta_event.rb +76 -0
- data/lib/openai/models/live/instructions_append_event.rb +57 -0
- data/lib/openai/models/live/instructions_appended_event.rb +65 -0
- data/lib/openai/models/live/live_create_params.rb +57 -0
- data/lib/openai/models/live/live_create_response.rb +77 -0
- data/lib/openai/models/live/media_session_config.rb +227 -0
- data/lib/openai/models/live/media_session_fork_config.rb +75 -0
- data/lib/openai/models/live/output_audio_delta_event.rb +58 -0
- data/lib/openai/models/live/output_transcript_delta_event.rb +76 -0
- data/lib/openai/models/live/response_create_event.rb +33 -0
- data/lib/openai/models/live/response_event.rb +67 -0
- data/lib/openai/models/live/response_item_create_event.rb +44 -0
- data/lib/openai/models/live/responses_delegation_config.rb +332 -0
- data/lib/openai/models/live/responses_delegation_update_config.rb +332 -0
- data/lib/openai/models/live/server_event.rb +295 -0
- data/lib/openai/models/live/server_event_selector.rb +32 -0
- data/lib/openai/models/live/session_accept_params.rb +257 -0
- data/lib/openai/models/live/session_close_event.rb +33 -0
- data/lib/openai/models/live/session_closed_event.rb +113 -0
- data/lib/openai/models/live/session_config.rb +236 -0
- data/lib/openai/models/live/session_download_recording_params.rb +27 -0
- data/lib/openai/models/live/session_fork_params.rb +66 -0
- data/lib/openai/models/live/session_fork_response.rb +77 -0
- data/lib/openai/models/live/session_hangup_params.rb +22 -0
- data/lib/openai/models/live/session_refer_params.rb +34 -0
- data/lib/openai/models/live/session_reject_params.rb +32 -0
- data/lib/openai/models/live/session_resource.rb +268 -0
- data/lib/openai/models/live/session_start_event.rb +46 -0
- data/lib/openai/models/live/session_started_event.rb +51 -0
- data/lib/openai/models/live/session_update_config.rb +69 -0
- data/lib/openai/models/live/session_update_event.rb +46 -0
- data/lib/openai/models/live/session_updated_event.rb +51 -0
- data/lib/openai/models/live/session_usage.rb +24 -0
- data/lib/openai/models/live/session_usage_updated_event.rb +81 -0
- data/lib/openai/models/live/thinking_append_event.rb +59 -0
- data/lib/openai/models/live/thinking_appended_event.rb +65 -0
- data/lib/openai/models/responses/response_input_item.rb +91 -1
- data/lib/openai/models/responses/response_item.rb +93 -1
- data/lib/openai/models/responses/response_output_item.rb +91 -1
- data/lib/openai/models/webhooks/live_call_incoming_webhook_event.rb +12 -7
- data/lib/openai/models/webhooks/live_transport_incoming_webhook_event.rb +137 -0
- data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +4 -4
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +9 -2
- data/lib/openai/models.rb +2 -0
- data/lib/openai/resources/live/forks.rb +16 -0
- data/lib/openai/resources/live/sessions.rb +180 -0
- data/lib/openai/resources/live/sideband.rb +16 -0
- data/lib/openai/resources/live.rb +54 -0
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +65 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/models/beta/beta_response_input_item.rbi +109 -0
- data/rbi/openai/models/beta/beta_response_item.rbi +105 -0
- data/rbi/openai/models/beta/beta_response_output_item.rbi +119 -0
- data/rbi/openai/models/conversations/conversation_item.rbi +133 -0
- data/rbi/openai/models/live/audio_format.rbi +185 -0
- data/rbi/openai/models/live/built_in_voice.rbi +46 -0
- data/rbi/openai/models/live/client_config.rbi +54 -0
- data/rbi/openai/models/live/client_delegation.rbi +51 -0
- data/rbi/openai/models/live/client_event.rbi +41 -0
- data/rbi/openai/models/live/commentary_append_event.rbi +88 -0
- data/rbi/openai/models/live/commentary_appended_event.rbi +97 -0
- data/rbi/openai/models/live/custom_voice.rbi +46 -0
- data/rbi/openai/models/live/data_channel_config.rbi +119 -0
- data/rbi/openai/models/live/delegation_created_event.rbi +207 -0
- data/rbi/openai/models/live/error.rbi +95 -0
- data/rbi/openai/models/live/error_event.rbi +87 -0
- data/rbi/openai/models/live/fork_client_event.rbi +40 -0
- data/rbi/openai/models/live/fork_server_event.rbi +436 -0
- data/rbi/openai/models/live/fork_session_config.rbi +234 -0
- data/rbi/openai/models/live/fork_session_start_event.rbi +80 -0
- data/rbi/openai/models/live/function_tool.rbi +95 -0
- data/rbi/openai/models/live/info_event.rbi +92 -0
- data/rbi/openai/models/live/initial_item.rbi +661 -0
- data/rbi/openai/models/live/input_audio_append_event.rbi +79 -0
- data/rbi/openai/models/live/input_audio_mute_event.rbi +62 -0
- data/rbi/openai/models/live/input_audio_muted_event.rbi +74 -0
- data/rbi/openai/models/live/input_audio_unmute_event.rbi +62 -0
- data/rbi/openai/models/live/input_audio_unmuted_event.rbi +74 -0
- data/rbi/openai/models/live/input_transcript_delta_event.rbi +115 -0
- data/rbi/openai/models/live/instructions_append_event.rbi +86 -0
- data/rbi/openai/models/live/instructions_appended_event.rbi +97 -0
- data/rbi/openai/models/live/live_create_params.rbi +121 -0
- data/rbi/openai/models/live/live_create_response.rbi +160 -0
- data/rbi/openai/models/live/media_session_config.rbi +390 -0
- data/rbi/openai/models/live/media_session_fork_config.rbi +143 -0
- data/rbi/openai/models/live/output_audio_delta_event.rbi +93 -0
- data/rbi/openai/models/live/output_transcript_delta_event.rbi +115 -0
- data/rbi/openai/models/live/response_create_event.rbi +62 -0
- data/rbi/openai/models/live/response_event.rbi +105 -0
- data/rbi/openai/models/live/response_item_create_event.rbi +183 -0
- data/rbi/openai/models/live/responses_delegation_config.rbi +562 -0
- data/rbi/openai/models/live/responses_delegation_update_config.rbi +585 -0
- data/rbi/openai/models/live/server_event.rbi +436 -0
- data/rbi/openai/models/live/server_event_selector.rbi +64 -0
- data/rbi/openai/models/live/session_accept_params.rbi +451 -0
- data/rbi/openai/models/live/session_close_event.rbi +62 -0
- data/rbi/openai/models/live/session_closed_event.rbi +148 -0
- data/rbi/openai/models/live/session_config.rbi +427 -0
- data/rbi/openai/models/live/session_download_recording_params.rbi +57 -0
- data/rbi/openai/models/live/session_fork_params.rbi +131 -0
- data/rbi/openai/models/live/session_fork_response.rbi +160 -0
- data/rbi/openai/models/live/session_hangup_params.rbi +53 -0
- data/rbi/openai/models/live/session_refer_params.rbi +64 -0
- data/rbi/openai/models/live/session_reject_params.rbi +62 -0
- data/rbi/openai/models/live/session_resource.rbi +461 -0
- data/rbi/openai/models/live/session_start_event.rbi +78 -0
- data/rbi/openai/models/live/session_started_event.rbi +86 -0
- data/rbi/openai/models/live/session_update_config.rbi +134 -0
- data/rbi/openai/models/live/session_update_event.rbi +78 -0
- data/rbi/openai/models/live/session_updated_event.rbi +86 -0
- data/rbi/openai/models/live/session_usage.rbi +53 -0
- data/rbi/openai/models/live/session_usage_updated_event.rbi +148 -0
- data/rbi/openai/models/live/thinking_append_event.rbi +88 -0
- data/rbi/openai/models/live/thinking_appended_event.rbi +97 -0
- data/rbi/openai/models/responses/response_input_item.rbi +113 -0
- data/rbi/openai/models/responses/response_item.rbi +105 -0
- data/rbi/openai/models/responses/response_output_item.rbi +125 -0
- data/rbi/openai/models/webhooks/live_call_incoming_webhook_event.rbi +11 -7
- data/rbi/openai/models/webhooks/live_transport_incoming_webhook_event.rbi +226 -0
- data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +4 -4
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +1 -0
- data/rbi/openai/models.rbi +2 -0
- data/rbi/openai/resources/live/forks.rbi +19 -0
- data/rbi/openai/resources/live/sessions.rbi +110 -0
- data/rbi/openai/resources/live/sideband.rbi +19 -0
- data/rbi/openai/resources/live.rbi +43 -0
- data/rbi/openai/resources/responses.rbi +75 -38
- data/rbi/openai/resources/webhooks.rbi +1 -0
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/models/beta/beta_response_input_item.rbs +56 -0
- data/sig/openai/models/beta/beta_response_item.rbs +56 -0
- data/sig/openai/models/beta/beta_response_output_item.rbs +56 -0
- data/sig/openai/models/conversations/conversation_item.rbs +56 -0
- data/sig/openai/models/live/audio_format.rbs +73 -0
- data/sig/openai/models/live/built_in_voice.rbs +58 -0
- data/sig/openai/models/live/client_config.rbs +15 -0
- data/sig/openai/models/live/client_delegation.rbs +15 -0
- data/sig/openai/models/live/client_event.rbs +24 -0
- data/sig/openai/models/live/commentary_append_event.rbs +37 -0
- data/sig/openai/models/live/commentary_appended_event.rbs +44 -0
- data/sig/openai/models/live/custom_voice.rbs +15 -0
- data/sig/openai/models/live/data_channel_config.rbs +56 -0
- data/sig/openai/models/live/delegation_created_event.rbs +89 -0
- data/sig/openai/models/live/error.rbs +46 -0
- data/sig/openai/models/live/error_event.rbs +39 -0
- data/sig/openai/models/live/fork_client_event.rbs +24 -0
- data/sig/openai/models/live/fork_server_event.rbs +212 -0
- data/sig/openai/models/live/fork_session_config.rbs +89 -0
- data/sig/openai/models/live/fork_session_start_event.rbs +32 -0
- data/sig/openai/models/live/function_tool.rbs +42 -0
- data/sig/openai/models/live/info_event.rbs +44 -0
- data/sig/openai/models/live/initial_item.rbs +332 -0
- data/sig/openai/models/live/input_audio_append_event.rbs +32 -0
- data/sig/openai/models/live/input_audio_mute_event.rbs +24 -0
- data/sig/openai/models/live/input_audio_muted_event.rbs +34 -0
- data/sig/openai/models/live/input_audio_unmute_event.rbs +24 -0
- data/sig/openai/models/live/input_audio_unmuted_event.rbs +34 -0
- data/sig/openai/models/live/input_transcript_delta_event.rbs +49 -0
- data/sig/openai/models/live/instructions_append_event.rbs +37 -0
- data/sig/openai/models/live/instructions_appended_event.rbs +44 -0
- data/sig/openai/models/live/live_create_params.rbs +45 -0
- data/sig/openai/models/live/live_create_response.rbs +49 -0
- data/sig/openai/models/live/media_session_config.rbs +157 -0
- data/sig/openai/models/live/media_session_fork_config.rbs +66 -0
- data/sig/openai/models/live/output_audio_delta_event.rbs +41 -0
- data/sig/openai/models/live/output_transcript_delta_event.rbs +49 -0
- data/sig/openai/models/live/response_create_event.rbs +18 -0
- data/sig/openai/models/live/response_event.rbs +44 -0
- data/sig/openai/models/live/response_item_create_event.rbs +32 -0
- data/sig/openai/models/live/responses_delegation_config.rbs +244 -0
- data/sig/openai/models/live/responses_delegation_update_config.rbs +246 -0
- data/sig/openai/models/live/server_event.rbs +212 -0
- data/sig/openai/models/live/server_event_selector.rbs +19 -0
- data/sig/openai/models/live/session_accept_params.rbs +185 -0
- data/sig/openai/models/live/session_close_event.rbs +17 -0
- data/sig/openai/models/live/session_closed_event.rbs +68 -0
- data/sig/openai/models/live/session_config.rbs +168 -0
- data/sig/openai/models/live/session_download_recording_params.rbs +25 -0
- data/sig/openai/models/live/session_fork_params.rbs +54 -0
- data/sig/openai/models/live/session_fork_response.rbs +49 -0
- data/sig/openai/models/live/session_hangup_params.rbs +25 -0
- data/sig/openai/models/live/session_refer_params.rbs +33 -0
- data/sig/openai/models/live/session_reject_params.rbs +33 -0
- data/sig/openai/models/live/session_resource.rbs +183 -0
- data/sig/openai/models/live/session_start_event.rbs +32 -0
- data/sig/openai/models/live/session_started_event.rbs +39 -0
- data/sig/openai/models/live/session_update_config.rbs +56 -0
- data/sig/openai/models/live/session_update_event.rbs +32 -0
- data/sig/openai/models/live/session_updated_event.rbs +39 -0
- data/sig/openai/models/live/session_usage.rbs +15 -0
- data/sig/openai/models/live/session_usage_updated_event.rbs +58 -0
- data/sig/openai/models/live/thinking_append_event.rbs +37 -0
- data/sig/openai/models/live/thinking_appended_event.rbs +44 -0
- data/sig/openai/models/responses/response_input_item.rbs +56 -0
- data/sig/openai/models/responses/response_item.rbs +56 -0
- data/sig/openai/models/responses/response_output_item.rbs +56 -0
- data/sig/openai/models/webhooks/live_transport_incoming_webhook_event.rbs +95 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -0
- data/sig/openai/models.rbs +2 -0
- data/sig/openai/resources/live/forks.rbs +9 -0
- data/sig/openai/resources/live/sessions.rbs +44 -0
- data/sig/openai/resources/live/sideband.rbs +9 -0
- data/sig/openai/resources/live.rbs +19 -0
- data/sig/openai/resources/webhooks.rbs +1 -0
- metadata +196 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class ErrorEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute error
|
|
8
|
+
# Details of the Live error and the client command that caused it, when known.
|
|
9
|
+
#
|
|
10
|
+
# @return [OpenAI::Models::Live::Error]
|
|
11
|
+
required :error, -> { OpenAI::Live::Error }
|
|
12
|
+
|
|
13
|
+
# @!attribute event_id
|
|
14
|
+
# The unique ID of the Live server event.
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :event_id, String
|
|
18
|
+
|
|
19
|
+
# @!attribute type
|
|
20
|
+
# The event type, always `error`.
|
|
21
|
+
#
|
|
22
|
+
# @return [Symbol, :error]
|
|
23
|
+
required :type, const: :error
|
|
24
|
+
|
|
25
|
+
# @!attribute client_event_id
|
|
26
|
+
# The event_id of the client command associated with this server event, when
|
|
27
|
+
# supplied.
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
optional :client_event_id, String
|
|
31
|
+
|
|
32
|
+
# @!method initialize(error:, event_id:, client_event_id: nil, type: :error)
|
|
33
|
+
# Reports an error in the Live session, such as an invalid client command. Use
|
|
34
|
+
# error.client_event_id, when present, to identify the command that caused the
|
|
35
|
+
# error.
|
|
36
|
+
#
|
|
37
|
+
# @param error [OpenAI::Models::Live::Error]
|
|
38
|
+
# Details of the Live error and the client command that caused it, when known.
|
|
39
|
+
#
|
|
40
|
+
# @param event_id [String]
|
|
41
|
+
# The unique ID of the Live server event.
|
|
42
|
+
#
|
|
43
|
+
# @param client_event_id [String]
|
|
44
|
+
# The event_id of the client command associated with this server event, when
|
|
45
|
+
# supplied.
|
|
46
|
+
#
|
|
47
|
+
# @param type [Symbol, :error]
|
|
48
|
+
# The event type, always `error`.
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
# Client events for a Live fork WebSocket. First send session.start with an
|
|
7
|
+
# overrides object (which may be empty), then wait for session.started before
|
|
8
|
+
# sending other commands. The model and conversation are inherited from the stored
|
|
9
|
+
# session.
|
|
10
|
+
module ForkClientEvent
|
|
11
|
+
extend OpenAI::Internal::Type::Union
|
|
12
|
+
|
|
13
|
+
discriminator :type
|
|
14
|
+
|
|
15
|
+
# Start a Live session after connecting to a stored session’s fork WebSocket. Send an empty `session` object to use the stored configuration.
|
|
16
|
+
variant :"session.start", -> { OpenAI::Live::ForkSessionStartEvent }
|
|
17
|
+
|
|
18
|
+
# Update the delegation settings of an active Live session. The server acknowledges accepted changes with `session.updated`.
|
|
19
|
+
variant :"session.update", -> { OpenAI::Live::SessionUpdateEvent }
|
|
20
|
+
|
|
21
|
+
# Send audio to a Live session over its primary WebSocket. WebRTC and SIP sessions send audio over their media transport.
|
|
22
|
+
variant :"session.input_audio.append", -> { OpenAI::Live::InputAudioAppendEvent }
|
|
23
|
+
|
|
24
|
+
# Mute audio input to the Live model without closing the session. The server acknowledges with `session.input_audio.muted`.
|
|
25
|
+
variant :"session.input_audio.mute", -> { OpenAI::Live::InputAudioMuteEvent }
|
|
26
|
+
|
|
27
|
+
# Resume audio input to a Live model after muting it. The server acknowledges with `session.input_audio.unmuted`.
|
|
28
|
+
variant :"session.input_audio.unmute", -> { OpenAI::Live::InputAudioUnmuteEvent }
|
|
29
|
+
|
|
30
|
+
# Append instructions to the Live conversation while it is running, optionally associating them with an existing client delegation.
|
|
31
|
+
variant :"session.instructions.append", -> { OpenAI::Live::InstructionsAppendEvent }
|
|
32
|
+
|
|
33
|
+
# Provide silent reasoning or progress context to the Live model, optionally for an existing client delegation.
|
|
34
|
+
variant :"session.thinking.append", -> { OpenAI::Live::ThinkingAppendEvent }
|
|
35
|
+
|
|
36
|
+
# Provide context the Live model can communicate to the user, optionally for an existing client delegation.
|
|
37
|
+
variant :"session.commentary.append", -> { OpenAI::Live::CommentaryAppendEvent }
|
|
38
|
+
|
|
39
|
+
# Add an input item to the Live session’s Responses backend. Requires Responses delegation; use `response.create` to request a response.
|
|
40
|
+
variant :"response.item.create", -> { OpenAI::Live::ResponseItemCreateEvent }
|
|
41
|
+
|
|
42
|
+
# Request a response from the Live session’s Responses backend, or continue a delegated response waiting for tool results. Requires Responses delegation.
|
|
43
|
+
variant :"response.create", -> { OpenAI::Live::ResponseCreateEvent }
|
|
44
|
+
|
|
45
|
+
# Request that the Live session close. The terminal `session.closed` event contains the close reason and final usage.
|
|
46
|
+
variant :"session.close", -> { OpenAI::Live::SessionCloseEvent }
|
|
47
|
+
|
|
48
|
+
# @!method self.variants
|
|
49
|
+
# @return [Array(OpenAI::Models::Live::ForkSessionStartEvent, OpenAI::Models::Live::SessionUpdateEvent, OpenAI::Models::Live::InputAudioAppendEvent, OpenAI::Models::Live::InputAudioMuteEvent, OpenAI::Models::Live::InputAudioUnmuteEvent, OpenAI::Models::Live::InstructionsAppendEvent, OpenAI::Models::Live::ThinkingAppendEvent, OpenAI::Models::Live::CommentaryAppendEvent, OpenAI::Models::Live::ResponseItemCreateEvent, OpenAI::Models::Live::ResponseCreateEvent, OpenAI::Models::Live::SessionCloseEvent)]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
# Server events for Live. Response lifecycle events are wrapped inside
|
|
7
|
+
# response.event; dispatch the nested event by its full type and tolerate new
|
|
8
|
+
# response event types. Follow the
|
|
9
|
+
# [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting)
|
|
10
|
+
# when designing the conversation and delegation policy.
|
|
11
|
+
module ForkServerEvent
|
|
12
|
+
extend OpenAI::Internal::Type::Union
|
|
13
|
+
|
|
14
|
+
discriminator :type
|
|
15
|
+
|
|
16
|
+
# Returned when a Live session has started. Contains the resolved session configuration, including server defaults.
|
|
17
|
+
variant :"session.started", -> { OpenAI::Live::SessionStartedEvent }
|
|
18
|
+
|
|
19
|
+
# Returned when a Live session update is accepted. Contains the resolved session configuration after the update.
|
|
20
|
+
variant :"session.updated", -> { OpenAI::Live::SessionUpdatedEvent }
|
|
21
|
+
|
|
22
|
+
# Returned when a session.input_audio.mute command is accepted. Input audio is no longer sent to the model; sideband audio reflection continues.
|
|
23
|
+
variant :"session.input_audio.muted", -> { OpenAI::Live::InputAudioMutedEvent }
|
|
24
|
+
|
|
25
|
+
# Returned when a session.input_audio.unmute command is accepted. Input audio is sent to the model again.
|
|
26
|
+
variant :"session.input_audio.unmuted", -> { OpenAI::Live::InputAudioUnmutedEvent }
|
|
27
|
+
|
|
28
|
+
# Returned when a session.instructions.append command is accepted into the Live session timeline. Acknowledges the appended instructions without guaranteeing that the model has acted on them.
|
|
29
|
+
variant :"session.instructions.appended", -> { OpenAI::Live::InstructionsAppendedEvent }
|
|
30
|
+
|
|
31
|
+
# Returned when a session.thinking.append command is accepted into the Live session timeline. Acknowledges the added reasoning context without guaranteeing any spoken output.
|
|
32
|
+
variant :"session.thinking.appended", -> { OpenAI::Live::ThinkingAppendedEvent }
|
|
33
|
+
|
|
34
|
+
# Returned when a session.commentary.append command is accepted into the Live session timeline. Acknowledges the added commentary without guaranteeing exact wording or completed audio playback.
|
|
35
|
+
variant :"session.commentary.appended", -> { OpenAI::Live::CommentaryAppendedEvent }
|
|
36
|
+
|
|
37
|
+
# Input audio received from the primary transport and reflected to a Live sideband connection before model-input muting.
|
|
38
|
+
variant :"session.input_audio.append", -> { OpenAI::Live::ForkServerEvent::SessionInputAudioAppend }
|
|
39
|
+
|
|
40
|
+
# An audio chunk generated by the Live model. Decode and play primary WebSocket chunks in delivery order using the configured session audio format. Sideband connections receive reflected output audio with timestamps.
|
|
41
|
+
variant :"session.output_audio.delta", -> { OpenAI::Live::OutputAudioDeltaEvent }
|
|
42
|
+
|
|
43
|
+
# A transcript fragment for user input audio in the Live session. Accumulate fragments in delivery order; these events do not define complete turns or include a transcript-done event.
|
|
44
|
+
variant :"session.input_transcript.delta", -> { OpenAI::Live::InputTranscriptDeltaEvent }
|
|
45
|
+
|
|
46
|
+
# A transcript fragment for assistant output audio in the Live session. Accumulate fragments in delivery order; these events do not define complete turns or include a transcript-done event.
|
|
47
|
+
variant :"session.output_transcript.delta", -> { OpenAI::Live::OutputTranscriptDeltaEvent }
|
|
48
|
+
|
|
49
|
+
# Returned when the Live model delegates work to your application or a Responses backend. Contains delegation metadata and the position on the session timeline where the work was delegated.
|
|
50
|
+
variant :"session.delegation.created", -> { OpenAI::Live::DelegationCreatedEvent }
|
|
51
|
+
|
|
52
|
+
# A streaming Responses API event from a backend delegated to by the Live session. Use the outer delegation_id to associate the nested stream with its Live delegation.
|
|
53
|
+
variant :"response.event", -> { OpenAI::Live::ResponseEvent }
|
|
54
|
+
|
|
55
|
+
# Reports cumulative Live audio usage and, when available, the most recent context-window usage. Delegated Responses token usage is reported separately in response.event events.
|
|
56
|
+
variant :"session.usage.updated", -> { OpenAI::Live::SessionUsageUpdatedEvent }
|
|
57
|
+
|
|
58
|
+
# Returned after the Live session finishes finalizing, with the close reason, final session snapshot, and cumulative audio usage. A connection closing without this event does not confirm successful finalization.
|
|
59
|
+
variant :"session.closed", -> { OpenAI::Live::SessionClosedEvent }
|
|
60
|
+
|
|
61
|
+
# Reports an error in the Live session, such as an invalid client command. Use error.client_event_id, when present, to identify the command that caused the error.
|
|
62
|
+
variant :error, -> { OpenAI::Live::ErrorEvent }
|
|
63
|
+
|
|
64
|
+
# An informational notice about the Live session, such as the event permissions applied to a frontend data channel.
|
|
65
|
+
variant :info, -> { OpenAI::Live::InfoEvent }
|
|
66
|
+
|
|
67
|
+
# A SIP DTMF keypress received from the caller. Delivered only to sideband observers.
|
|
68
|
+
variant :"transport.dtmf.received", -> { OpenAI::Live::ForkServerEvent::TransportDtmfReceived }
|
|
69
|
+
|
|
70
|
+
# A SIP DTMF keypress successfully sent by the hosted tool. Delivered only to sideband observers; this is not a client command.
|
|
71
|
+
variant :"transport.dtmf.send", -> { OpenAI::Live::ForkServerEvent::TransportDtmfSend }
|
|
72
|
+
|
|
73
|
+
# The outbound SIP provider leg is ringing or providing early media. Delivered only to sideband observers.
|
|
74
|
+
variant :"transport.ringing", -> { OpenAI::Live::ForkServerEvent::TransportRinging }
|
|
75
|
+
|
|
76
|
+
# The outbound SIP provider leg answered and media is established. Delivered only to sideband observers.
|
|
77
|
+
variant :"transport.answered", -> { OpenAI::Live::ForkServerEvent::TransportAnswered }
|
|
78
|
+
|
|
79
|
+
# An asynchronous outbound SIP setup failure. Delivered only to sideband observers.
|
|
80
|
+
variant :"transport.failed", -> { OpenAI::Live::ForkServerEvent::TransportFailed }
|
|
81
|
+
|
|
82
|
+
class SessionInputAudioAppend < OpenAI::Internal::Type::BaseModel
|
|
83
|
+
# @!attribute audio
|
|
84
|
+
# Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
|
|
85
|
+
# reflected to the sideband before model-input muting. This server event uses the
|
|
86
|
+
# same audio key as the client command, but is not an acknowledgment of it.
|
|
87
|
+
#
|
|
88
|
+
# @return [String]
|
|
89
|
+
required :audio, String
|
|
90
|
+
|
|
91
|
+
# @!attribute type
|
|
92
|
+
# The event type, always `session.input_audio.append`.
|
|
93
|
+
#
|
|
94
|
+
# @return [Symbol, :"session.input_audio.append"]
|
|
95
|
+
required :type, const: :"session.input_audio.append"
|
|
96
|
+
|
|
97
|
+
# @!method initialize(audio:, type: :"session.input_audio.append")
|
|
98
|
+
# Input audio received from the primary transport and reflected to a Live sideband
|
|
99
|
+
# connection before model-input muting.
|
|
100
|
+
#
|
|
101
|
+
# @param audio [String]
|
|
102
|
+
# Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
|
|
103
|
+
# reflected to the sideband before model-input muting. This server event uses the
|
|
104
|
+
# same audio key as the client command, but is not an acknowledgment of it.
|
|
105
|
+
#
|
|
106
|
+
# @param type [Symbol, :"session.input_audio.append"]
|
|
107
|
+
# The event type, always `session.input_audio.append`.
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
class TransportDtmfReceived < OpenAI::Internal::Type::BaseModel
|
|
111
|
+
# @!attribute event
|
|
112
|
+
#
|
|
113
|
+
# @return [String]
|
|
114
|
+
required :event, String
|
|
115
|
+
|
|
116
|
+
# @!attribute event_id
|
|
117
|
+
#
|
|
118
|
+
# @return [String]
|
|
119
|
+
required :event_id, String
|
|
120
|
+
|
|
121
|
+
# @!attribute type
|
|
122
|
+
#
|
|
123
|
+
# @return [Symbol, :"transport.dtmf.received"]
|
|
124
|
+
required :type, const: :"transport.dtmf.received"
|
|
125
|
+
|
|
126
|
+
# @!method initialize(event:, event_id:, type: :"transport.dtmf.received")
|
|
127
|
+
# A SIP DTMF keypress received from the caller. Delivered only to sideband
|
|
128
|
+
# observers.
|
|
129
|
+
#
|
|
130
|
+
# @param event [String]
|
|
131
|
+
# @param event_id [String]
|
|
132
|
+
# @param type [Symbol, :"transport.dtmf.received"]
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
class TransportDtmfSend < OpenAI::Internal::Type::BaseModel
|
|
136
|
+
# @!attribute event
|
|
137
|
+
#
|
|
138
|
+
# @return [String]
|
|
139
|
+
required :event, String
|
|
140
|
+
|
|
141
|
+
# @!attribute event_id
|
|
142
|
+
#
|
|
143
|
+
# @return [String]
|
|
144
|
+
required :event_id, String
|
|
145
|
+
|
|
146
|
+
# @!attribute type
|
|
147
|
+
#
|
|
148
|
+
# @return [Symbol, :"transport.dtmf.send"]
|
|
149
|
+
required :type, const: :"transport.dtmf.send"
|
|
150
|
+
|
|
151
|
+
# @!method initialize(event:, event_id:, type: :"transport.dtmf.send")
|
|
152
|
+
# A SIP DTMF keypress successfully sent by the hosted tool. Delivered only to
|
|
153
|
+
# sideband observers; this is not a client command.
|
|
154
|
+
#
|
|
155
|
+
# @param event [String]
|
|
156
|
+
# @param event_id [String]
|
|
157
|
+
# @param type [Symbol, :"transport.dtmf.send"]
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
class TransportRinging < OpenAI::Internal::Type::BaseModel
|
|
161
|
+
# @!attribute event_id
|
|
162
|
+
#
|
|
163
|
+
# @return [String]
|
|
164
|
+
required :event_id, String
|
|
165
|
+
|
|
166
|
+
# @!attribute session_id
|
|
167
|
+
# The canonical Live session ID.
|
|
168
|
+
#
|
|
169
|
+
# @return [String]
|
|
170
|
+
required :session_id, String
|
|
171
|
+
|
|
172
|
+
# @!attribute type
|
|
173
|
+
#
|
|
174
|
+
# @return [Symbol, :"transport.ringing"]
|
|
175
|
+
required :type, const: :"transport.ringing"
|
|
176
|
+
|
|
177
|
+
# @!method initialize(event_id:, session_id:, type: :"transport.ringing")
|
|
178
|
+
# The outbound SIP provider leg is ringing or providing early media. Delivered
|
|
179
|
+
# only to sideband observers.
|
|
180
|
+
#
|
|
181
|
+
# @param event_id [String]
|
|
182
|
+
#
|
|
183
|
+
# @param session_id [String]
|
|
184
|
+
# The canonical Live session ID.
|
|
185
|
+
#
|
|
186
|
+
# @param type [Symbol, :"transport.ringing"]
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
class TransportAnswered < OpenAI::Internal::Type::BaseModel
|
|
190
|
+
# @!attribute event_id
|
|
191
|
+
#
|
|
192
|
+
# @return [String]
|
|
193
|
+
required :event_id, String
|
|
194
|
+
|
|
195
|
+
# @!attribute session_id
|
|
196
|
+
# The canonical Live session ID.
|
|
197
|
+
#
|
|
198
|
+
# @return [String]
|
|
199
|
+
required :session_id, String
|
|
200
|
+
|
|
201
|
+
# @!attribute type
|
|
202
|
+
#
|
|
203
|
+
# @return [Symbol, :"transport.answered"]
|
|
204
|
+
required :type, const: :"transport.answered"
|
|
205
|
+
|
|
206
|
+
# @!method initialize(event_id:, session_id:, type: :"transport.answered")
|
|
207
|
+
# The outbound SIP provider leg answered and media is established. Delivered only
|
|
208
|
+
# to sideband observers.
|
|
209
|
+
#
|
|
210
|
+
# @param event_id [String]
|
|
211
|
+
#
|
|
212
|
+
# @param session_id [String]
|
|
213
|
+
# The canonical Live session ID.
|
|
214
|
+
#
|
|
215
|
+
# @param type [Symbol, :"transport.answered"]
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
class TransportFailed < OpenAI::Internal::Type::BaseModel
|
|
219
|
+
# @!attribute error
|
|
220
|
+
#
|
|
221
|
+
# @return [OpenAI::Models::Live::ForkServerEvent::TransportFailed::Error]
|
|
222
|
+
required :error, -> { OpenAI::Live::ForkServerEvent::TransportFailed::Error }
|
|
223
|
+
|
|
224
|
+
# @!attribute event_id
|
|
225
|
+
#
|
|
226
|
+
# @return [String]
|
|
227
|
+
required :event_id, String
|
|
228
|
+
|
|
229
|
+
# @!attribute session_id
|
|
230
|
+
# The canonical Live session ID.
|
|
231
|
+
#
|
|
232
|
+
# @return [String]
|
|
233
|
+
required :session_id, String
|
|
234
|
+
|
|
235
|
+
# @!attribute type
|
|
236
|
+
#
|
|
237
|
+
# @return [Symbol, :"transport.failed"]
|
|
238
|
+
required :type, const: :"transport.failed"
|
|
239
|
+
|
|
240
|
+
# @!method initialize(error:, event_id:, session_id:, type: :"transport.failed")
|
|
241
|
+
# An asynchronous outbound SIP setup failure. Delivered only to sideband
|
|
242
|
+
# observers.
|
|
243
|
+
#
|
|
244
|
+
# @param error [OpenAI::Models::Live::ForkServerEvent::TransportFailed::Error]
|
|
245
|
+
#
|
|
246
|
+
# @param event_id [String]
|
|
247
|
+
#
|
|
248
|
+
# @param session_id [String]
|
|
249
|
+
# The canonical Live session ID.
|
|
250
|
+
#
|
|
251
|
+
# @param type [Symbol, :"transport.failed"]
|
|
252
|
+
|
|
253
|
+
# @see OpenAI::Models::Live::ForkServerEvent::TransportFailed#error
|
|
254
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
255
|
+
# @!attribute code
|
|
256
|
+
# The call setup failure code.
|
|
257
|
+
#
|
|
258
|
+
# @return [String]
|
|
259
|
+
required :code, String
|
|
260
|
+
|
|
261
|
+
# @!attribute message
|
|
262
|
+
#
|
|
263
|
+
# @return [String]
|
|
264
|
+
required :message, String
|
|
265
|
+
|
|
266
|
+
# @!attribute type
|
|
267
|
+
#
|
|
268
|
+
# @return [Symbol, :call_error]
|
|
269
|
+
required :type, const: :call_error
|
|
270
|
+
|
|
271
|
+
# @!attribute param
|
|
272
|
+
# The parameter related to the error, if any. Empty when no parameter applies.
|
|
273
|
+
#
|
|
274
|
+
# @return [String, nil]
|
|
275
|
+
optional :param, String
|
|
276
|
+
|
|
277
|
+
# @!method initialize(code:, message:, param: nil, type: :call_error)
|
|
278
|
+
# @param code [String]
|
|
279
|
+
# The call setup failure code.
|
|
280
|
+
#
|
|
281
|
+
# @param message [String]
|
|
282
|
+
#
|
|
283
|
+
# @param param [String]
|
|
284
|
+
# The parameter related to the error, if any. Empty when no parameter applies.
|
|
285
|
+
#
|
|
286
|
+
# @param type [Symbol, :call_error]
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# @!method self.variants
|
|
291
|
+
# @return [Array(OpenAI::Models::Live::SessionStartedEvent, OpenAI::Models::Live::SessionUpdatedEvent, OpenAI::Models::Live::InputAudioMutedEvent, OpenAI::Models::Live::InputAudioUnmutedEvent, OpenAI::Models::Live::InstructionsAppendedEvent, OpenAI::Models::Live::ThinkingAppendedEvent, OpenAI::Models::Live::CommentaryAppendedEvent, OpenAI::Models::Live::ForkServerEvent::SessionInputAudioAppend, OpenAI::Models::Live::OutputAudioDeltaEvent, OpenAI::Models::Live::InputTranscriptDeltaEvent, OpenAI::Models::Live::OutputTranscriptDeltaEvent, OpenAI::Models::Live::DelegationCreatedEvent, OpenAI::Models::Live::ResponseEvent, OpenAI::Models::Live::SessionUsageUpdatedEvent, OpenAI::Models::Live::SessionClosedEvent, OpenAI::Models::Live::ErrorEvent, OpenAI::Models::Live::InfoEvent, OpenAI::Models::Live::ForkServerEvent::TransportDtmfReceived, OpenAI::Models::Live::ForkServerEvent::TransportDtmfSend, OpenAI::Models::Live::ForkServerEvent::TransportRinging, OpenAI::Models::Live::ForkServerEvent::TransportAnswered, OpenAI::Models::Live::ForkServerEvent::TransportFailed)]
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
end
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class ForkSessionConfig < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute audio
|
|
8
|
+
# Audio format for a WebSocket fork. WebRTC forks negotiate their audio format and
|
|
9
|
+
# must omit this field.
|
|
10
|
+
#
|
|
11
|
+
# @return [OpenAI::Models::Live::ForkSessionConfig::Audio, nil]
|
|
12
|
+
optional :audio, -> { OpenAI::Live::ForkSessionConfig::Audio }
|
|
13
|
+
|
|
14
|
+
# @!attribute client
|
|
15
|
+
# Frontend data-channel permissions for a WebRTC fork. Omitted permissions inherit
|
|
16
|
+
# the stored values. Not supported for WebSocket forks.
|
|
17
|
+
#
|
|
18
|
+
# @return [OpenAI::Models::Live::ClientConfig, nil]
|
|
19
|
+
optional :client, -> { OpenAI::Live::ClientConfig }
|
|
20
|
+
|
|
21
|
+
# @!attribute delegation
|
|
22
|
+
# Overrides for the stored session’s Responses backend. Only supported when the
|
|
23
|
+
# stored session already uses Responses delegation; the delegation type cannot
|
|
24
|
+
# change.
|
|
25
|
+
#
|
|
26
|
+
# @return [OpenAI::Models::Live::ForkSessionConfig::Delegation, nil]
|
|
27
|
+
optional :delegation, -> { OpenAI::Live::ForkSessionConfig::Delegation }
|
|
28
|
+
|
|
29
|
+
# @!attribute store
|
|
30
|
+
# Whether to store the forked session. Omission inherits the stored session's
|
|
31
|
+
# setting.
|
|
32
|
+
#
|
|
33
|
+
# @return [Boolean, nil]
|
|
34
|
+
optional :store, OpenAI::Internal::Type::Boolean
|
|
35
|
+
|
|
36
|
+
# @!method initialize(audio: nil, client: nil, delegation: nil, store: nil)
|
|
37
|
+
# Overrides for a stored session after connecting to the fork WebSocket. An empty
|
|
38
|
+
# object inherits the stored configuration; do not supply a new model.
|
|
39
|
+
# audio.format applies only to the new WebSocket connection. client overrides are
|
|
40
|
+
# only supported for WebRTC forks.
|
|
41
|
+
#
|
|
42
|
+
# @param audio [OpenAI::Models::Live::ForkSessionConfig::Audio]
|
|
43
|
+
# Audio format for a WebSocket fork. WebRTC forks negotiate their audio format and
|
|
44
|
+
# must omit this field.
|
|
45
|
+
#
|
|
46
|
+
# @param client [OpenAI::Models::Live::ClientConfig]
|
|
47
|
+
# Frontend data-channel permissions for a WebRTC fork. Omitted permissions inherit
|
|
48
|
+
# the stored values. Not supported for WebSocket forks.
|
|
49
|
+
#
|
|
50
|
+
# @param delegation [OpenAI::Models::Live::ForkSessionConfig::Delegation]
|
|
51
|
+
# Overrides for the stored session’s Responses backend. Only supported when the
|
|
52
|
+
# stored session already uses Responses delegation; the delegation type cannot
|
|
53
|
+
# change.
|
|
54
|
+
#
|
|
55
|
+
# @param store [Boolean]
|
|
56
|
+
# Whether to store the forked session. Omission inherits the stored session's
|
|
57
|
+
# setting.
|
|
58
|
+
|
|
59
|
+
# @see OpenAI::Models::Live::ForkSessionConfig#audio
|
|
60
|
+
class Audio < OpenAI::Internal::Type::BaseModel
|
|
61
|
+
# @!attribute format_
|
|
62
|
+
# Audio encoding and sample rate for audio sent and received over a Live WebSocket
|
|
63
|
+
# connection. WebRTC and SIP negotiate their media format separately.
|
|
64
|
+
#
|
|
65
|
+
# @return [OpenAI::Models::Live::AudioFormat::AudioPCM, OpenAI::Models::Live::AudioFormat::AudioPCMU, OpenAI::Models::Live::AudioFormat::AudioPCMA, nil]
|
|
66
|
+
optional :format_, union: -> { OpenAI::Live::AudioFormat }, api_name: :format
|
|
67
|
+
|
|
68
|
+
# @!method initialize(format_: nil)
|
|
69
|
+
# Audio format for a WebSocket fork. WebRTC forks negotiate their audio format and
|
|
70
|
+
# must omit this field.
|
|
71
|
+
#
|
|
72
|
+
# @param format_ [OpenAI::Models::Live::AudioFormat::AudioPCM, OpenAI::Models::Live::AudioFormat::AudioPCMU, OpenAI::Models::Live::AudioFormat::AudioPCMA]
|
|
73
|
+
# Audio encoding and sample rate for audio sent and received over a Live WebSocket
|
|
74
|
+
# connection. WebRTC and SIP negotiate their media format separately.
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# @see OpenAI::Models::Live::ForkSessionConfig#delegation
|
|
78
|
+
class Delegation < OpenAI::Internal::Type::BaseModel
|
|
79
|
+
# @!attribute type
|
|
80
|
+
# The delegation owner. Always `responses` for tasks handled by the Responses API.
|
|
81
|
+
#
|
|
82
|
+
# @return [Symbol, :responses]
|
|
83
|
+
required :type, const: :responses
|
|
84
|
+
|
|
85
|
+
# @!attribute responses
|
|
86
|
+
# Responses backend settings to update. Omitted settings keep their existing
|
|
87
|
+
# values.
|
|
88
|
+
#
|
|
89
|
+
# @return [OpenAI::Models::Live::ResponsesDelegationUpdateConfig, nil]
|
|
90
|
+
optional :responses, -> { OpenAI::Live::ResponsesDelegationUpdateConfig }
|
|
91
|
+
|
|
92
|
+
# @!method initialize(responses: nil, type: :responses)
|
|
93
|
+
# Overrides for the stored session’s Responses backend. Only supported when the
|
|
94
|
+
# stored session already uses Responses delegation; the delegation type cannot
|
|
95
|
+
# change.
|
|
96
|
+
#
|
|
97
|
+
# @param responses [OpenAI::Models::Live::ResponsesDelegationUpdateConfig]
|
|
98
|
+
# Responses backend settings to update. Omitted settings keep their existing
|
|
99
|
+
# values.
|
|
100
|
+
#
|
|
101
|
+
# @param type [Symbol, :responses]
|
|
102
|
+
# The delegation owner. Always `responses` for tasks handled by the Responses API.
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class ForkSessionStartEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute session
|
|
8
|
+
# Overrides for a stored session after connecting to the fork WebSocket. An empty
|
|
9
|
+
# object inherits the stored configuration; do not supply a new model.
|
|
10
|
+
# audio.format applies only to the new WebSocket connection. client overrides are
|
|
11
|
+
# only supported for WebRTC forks.
|
|
12
|
+
#
|
|
13
|
+
# @return [OpenAI::Models::Live::ForkSessionConfig]
|
|
14
|
+
required :session, -> { OpenAI::Live::ForkSessionConfig }
|
|
15
|
+
|
|
16
|
+
# @!attribute type
|
|
17
|
+
# The Live client event type. Always `session.start`.
|
|
18
|
+
#
|
|
19
|
+
# @return [Symbol, :"session.start"]
|
|
20
|
+
required :type, const: :"session.start"
|
|
21
|
+
|
|
22
|
+
# @!attribute event_id
|
|
23
|
+
# Optional client identifier for correlating this command with a server event's
|
|
24
|
+
# client_event_id or error.client_event_id.
|
|
25
|
+
#
|
|
26
|
+
# @return [String, nil]
|
|
27
|
+
optional :event_id, String, nil?: true
|
|
28
|
+
|
|
29
|
+
# @!method initialize(session:, event_id: nil, type: :"session.start")
|
|
30
|
+
# Start a Live session after connecting to a stored session’s fork WebSocket. Send
|
|
31
|
+
# an empty `session` object to use the stored configuration.
|
|
32
|
+
#
|
|
33
|
+
# @param session [OpenAI::Models::Live::ForkSessionConfig]
|
|
34
|
+
# Overrides for a stored session after connecting to the fork WebSocket. An empty
|
|
35
|
+
# object inherits the stored configuration; do not supply a new model.
|
|
36
|
+
# audio.format applies only to the new WebSocket connection. client overrides are
|
|
37
|
+
# only supported for WebRTC forks.
|
|
38
|
+
#
|
|
39
|
+
# @param event_id [String, nil]
|
|
40
|
+
# Optional client identifier for correlating this command with a server event's
|
|
41
|
+
# client_event_id or error.client_event_id.
|
|
42
|
+
#
|
|
43
|
+
# @param type [Symbol, :"session.start"]
|
|
44
|
+
# The Live client event type. Always `session.start`.
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class FunctionTool < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute name
|
|
8
|
+
# The name the delegated Responses model uses when calling this function.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :name, String
|
|
12
|
+
|
|
13
|
+
# @!attribute type
|
|
14
|
+
# The tool type. Always `function`.
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, :function]
|
|
17
|
+
required :type, const: :function
|
|
18
|
+
|
|
19
|
+
# @!attribute description
|
|
20
|
+
# What the function does and when the delegated Responses model should call it.
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :description, String, nil?: true
|
|
24
|
+
|
|
25
|
+
# @!attribute parameters
|
|
26
|
+
# A JSON Schema object describing the arguments accepted by the function.
|
|
27
|
+
#
|
|
28
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
29
|
+
optional :parameters, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown], nil?: true
|
|
30
|
+
|
|
31
|
+
# @!attribute strict
|
|
32
|
+
# Whether the delegated Responses model must follow the function’s parameter
|
|
33
|
+
# schema exactly.
|
|
34
|
+
#
|
|
35
|
+
# @return [Boolean, nil]
|
|
36
|
+
optional :strict, OpenAI::Internal::Type::Boolean, nil?: true
|
|
37
|
+
|
|
38
|
+
# @!method initialize(name:, description: nil, parameters: nil, strict: nil, type: :function)
|
|
39
|
+
# A function tool available to the Responses backend when the Live model delegates
|
|
40
|
+
# a task.
|
|
41
|
+
#
|
|
42
|
+
# @param name [String]
|
|
43
|
+
# The name the delegated Responses model uses when calling this function.
|
|
44
|
+
#
|
|
45
|
+
# @param description [String, nil]
|
|
46
|
+
# What the function does and when the delegated Responses model should call it.
|
|
47
|
+
#
|
|
48
|
+
# @param parameters [Hash{Symbol=>Object}, nil]
|
|
49
|
+
# A JSON Schema object describing the arguments accepted by the function.
|
|
50
|
+
#
|
|
51
|
+
# @param strict [Boolean, nil]
|
|
52
|
+
# Whether the delegated Responses model must follow the function’s parameter
|
|
53
|
+
# schema exactly.
|
|
54
|
+
#
|
|
55
|
+
# @param type [Symbol, :function]
|
|
56
|
+
# The tool type. Always `function`.
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class InfoEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute code
|
|
8
|
+
# A machine-readable code for the notice, such as `data_channel_permissions`.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :code, String
|
|
12
|
+
|
|
13
|
+
# @!attribute event_id
|
|
14
|
+
# The unique ID of the Live server event.
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :event_id, String
|
|
18
|
+
|
|
19
|
+
# @!attribute message
|
|
20
|
+
# A human-readable explanation of the Live session notice.
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
required :message, String
|
|
24
|
+
|
|
25
|
+
# @!attribute type
|
|
26
|
+
# The event type, always `info`.
|
|
27
|
+
#
|
|
28
|
+
# @return [Symbol, :info]
|
|
29
|
+
required :type, const: :info
|
|
30
|
+
|
|
31
|
+
# @!attribute client_event_id
|
|
32
|
+
# The event_id of the client command associated with this server event, when
|
|
33
|
+
# supplied.
|
|
34
|
+
#
|
|
35
|
+
# @return [String, nil]
|
|
36
|
+
optional :client_event_id, String
|
|
37
|
+
|
|
38
|
+
# @!method initialize(code:, event_id:, message:, client_event_id: nil, type: :info)
|
|
39
|
+
# An informational notice about the Live session, such as the event permissions
|
|
40
|
+
# applied to a frontend data channel.
|
|
41
|
+
#
|
|
42
|
+
# @param code [String]
|
|
43
|
+
# A machine-readable code for the notice, such as `data_channel_permissions`.
|
|
44
|
+
#
|
|
45
|
+
# @param event_id [String]
|
|
46
|
+
# The unique ID of the Live server event.
|
|
47
|
+
#
|
|
48
|
+
# @param message [String]
|
|
49
|
+
# A human-readable explanation of the Live session notice.
|
|
50
|
+
#
|
|
51
|
+
# @param client_event_id [String]
|
|
52
|
+
# The event_id of the client command associated with this server event, when
|
|
53
|
+
# supplied.
|
|
54
|
+
#
|
|
55
|
+
# @param type [Symbol, :info]
|
|
56
|
+
# The event type, always `info`.
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|