openai 0.98.0 → 0.100.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 +26 -0
- data/README.md +1 -1
- data/bedrock.md +17 -1
- data/lib/openai/client.rb +9 -0
- data/lib/openai/helpers/agents/session_stream.rb +11 -36
- data/lib/openai/helpers/agents/tools.rb +34 -4
- data/lib/openai/helpers/beta/agents/creation_stream.rb +26 -0
- data/lib/openai/helpers/beta/agents/function_tool.rb +11 -4
- data/lib/openai/helpers/beta/agents/tool_dispatcher.rb +74 -0
- data/lib/openai/helpers/beta/agents/tool_error.rb +28 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_completions_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
- data/lib/openai/models/admin/organization/usage_costs_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_images_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +140 -5
- data/lib/openai/models/admin/organization/usage_web_search_calls_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +140 -5
- 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/environments/template_create_params.rb +6 -6
- data/lib/openai/models/beta/agents/environments/template_update_params.rb +3 -6
- 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/agents/sessions/turns/item_list_params.rb +79 -0
- data/lib/openai/models/beta/beta_response.rb +220 -0
- data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/beta/beta_response_error.rb +12 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
- data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
- data/lib/openai/models/beta/beta_tool.rb +15 -18
- data/lib/openai/models/beta/environment_param.rb +6 -6
- 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/beta/session_turn_error.rb +9 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
- data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
- data/lib/openai/models/chat_model.rb +178 -0
- data/lib/openai/models/error_object.rb +12 -1
- data/lib/openai/models/eval_create_params.rb +1 -1
- data/lib/openai/models/eval_create_response.rb +1 -1
- data/lib/openai/models/eval_list_response.rb +1 -1
- data/lib/openai/models/eval_retrieve_response.rb +1 -1
- data/lib/openai/models/eval_update_response.rb +1 -1
- data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
- data/lib/openai/models/graders/score_model_grader.rb +2 -2
- 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 +88 -96
- 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_client_event.rb +9 -0
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
- data/lib/openai/models/realtime/session_update_event.rb +16 -0
- data/lib/openai/models/responses/response_compact_params.rb +220 -0
- data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/responses/response_error.rb +12 -1
- data/lib/openai/models/responses/responses_server_event.rb +12 -1
- data/lib/openai/models/responses/tool.rb +15 -18
- data/lib/openai/models/responses_model.rb +42 -0
- data/lib/openai/models/video_create_error.rb +12 -1
- 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/providers/bedrock.rb +20 -1
- data/lib/openai/resources/admin/organization/usage.rb +15 -6
- 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/beta/agents/environments/templates.rb +3 -4
- data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
- data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -2
- data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
- data/lib/openai/resources/images.rb +79 -109
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +10 -0
- data/rbi/openai/helpers/agents.rbi +2 -0
- data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
- data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
- data/rbi/openai/helpers/beta/agents.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +213 -3
- data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +213 -3
- 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/environments/template_create_params.rbi +6 -6
- data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
- 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/agents/sessions/turns/item_list_params.rbi +139 -0
- data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
- data/rbi/openai/models/beta/beta_tool.rbi +15 -18
- data/rbi/openai/models/beta/environment_param.rbi +6 -6
- data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
- data/rbi/openai/models/error_object.rbi +12 -0
- data/rbi/openai/models/eval_create_params.rbi +1 -1
- data/rbi/openai/models/eval_create_response.rbi +1 -1
- data/rbi/openai/models/eval_list_response.rbi +1 -1
- data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
- data/rbi/openai/models/eval_update_response.rbi +1 -1
- data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
- data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
- 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 +73 -91
- 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/realtime/session_update_event.rbi +16 -0
- data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/responses/response_error.rbi +12 -0
- data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
- data/rbi/openai/models/responses/tool.rbi +15 -18
- data/rbi/openai/models/video_create_error.rbi +12 -0
- 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/admin/organization/usage.rbi +15 -6
- 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/beta/agents/environments/templates.rbi +3 -4
- data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
- data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
- data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
- data/rbi/openai/resources/images.rbi +77 -109
- data/rbi/openai/resources/webhooks.rbi +5 -0
- data/sig/openai/helpers/agents.rbs +3 -0
- data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
- data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
- data/sig/openai/helpers/beta/agents.rbs +5 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_images_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +107 -5
- data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +107 -5
- 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/environments/template_create_params.rbs +4 -4
- data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
- 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/agents/sessions/turns/item_list_params.rbs +91 -0
- data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/beta/beta_response_error.rbs +10 -0
- data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
- data/sig/openai/models/beta/beta_tool.rbs +11 -15
- data/sig/openai/models/beta/environment_param.rbs +4 -4
- data/sig/openai/models/beta/session_turn_error.rbs +12 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
- data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
- data/sig/openai/models/error_object.rbs +10 -0
- data/sig/openai/models/eval_create_params.rbs +1 -1
- data/sig/openai/models/eval_create_response.rbs +1 -1
- data/sig/openai/models/eval_list_response.rbs +1 -1
- data/sig/openai/models/eval_retrieve_response.rbs +1 -1
- data/sig/openai/models/eval_update_response.rbs +1 -1
- data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
- data/sig/openai/models/graders/score_model_grader.rbs +3 -3
- 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 +54 -66
- 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/response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/responses/response_error.rbs +10 -0
- data/sig/openai/models/responses/responses_server_event.rbs +10 -0
- data/sig/openai/models/responses/tool.rbs +11 -15
- data/sig/openai/models/video_create_error.rbs +10 -0
- 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/beta/agents/sessions/turns/items.rbs +24 -0
- data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
- data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
- data/sig/openai/resources/webhooks.rbs +6 -1
- metadata +35 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class AgentSessionFailedWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::AgentSessionFailedWebhookEvent,
|
|
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::AgentSessionFailedWebhookEvent::Data) }
|
|
26
|
+
attr_reader :data
|
|
27
|
+
|
|
28
|
+
sig { params(data: OpenAI::Webhooks::AgentSessionFailedWebhookEvent::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.failed`.
|
|
36
|
+
sig { returns(Symbol) }
|
|
37
|
+
attr_accessor :type
|
|
38
|
+
|
|
39
|
+
# Sent when an agent session fails.
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
|
|
43
|
+
id: String,
|
|
44
|
+
|
|
45
|
+
created_at: Integer,
|
|
46
|
+
|
|
47
|
+
data: OpenAI::Webhooks::AgentSessionFailedWebhookEvent::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.failed`.
|
|
69
|
+
|
|
70
|
+
type: :"agent.session.failed"
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(
|
|
76
|
+
{
|
|
77
|
+
id: String,
|
|
78
|
+
created_at: Integer,
|
|
79
|
+
data: OpenAI::Webhooks::AgentSessionFailedWebhookEvent::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::AgentSessionFailedWebhookEvent::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
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class AgentSessionIdleWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::AgentSessionIdleWebhookEvent,
|
|
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::AgentSessionIdleWebhookEvent::Data) }
|
|
26
|
+
attr_reader :data
|
|
27
|
+
|
|
28
|
+
sig { params(data: OpenAI::Webhooks::AgentSessionIdleWebhookEvent::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.idle`.
|
|
36
|
+
sig { returns(Symbol) }
|
|
37
|
+
attr_accessor :type
|
|
38
|
+
|
|
39
|
+
# Sent when an agent session becomes idle.
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
|
|
43
|
+
id: String,
|
|
44
|
+
|
|
45
|
+
created_at: Integer,
|
|
46
|
+
|
|
47
|
+
data: OpenAI::Webhooks::AgentSessionIdleWebhookEvent::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.idle`.
|
|
69
|
+
|
|
70
|
+
type: :"agent.session.idle"
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(
|
|
76
|
+
{
|
|
77
|
+
id: String,
|
|
78
|
+
created_at: Integer,
|
|
79
|
+
data: OpenAI::Webhooks::AgentSessionIdleWebhookEvent::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::AgentSessionIdleWebhookEvent::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
|
|
@@ -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
|
|
@@ -179,8 +179,10 @@ module OpenAI
|
|
|
179
179
|
# End time (Unix seconds) of the query time range, exclusive.
|
|
180
180
|
end_time: nil,
|
|
181
181
|
# Group the usage data by the specified fields. Support fields include
|
|
182
|
-
# `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier
|
|
183
|
-
# combination of them.
|
|
182
|
+
# `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier`,
|
|
183
|
+
# `api_source` or any combination of them. When grouped by `api_source`, results
|
|
184
|
+
# use `agents_api` for attributed Agents API activity and `unlabeled` for all
|
|
185
|
+
# other activity. Without source grouping, `api_source` is null.
|
|
184
186
|
group_by: nil,
|
|
185
187
|
# Specifies the number of buckets to return.
|
|
186
188
|
#
|
|
@@ -227,8 +229,13 @@ module OpenAI
|
|
|
227
229
|
bucket_width: nil,
|
|
228
230
|
# End time (Unix seconds) of the query time range, exclusive.
|
|
229
231
|
end_time: nil,
|
|
230
|
-
# Group the costs by the specified fields.
|
|
231
|
-
# `line_item`, `api_key_id
|
|
232
|
+
# Group the costs by the specified fields. Supported fields include `project_id`,
|
|
233
|
+
# `user_id`, `line_item`, `api_key_id`, and `api_source`. Support for combining
|
|
234
|
+
# `user_id` with `project_id` grouping or the `project_ids` filter depends on the
|
|
235
|
+
# organization and requested time range. Unsupported combinations return HTTP 400.
|
|
236
|
+
# When grouped by `api_source`, results use `agents_api` for attributed Agents API
|
|
237
|
+
# activity and `unlabeled` for all other activity. Without source grouping,
|
|
238
|
+
# `api_source` is null.
|
|
232
239
|
group_by: nil,
|
|
233
240
|
# A limit on the number of buckets to be returned. Limit can range between 1 and
|
|
234
241
|
# 180, and the default is 7.
|
|
@@ -522,8 +529,10 @@ module OpenAI
|
|
|
522
529
|
# End time (Unix seconds) of the query time range, exclusive.
|
|
523
530
|
end_time: nil,
|
|
524
531
|
# Group the usage data by the specified fields. Support fields include
|
|
525
|
-
# `project_id`, `user_id`, `api_key_id`, `model`, `context_level` or
|
|
526
|
-
# combination of them.
|
|
532
|
+
# `project_id`, `user_id`, `api_key_id`, `model`, `context_level`, `api_source` or
|
|
533
|
+
# any combination of them. When grouped by `api_source`, results use `agents_api`
|
|
534
|
+
# for attributed Agents API activity and `unlabeled` for all other activity.
|
|
535
|
+
# Without source grouping, `api_source` is null.
|
|
527
536
|
group_by: nil,
|
|
528
537
|
# Specifies the number of buckets to return.
|
|
529
538
|
#
|
|
@@ -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:)
|
|
@@ -57,8 +57,8 @@ module OpenAI
|
|
|
57
57
|
files: nil,
|
|
58
58
|
# An optional human-readable display name for the template.
|
|
59
59
|
name: nil,
|
|
60
|
-
# Network access policy for the environment.
|
|
61
|
-
#
|
|
60
|
+
# Network access policy for the environment. If omitted, the API version
|
|
61
|
+
# determines whether network access is enabled or disabled.
|
|
62
62
|
network: nil,
|
|
63
63
|
# Packages to install in the environment. Defaults to empty package lists.
|
|
64
64
|
packages: nil,
|
|
@@ -136,8 +136,7 @@ module OpenAI
|
|
|
136
136
|
# A replacement human-readable display name, or `null` to clear the name.
|
|
137
137
|
name: nil,
|
|
138
138
|
# Network access available after setup completes. Omit to preserve the current
|
|
139
|
-
# policy, or pass `null` to reset to
|
|
140
|
-
# requests.
|
|
139
|
+
# policy, or pass `null` to reset to the default policy.
|
|
141
140
|
network: nil,
|
|
142
141
|
# Packages installed before the runtime network policy applies.
|
|
143
142
|
packages: nil,
|