openai 0.98.0 → 0.99.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 +7 -0
- data/README.md +1 -1
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_completions_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_costs_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_images_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +16 -3
- data/lib/openai/models/all_models.rb +42 -0
- data/lib/openai/models/audio/speech_create_params.rb +6 -0
- data/lib/openai/models/audio/voice.rb +75 -0
- data/lib/openai/models/audio/voice_create_params.rb +217 -0
- data/lib/openai/models/beta/agent_create_params.rb +0 -3
- data/lib/openai/models/beta/agent_update_params.rb +0 -3
- data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
- data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
- data/lib/openai/models/beta/beta_response.rb +220 -0
- data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
- data/lib/openai/models/beta/beta_tool.rb +3 -9
- data/lib/openai/models/beta/response_compact_params.rb +220 -0
- data/lib/openai/models/beta/response_create_params.rb +220 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
- data/lib/openai/models/chat_model.rb +178 -0
- data/lib/openai/models/image.rb +14 -14
- data/lib/openai/models/image_create_variation_params.rb +7 -7
- data/lib/openai/models/image_edit_params.rb +76 -87
- data/lib/openai/models/image_generate_params.rb +51 -62
- data/lib/openai/models/image_model.rb +5 -3
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
- data/lib/openai/models/responses/response_compact_params.rb +220 -0
- data/lib/openai/models/responses/tool.rb +3 -9
- data/lib/openai/models/responses_model.rb +42 -0
- data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
- data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
- data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
- data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
- data/lib/openai/resources/audio/speech.rb +2 -0
- data/lib/openai/resources/audio/voices.rb +53 -0
- data/lib/openai/resources/audio.rb +5 -0
- data/lib/openai/resources/images.rb +71 -103
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +8 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +19 -2
- data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
- data/rbi/openai/models/audio/voice.rbi +111 -0
- data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
- data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
- data/rbi/openai/models/beta/beta_tool.rbi +3 -9
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
- data/rbi/openai/models/image.rbi +14 -14
- data/rbi/openai/models/image_create_variation_params.rbi +6 -6
- data/rbi/openai/models/image_edit_params.rbi +61 -82
- data/rbi/openai/models/image_generate_params.rbi +30 -61
- data/rbi/openai/models/image_model.rbi +3 -3
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
- data/rbi/openai/models/responses/tool.rbi +3 -9
- data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
- data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
- data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
- data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
- data/rbi/openai/resources/audio/speech.rbi +2 -0
- data/rbi/openai/resources/audio/voices.rbi +49 -0
- data/rbi/openai/resources/audio.rbi +4 -0
- data/rbi/openai/resources/images.rbi +69 -103
- data/rbi/openai/resources/webhooks.rbi +5 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_images_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +20 -3
- data/sig/openai/models/audio/speech_create_params.rbs +4 -0
- data/sig/openai/models/audio/voice.rbs +70 -0
- data/sig/openai/models/audio/voice_create_params.rbs +203 -0
- data/sig/openai/models/beta/agent_create_params.rbs +1 -5
- data/sig/openai/models/beta/agent_update_params.rbs +1 -5
- data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
- data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
- data/sig/openai/models/beta/beta_tool.rbs +3 -9
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
- data/sig/openai/models/image.rbs +21 -21
- data/sig/openai/models/image_create_variation_params.rbs +4 -4
- data/sig/openai/models/image_edit_params.rbs +46 -60
- data/sig/openai/models/image_generate_params.rbs +23 -45
- data/sig/openai/models/image_model.rbs +6 -6
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
- data/sig/openai/models/responses/tool.rbs +3 -9
- data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
- data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
- data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
- data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
- data/sig/openai/resources/audio/voices.rbs +14 -0
- data/sig/openai/resources/audio.rbs +2 -0
- data/sig/openai/resources/webhooks.rbs +6 -1
- metadata +25 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class AgentSessionInProgressWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::AgentSessionInProgressWebhookEvent,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The unique ID of the event.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
22
|
+
sig { returns(Integer) }
|
|
23
|
+
attr_accessor :created_at
|
|
24
|
+
|
|
25
|
+
sig { returns(OpenAI::Webhooks::AgentSessionInProgressWebhookEvent::Data) }
|
|
26
|
+
attr_reader :data
|
|
27
|
+
|
|
28
|
+
sig { params(data: OpenAI::Webhooks::AgentSessionInProgressWebhookEvent::Data::OrHash).void }
|
|
29
|
+
attr_writer :data
|
|
30
|
+
|
|
31
|
+
# The object type. Always `event`.
|
|
32
|
+
sig { returns(Symbol) }
|
|
33
|
+
attr_accessor :object
|
|
34
|
+
|
|
35
|
+
# The event type. Always `agent.session.in_progress`.
|
|
36
|
+
sig { returns(Symbol) }
|
|
37
|
+
attr_accessor :type
|
|
38
|
+
|
|
39
|
+
# Sent when an agent session enters the in-progress state.
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
|
|
43
|
+
id: String,
|
|
44
|
+
|
|
45
|
+
created_at: Integer,
|
|
46
|
+
|
|
47
|
+
data: OpenAI::Webhooks::AgentSessionInProgressWebhookEvent::Data::OrHash,
|
|
48
|
+
|
|
49
|
+
object: Symbol,
|
|
50
|
+
|
|
51
|
+
type: Symbol
|
|
52
|
+
)
|
|
53
|
+
.returns(T.attached_class)
|
|
54
|
+
end
|
|
55
|
+
def self.new(
|
|
56
|
+
|
|
57
|
+
# The unique ID of the event.
|
|
58
|
+
id:,
|
|
59
|
+
|
|
60
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
61
|
+
created_at:,
|
|
62
|
+
|
|
63
|
+
data:,
|
|
64
|
+
|
|
65
|
+
# The object type. Always `event`.
|
|
66
|
+
object: :event,
|
|
67
|
+
|
|
68
|
+
# The event type. Always `agent.session.in_progress`.
|
|
69
|
+
|
|
70
|
+
type: :"agent.session.in_progress"
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(
|
|
76
|
+
{
|
|
77
|
+
id: String,
|
|
78
|
+
created_at: Integer,
|
|
79
|
+
data: OpenAI::Webhooks::AgentSessionInProgressWebhookEvent::Data,
|
|
80
|
+
object: Symbol,
|
|
81
|
+
type: Symbol
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
def to_hash
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
89
|
+
OrHash = T.type_alias do
|
|
90
|
+
T.any(
|
|
91
|
+
OpenAI::Webhooks::AgentSessionInProgressWebhookEvent::Data,
|
|
92
|
+
OpenAI::Internal::AnyHash
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# The ID of the session.
|
|
97
|
+
sig { returns(String) }
|
|
98
|
+
attr_accessor :id
|
|
99
|
+
|
|
100
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
101
|
+
sig { returns(String) }
|
|
102
|
+
attr_accessor :environment_type
|
|
103
|
+
|
|
104
|
+
# The ID of the environment, when one exists.
|
|
105
|
+
sig { returns(T.nilable(String)) }
|
|
106
|
+
attr_reader :environment_id
|
|
107
|
+
|
|
108
|
+
sig { params(environment_id: String).void }
|
|
109
|
+
attr_writer :environment_id
|
|
110
|
+
|
|
111
|
+
sig do
|
|
112
|
+
params(
|
|
113
|
+
|
|
114
|
+
id: String,
|
|
115
|
+
|
|
116
|
+
environment_type: String,
|
|
117
|
+
|
|
118
|
+
environment_id: String
|
|
119
|
+
)
|
|
120
|
+
.returns(T.attached_class)
|
|
121
|
+
end
|
|
122
|
+
def self.new(
|
|
123
|
+
|
|
124
|
+
# The ID of the session.
|
|
125
|
+
id:,
|
|
126
|
+
|
|
127
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
128
|
+
environment_type:,
|
|
129
|
+
|
|
130
|
+
# The ID of the environment, when one exists.
|
|
131
|
+
|
|
132
|
+
environment_id: nil
|
|
133
|
+
)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
sig do
|
|
137
|
+
override.returns(
|
|
138
|
+
{id: String, environment_type: String, environment_id: String}
|
|
139
|
+
)
|
|
140
|
+
end
|
|
141
|
+
def to_hash
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
end
|
|
151
|
+
end
|
|
@@ -5,12 +5,18 @@ module OpenAI
|
|
|
5
5
|
|
|
6
6
|
module Webhooks
|
|
7
7
|
|
|
8
|
-
# Sent when
|
|
8
|
+
# Sent when an agent session requires an action. Retrieve the session for action
|
|
9
|
+
# details.
|
|
9
10
|
module UnwrapWebhookEvent
|
|
10
11
|
extend OpenAI::Internal::Type::Union
|
|
11
12
|
|
|
12
13
|
Variants = T.type_alias do
|
|
13
14
|
T.any(
|
|
15
|
+
OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent,
|
|
16
|
+
OpenAI::Webhooks::AgentSessionCreatedWebhookEvent,
|
|
17
|
+
OpenAI::Webhooks::AgentSessionFailedWebhookEvent,
|
|
18
|
+
OpenAI::Webhooks::AgentSessionIdleWebhookEvent,
|
|
19
|
+
OpenAI::Webhooks::AgentSessionInProgressWebhookEvent,
|
|
14
20
|
OpenAI::Webhooks::BatchCancelledWebhookEvent,
|
|
15
21
|
OpenAI::Webhooks::BatchCompletedWebhookEvent,
|
|
16
22
|
OpenAI::Webhooks::BatchExpiredWebhookEvent,
|
|
@@ -121,6 +121,26 @@ module OpenAI
|
|
|
121
121
|
)
|
|
122
122
|
VIDEO_COMPLETED = T.let(:"video.completed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
123
123
|
VIDEO_FAILED = T.let(:"video.failed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
|
|
124
|
+
AGENT_SESSION_CREATED = T.let(
|
|
125
|
+
:"agent.session.created",
|
|
126
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
127
|
+
)
|
|
128
|
+
AGENT_SESSION_ACTION_REQUIRED = T.let(
|
|
129
|
+
:"agent.session.action_required",
|
|
130
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
131
|
+
)
|
|
132
|
+
AGENT_SESSION_IN_PROGRESS = T.let(
|
|
133
|
+
:"agent.session.in_progress",
|
|
134
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
135
|
+
)
|
|
136
|
+
AGENT_SESSION_IDLE = T.let(
|
|
137
|
+
:"agent.session.idle",
|
|
138
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
139
|
+
)
|
|
140
|
+
AGENT_SESSION_FAILED = T.let(
|
|
141
|
+
:"agent.session.failed",
|
|
142
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
143
|
+
)
|
|
124
144
|
SAFETY_ALERT_CREATED = T.let(
|
|
125
145
|
:"safety.alert.created",
|
|
126
146
|
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
@@ -106,6 +106,26 @@ module OpenAI
|
|
|
106
106
|
)
|
|
107
107
|
VIDEO_COMPLETED = T.let(:"video.completed", OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol)
|
|
108
108
|
VIDEO_FAILED = T.let(:"video.failed", OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol)
|
|
109
|
+
AGENT_SESSION_CREATED = T.let(
|
|
110
|
+
:"agent.session.created",
|
|
111
|
+
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
112
|
+
)
|
|
113
|
+
AGENT_SESSION_ACTION_REQUIRED = T.let(
|
|
114
|
+
:"agent.session.action_required",
|
|
115
|
+
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
116
|
+
)
|
|
117
|
+
AGENT_SESSION_IN_PROGRESS = T.let(
|
|
118
|
+
:"agent.session.in_progress",
|
|
119
|
+
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
120
|
+
)
|
|
121
|
+
AGENT_SESSION_IDLE = T.let(
|
|
122
|
+
:"agent.session.idle",
|
|
123
|
+
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
124
|
+
)
|
|
125
|
+
AGENT_SESSION_FAILED = T.let(
|
|
126
|
+
:"agent.session.failed",
|
|
127
|
+
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
128
|
+
)
|
|
109
129
|
SAFETY_ALERT_CREATED = T.let(
|
|
110
130
|
:"safety.alert.created",
|
|
111
131
|
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
@@ -138,6 +138,26 @@ module OpenAI
|
|
|
138
138
|
)
|
|
139
139
|
VIDEO_COMPLETED = T.let(:"video.completed", OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol)
|
|
140
140
|
VIDEO_FAILED = T.let(:"video.failed", OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol)
|
|
141
|
+
AGENT_SESSION_CREATED = T.let(
|
|
142
|
+
:"agent.session.created",
|
|
143
|
+
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
144
|
+
)
|
|
145
|
+
AGENT_SESSION_ACTION_REQUIRED = T.let(
|
|
146
|
+
:"agent.session.action_required",
|
|
147
|
+
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
148
|
+
)
|
|
149
|
+
AGENT_SESSION_IN_PROGRESS = T.let(
|
|
150
|
+
:"agent.session.in_progress",
|
|
151
|
+
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
152
|
+
)
|
|
153
|
+
AGENT_SESSION_IDLE = T.let(
|
|
154
|
+
:"agent.session.idle",
|
|
155
|
+
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
156
|
+
)
|
|
157
|
+
AGENT_SESSION_FAILED = T.let(
|
|
158
|
+
:"agent.session.failed",
|
|
159
|
+
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
160
|
+
)
|
|
141
161
|
SAFETY_ALERT_CREATED = T.let(
|
|
142
162
|
:"safety.alert.created",
|
|
143
163
|
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
@@ -41,6 +41,8 @@ module OpenAI
|
|
|
41
41
|
# object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
|
|
42
42
|
# voices are available in the
|
|
43
43
|
# [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
|
|
44
|
+
# Custom voices must be created from audio samples. Voices created from text
|
|
45
|
+
# prompts are supported only in Live.
|
|
44
46
|
voice:,
|
|
45
47
|
# Control the voice of your generated audio with additional instructions. Does not
|
|
46
48
|
# work with `tts-1` or `tts-1-hd`.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
|
|
6
|
+
class Audio
|
|
7
|
+
|
|
8
|
+
# Turn audio into text or text into audio.
|
|
9
|
+
class Voices
|
|
10
|
+
|
|
11
|
+
# Creates a voice from a text prompt or from a consent recording and an audio
|
|
12
|
+
# sample.
|
|
13
|
+
#
|
|
14
|
+
# For prompt-based creation, send `type: "prompt"` with a `name` and `prompt` as
|
|
15
|
+
# JSON or multipart form data. For creation from an audio sample, send
|
|
16
|
+
# `type: "audio_sample"` with a `name`, `audio_sample`, and `consent` recording ID
|
|
17
|
+
# as multipart form data. The type defaults to `audio_sample` when omitted.
|
|
18
|
+
#
|
|
19
|
+
# Returns the saved voice's metadata. Voices created from text prompts are
|
|
20
|
+
# supported only in Live, not in Realtime or the speech endpoint. The response
|
|
21
|
+
# does not include preview audio.
|
|
22
|
+
sig {
|
|
23
|
+
params(
|
|
24
|
+
body: T.any(
|
|
25
|
+
OpenAI::Audio::VoiceCreateParams::Body::AudioSample::OrHash,
|
|
26
|
+
OpenAI::Audio::VoiceCreateParams::Body::Prompt::OrHash
|
|
27
|
+
),
|
|
28
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
29
|
+
)
|
|
30
|
+
.returns(OpenAI::Audio::Voice)
|
|
31
|
+
}
|
|
32
|
+
def create(
|
|
33
|
+
# Creates a voice from a consent recording and an audio sample. Requires
|
|
34
|
+
# multipart/form-data.
|
|
35
|
+
body:,
|
|
36
|
+
request_options: {}
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# @api private
|
|
41
|
+
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
42
|
+
def self.new(client:)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -17,6 +17,10 @@ module OpenAI
|
|
|
17
17
|
sig { returns(OpenAI::Resources::Audio::Speech) }
|
|
18
18
|
attr_reader :speech
|
|
19
19
|
|
|
20
|
+
# Turn audio into text or text into audio.
|
|
21
|
+
sig { returns(OpenAI::Resources::Audio::Voices) }
|
|
22
|
+
attr_reader :voices
|
|
23
|
+
|
|
20
24
|
# @api private
|
|
21
25
|
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
22
26
|
def self.new(client:)
|