openai 0.105.0 → 0.107.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 +67 -0
- data/README.md +1 -1
- data/lib/openai/helpers/live/websocket.rb +12 -141
- data/lib/openai/helpers/local_audio/process.rb +13 -3
- data/lib/openai/helpers/models/embedding.rb +42 -0
- data/lib/openai/helpers/realtime/connection.rb +22 -5
- data/lib/openai/helpers/realtime/recovery.rb +11 -5
- data/lib/openai/helpers/realtime/translation.rb +37 -169
- data/lib/openai/helpers/realtime/unknown_server_event.rb +5 -12
- data/lib/openai/helpers/responses_websocket/connection.rb +56 -35
- data/lib/openai/helpers/responses_websocket/unknown_server_event.rb +2 -14
- data/lib/openai/helpers/websocket/async_websocket_transport.rb +8 -6
- data/lib/openai/helpers/websocket/client_request.rb +1 -1
- data/lib/openai/helpers/websocket/connection.rb +21 -10
- data/lib/openai/helpers/websocket/connection_manager.rb +2 -1
- data/lib/openai/helpers/websocket/protocol.rb +160 -0
- data/lib/openai/helpers/websocket/typed_connection.rb +22 -16
- data/lib/openai/helpers/websocket/typed_resource.rb +15 -0
- data/lib/openai/internal/transport/base_client.rb +1 -1
- data/lib/openai/models/admin/organization/external_storage_configuration.rb +1 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_completions_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_costs_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_decisions_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_images_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +12 -1
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +12 -1
- data/lib/openai/models/beta/agent_create_params.rb +3 -0
- data/lib/openai/models/beta/agent_update_params.rb +3 -0
- data/lib/openai/models/beta/agents/session_create_params.rb +3 -0
- data/lib/openai/models/beta/agents/session_update_params.rb +3 -0
- data/lib/openai/models/beta/assistant_update_params.rb +12 -0
- data/lib/openai/models/beta/beta_response.rb +12 -0
- data/lib/openai/models/beta/beta_response_input_item.rb +10 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +12 -0
- data/lib/openai/models/beta/response_compact_params.rb +12 -0
- data/lib/openai/models/beta/response_create_params.rb +12 -0
- data/lib/openai/models/chat_model.rb +12 -0
- data/lib/openai/models/decision_create_params.rb +112 -1
- data/lib/openai/models/decision_input_image.rb +14 -1
- data/lib/openai/models/decision_input_text.rb +15 -1
- data/lib/openai/models/decision_prompt_cache_breakpoint.rb +21 -0
- data/lib/openai/models/live/sideband_server_event.rb +243 -3
- data/lib/openai/models/responses/response_compact_params.rb +12 -0
- data/lib/openai/models/responses/response_input_item.rb +10 -1
- data/lib/openai/models.rb +2 -0
- data/lib/openai/resources/beta/responses.rb +19 -0
- data/lib/openai/resources/decisions.rb +15 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +2 -0
- data/rbi/openai/client.rbi +1 -8
- data/rbi/openai/helpers/realtime/translation.rbi +0 -5
- data/rbi/openai/helpers/realtime/unknown_server_event.rbi +6 -0
- data/rbi/openai/helpers/websocket.rbi +44 -6
- data/rbi/openai/internal/transport/base_client.rbi +2 -6
- data/rbi/openai/models/admin/organization/external_storage_configuration.rbi +1 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_decisions_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +12 -0
- data/rbi/openai/models/beta/agent_create_params.rbi +3 -0
- data/rbi/openai/models/beta/agent_update_params.rbi +3 -0
- data/rbi/openai/models/beta/agents/session_create_params.rbi +3 -0
- data/rbi/openai/models/beta/agents/session_update_params.rbi +3 -0
- data/rbi/openai/models/beta/beta_response_input_item.rbi +14 -1
- data/rbi/openai/models/decision_create_params.rbi +146 -0
- data/rbi/openai/models/decision_input_image.rbi +22 -1
- data/rbi/openai/models/decision_input_text.rbi +21 -1
- data/rbi/openai/models/decision_prompt_cache_breakpoint.rbi +48 -0
- data/rbi/openai/models/live/output_audio_delta_event.rbi +1 -1
- data/rbi/openai/models/live/sideband_server_event.rbi +406 -3
- data/rbi/openai/models/responses/response_input_item.rbi +10 -1
- data/rbi/openai/models.rbi +2 -0
- data/rbi/openai/resources/beta/responses.rbi +17 -0
- data/rbi/openai/resources/decisions.rbi +14 -0
- data/realtime.md +22 -3
- data/sig/openai/client.rbs +1 -1
- data/sig/openai/helpers/realtime/translation.rbs +0 -2
- data/sig/openai/helpers/realtime/unknown_server_event.rbs +2 -0
- data/sig/openai/helpers/websocket.rbs +23 -6
- data/sig/openai/models/admin/organization/external_storage_configuration.rbs +2 -1
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_decisions_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_images_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +10 -0
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +10 -0
- data/sig/openai/models/beta/agent_create_params.rbs +5 -1
- data/sig/openai/models/beta/agent_update_params.rbs +5 -1
- data/sig/openai/models/beta/agents/session_create_params.rbs +5 -1
- data/sig/openai/models/beta/agents/session_update_params.rbs +5 -1
- data/sig/openai/models/beta/beta_response_input_item.rbs +8 -0
- data/sig/openai/models/decision_create_params.rbs +106 -0
- data/sig/openai/models/decision_input_image.rbs +18 -2
- data/sig/openai/models/decision_input_text.rbs +29 -3
- data/sig/openai/models/decision_prompt_cache_breakpoint.rbs +16 -0
- data/sig/openai/models/live/sideband_server_event.rbs +225 -0
- data/sig/openai/models/responses/response_input_item.rbs +8 -3
- data/sig/openai/models.rbs +2 -0
- data/sig/openai/resources/beta/responses.rbs +7 -0
- data/sig/openai/resources/decisions.rbs +3 -0
- metadata +6 -1
|
@@ -24,6 +24,15 @@ module OpenAI
|
|
|
24
24
|
sig { returns(T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol)) }
|
|
25
25
|
attr_accessor :detail
|
|
26
26
|
|
|
27
|
+
# Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
28
|
+
# from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
29
|
+
# token block.
|
|
30
|
+
sig { returns(T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash)) }
|
|
31
|
+
attr_reader :prompt_cache_breakpoint
|
|
32
|
+
|
|
33
|
+
sig { params(prompt_cache_breakpoint: T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash)).void }
|
|
34
|
+
attr_writer :prompt_cache_breakpoint
|
|
35
|
+
|
|
27
36
|
# An image provided as a base64 data URL or a publicly accessible HTTP(S) URL.
|
|
28
37
|
# File IDs are not supported.
|
|
29
38
|
sig do
|
|
@@ -33,6 +42,8 @@ module OpenAI
|
|
|
33
42
|
|
|
34
43
|
detail: T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol),
|
|
35
44
|
|
|
45
|
+
prompt_cache_breakpoint: T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash),
|
|
46
|
+
|
|
36
47
|
type: Symbol
|
|
37
48
|
)
|
|
38
49
|
.returns(T.attached_class)
|
|
@@ -46,13 +57,23 @@ module OpenAI
|
|
|
46
57
|
# auto.
|
|
47
58
|
detail: nil,
|
|
48
59
|
|
|
60
|
+
# Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
61
|
+
# from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
62
|
+
# token block.
|
|
63
|
+
prompt_cache_breakpoint: nil,
|
|
64
|
+
|
|
49
65
|
type: :input_image
|
|
50
66
|
)
|
|
51
67
|
end
|
|
52
68
|
|
|
53
69
|
sig do
|
|
54
70
|
override.returns(
|
|
55
|
-
{
|
|
71
|
+
{
|
|
72
|
+
image_url: String,
|
|
73
|
+
type: Symbol,
|
|
74
|
+
detail: T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol),
|
|
75
|
+
prompt_cache_breakpoint: T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash)
|
|
76
|
+
}
|
|
56
77
|
)
|
|
57
78
|
end
|
|
58
79
|
def to_hash
|
|
@@ -18,11 +18,22 @@ module OpenAI
|
|
|
18
18
|
sig { returns(Symbol) }
|
|
19
19
|
attr_accessor :type
|
|
20
20
|
|
|
21
|
+
# Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
22
|
+
# from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
23
|
+
# token block.
|
|
24
|
+
sig { returns(T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash)) }
|
|
25
|
+
attr_reader :prompt_cache_breakpoint
|
|
26
|
+
|
|
27
|
+
sig { params(prompt_cache_breakpoint: T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash)).void }
|
|
28
|
+
attr_writer :prompt_cache_breakpoint
|
|
29
|
+
|
|
21
30
|
sig do
|
|
22
31
|
params(
|
|
23
32
|
|
|
24
33
|
text: String,
|
|
25
34
|
|
|
35
|
+
prompt_cache_breakpoint: T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash),
|
|
36
|
+
|
|
26
37
|
type: Symbol
|
|
27
38
|
)
|
|
28
39
|
.returns(T.attached_class)
|
|
@@ -31,13 +42,22 @@ module OpenAI
|
|
|
31
42
|
|
|
32
43
|
text:,
|
|
33
44
|
|
|
45
|
+
# Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
46
|
+
# from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
47
|
+
# token block.
|
|
48
|
+
prompt_cache_breakpoint: nil,
|
|
49
|
+
|
|
34
50
|
type: :input_text
|
|
35
51
|
)
|
|
36
52
|
end
|
|
37
53
|
|
|
38
54
|
sig do
|
|
39
55
|
override.returns(
|
|
40
|
-
{
|
|
56
|
+
{
|
|
57
|
+
text: String,
|
|
58
|
+
type: Symbol,
|
|
59
|
+
prompt_cache_breakpoint: T.nilable(OpenAI::DecisionPromptCacheBreakpoint::OrHash)
|
|
60
|
+
}
|
|
41
61
|
)
|
|
42
62
|
end
|
|
43
63
|
def to_hash
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
class DecisionPromptCacheBreakpoint < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
|
|
8
|
+
OrHash = T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
OpenAI::DecisionPromptCacheBreakpoint,
|
|
11
|
+
OpenAI::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# The breakpoint mode. Always `explicit`.
|
|
16
|
+
sig { returns(Symbol) }
|
|
17
|
+
attr_accessor :mode
|
|
18
|
+
|
|
19
|
+
# Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL
|
|
20
|
+
# from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a
|
|
21
|
+
# token block.
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
|
|
25
|
+
mode: Symbol
|
|
26
|
+
)
|
|
27
|
+
.returns(T.attached_class)
|
|
28
|
+
end
|
|
29
|
+
def self.new(
|
|
30
|
+
|
|
31
|
+
# The breakpoint mode. Always `explicit`.
|
|
32
|
+
|
|
33
|
+
mode: :explicit
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
sig do
|
|
38
|
+
override.returns(
|
|
39
|
+
{mode: Symbol}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -5,8 +5,8 @@ module OpenAI
|
|
|
5
5
|
|
|
6
6
|
module Live
|
|
7
7
|
|
|
8
|
-
# Server events received by an attached Live sideband WebSocket
|
|
9
|
-
#
|
|
8
|
+
# Server events received by an attached Live sideband WebSocket, including
|
|
9
|
+
# reflected input and output audio and transport notifications.
|
|
10
10
|
module SidebandServerEvent
|
|
11
11
|
extend OpenAI::Internal::Type::Union
|
|
12
12
|
|
|
@@ -31,10 +31,413 @@ module OpenAI
|
|
|
31
31
|
OpenAI::Live::SessionUsageUpdatedEvent,
|
|
32
32
|
OpenAI::Live::SessionClosedEvent,
|
|
33
33
|
OpenAI::Live::ErrorEvent,
|
|
34
|
-
OpenAI::Live::InfoEvent
|
|
34
|
+
OpenAI::Live::InfoEvent,
|
|
35
|
+
OpenAI::Live::SidebandServerEvent::SessionInputAudioAppend,
|
|
36
|
+
OpenAI::Live::OutputAudioDeltaEvent,
|
|
37
|
+
OpenAI::Live::SidebandServerEvent::TransportDtmfReceived,
|
|
38
|
+
OpenAI::Live::SidebandServerEvent::TransportDtmfSend,
|
|
39
|
+
OpenAI::Live::SidebandServerEvent::TransportRinging,
|
|
40
|
+
OpenAI::Live::SidebandServerEvent::TransportAnswered,
|
|
41
|
+
OpenAI::Live::SidebandServerEvent::TransportFailed
|
|
35
42
|
)
|
|
36
43
|
end
|
|
37
44
|
|
|
45
|
+
class SessionInputAudioAppend < OpenAI::Internal::Type::BaseModel
|
|
46
|
+
OrHash = T.type_alias do
|
|
47
|
+
T.any(
|
|
48
|
+
OpenAI::Live::SidebandServerEvent::SessionInputAudioAppend,
|
|
49
|
+
OpenAI::Internal::AnyHash
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
|
|
54
|
+
# reflected to the sideband before model-input muting. This server event uses the
|
|
55
|
+
# same audio key as the client command, but is not an acknowledgment of it.
|
|
56
|
+
sig { returns(String) }
|
|
57
|
+
attr_accessor :audio
|
|
58
|
+
|
|
59
|
+
# The event type, always `session.input_audio.append`.
|
|
60
|
+
sig { returns(Symbol) }
|
|
61
|
+
attr_accessor :type
|
|
62
|
+
|
|
63
|
+
# Input audio received from the primary transport and reflected to a Live sideband
|
|
64
|
+
# connection before model-input muting.
|
|
65
|
+
sig do
|
|
66
|
+
params(
|
|
67
|
+
|
|
68
|
+
audio: String,
|
|
69
|
+
|
|
70
|
+
type: Symbol
|
|
71
|
+
)
|
|
72
|
+
.returns(T.attached_class)
|
|
73
|
+
end
|
|
74
|
+
def self.new(
|
|
75
|
+
|
|
76
|
+
# Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
|
|
77
|
+
# reflected to the sideband before model-input muting. This server event uses the
|
|
78
|
+
# same audio key as the client command, but is not an acknowledgment of it.
|
|
79
|
+
audio:,
|
|
80
|
+
|
|
81
|
+
# The event type, always `session.input_audio.append`.
|
|
82
|
+
|
|
83
|
+
type: :"session.input_audio.append"
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
sig do
|
|
88
|
+
override.returns(
|
|
89
|
+
{audio: String, type: Symbol}
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
def to_hash
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
class TransportDtmfReceived < OpenAI::Internal::Type::BaseModel
|
|
98
|
+
OrHash = T.type_alias do
|
|
99
|
+
T.any(
|
|
100
|
+
OpenAI::Live::SidebandServerEvent::TransportDtmfReceived,
|
|
101
|
+
OpenAI::Internal::AnyHash
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
sig { returns(String) }
|
|
106
|
+
attr_accessor :event
|
|
107
|
+
|
|
108
|
+
sig { returns(String) }
|
|
109
|
+
attr_accessor :event_id
|
|
110
|
+
|
|
111
|
+
sig { returns(Symbol) }
|
|
112
|
+
attr_accessor :type
|
|
113
|
+
|
|
114
|
+
# A SIP DTMF keypress received from the caller. Delivered only to sideband
|
|
115
|
+
# observers.
|
|
116
|
+
sig do
|
|
117
|
+
params(
|
|
118
|
+
|
|
119
|
+
event: String,
|
|
120
|
+
|
|
121
|
+
event_id: String,
|
|
122
|
+
|
|
123
|
+
type: Symbol
|
|
124
|
+
)
|
|
125
|
+
.returns(T.attached_class)
|
|
126
|
+
end
|
|
127
|
+
def self.new(
|
|
128
|
+
|
|
129
|
+
event:,
|
|
130
|
+
|
|
131
|
+
event_id:,
|
|
132
|
+
|
|
133
|
+
type: :"transport.dtmf.received"
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
sig do
|
|
138
|
+
override.returns(
|
|
139
|
+
{event: String, event_id: String, type: Symbol}
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
def to_hash
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
class TransportDtmfSend < OpenAI::Internal::Type::BaseModel
|
|
148
|
+
OrHash = T.type_alias do
|
|
149
|
+
T.any(
|
|
150
|
+
OpenAI::Live::SidebandServerEvent::TransportDtmfSend,
|
|
151
|
+
OpenAI::Internal::AnyHash
|
|
152
|
+
)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
sig { returns(String) }
|
|
156
|
+
attr_accessor :event
|
|
157
|
+
|
|
158
|
+
sig { returns(String) }
|
|
159
|
+
attr_accessor :event_id
|
|
160
|
+
|
|
161
|
+
sig { returns(Symbol) }
|
|
162
|
+
attr_accessor :type
|
|
163
|
+
|
|
164
|
+
# The event_id of the client command, when supplied.
|
|
165
|
+
sig { returns(T.nilable(String)) }
|
|
166
|
+
attr_reader :client_event_id
|
|
167
|
+
|
|
168
|
+
sig { params(client_event_id: String).void }
|
|
169
|
+
attr_writer :client_event_id
|
|
170
|
+
|
|
171
|
+
# A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to
|
|
172
|
+
# sideband observers; this is not a client command.
|
|
173
|
+
sig do
|
|
174
|
+
params(
|
|
175
|
+
|
|
176
|
+
event: String,
|
|
177
|
+
|
|
178
|
+
event_id: String,
|
|
179
|
+
|
|
180
|
+
client_event_id: String,
|
|
181
|
+
|
|
182
|
+
type: Symbol
|
|
183
|
+
)
|
|
184
|
+
.returns(T.attached_class)
|
|
185
|
+
end
|
|
186
|
+
def self.new(
|
|
187
|
+
|
|
188
|
+
event:,
|
|
189
|
+
|
|
190
|
+
event_id:,
|
|
191
|
+
|
|
192
|
+
# The event_id of the client command, when supplied.
|
|
193
|
+
client_event_id: nil,
|
|
194
|
+
|
|
195
|
+
type: :"transport.dtmf.send"
|
|
196
|
+
)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
sig do
|
|
200
|
+
override.returns(
|
|
201
|
+
{event: String, event_id: String, type: Symbol, client_event_id: T.nilable(String)}
|
|
202
|
+
)
|
|
203
|
+
end
|
|
204
|
+
def to_hash
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
class TransportRinging < OpenAI::Internal::Type::BaseModel
|
|
210
|
+
OrHash = T.type_alias do
|
|
211
|
+
T.any(
|
|
212
|
+
OpenAI::Live::SidebandServerEvent::TransportRinging,
|
|
213
|
+
OpenAI::Internal::AnyHash
|
|
214
|
+
)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
sig { returns(String) }
|
|
218
|
+
attr_accessor :event_id
|
|
219
|
+
|
|
220
|
+
# The canonical Live session ID.
|
|
221
|
+
sig { returns(String) }
|
|
222
|
+
attr_accessor :session_id
|
|
223
|
+
|
|
224
|
+
sig { returns(Symbol) }
|
|
225
|
+
attr_accessor :type
|
|
226
|
+
|
|
227
|
+
# The outbound SIP provider leg is ringing or providing early media. Delivered
|
|
228
|
+
# only to sideband observers.
|
|
229
|
+
sig do
|
|
230
|
+
params(
|
|
231
|
+
|
|
232
|
+
event_id: String,
|
|
233
|
+
|
|
234
|
+
session_id: String,
|
|
235
|
+
|
|
236
|
+
type: Symbol
|
|
237
|
+
)
|
|
238
|
+
.returns(T.attached_class)
|
|
239
|
+
end
|
|
240
|
+
def self.new(
|
|
241
|
+
|
|
242
|
+
event_id:,
|
|
243
|
+
|
|
244
|
+
# The canonical Live session ID.
|
|
245
|
+
session_id:,
|
|
246
|
+
|
|
247
|
+
type: :"transport.ringing"
|
|
248
|
+
)
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
sig do
|
|
252
|
+
override.returns(
|
|
253
|
+
{event_id: String, session_id: String, type: Symbol}
|
|
254
|
+
)
|
|
255
|
+
end
|
|
256
|
+
def to_hash
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
class TransportAnswered < OpenAI::Internal::Type::BaseModel
|
|
262
|
+
OrHash = T.type_alias do
|
|
263
|
+
T.any(
|
|
264
|
+
OpenAI::Live::SidebandServerEvent::TransportAnswered,
|
|
265
|
+
OpenAI::Internal::AnyHash
|
|
266
|
+
)
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
sig { returns(String) }
|
|
270
|
+
attr_accessor :event_id
|
|
271
|
+
|
|
272
|
+
# The canonical Live session ID.
|
|
273
|
+
sig { returns(String) }
|
|
274
|
+
attr_accessor :session_id
|
|
275
|
+
|
|
276
|
+
sig { returns(Symbol) }
|
|
277
|
+
attr_accessor :type
|
|
278
|
+
|
|
279
|
+
# The outbound SIP provider leg answered and media is established. Delivered only
|
|
280
|
+
# to sideband observers.
|
|
281
|
+
sig do
|
|
282
|
+
params(
|
|
283
|
+
|
|
284
|
+
event_id: String,
|
|
285
|
+
|
|
286
|
+
session_id: String,
|
|
287
|
+
|
|
288
|
+
type: Symbol
|
|
289
|
+
)
|
|
290
|
+
.returns(T.attached_class)
|
|
291
|
+
end
|
|
292
|
+
def self.new(
|
|
293
|
+
|
|
294
|
+
event_id:,
|
|
295
|
+
|
|
296
|
+
# The canonical Live session ID.
|
|
297
|
+
session_id:,
|
|
298
|
+
|
|
299
|
+
type: :"transport.answered"
|
|
300
|
+
)
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
sig do
|
|
304
|
+
override.returns(
|
|
305
|
+
{event_id: String, session_id: String, type: Symbol}
|
|
306
|
+
)
|
|
307
|
+
end
|
|
308
|
+
def to_hash
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
class TransportFailed < OpenAI::Internal::Type::BaseModel
|
|
314
|
+
OrHash = T.type_alias do
|
|
315
|
+
T.any(
|
|
316
|
+
OpenAI::Live::SidebandServerEvent::TransportFailed,
|
|
317
|
+
OpenAI::Internal::AnyHash
|
|
318
|
+
)
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
sig { returns(OpenAI::Live::SidebandServerEvent::TransportFailed::Error) }
|
|
322
|
+
attr_reader :error
|
|
323
|
+
|
|
324
|
+
sig { params(error: OpenAI::Live::SidebandServerEvent::TransportFailed::Error::OrHash).void }
|
|
325
|
+
attr_writer :error
|
|
326
|
+
|
|
327
|
+
sig { returns(String) }
|
|
328
|
+
attr_accessor :event_id
|
|
329
|
+
|
|
330
|
+
# The canonical Live session ID.
|
|
331
|
+
sig { returns(String) }
|
|
332
|
+
attr_accessor :session_id
|
|
333
|
+
|
|
334
|
+
sig { returns(Symbol) }
|
|
335
|
+
attr_accessor :type
|
|
336
|
+
|
|
337
|
+
# An asynchronous outbound SIP setup failure. Delivered only to sideband
|
|
338
|
+
# observers.
|
|
339
|
+
sig do
|
|
340
|
+
params(
|
|
341
|
+
|
|
342
|
+
error: OpenAI::Live::SidebandServerEvent::TransportFailed::Error::OrHash,
|
|
343
|
+
|
|
344
|
+
event_id: String,
|
|
345
|
+
|
|
346
|
+
session_id: String,
|
|
347
|
+
|
|
348
|
+
type: Symbol
|
|
349
|
+
)
|
|
350
|
+
.returns(T.attached_class)
|
|
351
|
+
end
|
|
352
|
+
def self.new(
|
|
353
|
+
|
|
354
|
+
error:,
|
|
355
|
+
|
|
356
|
+
event_id:,
|
|
357
|
+
|
|
358
|
+
# The canonical Live session ID.
|
|
359
|
+
session_id:,
|
|
360
|
+
|
|
361
|
+
type: :"transport.failed"
|
|
362
|
+
)
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
sig do
|
|
366
|
+
override.returns(
|
|
367
|
+
{
|
|
368
|
+
error: OpenAI::Live::SidebandServerEvent::TransportFailed::Error,
|
|
369
|
+
event_id: String,
|
|
370
|
+
session_id: String,
|
|
371
|
+
type: Symbol
|
|
372
|
+
}
|
|
373
|
+
)
|
|
374
|
+
end
|
|
375
|
+
def to_hash
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
379
|
+
OrHash = T.type_alias do
|
|
380
|
+
T.any(
|
|
381
|
+
OpenAI::Live::SidebandServerEvent::TransportFailed::Error,
|
|
382
|
+
OpenAI::Internal::AnyHash
|
|
383
|
+
)
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
# The call setup failure code.
|
|
387
|
+
sig { returns(String) }
|
|
388
|
+
attr_accessor :code
|
|
389
|
+
|
|
390
|
+
sig { returns(String) }
|
|
391
|
+
attr_accessor :message
|
|
392
|
+
|
|
393
|
+
sig { returns(Symbol) }
|
|
394
|
+
attr_accessor :type
|
|
395
|
+
|
|
396
|
+
# The parameter related to the error, if any. Empty when no parameter applies.
|
|
397
|
+
sig { returns(T.nilable(String)) }
|
|
398
|
+
attr_reader :param
|
|
399
|
+
|
|
400
|
+
sig { params(param: String).void }
|
|
401
|
+
attr_writer :param
|
|
402
|
+
|
|
403
|
+
sig do
|
|
404
|
+
params(
|
|
405
|
+
|
|
406
|
+
code: String,
|
|
407
|
+
|
|
408
|
+
message: String,
|
|
409
|
+
|
|
410
|
+
param: String,
|
|
411
|
+
|
|
412
|
+
type: Symbol
|
|
413
|
+
)
|
|
414
|
+
.returns(T.attached_class)
|
|
415
|
+
end
|
|
416
|
+
def self.new(
|
|
417
|
+
|
|
418
|
+
# The call setup failure code.
|
|
419
|
+
code:,
|
|
420
|
+
|
|
421
|
+
message:,
|
|
422
|
+
|
|
423
|
+
# The parameter related to the error, if any. Empty when no parameter applies.
|
|
424
|
+
param: nil,
|
|
425
|
+
|
|
426
|
+
type: :call_error
|
|
427
|
+
)
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
sig do
|
|
431
|
+
override.returns(
|
|
432
|
+
{code: String, message: String, type: Symbol, param: T.nilable(String)}
|
|
433
|
+
)
|
|
434
|
+
end
|
|
435
|
+
def to_hash
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
end
|
|
439
|
+
end
|
|
440
|
+
|
|
38
441
|
sig { override.returns(T::Array[OpenAI::Live::SidebandServerEvent::Variants]) }
|
|
39
442
|
def self.variants
|
|
40
443
|
end
|
|
@@ -3433,16 +3433,25 @@ module OpenAI
|
|
|
3433
3433
|
sig { returns(Symbol) }
|
|
3434
3434
|
attr_accessor :type
|
|
3435
3435
|
|
|
3436
|
+
# The unique ID of this compaction trigger.
|
|
3437
|
+
sig { returns(T.nilable(String)) }
|
|
3438
|
+
attr_accessor :id
|
|
3439
|
+
|
|
3436
3440
|
# Compacts the current context. Must be the final input item.
|
|
3437
3441
|
sig do
|
|
3438
3442
|
params(
|
|
3439
3443
|
|
|
3444
|
+
id: T.nilable(String),
|
|
3445
|
+
|
|
3440
3446
|
type: Symbol
|
|
3441
3447
|
)
|
|
3442
3448
|
.returns(T.attached_class)
|
|
3443
3449
|
end
|
|
3444
3450
|
def self.new(
|
|
3445
3451
|
|
|
3452
|
+
# The unique ID of this compaction trigger.
|
|
3453
|
+
id: nil,
|
|
3454
|
+
|
|
3446
3455
|
# The type of the item. Always `compaction_trigger`.
|
|
3447
3456
|
|
|
3448
3457
|
type: :compaction_trigger
|
|
@@ -3451,7 +3460,7 @@ module OpenAI
|
|
|
3451
3460
|
|
|
3452
3461
|
sig do
|
|
3453
3462
|
override.returns(
|
|
3454
|
-
{type: Symbol}
|
|
3463
|
+
{type: Symbol, id: T.nilable(String)}
|
|
3455
3464
|
)
|
|
3456
3465
|
end
|
|
3457
3466
|
def to_hash
|
data/rbi/openai/models.rbi
CHANGED
|
@@ -8,6 +8,23 @@ module OpenAI
|
|
|
8
8
|
# Create and manage model responses.
|
|
9
9
|
class Responses
|
|
10
10
|
|
|
11
|
+
include OpenAI::WebSocket::Resource
|
|
12
|
+
|
|
13
|
+
# @api private
|
|
14
|
+
sig { params(query: T::Hash[T.untyped, T.untyped]).returns(T::Hash[Symbol, T.untyped]) }
|
|
15
|
+
def __websocket_request(query: {})
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# @api private
|
|
19
|
+
sig { returns(T.untyped) }
|
|
20
|
+
def __websocket_client_event
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# @api private
|
|
24
|
+
sig { returns(T.untyped) }
|
|
25
|
+
def __websocket_server_event
|
|
26
|
+
end
|
|
27
|
+
|
|
11
28
|
# Create and manage model responses.
|
|
12
29
|
sig { returns(OpenAI::Resources::Beta::Responses::InputItems) }
|
|
13
30
|
attr_reader :input_items
|
|
@@ -18,6 +18,8 @@ module OpenAI
|
|
|
18
18
|
OpenAI::DecisionCreateParams::Question::Score::OrHash
|
|
19
19
|
)
|
|
20
20
|
],
|
|
21
|
+
prompt_cache_key: T.nilable(String),
|
|
22
|
+
prompt_cache_options: T.nilable(OpenAI::DecisionCreateParams::PromptCacheOptions::OrHash),
|
|
21
23
|
safety_identifier: T.nilable(String),
|
|
22
24
|
request_options: OpenAI::RequestOptions::OrHash
|
|
23
25
|
)
|
|
@@ -34,6 +36,18 @@ module OpenAI
|
|
|
34
36
|
# Ask 1–200 questions about the input. Each question can be a predicate, choice,
|
|
35
37
|
# or score. Answers come back in the same order.
|
|
36
38
|
questions:,
|
|
39
|
+
# Partition prompt cache reuse by caller-provided key.
|
|
40
|
+
prompt_cache_key: nil,
|
|
41
|
+
# Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
42
|
+
# default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
43
|
+
# explicit breakpoints to content blocks with `prompt_cache_breakpoint`. Each
|
|
44
|
+
# request can write up to four breakpoints. For cache matching, OpenAI considers
|
|
45
|
+
# up to the latest 80 breakpoints in the conversation, without a content-block
|
|
46
|
+
# lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
|
|
47
|
+
# `ttl` defaults to `30m`, which is currently the only supported value. See the
|
|
48
|
+
# [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
|
|
49
|
+
# for current details.
|
|
50
|
+
prompt_cache_options: nil,
|
|
37
51
|
# Opaque caller-provided end-user identifier, scoped by the verified org. Match
|
|
38
52
|
# Responses' limit; this is never the authenticated user identity.
|
|
39
53
|
safety_identifier: nil,
|