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,97 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Live
|
|
7
|
+
|
|
8
|
+
class CommentaryAppendedEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Live::CommentaryAppendedEvent,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The end of this event on the Live session timeline, in milliseconds from the
|
|
18
|
+
# beginning of the session. For appended context, this can equal start_ms.
|
|
19
|
+
sig { returns(Integer) }
|
|
20
|
+
attr_accessor :end_ms
|
|
21
|
+
|
|
22
|
+
# The unique ID of the Live server event.
|
|
23
|
+
sig { returns(String) }
|
|
24
|
+
attr_accessor :event_id
|
|
25
|
+
|
|
26
|
+
# The start of this event on the Live session timeline, in milliseconds from the
|
|
27
|
+
# beginning of the session.
|
|
28
|
+
sig { returns(Integer) }
|
|
29
|
+
attr_accessor :start_ms
|
|
30
|
+
|
|
31
|
+
# The event type, always `session.commentary.appended`.
|
|
32
|
+
sig { returns(Symbol) }
|
|
33
|
+
attr_accessor :type
|
|
34
|
+
|
|
35
|
+
# The event_id of the client command associated with this server event, when
|
|
36
|
+
# supplied.
|
|
37
|
+
sig { returns(T.nilable(String)) }
|
|
38
|
+
attr_reader :client_event_id
|
|
39
|
+
|
|
40
|
+
sig { params(client_event_id: String).void }
|
|
41
|
+
attr_writer :client_event_id
|
|
42
|
+
|
|
43
|
+
# Returned when a session.commentary.append command is accepted into the Live
|
|
44
|
+
# session timeline. Acknowledges the added commentary without guaranteeing exact
|
|
45
|
+
# wording or completed audio playback.
|
|
46
|
+
sig do
|
|
47
|
+
params(
|
|
48
|
+
|
|
49
|
+
end_ms: Integer,
|
|
50
|
+
|
|
51
|
+
event_id: String,
|
|
52
|
+
|
|
53
|
+
start_ms: Integer,
|
|
54
|
+
|
|
55
|
+
client_event_id: String,
|
|
56
|
+
|
|
57
|
+
type: Symbol
|
|
58
|
+
)
|
|
59
|
+
.returns(T.attached_class)
|
|
60
|
+
end
|
|
61
|
+
def self.new(
|
|
62
|
+
|
|
63
|
+
# The end of this event on the Live session timeline, in milliseconds from the
|
|
64
|
+
# beginning of the session. For appended context, this can equal start_ms.
|
|
65
|
+
end_ms:,
|
|
66
|
+
|
|
67
|
+
# The unique ID of the Live server event.
|
|
68
|
+
event_id:,
|
|
69
|
+
|
|
70
|
+
# The start of this event on the Live session timeline, in milliseconds from the
|
|
71
|
+
# beginning of the session.
|
|
72
|
+
start_ms:,
|
|
73
|
+
|
|
74
|
+
# The event_id of the client command associated with this server event, when
|
|
75
|
+
# supplied.
|
|
76
|
+
client_event_id: nil,
|
|
77
|
+
|
|
78
|
+
# The event type, always `session.commentary.appended`.
|
|
79
|
+
|
|
80
|
+
type: :"session.commentary.appended"
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
sig do
|
|
85
|
+
override.returns(
|
|
86
|
+
{end_ms: Integer, event_id: String, start_ms: Integer, type: Symbol, client_event_id: T.nilable(String)}
|
|
87
|
+
)
|
|
88
|
+
end
|
|
89
|
+
def to_hash
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Live
|
|
7
|
+
|
|
8
|
+
class CustomVoice < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Live::CustomVoice,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
|
|
23
|
+
id: String
|
|
24
|
+
)
|
|
25
|
+
.returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(
|
|
28
|
+
|
|
29
|
+
id:
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
override.returns(
|
|
35
|
+
{id: String}
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
def to_hash
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Live
|
|
7
|
+
|
|
8
|
+
class DataChannelConfig < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Live::DataChannelConfig,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Client event types that the frontend data channel may send. Use 'all' to allow
|
|
18
|
+
# every client event; an empty array allows none. Omission preserves the existing
|
|
19
|
+
# allow-all behavior.
|
|
20
|
+
sig { returns(T.nilable(OpenAI::Live::DataChannelConfig::AllowedClientEvents::Variants)) }
|
|
21
|
+
attr_reader :allowed_client_events
|
|
22
|
+
|
|
23
|
+
sig { params(allowed_client_events: OpenAI::Live::DataChannelConfig::AllowedClientEvents::Variants).void }
|
|
24
|
+
attr_writer :allowed_client_events
|
|
25
|
+
|
|
26
|
+
# Server events that may be sent to the frontend data channel. Use 'all' to allow
|
|
27
|
+
# every server event; an empty array allows none. Omission preserves the existing
|
|
28
|
+
# allow-all behavior. Responses events use an object with type 'response.event'
|
|
29
|
+
# and a response_event selector.
|
|
30
|
+
sig { returns(T.nilable(T.any(Symbol, T::Array[OpenAI::Live::ServerEventSelector]))) }
|
|
31
|
+
attr_reader :allowed_server_events
|
|
32
|
+
|
|
33
|
+
sig { params(allowed_server_events: T.any(Symbol, T::Array[OpenAI::Live::ServerEventSelector::OrHash])).void }
|
|
34
|
+
attr_writer :allowed_server_events
|
|
35
|
+
|
|
36
|
+
# Control which Live events an untrusted WebRTC frontend can send and receive over
|
|
37
|
+
# its data channel. These restrictions do not apply to trusted sideband
|
|
38
|
+
# connections.
|
|
39
|
+
sig do
|
|
40
|
+
params(
|
|
41
|
+
|
|
42
|
+
allowed_client_events: OpenAI::Live::DataChannelConfig::AllowedClientEvents::Variants,
|
|
43
|
+
|
|
44
|
+
allowed_server_events: T.any(Symbol, T::Array[OpenAI::Live::ServerEventSelector::OrHash])
|
|
45
|
+
)
|
|
46
|
+
.returns(T.attached_class)
|
|
47
|
+
end
|
|
48
|
+
def self.new(
|
|
49
|
+
|
|
50
|
+
# Client event types that the frontend data channel may send. Use 'all' to allow
|
|
51
|
+
# every client event; an empty array allows none. Omission preserves the existing
|
|
52
|
+
# allow-all behavior.
|
|
53
|
+
allowed_client_events: nil,
|
|
54
|
+
|
|
55
|
+
# Server events that may be sent to the frontend data channel. Use 'all' to allow
|
|
56
|
+
# every server event; an empty array allows none. Omission preserves the existing
|
|
57
|
+
# allow-all behavior. Responses events use an object with type 'response.event'
|
|
58
|
+
# and a response_event selector.
|
|
59
|
+
|
|
60
|
+
allowed_server_events: nil
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
sig do
|
|
65
|
+
override.returns(
|
|
66
|
+
{
|
|
67
|
+
allowed_client_events: OpenAI::Live::DataChannelConfig::AllowedClientEvents::Variants,
|
|
68
|
+
allowed_server_events: T.any(Symbol, T::Array[OpenAI::Live::ServerEventSelector])
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
def to_hash
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Client event types that the frontend data channel may send. Use 'all' to allow
|
|
76
|
+
# every client event; an empty array allows none. Omission preserves the existing
|
|
77
|
+
# allow-all behavior.
|
|
78
|
+
module AllowedClientEvents
|
|
79
|
+
extend OpenAI::Internal::Type::Union
|
|
80
|
+
|
|
81
|
+
Variants = T.type_alias { T.any(Symbol, T::Array[String]) }
|
|
82
|
+
|
|
83
|
+
sig { override.returns(T::Array[OpenAI::Live::DataChannelConfig::AllowedClientEvents::Variants]) }
|
|
84
|
+
def self.variants
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
StringArray = T.let(
|
|
88
|
+
OpenAI::Internal::Type::ArrayOf[String],
|
|
89
|
+
OpenAI::Internal::Type::Converter
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Server events that may be sent to the frontend data channel. Use 'all' to allow
|
|
95
|
+
# every server event; an empty array allows none. Omission preserves the existing
|
|
96
|
+
# allow-all behavior. Responses events use an object with type 'response.event'
|
|
97
|
+
# and a response_event selector.
|
|
98
|
+
module AllowedServerEvents
|
|
99
|
+
extend OpenAI::Internal::Type::Union
|
|
100
|
+
|
|
101
|
+
Variants = T.type_alias { T.any(Symbol, T::Array[OpenAI::Live::ServerEventSelector]) }
|
|
102
|
+
|
|
103
|
+
sig { override.returns(T::Array[OpenAI::Live::DataChannelConfig::AllowedServerEvents::Variants]) }
|
|
104
|
+
def self.variants
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
ServerEventSelectorArray = T.let(
|
|
108
|
+
OpenAI::Internal::Type::ArrayOf[OpenAI::Live::ServerEventSelector],
|
|
109
|
+
OpenAI::Internal::Type::Converter
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
end
|
|
119
|
+
end
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Live
|
|
7
|
+
|
|
8
|
+
class DelegationCreatedEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Live::DelegationCreatedEvent,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The delegated work identifier and destination. This object contains metadata,
|
|
18
|
+
# not the task text.
|
|
19
|
+
sig { returns(OpenAI::Live::DelegationCreatedEvent::Delegation) }
|
|
20
|
+
attr_reader :delegation
|
|
21
|
+
|
|
22
|
+
sig { params(delegation: OpenAI::Live::DelegationCreatedEvent::Delegation::OrHash).void }
|
|
23
|
+
attr_writer :delegation
|
|
24
|
+
|
|
25
|
+
# The unique ID of the Live server event.
|
|
26
|
+
sig { returns(String) }
|
|
27
|
+
attr_accessor :event_id
|
|
28
|
+
|
|
29
|
+
# The position on the Live session timeline where the delegation was created, in
|
|
30
|
+
# milliseconds from the beginning of the session.
|
|
31
|
+
sig { returns(Integer) }
|
|
32
|
+
attr_accessor :offset_ms
|
|
33
|
+
|
|
34
|
+
# The event type, always `session.delegation.created`.
|
|
35
|
+
sig { returns(Symbol) }
|
|
36
|
+
attr_accessor :type
|
|
37
|
+
|
|
38
|
+
# The event_id of the client command associated with this server event, when
|
|
39
|
+
# supplied.
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_reader :client_event_id
|
|
42
|
+
|
|
43
|
+
sig { params(client_event_id: String).void }
|
|
44
|
+
attr_writer :client_event_id
|
|
45
|
+
|
|
46
|
+
# Returned when the Live model delegates work to your application or a Responses
|
|
47
|
+
# backend. Contains delegation metadata and the position on the session timeline
|
|
48
|
+
# where the work was delegated.
|
|
49
|
+
sig do
|
|
50
|
+
params(
|
|
51
|
+
|
|
52
|
+
delegation: OpenAI::Live::DelegationCreatedEvent::Delegation::OrHash,
|
|
53
|
+
|
|
54
|
+
event_id: String,
|
|
55
|
+
|
|
56
|
+
offset_ms: Integer,
|
|
57
|
+
|
|
58
|
+
client_event_id: String,
|
|
59
|
+
|
|
60
|
+
type: Symbol
|
|
61
|
+
)
|
|
62
|
+
.returns(T.attached_class)
|
|
63
|
+
end
|
|
64
|
+
def self.new(
|
|
65
|
+
|
|
66
|
+
# The delegated work identifier and destination. This object contains metadata,
|
|
67
|
+
# not the task text.
|
|
68
|
+
delegation:,
|
|
69
|
+
|
|
70
|
+
# The unique ID of the Live server event.
|
|
71
|
+
event_id:,
|
|
72
|
+
|
|
73
|
+
# The position on the Live session timeline where the delegation was created, in
|
|
74
|
+
# milliseconds from the beginning of the session.
|
|
75
|
+
offset_ms:,
|
|
76
|
+
|
|
77
|
+
# The event_id of the client command associated with this server event, when
|
|
78
|
+
# supplied.
|
|
79
|
+
client_event_id: nil,
|
|
80
|
+
|
|
81
|
+
# The event type, always `session.delegation.created`.
|
|
82
|
+
|
|
83
|
+
type: :"session.delegation.created"
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
sig do
|
|
88
|
+
override.returns(
|
|
89
|
+
{
|
|
90
|
+
delegation: OpenAI::Live::DelegationCreatedEvent::Delegation,
|
|
91
|
+
event_id: String,
|
|
92
|
+
offset_ms: Integer,
|
|
93
|
+
type: Symbol,
|
|
94
|
+
client_event_id: T.nilable(String)
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
def to_hash
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
class Delegation < OpenAI::Internal::Type::BaseModel
|
|
102
|
+
OrHash = T.type_alias do
|
|
103
|
+
T.any(
|
|
104
|
+
OpenAI::Live::DelegationCreatedEvent::Delegation,
|
|
105
|
+
OpenAI::Internal::AnyHash
|
|
106
|
+
)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# The unique ID of the delegation. Use this as delegation_id when replying to
|
|
110
|
+
# client-owned work or correlating Responses events.
|
|
111
|
+
sig { returns(String) }
|
|
112
|
+
attr_accessor :id
|
|
113
|
+
|
|
114
|
+
# Where the Live model delegated the work: `client` for your application, or
|
|
115
|
+
# `responses` for the configured Responses backend.
|
|
116
|
+
sig { returns(OpenAI::Live::DelegationCreatedEvent::Delegation::Target::OrSymbol) }
|
|
117
|
+
attr_accessor :target
|
|
118
|
+
|
|
119
|
+
# The object type, always `delegation`.
|
|
120
|
+
sig { returns(Symbol) }
|
|
121
|
+
attr_accessor :type
|
|
122
|
+
|
|
123
|
+
# The ID of the Responses API response associated with a Responses delegation.
|
|
124
|
+
# Omitted for client delegations.
|
|
125
|
+
sig { returns(T.nilable(String)) }
|
|
126
|
+
attr_reader :response_id
|
|
127
|
+
|
|
128
|
+
sig { params(response_id: String).void }
|
|
129
|
+
attr_writer :response_id
|
|
130
|
+
|
|
131
|
+
# The delegated work identifier and destination. This object contains metadata,
|
|
132
|
+
# not the task text.
|
|
133
|
+
sig do
|
|
134
|
+
params(
|
|
135
|
+
|
|
136
|
+
id: String,
|
|
137
|
+
|
|
138
|
+
target: OpenAI::Live::DelegationCreatedEvent::Delegation::Target::OrSymbol,
|
|
139
|
+
|
|
140
|
+
response_id: String,
|
|
141
|
+
|
|
142
|
+
type: Symbol
|
|
143
|
+
)
|
|
144
|
+
.returns(T.attached_class)
|
|
145
|
+
end
|
|
146
|
+
def self.new(
|
|
147
|
+
|
|
148
|
+
# The unique ID of the delegation. Use this as delegation_id when replying to
|
|
149
|
+
# client-owned work or correlating Responses events.
|
|
150
|
+
id:,
|
|
151
|
+
|
|
152
|
+
# Where the Live model delegated the work: `client` for your application, or
|
|
153
|
+
# `responses` for the configured Responses backend.
|
|
154
|
+
target:,
|
|
155
|
+
|
|
156
|
+
# The ID of the Responses API response associated with a Responses delegation.
|
|
157
|
+
# Omitted for client delegations.
|
|
158
|
+
response_id: nil,
|
|
159
|
+
|
|
160
|
+
# The object type, always `delegation`.
|
|
161
|
+
|
|
162
|
+
type: :delegation
|
|
163
|
+
)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
sig do
|
|
167
|
+
override.returns(
|
|
168
|
+
{
|
|
169
|
+
id: String,
|
|
170
|
+
target: OpenAI::Live::DelegationCreatedEvent::Delegation::Target::OrSymbol,
|
|
171
|
+
type: Symbol,
|
|
172
|
+
response_id: T.nilable(String)
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
def to_hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Where the Live model delegated the work: `client` for your application, or
|
|
180
|
+
# `responses` for the configured Responses backend.
|
|
181
|
+
module Target
|
|
182
|
+
extend OpenAI::Internal::Type::Union
|
|
183
|
+
|
|
184
|
+
Variants = T.type_alias { OpenAI::Live::DelegationCreatedEvent::Delegation::Target::TaggedSymbol }
|
|
185
|
+
|
|
186
|
+
sig { override.returns(T::Array[OpenAI::Live::DelegationCreatedEvent::Delegation::Target::Variants]) }
|
|
187
|
+
def self.variants
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
TaggedSymbol = T.type_alias do
|
|
191
|
+
T.all(Symbol, OpenAI::Live::DelegationCreatedEvent::Delegation::Target)
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
195
|
+
|
|
196
|
+
CLIENT = T.let(:client, OpenAI::Live::DelegationCreatedEvent::Delegation::Target::TaggedSymbol)
|
|
197
|
+
RESPONSES = T.let(:responses, OpenAI::Live::DelegationCreatedEvent::Delegation::Target::TaggedSymbol)
|
|
198
|
+
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
end
|
|
207
|
+
end
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Live
|
|
7
|
+
|
|
8
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Live::Error,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# A machine-readable code identifying the Live error, such as `unknown_parameter`.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :code
|
|
20
|
+
|
|
21
|
+
# A human-readable explanation of the Live error.
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :message
|
|
24
|
+
|
|
25
|
+
# The category of error, such as `invalid_request_error` for an invalid Live
|
|
26
|
+
# client command.
|
|
27
|
+
sig { returns(String) }
|
|
28
|
+
attr_accessor :type
|
|
29
|
+
|
|
30
|
+
# The event_id of the client command that caused the error, when supplied.
|
|
31
|
+
sig { returns(T.nilable(String)) }
|
|
32
|
+
attr_reader :client_event_id
|
|
33
|
+
|
|
34
|
+
sig { params(client_event_id: String).void }
|
|
35
|
+
attr_writer :client_event_id
|
|
36
|
+
|
|
37
|
+
# The parameter that caused the error, when applicable, such as `session.voice`.
|
|
38
|
+
sig { returns(T.nilable(String)) }
|
|
39
|
+
attr_reader :param
|
|
40
|
+
|
|
41
|
+
sig { params(param: String).void }
|
|
42
|
+
attr_writer :param
|
|
43
|
+
|
|
44
|
+
# Details of an error encountered by the Live session, including the affected
|
|
45
|
+
# parameter or client command when available.
|
|
46
|
+
sig do
|
|
47
|
+
params(
|
|
48
|
+
|
|
49
|
+
code: String,
|
|
50
|
+
|
|
51
|
+
message: String,
|
|
52
|
+
|
|
53
|
+
type: String,
|
|
54
|
+
|
|
55
|
+
client_event_id: String,
|
|
56
|
+
|
|
57
|
+
param: String
|
|
58
|
+
)
|
|
59
|
+
.returns(T.attached_class)
|
|
60
|
+
end
|
|
61
|
+
def self.new(
|
|
62
|
+
|
|
63
|
+
# A machine-readable code identifying the Live error, such as `unknown_parameter`.
|
|
64
|
+
code:,
|
|
65
|
+
|
|
66
|
+
# A human-readable explanation of the Live error.
|
|
67
|
+
message:,
|
|
68
|
+
|
|
69
|
+
# The category of error, such as `invalid_request_error` for an invalid Live
|
|
70
|
+
# client command.
|
|
71
|
+
type:,
|
|
72
|
+
|
|
73
|
+
# The event_id of the client command that caused the error, when supplied.
|
|
74
|
+
client_event_id: nil,
|
|
75
|
+
|
|
76
|
+
# The parameter that caused the error, when applicable, such as `session.voice`.
|
|
77
|
+
|
|
78
|
+
param: nil
|
|
79
|
+
)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
sig do
|
|
83
|
+
override.returns(
|
|
84
|
+
{code: String, message: String, type: String, client_event_id: String, param: String}
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
def to_hash
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Live
|
|
7
|
+
|
|
8
|
+
class ErrorEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Live::ErrorEvent,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Details of the Live error and the client command that caused it, when known.
|
|
18
|
+
sig { returns(OpenAI::Live::Error) }
|
|
19
|
+
attr_reader :error
|
|
20
|
+
|
|
21
|
+
sig { params(error: OpenAI::Live::Error::OrHash).void }
|
|
22
|
+
attr_writer :error
|
|
23
|
+
|
|
24
|
+
# The unique ID of the Live server event.
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
attr_accessor :event_id
|
|
27
|
+
|
|
28
|
+
# The event type, always `error`.
|
|
29
|
+
sig { returns(Symbol) }
|
|
30
|
+
attr_accessor :type
|
|
31
|
+
|
|
32
|
+
# The event_id of the client command associated with this server event, when
|
|
33
|
+
# supplied.
|
|
34
|
+
sig { returns(T.nilable(String)) }
|
|
35
|
+
attr_reader :client_event_id
|
|
36
|
+
|
|
37
|
+
sig { params(client_event_id: String).void }
|
|
38
|
+
attr_writer :client_event_id
|
|
39
|
+
|
|
40
|
+
# Reports an error in the Live session, such as an invalid client command. Use
|
|
41
|
+
# error.client_event_id, when present, to identify the command that caused the
|
|
42
|
+
# error.
|
|
43
|
+
sig do
|
|
44
|
+
params(
|
|
45
|
+
|
|
46
|
+
error: OpenAI::Live::Error::OrHash,
|
|
47
|
+
|
|
48
|
+
event_id: String,
|
|
49
|
+
|
|
50
|
+
client_event_id: String,
|
|
51
|
+
|
|
52
|
+
type: Symbol
|
|
53
|
+
)
|
|
54
|
+
.returns(T.attached_class)
|
|
55
|
+
end
|
|
56
|
+
def self.new(
|
|
57
|
+
|
|
58
|
+
# Details of the Live error and the client command that caused it, when known.
|
|
59
|
+
error:,
|
|
60
|
+
|
|
61
|
+
# The unique ID of the Live server event.
|
|
62
|
+
event_id:,
|
|
63
|
+
|
|
64
|
+
# The event_id of the client command associated with this server event, when
|
|
65
|
+
# supplied.
|
|
66
|
+
client_event_id: nil,
|
|
67
|
+
|
|
68
|
+
# The event type, always `error`.
|
|
69
|
+
|
|
70
|
+
type: :error
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(
|
|
76
|
+
{error: OpenAI::Live::Error, event_id: String, type: Symbol, client_event_id: T.nilable(String)}
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
def to_hash
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Live
|
|
7
|
+
|
|
8
|
+
# Client events for a Live fork WebSocket. First send session.start with an
|
|
9
|
+
# overrides object (which may be empty), then wait for session.started before
|
|
10
|
+
# sending other commands. The model and conversation are inherited from the stored
|
|
11
|
+
# session.
|
|
12
|
+
module ForkClientEvent
|
|
13
|
+
extend OpenAI::Internal::Type::Union
|
|
14
|
+
|
|
15
|
+
Variants = T.type_alias do
|
|
16
|
+
T.any(
|
|
17
|
+
OpenAI::Live::ForkSessionStartEvent,
|
|
18
|
+
OpenAI::Live::SessionUpdateEvent,
|
|
19
|
+
OpenAI::Live::InputAudioAppendEvent,
|
|
20
|
+
OpenAI::Live::InputAudioMuteEvent,
|
|
21
|
+
OpenAI::Live::InputAudioUnmuteEvent,
|
|
22
|
+
OpenAI::Live::InstructionsAppendEvent,
|
|
23
|
+
OpenAI::Live::ThinkingAppendEvent,
|
|
24
|
+
OpenAI::Live::CommentaryAppendEvent,
|
|
25
|
+
OpenAI::Live::ResponseItemCreateEvent,
|
|
26
|
+
OpenAI::Live::ResponseCreateEvent,
|
|
27
|
+
OpenAI::Live::SessionCloseEvent
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
sig { override.returns(T::Array[OpenAI::Live::ForkClientEvent::Variants]) }
|
|
32
|
+
def self.variants
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
end
|
|
40
|
+
end
|