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,106 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Webhooks
|
|
6
|
+
class AgentSessionCreatedWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique ID of the event.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute created_at
|
|
14
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :created_at, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute data
|
|
20
|
+
#
|
|
21
|
+
# @return [OpenAI::Models::Webhooks::AgentSessionCreatedWebhookEvent::Data]
|
|
22
|
+
required :data, -> { OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data }
|
|
23
|
+
|
|
24
|
+
# @!attribute object
|
|
25
|
+
# The object type. Always `event`.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :event]
|
|
28
|
+
required :object, const: :event
|
|
29
|
+
|
|
30
|
+
# @!attribute type
|
|
31
|
+
# The event type. Always `agent.session.created`.
|
|
32
|
+
#
|
|
33
|
+
# @return [Symbol, :"agent.session.created"]
|
|
34
|
+
required :type, const: :"agent.session.created"
|
|
35
|
+
|
|
36
|
+
# @!method initialize(id:, created_at:, data:, object: :event, type: :"agent.session.created")
|
|
37
|
+
# Sent when an agent session is created.
|
|
38
|
+
#
|
|
39
|
+
# @param id [String]
|
|
40
|
+
# The unique ID of the event.
|
|
41
|
+
#
|
|
42
|
+
# @param created_at [Integer]
|
|
43
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
44
|
+
#
|
|
45
|
+
# @param data [OpenAI::Models::Webhooks::AgentSessionCreatedWebhookEvent::Data]
|
|
46
|
+
#
|
|
47
|
+
# @param object [Symbol, :event]
|
|
48
|
+
# The object type. Always `event`.
|
|
49
|
+
#
|
|
50
|
+
# @param type [Symbol, :"agent.session.created"]
|
|
51
|
+
# The event type. Always `agent.session.created`.
|
|
52
|
+
|
|
53
|
+
# @see OpenAI::Models::Webhooks::AgentSessionCreatedWebhookEvent#data
|
|
54
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
55
|
+
# @!attribute id
|
|
56
|
+
# The ID of the session.
|
|
57
|
+
#
|
|
58
|
+
# @return [String]
|
|
59
|
+
required :id, String
|
|
60
|
+
|
|
61
|
+
# @!attribute environment_type
|
|
62
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
required :environment_type, String
|
|
66
|
+
|
|
67
|
+
# @!attribute connect
|
|
68
|
+
#
|
|
69
|
+
# @return [OpenAI::Models::Webhooks::AgentSessionCreatedWebhookEvent::Data::Connect, nil]
|
|
70
|
+
optional :connect, -> { OpenAI::Webhooks::AgentSessionCreatedWebhookEvent::Data::Connect }
|
|
71
|
+
|
|
72
|
+
# @!attribute environment_id
|
|
73
|
+
# The ID of the environment, when one exists.
|
|
74
|
+
#
|
|
75
|
+
# @return [String, nil]
|
|
76
|
+
optional :environment_id, String
|
|
77
|
+
|
|
78
|
+
# @!method initialize(id:, environment_type:, connect: nil, environment_id: nil)
|
|
79
|
+
# @param id [String]
|
|
80
|
+
# The ID of the session.
|
|
81
|
+
#
|
|
82
|
+
# @param environment_type [String]
|
|
83
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
84
|
+
#
|
|
85
|
+
# @param connect [OpenAI::Models::Webhooks::AgentSessionCreatedWebhookEvent::Data::Connect]
|
|
86
|
+
#
|
|
87
|
+
# @param environment_id [String]
|
|
88
|
+
# The ID of the environment, when one exists.
|
|
89
|
+
|
|
90
|
+
# @see OpenAI::Models::Webhooks::AgentSessionCreatedWebhookEvent::Data#connect
|
|
91
|
+
class Connect < OpenAI::Internal::Type::BaseModel
|
|
92
|
+
# @!attribute remote_url
|
|
93
|
+
# The URL used to connect the self-hosted environment.
|
|
94
|
+
#
|
|
95
|
+
# @return [String]
|
|
96
|
+
required :remote_url, String
|
|
97
|
+
|
|
98
|
+
# @!method initialize(remote_url:)
|
|
99
|
+
# @param remote_url [String]
|
|
100
|
+
# The URL used to connect the self-hosted environment.
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Webhooks
|
|
6
|
+
class AgentSessionFailedWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique ID of the event.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute created_at
|
|
14
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :created_at, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute data
|
|
20
|
+
#
|
|
21
|
+
# @return [OpenAI::Models::Webhooks::AgentSessionFailedWebhookEvent::Data]
|
|
22
|
+
required :data, -> { OpenAI::Webhooks::AgentSessionFailedWebhookEvent::Data }
|
|
23
|
+
|
|
24
|
+
# @!attribute object
|
|
25
|
+
# The object type. Always `event`.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :event]
|
|
28
|
+
required :object, const: :event
|
|
29
|
+
|
|
30
|
+
# @!attribute type
|
|
31
|
+
# The event type. Always `agent.session.failed`.
|
|
32
|
+
#
|
|
33
|
+
# @return [Symbol, :"agent.session.failed"]
|
|
34
|
+
required :type, const: :"agent.session.failed"
|
|
35
|
+
|
|
36
|
+
# @!method initialize(id:, created_at:, data:, object: :event, type: :"agent.session.failed")
|
|
37
|
+
# Sent when an agent session fails.
|
|
38
|
+
#
|
|
39
|
+
# @param id [String]
|
|
40
|
+
# The unique ID of the event.
|
|
41
|
+
#
|
|
42
|
+
# @param created_at [Integer]
|
|
43
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
44
|
+
#
|
|
45
|
+
# @param data [OpenAI::Models::Webhooks::AgentSessionFailedWebhookEvent::Data]
|
|
46
|
+
#
|
|
47
|
+
# @param object [Symbol, :event]
|
|
48
|
+
# The object type. Always `event`.
|
|
49
|
+
#
|
|
50
|
+
# @param type [Symbol, :"agent.session.failed"]
|
|
51
|
+
# The event type. Always `agent.session.failed`.
|
|
52
|
+
|
|
53
|
+
# @see OpenAI::Models::Webhooks::AgentSessionFailedWebhookEvent#data
|
|
54
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
55
|
+
# @!attribute id
|
|
56
|
+
# The ID of the session.
|
|
57
|
+
#
|
|
58
|
+
# @return [String]
|
|
59
|
+
required :id, String
|
|
60
|
+
|
|
61
|
+
# @!attribute environment_type
|
|
62
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
required :environment_type, String
|
|
66
|
+
|
|
67
|
+
# @!attribute environment_id
|
|
68
|
+
# The ID of the environment, when one exists.
|
|
69
|
+
#
|
|
70
|
+
# @return [String, nil]
|
|
71
|
+
optional :environment_id, String
|
|
72
|
+
|
|
73
|
+
# @!method initialize(id:, environment_type:, environment_id: nil)
|
|
74
|
+
# @param id [String]
|
|
75
|
+
# The ID of the session.
|
|
76
|
+
#
|
|
77
|
+
# @param environment_type [String]
|
|
78
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
79
|
+
#
|
|
80
|
+
# @param environment_id [String]
|
|
81
|
+
# The ID of the environment, when one exists.
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Webhooks
|
|
6
|
+
class AgentSessionIdleWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique ID of the event.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute created_at
|
|
14
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :created_at, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute data
|
|
20
|
+
#
|
|
21
|
+
# @return [OpenAI::Models::Webhooks::AgentSessionIdleWebhookEvent::Data]
|
|
22
|
+
required :data, -> { OpenAI::Webhooks::AgentSessionIdleWebhookEvent::Data }
|
|
23
|
+
|
|
24
|
+
# @!attribute object
|
|
25
|
+
# The object type. Always `event`.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :event]
|
|
28
|
+
required :object, const: :event
|
|
29
|
+
|
|
30
|
+
# @!attribute type
|
|
31
|
+
# The event type. Always `agent.session.idle`.
|
|
32
|
+
#
|
|
33
|
+
# @return [Symbol, :"agent.session.idle"]
|
|
34
|
+
required :type, const: :"agent.session.idle"
|
|
35
|
+
|
|
36
|
+
# @!method initialize(id:, created_at:, data:, object: :event, type: :"agent.session.idle")
|
|
37
|
+
# Sent when an agent session becomes idle.
|
|
38
|
+
#
|
|
39
|
+
# @param id [String]
|
|
40
|
+
# The unique ID of the event.
|
|
41
|
+
#
|
|
42
|
+
# @param created_at [Integer]
|
|
43
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
44
|
+
#
|
|
45
|
+
# @param data [OpenAI::Models::Webhooks::AgentSessionIdleWebhookEvent::Data]
|
|
46
|
+
#
|
|
47
|
+
# @param object [Symbol, :event]
|
|
48
|
+
# The object type. Always `event`.
|
|
49
|
+
#
|
|
50
|
+
# @param type [Symbol, :"agent.session.idle"]
|
|
51
|
+
# The event type. Always `agent.session.idle`.
|
|
52
|
+
|
|
53
|
+
# @see OpenAI::Models::Webhooks::AgentSessionIdleWebhookEvent#data
|
|
54
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
55
|
+
# @!attribute id
|
|
56
|
+
# The ID of the session.
|
|
57
|
+
#
|
|
58
|
+
# @return [String]
|
|
59
|
+
required :id, String
|
|
60
|
+
|
|
61
|
+
# @!attribute environment_type
|
|
62
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
required :environment_type, String
|
|
66
|
+
|
|
67
|
+
# @!attribute environment_id
|
|
68
|
+
# The ID of the environment, when one exists.
|
|
69
|
+
#
|
|
70
|
+
# @return [String, nil]
|
|
71
|
+
optional :environment_id, String
|
|
72
|
+
|
|
73
|
+
# @!method initialize(id:, environment_type:, environment_id: nil)
|
|
74
|
+
# @param id [String]
|
|
75
|
+
# The ID of the session.
|
|
76
|
+
#
|
|
77
|
+
# @param environment_type [String]
|
|
78
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
79
|
+
#
|
|
80
|
+
# @param environment_id [String]
|
|
81
|
+
# The ID of the environment, when one exists.
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Webhooks
|
|
6
|
+
class AgentSessionInProgressWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique ID of the event.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute created_at
|
|
14
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :created_at, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute data
|
|
20
|
+
#
|
|
21
|
+
# @return [OpenAI::Models::Webhooks::AgentSessionInProgressWebhookEvent::Data]
|
|
22
|
+
required :data, -> { OpenAI::Webhooks::AgentSessionInProgressWebhookEvent::Data }
|
|
23
|
+
|
|
24
|
+
# @!attribute object
|
|
25
|
+
# The object type. Always `event`.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :event]
|
|
28
|
+
required :object, const: :event
|
|
29
|
+
|
|
30
|
+
# @!attribute type
|
|
31
|
+
# The event type. Always `agent.session.in_progress`.
|
|
32
|
+
#
|
|
33
|
+
# @return [Symbol, :"agent.session.in_progress"]
|
|
34
|
+
required :type, const: :"agent.session.in_progress"
|
|
35
|
+
|
|
36
|
+
# @!method initialize(id:, created_at:, data:, object: :event, type: :"agent.session.in_progress")
|
|
37
|
+
# Sent when an agent session enters the in-progress state.
|
|
38
|
+
#
|
|
39
|
+
# @param id [String]
|
|
40
|
+
# The unique ID of the event.
|
|
41
|
+
#
|
|
42
|
+
# @param created_at [Integer]
|
|
43
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
44
|
+
#
|
|
45
|
+
# @param data [OpenAI::Models::Webhooks::AgentSessionInProgressWebhookEvent::Data]
|
|
46
|
+
#
|
|
47
|
+
# @param object [Symbol, :event]
|
|
48
|
+
# The object type. Always `event`.
|
|
49
|
+
#
|
|
50
|
+
# @param type [Symbol, :"agent.session.in_progress"]
|
|
51
|
+
# The event type. Always `agent.session.in_progress`.
|
|
52
|
+
|
|
53
|
+
# @see OpenAI::Models::Webhooks::AgentSessionInProgressWebhookEvent#data
|
|
54
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
55
|
+
# @!attribute id
|
|
56
|
+
# The ID of the session.
|
|
57
|
+
#
|
|
58
|
+
# @return [String]
|
|
59
|
+
required :id, String
|
|
60
|
+
|
|
61
|
+
# @!attribute environment_type
|
|
62
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
required :environment_type, String
|
|
66
|
+
|
|
67
|
+
# @!attribute environment_id
|
|
68
|
+
# The ID of the environment, when one exists.
|
|
69
|
+
#
|
|
70
|
+
# @return [String, nil]
|
|
71
|
+
optional :environment_id, String
|
|
72
|
+
|
|
73
|
+
# @!method initialize(id:, environment_type:, environment_id: nil)
|
|
74
|
+
# @param id [String]
|
|
75
|
+
# The ID of the session.
|
|
76
|
+
#
|
|
77
|
+
# @param environment_type [String]
|
|
78
|
+
# The environment type: `none`, `openai_hosted`, or `self_hosted`.
|
|
79
|
+
#
|
|
80
|
+
# @param environment_id [String]
|
|
81
|
+
# The ID of the environment, when one exists.
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -3,12 +3,28 @@
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
5
|
module Webhooks
|
|
6
|
-
# Sent when
|
|
6
|
+
# Sent when an agent session requires an action. Retrieve the session for action
|
|
7
|
+
# details.
|
|
7
8
|
module UnwrapWebhookEvent
|
|
8
9
|
extend OpenAI::Internal::Type::Union
|
|
9
10
|
|
|
10
11
|
discriminator :type
|
|
11
12
|
|
|
13
|
+
# Sent when an agent session requires an action. Retrieve the session for action details.
|
|
14
|
+
variant :"agent.session.action_required", -> { OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent }
|
|
15
|
+
|
|
16
|
+
# Sent when an agent session is created.
|
|
17
|
+
variant :"agent.session.created", -> { OpenAI::Webhooks::AgentSessionCreatedWebhookEvent }
|
|
18
|
+
|
|
19
|
+
# Sent when an agent session fails.
|
|
20
|
+
variant :"agent.session.failed", -> { OpenAI::Webhooks::AgentSessionFailedWebhookEvent }
|
|
21
|
+
|
|
22
|
+
# Sent when an agent session becomes idle.
|
|
23
|
+
variant :"agent.session.idle", -> { OpenAI::Webhooks::AgentSessionIdleWebhookEvent }
|
|
24
|
+
|
|
25
|
+
# Sent when an agent session enters the in-progress state.
|
|
26
|
+
variant :"agent.session.in_progress", -> { OpenAI::Webhooks::AgentSessionInProgressWebhookEvent }
|
|
27
|
+
|
|
12
28
|
# Sent when a batch API request has been cancelled.
|
|
13
29
|
variant :"batch.cancelled", -> { OpenAI::Webhooks::BatchCancelledWebhookEvent }
|
|
14
30
|
|
|
@@ -81,7 +97,7 @@ module OpenAI
|
|
|
81
97
|
variant :"safety.warning_issued", -> { OpenAI::Webhooks::SafetyWarningIssuedWebhookEvent }
|
|
82
98
|
|
|
83
99
|
# @!method self.variants
|
|
84
|
-
# @return [Array(OpenAI::Models::Webhooks::BatchCancelledWebhookEvent, OpenAI::Models::Webhooks::BatchCompletedWebhookEvent, OpenAI::Models::Webhooks::BatchExpiredWebhookEvent, OpenAI::Models::Webhooks::BatchFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunCanceledWebhookEvent, OpenAI::Models::Webhooks::EvalRunFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunSucceededWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobCancelledWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobFailedWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobSucceededWebhookEvent, OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent, OpenAI::Models::Webhooks::LiveTransportIncomingWebhookEvent, OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent, OpenAI::Models::Webhooks::ResponseCancelledWebhookEvent, OpenAI::Models::Webhooks::ResponseCompletedWebhookEvent, OpenAI::Models::Webhooks::ResponseFailedWebhookEvent, OpenAI::Models::Webhooks::ResponseIncompleteWebhookEvent, OpenAI::Models::Webhooks::SafetyAlertCreatedWebhookEvent, OpenAI::Models::Webhooks::SafetyDeactivationIssuedWebhookEvent, OpenAI::Models::Webhooks::SafetyOrgAlertCreatedWebhookEvent, OpenAI::Models::Webhooks::SafetyWarningIssuedWebhookEvent)]
|
|
100
|
+
# @return [Array(OpenAI::Models::Webhooks::AgentSessionActionRequiredWebhookEvent, OpenAI::Models::Webhooks::AgentSessionCreatedWebhookEvent, OpenAI::Models::Webhooks::AgentSessionFailedWebhookEvent, OpenAI::Models::Webhooks::AgentSessionIdleWebhookEvent, OpenAI::Models::Webhooks::AgentSessionInProgressWebhookEvent, OpenAI::Models::Webhooks::BatchCancelledWebhookEvent, OpenAI::Models::Webhooks::BatchCompletedWebhookEvent, OpenAI::Models::Webhooks::BatchExpiredWebhookEvent, OpenAI::Models::Webhooks::BatchFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunCanceledWebhookEvent, OpenAI::Models::Webhooks::EvalRunFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunSucceededWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobCancelledWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobFailedWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobSucceededWebhookEvent, OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent, OpenAI::Models::Webhooks::LiveTransportIncomingWebhookEvent, OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent, OpenAI::Models::Webhooks::ResponseCancelledWebhookEvent, OpenAI::Models::Webhooks::ResponseCompletedWebhookEvent, OpenAI::Models::Webhooks::ResponseFailedWebhookEvent, OpenAI::Models::Webhooks::ResponseIncompleteWebhookEvent, OpenAI::Models::Webhooks::SafetyAlertCreatedWebhookEvent, OpenAI::Models::Webhooks::SafetyDeactivationIssuedWebhookEvent, OpenAI::Models::Webhooks::SafetyOrgAlertCreatedWebhookEvent, OpenAI::Models::Webhooks::SafetyWarningIssuedWebhookEvent)]
|
|
85
101
|
end
|
|
86
102
|
end
|
|
87
103
|
end
|
|
@@ -62,6 +62,11 @@ module OpenAI
|
|
|
62
62
|
REALTIME_CALL_INCOMING = :"realtime.call.incoming"
|
|
63
63
|
VIDEO_COMPLETED = :"video.completed"
|
|
64
64
|
VIDEO_FAILED = :"video.failed"
|
|
65
|
+
AGENT_SESSION_CREATED = :"agent.session.created"
|
|
66
|
+
AGENT_SESSION_ACTION_REQUIRED = :"agent.session.action_required"
|
|
67
|
+
AGENT_SESSION_IN_PROGRESS = :"agent.session.in_progress"
|
|
68
|
+
AGENT_SESSION_IDLE = :"agent.session.idle"
|
|
69
|
+
AGENT_SESSION_FAILED = :"agent.session.failed"
|
|
65
70
|
SAFETY_ALERT_CREATED = :"safety.alert.created"
|
|
66
71
|
|
|
67
72
|
# @!method self.values
|
|
@@ -48,6 +48,11 @@ module OpenAI
|
|
|
48
48
|
REALTIME_CALL_INCOMING = :"realtime.call.incoming"
|
|
49
49
|
VIDEO_COMPLETED = :"video.completed"
|
|
50
50
|
VIDEO_FAILED = :"video.failed"
|
|
51
|
+
AGENT_SESSION_CREATED = :"agent.session.created"
|
|
52
|
+
AGENT_SESSION_ACTION_REQUIRED = :"agent.session.action_required"
|
|
53
|
+
AGENT_SESSION_IN_PROGRESS = :"agent.session.in_progress"
|
|
54
|
+
AGENT_SESSION_IDLE = :"agent.session.idle"
|
|
55
|
+
AGENT_SESSION_FAILED = :"agent.session.failed"
|
|
51
56
|
SAFETY_ALERT_CREATED = :"safety.alert.created"
|
|
52
57
|
|
|
53
58
|
# @!method self.values
|
|
@@ -69,6 +69,11 @@ module OpenAI
|
|
|
69
69
|
REALTIME_CALL_INCOMING = :"realtime.call.incoming"
|
|
70
70
|
VIDEO_COMPLETED = :"video.completed"
|
|
71
71
|
VIDEO_FAILED = :"video.failed"
|
|
72
|
+
AGENT_SESSION_CREATED = :"agent.session.created"
|
|
73
|
+
AGENT_SESSION_ACTION_REQUIRED = :"agent.session.action_required"
|
|
74
|
+
AGENT_SESSION_IN_PROGRESS = :"agent.session.in_progress"
|
|
75
|
+
AGENT_SESSION_IDLE = :"agent.session.idle"
|
|
76
|
+
AGENT_SESSION_FAILED = :"agent.session.failed"
|
|
72
77
|
SAFETY_ALERT_CREATED = :"safety.alert.created"
|
|
73
78
|
|
|
74
79
|
# @!method self.values
|
|
@@ -26,6 +26,8 @@ module OpenAI
|
|
|
26
26
|
# object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
|
|
27
27
|
# voices are available in the
|
|
28
28
|
# [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
|
|
29
|
+
# Custom voices must be created from audio samples. Voices created from text
|
|
30
|
+
# prompts are supported only in Live.
|
|
29
31
|
#
|
|
30
32
|
# @param instructions [String]
|
|
31
33
|
# Control the voice of your generated audio with additional instructions. Does not
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class Audio
|
|
6
|
+
# Turn audio into text or text into audio.
|
|
7
|
+
class Voices
|
|
8
|
+
# Creates a voice from a text prompt or from a consent recording and an audio
|
|
9
|
+
# sample.
|
|
10
|
+
#
|
|
11
|
+
# For prompt-based creation, send `type: "prompt"` with a `name` and `prompt` as
|
|
12
|
+
# JSON or multipart form data. For creation from an audio sample, send
|
|
13
|
+
# `type: "audio_sample"` with a `name`, `audio_sample`, and `consent` recording ID
|
|
14
|
+
# as multipart form data. The type defaults to `audio_sample` when omitted.
|
|
15
|
+
#
|
|
16
|
+
# Returns the saved voice's metadata. Voices created from text prompts are
|
|
17
|
+
# supported only in Live, not in Realtime or the speech endpoint. The response
|
|
18
|
+
# does not include preview audio.
|
|
19
|
+
#
|
|
20
|
+
# @overload create(body:, request_options: {})
|
|
21
|
+
#
|
|
22
|
+
# @param body [OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample, OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt]
|
|
23
|
+
# Creates a voice from a consent recording and an audio sample. Requires
|
|
24
|
+
# multipart/form-data.
|
|
25
|
+
#
|
|
26
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
27
|
+
#
|
|
28
|
+
# @return [OpenAI::Models::Audio::Voice]
|
|
29
|
+
#
|
|
30
|
+
# @see OpenAI::Models::Audio::VoiceCreateParams
|
|
31
|
+
def create(params)
|
|
32
|
+
parsed, options = OpenAI::Audio::VoiceCreateParams.dump_request(params)
|
|
33
|
+
@client.request(
|
|
34
|
+
method: :post,
|
|
35
|
+
path: "audio/voices",
|
|
36
|
+
headers: {"content-type" => "multipart/form-data"},
|
|
37
|
+
body: parsed[:body],
|
|
38
|
+
model: OpenAI::Audio::Voice,
|
|
39
|
+
security: {bearer_auth: true},
|
|
40
|
+
options: options
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# @api private
|
|
45
|
+
#
|
|
46
|
+
# @param client [OpenAI::Client]
|
|
47
|
+
def initialize(client:)
|
|
48
|
+
@client = client
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -15,6 +15,10 @@ module OpenAI
|
|
|
15
15
|
# @return [OpenAI::Resources::Audio::Speech]
|
|
16
16
|
attr_reader :speech
|
|
17
17
|
|
|
18
|
+
# Turn audio into text or text into audio.
|
|
19
|
+
# @return [OpenAI::Resources::Audio::Voices]
|
|
20
|
+
attr_reader :voices
|
|
21
|
+
|
|
18
22
|
# @api private
|
|
19
23
|
#
|
|
20
24
|
# @param client [OpenAI::Client]
|
|
@@ -23,6 +27,7 @@ module OpenAI
|
|
|
23
27
|
@transcriptions = OpenAI::Resources::Audio::Transcriptions.new(client: client)
|
|
24
28
|
@translations = OpenAI::Resources::Audio::Translations.new(client: client)
|
|
25
29
|
@speech = OpenAI::Resources::Audio::Speech.new(client: client)
|
|
30
|
+
@voices = OpenAI::Resources::Audio::Voices.new(client: client)
|
|
26
31
|
end
|
|
27
32
|
end
|
|
28
33
|
end
|