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,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
# @see OpenAI::Resources::Live::Sessions#fork
|
|
7
|
+
class SessionForkParams < OpenAI::Internal::Type::BaseModel
|
|
8
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute session_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :session_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute transport
|
|
17
|
+
# WebRTC transport with an SDP offer for the new connection to the forked session.
|
|
18
|
+
#
|
|
19
|
+
# @return [OpenAI::Models::Live::SessionForkParams::Transport]
|
|
20
|
+
required :transport, -> { OpenAI::Live::SessionForkParams::Transport }
|
|
21
|
+
|
|
22
|
+
# @!attribute session
|
|
23
|
+
# Optional configuration overrides for the new Live session. Omit this object or
|
|
24
|
+
# send an empty object to inherit the stored session's settings.
|
|
25
|
+
#
|
|
26
|
+
# @return [OpenAI::Models::Live::MediaSessionForkConfig, nil]
|
|
27
|
+
optional :session, -> { OpenAI::Live::MediaSessionForkConfig }
|
|
28
|
+
|
|
29
|
+
# @!method initialize(session_id:, transport:, session: nil, request_options: {})
|
|
30
|
+
# @param session_id [String]
|
|
31
|
+
#
|
|
32
|
+
# @param transport [OpenAI::Models::Live::SessionForkParams::Transport]
|
|
33
|
+
# WebRTC transport with an SDP offer for the new connection to the forked session.
|
|
34
|
+
#
|
|
35
|
+
# @param session [OpenAI::Models::Live::MediaSessionForkConfig]
|
|
36
|
+
# Optional configuration overrides for the new Live session. Omit this object or
|
|
37
|
+
# send an empty object to inherit the stored session's settings.
|
|
38
|
+
#
|
|
39
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
40
|
+
|
|
41
|
+
class Transport < OpenAI::Internal::Type::BaseModel
|
|
42
|
+
# @!attribute sdp
|
|
43
|
+
# Session Description Protocol message for the WebRTC connection.
|
|
44
|
+
#
|
|
45
|
+
# @return [String]
|
|
46
|
+
required :sdp, String
|
|
47
|
+
|
|
48
|
+
# @!attribute type
|
|
49
|
+
# The transport used for the Live session. Always `webrtc`.
|
|
50
|
+
#
|
|
51
|
+
# @return [Symbol, :webrtc]
|
|
52
|
+
required :type, const: :webrtc
|
|
53
|
+
|
|
54
|
+
# @!method initialize(sdp:, type: :webrtc)
|
|
55
|
+
# WebRTC transport with an SDP offer for the new connection to the forked session.
|
|
56
|
+
#
|
|
57
|
+
# @param sdp [String]
|
|
58
|
+
# Session Description Protocol message for the WebRTC connection.
|
|
59
|
+
#
|
|
60
|
+
# @param type [Symbol, :webrtc]
|
|
61
|
+
# The transport used for the Live session. Always `webrtc`.
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
# @see OpenAI::Resources::Live::Sessions#fork
|
|
7
|
+
class SessionForkResponse < OpenAI::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute session
|
|
9
|
+
# The newly created Live session. Use its ID for session controls and sideband
|
|
10
|
+
# connections.
|
|
11
|
+
#
|
|
12
|
+
# @return [OpenAI::Models::Live::SessionForkResponse::Session]
|
|
13
|
+
required :session, -> { OpenAI::Models::Live::SessionForkResponse::Session }
|
|
14
|
+
|
|
15
|
+
# @!attribute transport
|
|
16
|
+
# WebRTC transport with the SDP answer.
|
|
17
|
+
#
|
|
18
|
+
# @return [OpenAI::Models::Live::SessionForkResponse::Transport]
|
|
19
|
+
required :transport, -> { OpenAI::Models::Live::SessionForkResponse::Transport }
|
|
20
|
+
|
|
21
|
+
# @!method initialize(session:, transport:)
|
|
22
|
+
# The created Live session identifier and WebRTC answer. Apply transport.sdp as
|
|
23
|
+
# the peer's remote answer and wait for session.started on the data channel before
|
|
24
|
+
# sending commands.
|
|
25
|
+
#
|
|
26
|
+
# @param session [OpenAI::Models::Live::SessionForkResponse::Session]
|
|
27
|
+
# The newly created Live session. Use its ID for session controls and sideband
|
|
28
|
+
# connections.
|
|
29
|
+
#
|
|
30
|
+
# @param transport [OpenAI::Models::Live::SessionForkResponse::Transport]
|
|
31
|
+
# WebRTC transport with the SDP answer.
|
|
32
|
+
|
|
33
|
+
# @see OpenAI::Models::Live::SessionForkResponse#session
|
|
34
|
+
class Session < OpenAI::Internal::Type::BaseModel
|
|
35
|
+
# @!attribute id
|
|
36
|
+
# Opaque session identifier. Preserve the returned value unchanged, including its
|
|
37
|
+
# prefix.
|
|
38
|
+
#
|
|
39
|
+
# @return [String]
|
|
40
|
+
required :id, String
|
|
41
|
+
|
|
42
|
+
# @!method initialize(id:)
|
|
43
|
+
# The newly created Live session. Use its ID for session controls and sideband
|
|
44
|
+
# connections.
|
|
45
|
+
#
|
|
46
|
+
# @param id [String]
|
|
47
|
+
# Opaque session identifier. Preserve the returned value unchanged, including its
|
|
48
|
+
# prefix.
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# @see OpenAI::Models::Live::SessionForkResponse#transport
|
|
52
|
+
class Transport < OpenAI::Internal::Type::BaseModel
|
|
53
|
+
# @!attribute sdp
|
|
54
|
+
# Session Description Protocol message for the WebRTC connection.
|
|
55
|
+
#
|
|
56
|
+
# @return [String]
|
|
57
|
+
required :sdp, String
|
|
58
|
+
|
|
59
|
+
# @!attribute type
|
|
60
|
+
# The transport used for the Live session. Always `webrtc`.
|
|
61
|
+
#
|
|
62
|
+
# @return [Symbol, :webrtc]
|
|
63
|
+
required :type, const: :webrtc
|
|
64
|
+
|
|
65
|
+
# @!method initialize(sdp:, type: :webrtc)
|
|
66
|
+
# WebRTC transport with the SDP answer.
|
|
67
|
+
#
|
|
68
|
+
# @param sdp [String]
|
|
69
|
+
# Session Description Protocol message for the WebRTC connection.
|
|
70
|
+
#
|
|
71
|
+
# @param type [Symbol, :webrtc]
|
|
72
|
+
# The transport used for the Live session. Always `webrtc`.
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
# @see OpenAI::Resources::Live::Sessions#hangup
|
|
7
|
+
class SessionHangupParams < OpenAI::Internal::Type::BaseModel
|
|
8
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute session_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :session_id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(session_id:, request_options: {})
|
|
17
|
+
# @param session_id [String]
|
|
18
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
# @see OpenAI::Resources::Live::Sessions#refer
|
|
7
|
+
class SessionReferParams < OpenAI::Internal::Type::BaseModel
|
|
8
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute session_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :session_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute target_uri
|
|
17
|
+
# Nonblank URI for the SIP Refer-To header, such as tel:+14155550123 or
|
|
18
|
+
# sip:agent@example.com.
|
|
19
|
+
#
|
|
20
|
+
# @return [String]
|
|
21
|
+
required :target_uri, String
|
|
22
|
+
|
|
23
|
+
# @!method initialize(session_id:, target_uri:, request_options: {})
|
|
24
|
+
# @param session_id [String]
|
|
25
|
+
#
|
|
26
|
+
# @param target_uri [String]
|
|
27
|
+
# Nonblank URI for the SIP Refer-To header, such as tel:+14155550123 or
|
|
28
|
+
# sip:agent@example.com.
|
|
29
|
+
#
|
|
30
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
# @see OpenAI::Resources::Live::Sessions#reject
|
|
7
|
+
class SessionRejectParams < OpenAI::Internal::Type::BaseModel
|
|
8
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute session_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :session_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute status_code
|
|
17
|
+
# SIP rejection status sent to the caller. This field is required.
|
|
18
|
+
#
|
|
19
|
+
# @return [Integer]
|
|
20
|
+
required :status_code, Integer
|
|
21
|
+
|
|
22
|
+
# @!method initialize(session_id:, status_code:, request_options: {})
|
|
23
|
+
# @param session_id [String]
|
|
24
|
+
#
|
|
25
|
+
# @param status_code [Integer]
|
|
26
|
+
# SIP rejection status sent to the caller. This field is required.
|
|
27
|
+
#
|
|
28
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class SessionResource < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique ID of the Live session. Use this ID for sideband connections,
|
|
9
|
+
# forking, and recording download.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :id, String
|
|
13
|
+
|
|
14
|
+
# @!attribute expires_at
|
|
15
|
+
# The Unix timestamp, in seconds, at which the Live session expires.
|
|
16
|
+
#
|
|
17
|
+
# @return [Integer]
|
|
18
|
+
required :expires_at, Integer
|
|
19
|
+
|
|
20
|
+
# @!attribute model
|
|
21
|
+
# The Live model. Required in the session configuration for every transport; do
|
|
22
|
+
# not pass it as a URL query parameter.
|
|
23
|
+
#
|
|
24
|
+
# @return [String, Symbol, OpenAI::Models::Live::SessionResource::Model]
|
|
25
|
+
required :model, union: -> { OpenAI::Live::SessionResource::Model }
|
|
26
|
+
|
|
27
|
+
# @!attribute status
|
|
28
|
+
# The status of the session snapshot. Always `active`, including the final
|
|
29
|
+
# snapshot in session.closed; use the event type to determine that the session has
|
|
30
|
+
# closed.
|
|
31
|
+
#
|
|
32
|
+
# @return [Symbol, :active]
|
|
33
|
+
required :status, const: :active
|
|
34
|
+
|
|
35
|
+
# @!attribute audio
|
|
36
|
+
# Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC
|
|
37
|
+
# and SIP negotiate their media format. Voice and format are immutable after
|
|
38
|
+
# startup.
|
|
39
|
+
#
|
|
40
|
+
# @return [OpenAI::Models::Live::SessionResource::Audio, nil]
|
|
41
|
+
optional :audio, -> { OpenAI::Live::SessionResource::Audio }
|
|
42
|
+
|
|
43
|
+
# @!attribute client
|
|
44
|
+
# Startup-only capabilities for an untrusted frontend attached to a unified WebRTC
|
|
45
|
+
# session. Trusted sideband connections are unaffected.
|
|
46
|
+
#
|
|
47
|
+
# @return [OpenAI::Models::Live::ClientConfig, nil]
|
|
48
|
+
optional :client, -> { OpenAI::Live::ClientConfig }
|
|
49
|
+
|
|
50
|
+
# @!attribute delegation
|
|
51
|
+
# Who handles tasks delegated by the Live model. Omitted or null selects your
|
|
52
|
+
# application; use `responses` to let the API manage a Responses backend.
|
|
53
|
+
#
|
|
54
|
+
# @return [OpenAI::Models::Live::ClientDelegation, OpenAI::Models::Live::SessionResource::Delegation::Responses, nil]
|
|
55
|
+
optional :delegation, union: -> { OpenAI::Live::SessionResource::Delegation }, nil?: true
|
|
56
|
+
|
|
57
|
+
# @!attribute input
|
|
58
|
+
# Ordered text-only history supplied before startup. Supports developer, user, and
|
|
59
|
+
# assistant messages with one text part each; at most 128 messages and 8,192
|
|
60
|
+
# rendered tokens in total.
|
|
61
|
+
#
|
|
62
|
+
# @return [Array<OpenAI::Models::Live::InitialItem::Developer, OpenAI::Models::Live::InitialItem::User, OpenAI::Models::Live::InitialItem::Assistant>, nil]
|
|
63
|
+
optional :input, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Live::InitialItem] }
|
|
64
|
+
|
|
65
|
+
# @!attribute instructions
|
|
66
|
+
# Frontend instructions for voice, conversation, interruptions, and when to
|
|
67
|
+
# delegate. Start with the
|
|
68
|
+
# [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting);
|
|
69
|
+
# put business rules and tool workflows in a separate
|
|
70
|
+
# [backend prompt](https://developers.openai.com/api/docs/guides/live-delegation#start-with-your-existing-backend-prompt).
|
|
71
|
+
# Limited to 16,384 client-supplied tokens. Omitted or blank instructions use
|
|
72
|
+
# server defaults. Immutable after startup.
|
|
73
|
+
#
|
|
74
|
+
# @return [String, nil]
|
|
75
|
+
optional :instructions, String, nil?: true
|
|
76
|
+
|
|
77
|
+
# @!attribute store
|
|
78
|
+
# Whether to store the session for later forking and recording download. Defaults
|
|
79
|
+
# to false for new sessions.
|
|
80
|
+
#
|
|
81
|
+
# @return [Boolean, nil]
|
|
82
|
+
optional :store, OpenAI::Internal::Type::Boolean
|
|
83
|
+
|
|
84
|
+
# @!method initialize(id:, expires_at:, model:, audio: nil, client: nil, delegation: nil, input: nil, instructions: nil, store: nil, status: :active)
|
|
85
|
+
# The resolved Live session configuration and server-assigned session metadata.
|
|
86
|
+
#
|
|
87
|
+
# @param id [String]
|
|
88
|
+
# The unique ID of the Live session. Use this ID for sideband connections,
|
|
89
|
+
# forking, and recording download.
|
|
90
|
+
#
|
|
91
|
+
# @param expires_at [Integer]
|
|
92
|
+
# The Unix timestamp, in seconds, at which the Live session expires.
|
|
93
|
+
#
|
|
94
|
+
# @param model [String, Symbol, OpenAI::Models::Live::SessionResource::Model]
|
|
95
|
+
# The Live model. Required in the session configuration for every transport; do
|
|
96
|
+
# not pass it as a URL query parameter.
|
|
97
|
+
#
|
|
98
|
+
# @param audio [OpenAI::Models::Live::SessionResource::Audio]
|
|
99
|
+
# Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC
|
|
100
|
+
# and SIP negotiate their media format. Voice and format are immutable after
|
|
101
|
+
# startup.
|
|
102
|
+
#
|
|
103
|
+
# @param client [OpenAI::Models::Live::ClientConfig]
|
|
104
|
+
# Startup-only capabilities for an untrusted frontend attached to a unified WebRTC
|
|
105
|
+
# session. Trusted sideband connections are unaffected.
|
|
106
|
+
#
|
|
107
|
+
# @param delegation [OpenAI::Models::Live::ClientDelegation, OpenAI::Models::Live::SessionResource::Delegation::Responses, nil]
|
|
108
|
+
# Who handles tasks delegated by the Live model. Omitted or null selects your
|
|
109
|
+
# application; use `responses` to let the API manage a Responses backend.
|
|
110
|
+
#
|
|
111
|
+
# @param input [Array<OpenAI::Models::Live::InitialItem::Developer, OpenAI::Models::Live::InitialItem::User, OpenAI::Models::Live::InitialItem::Assistant>]
|
|
112
|
+
# Ordered text-only history supplied before startup. Supports developer, user, and
|
|
113
|
+
# assistant messages with one text part each; at most 128 messages and 8,192
|
|
114
|
+
# rendered tokens in total.
|
|
115
|
+
#
|
|
116
|
+
# @param instructions [String, nil]
|
|
117
|
+
# Frontend instructions for voice, conversation, interruptions, and when to
|
|
118
|
+
# delegate. Start with the
|
|
119
|
+
# [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting);
|
|
120
|
+
# put business rules and tool workflows in a separate
|
|
121
|
+
# [backend prompt](https://developers.openai.com/api/docs/guides/live-delegation#start-with-your-existing-backend-prompt).
|
|
122
|
+
# Limited to 16,384 client-supplied tokens. Omitted or blank instructions use
|
|
123
|
+
# server defaults. Immutable after startup.
|
|
124
|
+
#
|
|
125
|
+
# @param store [Boolean]
|
|
126
|
+
# Whether to store the session for later forking and recording download. Defaults
|
|
127
|
+
# to false for new sessions.
|
|
128
|
+
#
|
|
129
|
+
# @param status [Symbol, :active]
|
|
130
|
+
# The status of the session snapshot. Always `active`, including the final
|
|
131
|
+
# snapshot in session.closed; use the event type to determine that the session has
|
|
132
|
+
# closed.
|
|
133
|
+
|
|
134
|
+
# The Live model. Required in the session configuration for every transport; do
|
|
135
|
+
# not pass it as a URL query parameter.
|
|
136
|
+
#
|
|
137
|
+
# @see OpenAI::Models::Live::SessionResource#model
|
|
138
|
+
module Model
|
|
139
|
+
extend OpenAI::Internal::Type::Union
|
|
140
|
+
|
|
141
|
+
variant String
|
|
142
|
+
|
|
143
|
+
variant const: -> { OpenAI::Models::Live::SessionResource::Model::GPT_LIVE_1 }
|
|
144
|
+
|
|
145
|
+
# @!method self.variants
|
|
146
|
+
# @return [Array(String, Symbol)]
|
|
147
|
+
|
|
148
|
+
define_sorbet_constant!(:Variants) do
|
|
149
|
+
T.type_alias { T.any(String, OpenAI::Live::SessionResource::Model::TaggedSymbol) }
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# @!group
|
|
153
|
+
|
|
154
|
+
GPT_LIVE_1 = :"gpt-live-1"
|
|
155
|
+
|
|
156
|
+
# @!endgroup
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# @see OpenAI::Models::Live::SessionResource#audio
|
|
160
|
+
class Audio < OpenAI::Internal::Type::BaseModel
|
|
161
|
+
# @!attribute format_
|
|
162
|
+
# Audio encoding and sample rate for audio sent and received over a Live WebSocket
|
|
163
|
+
# connection. WebRTC and SIP negotiate their media format separately.
|
|
164
|
+
#
|
|
165
|
+
# @return [OpenAI::Models::Live::AudioFormat::AudioPCM, OpenAI::Models::Live::AudioFormat::AudioPCMU, OpenAI::Models::Live::AudioFormat::AudioPCMA, nil]
|
|
166
|
+
optional :format_, union: -> { OpenAI::Live::AudioFormat }, api_name: :format
|
|
167
|
+
|
|
168
|
+
# @!attribute output
|
|
169
|
+
# The voice used for speech generated by the Live model.
|
|
170
|
+
#
|
|
171
|
+
# @return [OpenAI::Models::Live::SessionResource::Audio::Output, nil]
|
|
172
|
+
optional :output, -> { OpenAI::Live::SessionResource::Audio::Output }
|
|
173
|
+
|
|
174
|
+
# @!method initialize(format_: nil, output: nil)
|
|
175
|
+
# Startup audio configuration. Only primary WebSockets accept audio.format; WebRTC
|
|
176
|
+
# and SIP negotiate their media format. Voice and format are immutable after
|
|
177
|
+
# startup.
|
|
178
|
+
#
|
|
179
|
+
# @param format_ [OpenAI::Models::Live::AudioFormat::AudioPCM, OpenAI::Models::Live::AudioFormat::AudioPCMU, OpenAI::Models::Live::AudioFormat::AudioPCMA]
|
|
180
|
+
# Audio encoding and sample rate for audio sent and received over a Live WebSocket
|
|
181
|
+
# connection. WebRTC and SIP negotiate their media format separately.
|
|
182
|
+
#
|
|
183
|
+
# @param output [OpenAI::Models::Live::SessionResource::Audio::Output]
|
|
184
|
+
# The voice used for speech generated by the Live model.
|
|
185
|
+
|
|
186
|
+
# @see OpenAI::Models::Live::SessionResource::Audio#output
|
|
187
|
+
class Output < OpenAI::Internal::Type::BaseModel
|
|
188
|
+
# @!attribute voice
|
|
189
|
+
# The voice used for Live speech, as a built-in voice name or a custom voice
|
|
190
|
+
# object containing its ID. Defaults to `marin` and cannot change after startup.
|
|
191
|
+
#
|
|
192
|
+
# @return [String, Symbol, OpenAI::Models::Live::BuiltInVoice, OpenAI::Models::Live::CustomVoice, nil]
|
|
193
|
+
optional :voice, union: -> { OpenAI::Live::SessionResource::Audio::Output::Voice }
|
|
194
|
+
|
|
195
|
+
# @!method initialize(voice: nil)
|
|
196
|
+
# The voice used for speech generated by the Live model.
|
|
197
|
+
#
|
|
198
|
+
# @param voice [String, Symbol, OpenAI::Models::Live::BuiltInVoice, OpenAI::Models::Live::CustomVoice]
|
|
199
|
+
# The voice used for Live speech, as a built-in voice name or a custom voice
|
|
200
|
+
# object containing its ID. Defaults to `marin` and cannot change after startup.
|
|
201
|
+
|
|
202
|
+
# The voice used for Live speech, as a built-in voice name or a custom voice
|
|
203
|
+
# object containing its ID. Defaults to `marin` and cannot change after startup.
|
|
204
|
+
#
|
|
205
|
+
# @see OpenAI::Models::Live::SessionResource::Audio::Output#voice
|
|
206
|
+
module Voice
|
|
207
|
+
extend OpenAI::Internal::Type::Union
|
|
208
|
+
|
|
209
|
+
variant String
|
|
210
|
+
|
|
211
|
+
# The voice used for Live speech, as a built-in voice name or a custom voice object containing its ID. Defaults to `marin` and cannot change after startup.
|
|
212
|
+
variant enum: -> { OpenAI::Live::BuiltInVoice }
|
|
213
|
+
|
|
214
|
+
variant -> { OpenAI::Live::CustomVoice }
|
|
215
|
+
|
|
216
|
+
# @!method self.variants
|
|
217
|
+
# @return [Array(String, Symbol, OpenAI::Models::Live::BuiltInVoice, OpenAI::Models::Live::CustomVoice)]
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Who handles tasks delegated by the Live model. Omitted or null selects your
|
|
223
|
+
# application; use `responses` to let the API manage a Responses backend.
|
|
224
|
+
#
|
|
225
|
+
# @see OpenAI::Models::Live::SessionResource#delegation
|
|
226
|
+
module Delegation
|
|
227
|
+
extend OpenAI::Internal::Type::Union
|
|
228
|
+
|
|
229
|
+
discriminator :type
|
|
230
|
+
|
|
231
|
+
# Delegate tasks to your application. The Live session emits delegation events that your backend handles.
|
|
232
|
+
variant :client, -> { OpenAI::Live::ClientDelegation }
|
|
233
|
+
|
|
234
|
+
# Delegate tasks to a Responses model managed by the Live session.
|
|
235
|
+
variant :responses, -> { OpenAI::Live::SessionResource::Delegation::Responses }
|
|
236
|
+
|
|
237
|
+
class Responses < OpenAI::Internal::Type::BaseModel
|
|
238
|
+
# @!attribute responses
|
|
239
|
+
# Backend model, prompt, and tools used when the Live session delegates a task to
|
|
240
|
+
# Responses.
|
|
241
|
+
#
|
|
242
|
+
# @return [OpenAI::Models::Live::ResponsesDelegationConfig]
|
|
243
|
+
required :responses, -> { OpenAI::Live::ResponsesDelegationConfig }
|
|
244
|
+
|
|
245
|
+
# @!attribute type
|
|
246
|
+
# The delegation owner. Always `responses` for tasks handled by the Responses API.
|
|
247
|
+
#
|
|
248
|
+
# @return [Symbol, :responses]
|
|
249
|
+
required :type, const: :responses
|
|
250
|
+
|
|
251
|
+
# @!method initialize(responses:, type: :responses)
|
|
252
|
+
# Delegate tasks to a Responses model managed by the Live session.
|
|
253
|
+
#
|
|
254
|
+
# @param responses [OpenAI::Models::Live::ResponsesDelegationConfig]
|
|
255
|
+
# Backend model, prompt, and tools used when the Live session delegates a task to
|
|
256
|
+
# Responses.
|
|
257
|
+
#
|
|
258
|
+
# @param type [Symbol, :responses]
|
|
259
|
+
# The delegation owner. Always `responses` for tasks handled by the Responses API.
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# @!method self.variants
|
|
263
|
+
# @return [Array(OpenAI::Models::Live::ClientDelegation, OpenAI::Models::Live::SessionResource::Delegation::Responses)]
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
end
|
|
268
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class SessionStartEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute session
|
|
8
|
+
# Initial configuration for a primary WebSocket. Send session.start first and wait
|
|
9
|
+
# for session.started before application commands. WebRTC creation already starts
|
|
10
|
+
# the session; do not send this event again on its data channel.
|
|
11
|
+
#
|
|
12
|
+
# @return [OpenAI::Models::Live::SessionConfig]
|
|
13
|
+
required :session, -> { OpenAI::Live::SessionConfig }
|
|
14
|
+
|
|
15
|
+
# @!attribute type
|
|
16
|
+
# The Live client event type. Always `session.start`.
|
|
17
|
+
#
|
|
18
|
+
# @return [Symbol, :"session.start"]
|
|
19
|
+
required :type, const: :"session.start"
|
|
20
|
+
|
|
21
|
+
# @!attribute event_id
|
|
22
|
+
# Optional client identifier for correlating this command with a server event's
|
|
23
|
+
# client_event_id or error.client_event_id.
|
|
24
|
+
#
|
|
25
|
+
# @return [String, nil]
|
|
26
|
+
optional :event_id, String, nil?: true
|
|
27
|
+
|
|
28
|
+
# @!method initialize(session:, event_id: nil, type: :"session.start")
|
|
29
|
+
# Start a Live session on a primary WebSocket. Send this event before other
|
|
30
|
+
# commands and wait for `session.started`.
|
|
31
|
+
#
|
|
32
|
+
# @param session [OpenAI::Models::Live::SessionConfig]
|
|
33
|
+
# Initial configuration for a primary WebSocket. Send session.start first and wait
|
|
34
|
+
# for session.started before application commands. WebRTC creation already starts
|
|
35
|
+
# the session; do not send this event again on its data channel.
|
|
36
|
+
#
|
|
37
|
+
# @param event_id [String, nil]
|
|
38
|
+
# Optional client identifier for correlating this command with a server event's
|
|
39
|
+
# client_event_id or error.client_event_id.
|
|
40
|
+
#
|
|
41
|
+
# @param type [Symbol, :"session.start"]
|
|
42
|
+
# The Live client event type. Always `session.start`.
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class SessionStartedEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute event_id
|
|
8
|
+
# The unique ID of the Live server event.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :event_id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute session
|
|
14
|
+
# The resolved Live session configuration and server-assigned session metadata.
|
|
15
|
+
#
|
|
16
|
+
# @return [OpenAI::Models::Live::SessionResource]
|
|
17
|
+
required :session, -> { OpenAI::Live::SessionResource }
|
|
18
|
+
|
|
19
|
+
# @!attribute type
|
|
20
|
+
# The event type, always `session.started`.
|
|
21
|
+
#
|
|
22
|
+
# @return [Symbol, :"session.started"]
|
|
23
|
+
required :type, const: :"session.started"
|
|
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(event_id:, session:, client_event_id: nil, type: :"session.started")
|
|
33
|
+
# Returned when a Live session has started. Contains the resolved session
|
|
34
|
+
# configuration, including server defaults.
|
|
35
|
+
#
|
|
36
|
+
# @param event_id [String]
|
|
37
|
+
# The unique ID of the Live server event.
|
|
38
|
+
#
|
|
39
|
+
# @param session [OpenAI::Models::Live::SessionResource]
|
|
40
|
+
# The resolved Live session configuration and server-assigned session metadata.
|
|
41
|
+
#
|
|
42
|
+
# @param client_event_id [String]
|
|
43
|
+
# The event_id of the client command associated with this server event, when
|
|
44
|
+
# supplied.
|
|
45
|
+
#
|
|
46
|
+
# @param type [Symbol, :"session.started"]
|
|
47
|
+
# The event type, always `session.started`.
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Live
|
|
6
|
+
class SessionUpdateConfig < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute delegation
|
|
8
|
+
# Delegation settings to update. The delegation type must match the current
|
|
9
|
+
# session; omitted settings retain their values.
|
|
10
|
+
#
|
|
11
|
+
# @return [OpenAI::Models::Live::ClientDelegation, OpenAI::Models::Live::SessionUpdateConfig::Delegation::Responses, nil]
|
|
12
|
+
optional :delegation, union: -> { OpenAI::Live::SessionUpdateConfig::Delegation }, nil?: true
|
|
13
|
+
|
|
14
|
+
# @!method initialize(delegation: nil)
|
|
15
|
+
# Changes to an active Live session. Only delegation backend settings can be
|
|
16
|
+
# updated after startup.
|
|
17
|
+
#
|
|
18
|
+
# @param delegation [OpenAI::Models::Live::ClientDelegation, OpenAI::Models::Live::SessionUpdateConfig::Delegation::Responses, nil]
|
|
19
|
+
# Delegation settings to update. The delegation type must match the current
|
|
20
|
+
# session; omitted settings retain their values.
|
|
21
|
+
|
|
22
|
+
# Delegation settings to update. The delegation type must match the current
|
|
23
|
+
# session; omitted settings retain their values.
|
|
24
|
+
#
|
|
25
|
+
# @see OpenAI::Models::Live::SessionUpdateConfig#delegation
|
|
26
|
+
module Delegation
|
|
27
|
+
extend OpenAI::Internal::Type::Union
|
|
28
|
+
|
|
29
|
+
discriminator :type
|
|
30
|
+
|
|
31
|
+
# Delegate tasks to your application. The Live session emits delegation events that your backend handles.
|
|
32
|
+
variant :client, -> { OpenAI::Live::ClientDelegation }
|
|
33
|
+
|
|
34
|
+
# Update the Responses backend for an existing Live session without changing delegation ownership.
|
|
35
|
+
variant :responses, -> { OpenAI::Live::SessionUpdateConfig::Delegation::Responses }
|
|
36
|
+
|
|
37
|
+
class Responses < OpenAI::Internal::Type::BaseModel
|
|
38
|
+
# @!attribute type
|
|
39
|
+
# The delegation owner. Always `responses` for tasks handled by the Responses API.
|
|
40
|
+
#
|
|
41
|
+
# @return [Symbol, :responses]
|
|
42
|
+
required :type, const: :responses
|
|
43
|
+
|
|
44
|
+
# @!attribute responses
|
|
45
|
+
# Responses backend settings to update. Omitted settings keep their existing
|
|
46
|
+
# values.
|
|
47
|
+
#
|
|
48
|
+
# @return [OpenAI::Models::Live::ResponsesDelegationUpdateConfig, nil]
|
|
49
|
+
optional :responses, -> { OpenAI::Live::ResponsesDelegationUpdateConfig }
|
|
50
|
+
|
|
51
|
+
# @!method initialize(responses: nil, type: :responses)
|
|
52
|
+
# Update the Responses backend for an existing Live session without changing
|
|
53
|
+
# delegation ownership.
|
|
54
|
+
#
|
|
55
|
+
# @param responses [OpenAI::Models::Live::ResponsesDelegationUpdateConfig]
|
|
56
|
+
# Responses backend settings to update. Omitted settings keep their existing
|
|
57
|
+
# values.
|
|
58
|
+
#
|
|
59
|
+
# @param type [Symbol, :responses]
|
|
60
|
+
# The delegation owner. Always `responses` for tasks handled by the Responses API.
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# @!method self.variants
|
|
64
|
+
# @return [Array(OpenAI::Models::Live::ClientDelegation, OpenAI::Models::Live::SessionUpdateConfig::Delegation::Responses)]
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|