openai 0.97.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 +31 -0
- data/README.md +76 -1
- data/lib/openai/helpers/agents/session_stream.rb +60 -3
- data/lib/openai/helpers/beta/agents/artifacts.rb +72 -0
- data/lib/openai/helpers/beta/agents/creation_stream.rb +69 -0
- data/lib/openai/helpers/beta/agents/files.rb +236 -0
- data/lib/openai/helpers/beta/agents/function_tool.rb +65 -0
- data/lib/openai/helpers/beta/agents/model_adapter.rb +27 -0
- data/lib/openai/helpers/beta/agents/result.rb +170 -0
- data/lib/openai/helpers/beta/agents/typed_output.rb +191 -0
- data/lib/openai/helpers/live/websocket.rb +7 -1
- data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +1 -1
- data/lib/openai/helpers/responses_websocket/connection.rb +7 -1
- data/lib/openai/helpers/responses_websocket/session.rb +5 -1
- data/lib/openai/helpers/responses_websocket/transports/async_websocket.rb +12 -2
- data/lib/openai/internal/transport/base_client.rb +18 -0
- data/lib/openai/internal/type/array_of.rb +1 -1
- data/lib/openai/internal/type/base_model.rb +6 -3
- data/lib/openai/internal/type/converter.rb +50 -3
- data/lib/openai/internal/type/hash_of.rb +1 -1
- data/lib/openai/internal/type/union.rb +6 -6
- 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/agents/sessions/session_trace.rb +64 -0
- data/lib/openai/models/beta/agents/sessions/trace_list_params.rb +68 -0
- data/lib/openai/models/beta/agents/vaults/credential.rb +8 -4
- data/lib/openai/models/beta/beta_response.rb +220 -0
- data/lib/openai/models/beta/beta_response_output_text.rb +2 -2
- data/lib/openai/models/beta/beta_response_output_text_annotation_added_event.rb +2 -2
- 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/environment.rb +33 -1
- data/lib/openai/models/beta/environment_param.rb +24 -1
- 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 +3 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
- data/lib/openai/models/chat/chat_completion_content_part_image.rb +1 -0
- 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/live/fork_server_event.rb +14 -3
- data/lib/openai/models/live/server_event.rb +14 -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/realtime/translations/client_secret_create_params.rb +28 -0
- data/lib/openai/models/responses/response_compact_params.rb +220 -0
- data/lib/openai/models/responses/response_output_text.rb +2 -2
- data/lib/openai/models/responses/response_output_text_annotation_added_event.rb +2 -2
- 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/beta/agents/environments/files.rb +31 -0
- data/lib/openai/resources/beta/agents/sessions/artifacts.rb +8 -0
- data/lib/openai/resources/beta/agents/sessions/events.rb +6 -5
- data/lib/openai/resources/beta/agents/sessions/traces.rb +58 -0
- data/lib/openai/resources/beta/agents/sessions.rb +18 -5
- data/lib/openai/resources/evals/runs.rb +1 -1
- data/lib/openai/resources/images.rb +71 -103
- data/lib/openai/resources/realtime/translations/client_secrets.rb +58 -0
- data/lib/openai/resources/realtime/translations.rb +20 -0
- data/lib/openai/resources/realtime.rb +4 -0
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +17 -1
- data/rbi/openai/helpers/agents.rbi +20 -1
- data/rbi/openai/helpers/beta/agents/artifacts.rbi +29 -0
- data/rbi/openai/helpers/beta/agents/files.rbi +65 -0
- data/rbi/openai/helpers/beta/agents/function_tool.rbi +40 -0
- data/rbi/openai/helpers/beta/agents/model_adapter.rbi +22 -0
- data/rbi/openai/helpers/beta/agents.rbi +146 -0
- data/rbi/openai/internal/transport/base_client.rbi +12 -0
- data/rbi/openai/internal/type/base_model.rbi +2 -2
- data/rbi/openai/internal/type/converter.rbi +21 -3
- data/rbi/openai/internal/type/union.rbi +6 -2
- 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/agents/sessions/session_trace.rbi +97 -0
- data/rbi/openai/models/beta/agents/sessions/trace_list_params.rbi +121 -0
- data/rbi/openai/models/beta/agents/vaults/credential.rbi +5 -5
- data/rbi/openai/models/beta/beta_response_output_text.rbi +2 -2
- data/rbi/openai/models/beta/beta_response_output_text_annotation_added_event.rbi +2 -2
- data/rbi/openai/models/beta/beta_tool.rbi +3 -9
- data/rbi/openai/models/beta/environment.rbi +29 -0
- data/rbi/openai/models/beta/environment_param.rbi +31 -0
- data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
- data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +1 -0
- 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/live/fork_server_event.rbi +14 -2
- data/rbi/openai/models/live/server_event.rbi +14 -2
- 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/translations/client_secret_create_params.rbi +68 -0
- data/rbi/openai/models/responses/response_output_text.rbi +2 -2
- data/rbi/openai/models/responses/response_output_text_annotation_added_event.rbi +2 -2
- 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/beta/agents/environments/files.rbi +31 -0
- data/rbi/openai/resources/beta/agents/sessions/artifacts.rbi +8 -0
- data/rbi/openai/resources/beta/agents/sessions/events.rbi +6 -5
- data/rbi/openai/resources/beta/agents/sessions/traces.rbi +54 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +6 -1
- data/rbi/openai/resources/images.rbi +69 -103
- data/rbi/openai/resources/realtime/translations/client_secrets.rbi +54 -0
- data/rbi/openai/resources/realtime/translations.rbi +22 -0
- data/rbi/openai/resources/realtime.rbi +3 -0
- data/rbi/openai/resources/webhooks.rbi +5 -0
- data/sig/openai/helpers/agents.rbs +7 -0
- data/sig/openai/helpers/beta/agents/artifacts.rbs +20 -0
- data/sig/openai/helpers/beta/agents/files.rbs +41 -0
- data/sig/openai/helpers/beta/agents/function_tool.rbs +24 -0
- data/sig/openai/helpers/beta/agents/model_adapter.rbs +16 -0
- data/sig/openai/helpers/beta/agents.rbs +71 -0
- data/sig/openai/helpers/structured_output.rbs +12 -0
- data/sig/openai/internal/transport/base_client.rbs +8 -0
- data/sig/openai/internal/type/base_model.rbs +3 -1
- data/sig/openai/internal/type/converter.rbs +16 -2
- data/sig/openai/internal/type/union.rbs +2 -1
- 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/agents/sessions/session_trace.rbs +65 -0
- data/sig/openai/models/beta/agents/sessions/trace_list_params.rbs +81 -0
- data/sig/openai/models/beta/agents/vaults/credential.rbs +5 -5
- data/sig/openai/models/beta/beta_response_output_text.rbs +2 -2
- data/sig/openai/models/beta/beta_response_output_text_annotation_added_event.rbs +2 -2
- data/sig/openai/models/beta/beta_tool.rbs +3 -9
- data/sig/openai/models/beta/environment.rbs +22 -0
- data/sig/openai/models/beta/environment_param.rbs +25 -0
- data/sig/openai/models/beta/session_turn_error.rbs +4 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
- data/sig/openai/models/chat/chat_completion_content_part_image.rbs +2 -1
- 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/live/fork_server_event.rbs +17 -2
- data/sig/openai/models/live/server_event.rbs +17 -2
- 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/realtime/translations/client_secret_create_params.rbs +39 -0
- data/sig/openai/models/responses/response_output_text.rbs +2 -2
- data/sig/openai/models/responses/response_output_text_annotation_added_event.rbs +2 -2
- 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/beta/agents/environments/files.rbs +17 -0
- data/sig/openai/resources/beta/agents/sessions/artifacts.rbs +4 -0
- data/sig/openai/resources/beta/agents/sessions/traces.rbs +21 -0
- data/sig/openai/resources/beta/agents/sessions.rbs +4 -1
- data/sig/openai/resources/realtime/translations/client_secrets.rbs +17 -0
- data/sig/openai/resources/realtime/translations.rbs +11 -0
- data/sig/openai/resources/realtime.rbs +2 -0
- data/sig/openai/resources/webhooks.rbs +6 -1
- metadata +61 -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:)
|
|
@@ -10,6 +10,37 @@ module OpenAI
|
|
|
10
10
|
class Environments
|
|
11
11
|
|
|
12
12
|
class Files
|
|
13
|
+
# Beta file helpers.
|
|
14
|
+
sig {
|
|
15
|
+
params(files: T::Hash[String, T.any(String, Pathname)], request_options: OpenAI::RequestOptions::OrHash)
|
|
16
|
+
.returns(OpenAI::Helpers::Beta::Agents::PreparedFiles)
|
|
17
|
+
}
|
|
18
|
+
def prepare(files, request_options: {})
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
sig {
|
|
22
|
+
params(
|
|
23
|
+
directory: T.any(String, Pathname),
|
|
24
|
+
destination: String,
|
|
25
|
+
include: T::Array[String],
|
|
26
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
27
|
+
)
|
|
28
|
+
.returns(OpenAI::Helpers::Beta::Agents::PreparedFiles)
|
|
29
|
+
}
|
|
30
|
+
def prepare_directory(directory, destination:, include:, request_options: {})
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig {
|
|
34
|
+
params(
|
|
35
|
+
environment_id: String,
|
|
36
|
+
file: T.any(String, Pathname),
|
|
37
|
+
path: String,
|
|
38
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
39
|
+
)
|
|
40
|
+
.returns(OpenAI::Helpers::Beta::Agents::PreparedFiles)
|
|
41
|
+
}
|
|
42
|
+
def upload(environment_id, file:, path:, request_options: {})
|
|
43
|
+
end
|
|
13
44
|
|
|
14
45
|
# Copies inline bytes or a Files API file into a connected execution environment.
|
|
15
46
|
# See
|
|
@@ -10,6 +10,14 @@ module OpenAI
|
|
|
10
10
|
class Sessions
|
|
11
11
|
|
|
12
12
|
class Artifacts
|
|
13
|
+
# Beta result-scoped downloads.
|
|
14
|
+
sig {
|
|
15
|
+
params(result: OpenAI::Helpers::Beta::Agents::TurnResult).returns(
|
|
16
|
+
OpenAI::Helpers::Beta::Agents::ResultArtifacts
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
def for_result(result)
|
|
20
|
+
end
|
|
13
21
|
|
|
14
22
|
# Retrieves immutable metadata for one durable session artifact. See
|
|
15
23
|
# [session artifacts](https://developers.openai.com/api/docs/guides/agents-api/environments/files#openai-hosted-artifacts).
|
|
@@ -11,11 +11,12 @@ module OpenAI
|
|
|
11
11
|
|
|
12
12
|
class Events
|
|
13
13
|
|
|
14
|
-
# Submits message, cancellation,
|
|
15
|
-
# Cancellation can recover a still-open turn
|
|
16
|
-
# marking it cancelled and abandoning
|
|
17
|
-
# published files, and existing terminal
|
|
18
|
-
# acceptance, not durable completion.
|
|
14
|
+
# Submits message, cancellation, tool-result, or computer-use approval-response
|
|
15
|
+
# events to a managed agent session. Cancellation can recover a still-open turn
|
|
16
|
+
# whose backend execution has ended by marking it cancelled and abandoning
|
|
17
|
+
# unpublished outputs. Saved results, published files, and existing terminal
|
|
18
|
+
# outcomes are preserved. HTTP 202 confirms acceptance, not durable completion.
|
|
19
|
+
# See
|
|
19
20
|
# [session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events).
|
|
20
21
|
sig {
|
|
21
22
|
params(
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
|
|
6
|
+
class Beta
|
|
7
|
+
|
|
8
|
+
class Agents
|
|
9
|
+
|
|
10
|
+
class Sessions
|
|
11
|
+
|
|
12
|
+
class Traces
|
|
13
|
+
|
|
14
|
+
# Lists published root-turn traces as OTLP JSON, ordered by turn creation time and
|
|
15
|
+
# ID. Unpublished traces are skipped. Each page returns data available when read;
|
|
16
|
+
# it does not wait for late traces. Trace reads and the JSON response are limited
|
|
17
|
+
# to 16 MiB per request. If the limit is exceeded, request fewer traces.
|
|
18
|
+
sig {
|
|
19
|
+
params(
|
|
20
|
+
session_id: String,
|
|
21
|
+
after: String,
|
|
22
|
+
limit: Integer,
|
|
23
|
+
order: OpenAI::Beta::Agents::Sessions::TraceListParams::Order::OrSymbol,
|
|
24
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
25
|
+
)
|
|
26
|
+
.returns(OpenAI::Internal::CursorPage[OpenAI::Beta::Agents::Sessions::SessionTrace])
|
|
27
|
+
}
|
|
28
|
+
def list(
|
|
29
|
+
# The ID of the session.
|
|
30
|
+
session_id,
|
|
31
|
+
# Return resources after this resource ID in the selected order.
|
|
32
|
+
after: nil,
|
|
33
|
+
# The maximum number of resources to return, between 1 and 100. Defaults to 20.
|
|
34
|
+
limit: nil,
|
|
35
|
+
# The order in which resources are returned. Defaults to `desc`.
|
|
36
|
+
order: nil,
|
|
37
|
+
request_options: {}
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# @api private
|
|
42
|
+
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
43
|
+
def self.new(client:)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -21,6 +21,9 @@ module OpenAI
|
|
|
21
21
|
sig { returns(OpenAI::Resources::Beta::Agents::Sessions::Events) }
|
|
22
22
|
attr_reader :events
|
|
23
23
|
|
|
24
|
+
sig { returns(OpenAI::Resources::Beta::Agents::Sessions::Traces) }
|
|
25
|
+
attr_reader :traces
|
|
26
|
+
|
|
24
27
|
sig { returns(OpenAI::Resources::Beta::Agents::Sessions::Turns) }
|
|
25
28
|
attr_reader :turns
|
|
26
29
|
|
|
@@ -88,13 +91,14 @@ module OpenAI
|
|
|
88
91
|
),
|
|
89
92
|
agent: OpenAI::Beta::Agents::SessionCreateParams::Agent::OrHash,
|
|
90
93
|
agent_id: String,
|
|
94
|
+
output_type: T.nilable(T.class_of(OpenAI::Helpers::StructuredOutput::BaseModel)),
|
|
91
95
|
input: T.nilable(OpenAI::Beta::Agents::SessionCreateParams::Input::Variants),
|
|
92
96
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
93
97
|
vault_ids: T.nilable(T::Array[String]),
|
|
94
98
|
stream: T.noreturn,
|
|
95
99
|
request_options: OpenAI::RequestOptions::OrHash
|
|
96
100
|
)
|
|
97
|
-
.returns(OpenAI::
|
|
101
|
+
.returns(OpenAI::Helpers::Beta::Agents::CreationStream)
|
|
98
102
|
}
|
|
99
103
|
def create_streaming(
|
|
100
104
|
# An inline execution environment or a reference to an environment template.
|
|
@@ -105,6 +109,7 @@ module OpenAI
|
|
|
105
109
|
# The ID of a saved reusable agent. Omit `agent` to use its configuration
|
|
106
110
|
# unchanged.
|
|
107
111
|
agent_id: nil,
|
|
112
|
+
output_type: nil,
|
|
108
113
|
# Initial input to submit when the session is created. A string is shorthand for a
|
|
109
114
|
# single user message. Required when `environment.type` is `none`, or when
|
|
110
115
|
# `stream` is `true` for an environment that is not `self_hosted`; optional for
|