openai 0.101.0 → 0.102.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 +14 -0
- data/README.md +1 -1
- data/lib/openai/models/audio/speech_create_params.rb +3 -6
- data/lib/openai/models/audio/voice.rb +4 -9
- data/lib/openai/models/audio/voice_create_params.rb +3 -100
- data/lib/openai/models/beta/agents/environment_create_params.rb +300 -0
- data/lib/openai/models/beta/agents/environment_info.rb +4 -1
- data/lib/openai/models/beta/agents/environment_list_params.rb +78 -0
- data/lib/openai/models/beta/environment_param.rb +12 -1
- data/lib/openai/models/chat/chat_completion_audio_param.rb +3 -3
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +3 -6
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +3 -6
- data/lib/openai/models/webhooks/agent_environment_failed_webhook_event.rb +73 -0
- data/lib/openai/models/webhooks/agent_environment_ready_webhook_event.rb +73 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +9 -3
- data/lib/openai/models/webhooks/webhook_create_params.rb +2 -0
- data/lib/openai/models/webhooks/webhook_test_params.rb +2 -0
- data/lib/openai/models/webhooks/webhook_update_params.rb +2 -0
- data/lib/openai/resources/audio/speech.rb +1 -2
- data/lib/openai/resources/audio/voices.rb +10 -10
- data/lib/openai/resources/beta/agents/environments/files.rb +4 -2
- data/lib/openai/resources/beta/agents/environments/templates.rb +10 -5
- data/lib/openai/resources/beta/agents/environments.rb +80 -1
- data/lib/openai/resources/beta/agents/sessions/artifacts.rb +8 -5
- data/lib/openai/resources/beta/agents/sessions/events.rb +10 -4
- data/lib/openai/resources/beta/agents/sessions/items.rb +2 -1
- data/lib/openai/resources/beta/agents/sessions/subagents/items.rb +2 -1
- data/lib/openai/resources/beta/agents/sessions/subagents/turns/items.rb +2 -1
- data/lib/openai/resources/beta/agents/sessions/subagents/turns.rb +4 -2
- data/lib/openai/resources/beta/agents/sessions/subagents.rb +4 -2
- data/lib/openai/resources/beta/agents/sessions/traces.rb +2 -1
- data/lib/openai/resources/beta/agents/sessions/turns/items.rb +2 -1
- data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -2
- data/lib/openai/resources/beta/agents/sessions.rb +16 -7
- data/lib/openai/resources/beta/agents/vaults/credentials.rb +10 -5
- data/lib/openai/resources/beta/agents/vaults.rb +8 -4
- data/lib/openai/resources/beta/agents.rb +10 -5
- data/lib/openai/resources/beta/assistants.rb +10 -5
- data/lib/openai/resources/beta/chatkit/sessions.rb +4 -2
- data/lib/openai/resources/beta/chatkit/threads.rb +8 -4
- data/lib/openai/resources/beta/threads/messages.rb +10 -5
- data/lib/openai/resources/beta/threads/runs/steps.rb +4 -2
- data/lib/openai/resources/beta/threads/runs.rb +24 -10
- data/lib/openai/resources/beta/threads.rb +16 -7
- data/lib/openai/resources/vector_stores/file_batches.rb +8 -10
- data/lib/openai/resources/vector_stores/files.rb +12 -12
- data/lib/openai/resources/vector_stores.rb +12 -6
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +4 -0
- data/rbi/openai/models/audio/speech_create_params.rbi +3 -6
- data/rbi/openai/models/audio/voice.rbi +4 -9
- data/rbi/openai/models/audio/voice_create_params.rbi +4 -149
- data/rbi/openai/models/beta/agents/environment_create_params.rbi +499 -0
- data/rbi/openai/models/beta/agents/environment_info.rbi +3 -0
- data/rbi/openai/models/beta/agents/environment_list_params.rbi +136 -0
- data/rbi/openai/models/beta/environment_param.rbi +15 -0
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +3 -3
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +3 -6
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +3 -6
- data/rbi/openai/models/webhooks/agent_environment_failed_webhook_event.rbi +134 -0
- data/rbi/openai/models/webhooks/agent_environment_ready_webhook_event.rbi +134 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +4 -2
- data/rbi/openai/models/webhooks/webhook_create_params.rbi +8 -0
- data/rbi/openai/models/webhooks/webhook_test_params.rbi +8 -0
- data/rbi/openai/models/webhooks/webhook_update_params.rbi +8 -0
- data/rbi/openai/resources/audio/speech.rbi +1 -2
- data/rbi/openai/resources/audio/voices.rbi +10 -13
- data/rbi/openai/resources/beta/agents/environments.rbi +53 -0
- data/rbi/openai/resources/webhooks.rbi +2 -0
- data/sig/openai/models/audio/speech_create_params.rbs +2 -4
- data/sig/openai/models/audio/voice.rbs +3 -6
- data/sig/openai/models/audio/voice_create_params.rbs +1 -90
- data/sig/openai/models/beta/agents/environment_create_params.rbs +268 -0
- data/sig/openai/models/beta/agents/environment_info.rbs +5 -1
- data/sig/openai/models/beta/agents/environment_list_params.rbs +97 -0
- data/sig/openai/models/beta/environment_param.rbs +14 -0
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +2 -2
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +3 -6
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +3 -6
- data/sig/openai/models/webhooks/agent_environment_failed_webhook_event.rbs +70 -0
- data/sig/openai/models/webhooks/agent_environment_ready_webhook_event.rbs +70 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +3 -1
- data/sig/openai/models/webhooks/webhook_create_params.rbs +4 -0
- data/sig/openai/models/webhooks/webhook_test_params.rbs +4 -0
- data/sig/openai/models/webhooks/webhook_update_params.rbs +4 -0
- data/sig/openai/resources/beta/agents/environments.rbs +15 -0
- data/sig/openai/resources/webhooks.rbs +3 -1
- metadata +13 -1
|
@@ -16,7 +16,7 @@ module OpenAI
|
|
|
16
16
|
# `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
|
|
17
17
|
# `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
|
|
18
18
|
# for example `{ "id": "voice_1234" }`. Custom voices must be created from audio
|
|
19
|
-
# samples.
|
|
19
|
+
# samples.
|
|
20
20
|
#
|
|
21
21
|
# @return [String, Symbol, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice::ID, OpenAI::Models::Chat::ChatCompletionAudioParam::Voice]
|
|
22
22
|
required :voice, union: -> { OpenAI::Chat::ChatCompletionAudioParam::Voice }
|
|
@@ -35,7 +35,7 @@ module OpenAI
|
|
|
35
35
|
# `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
|
|
36
36
|
# `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
|
|
37
37
|
# for example `{ "id": "voice_1234" }`. Custom voices must be created from audio
|
|
38
|
-
# samples.
|
|
38
|
+
# samples.
|
|
39
39
|
|
|
40
40
|
# Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`,
|
|
41
41
|
# or `pcm16`.
|
|
@@ -59,7 +59,7 @@ module OpenAI
|
|
|
59
59
|
# `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
|
|
60
60
|
# `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
|
|
61
61
|
# for example `{ "id": "voice_1234" }`. Custom voices must be created from audio
|
|
62
|
-
# samples.
|
|
62
|
+
# samples.
|
|
63
63
|
#
|
|
64
64
|
# @see OpenAI::Models::Chat::ChatCompletionAudioParam#voice
|
|
65
65
|
module Voice
|
|
@@ -28,8 +28,7 @@ module OpenAI
|
|
|
28
28
|
# `cedar`. You may also provide a custom voice object with an `id`, for example
|
|
29
29
|
# `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
|
|
30
30
|
# model has responded with audio at least once. Custom voices must be created from
|
|
31
|
-
# audio samples.
|
|
32
|
-
# recommend `marin` and `cedar` for best quality.
|
|
31
|
+
# audio samples. We recommend `marin` and `cedar` for best quality.
|
|
33
32
|
#
|
|
34
33
|
# @return [String, Symbol, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice::ID, OpenAI::Models::Realtime::RealtimeAudioConfigOutput::Voice, nil]
|
|
35
34
|
optional :voice, union: -> { OpenAI::Realtime::RealtimeAudioConfigOutput::Voice }
|
|
@@ -53,16 +52,14 @@ module OpenAI
|
|
|
53
52
|
# `cedar`. You may also provide a custom voice object with an `id`, for example
|
|
54
53
|
# `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
|
|
55
54
|
# model has responded with audio at least once. Custom voices must be created from
|
|
56
|
-
# audio samples.
|
|
57
|
-
# recommend `marin` and `cedar` for best quality.
|
|
55
|
+
# audio samples. We recommend `marin` and `cedar` for best quality.
|
|
58
56
|
|
|
59
57
|
# The voice the model uses to respond. Supported built-in voices are `alloy`,
|
|
60
58
|
# `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
|
|
61
59
|
# `cedar`. You may also provide a custom voice object with an `id`, for example
|
|
62
60
|
# `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
|
|
63
61
|
# model has responded with audio at least once. Custom voices must be created from
|
|
64
|
-
# audio samples.
|
|
65
|
-
# recommend `marin` and `cedar` for best quality.
|
|
62
|
+
# audio samples. We recommend `marin` and `cedar` for best quality.
|
|
66
63
|
#
|
|
67
64
|
# @see OpenAI::Models::Realtime::RealtimeAudioConfigOutput#voice
|
|
68
65
|
module Voice
|
|
@@ -28,8 +28,7 @@ module OpenAI
|
|
|
28
28
|
# `cedar`. You may also provide a custom voice object with an `id`, for example
|
|
29
29
|
# `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
|
|
30
30
|
# model has responded with audio at least once. Custom voices must be created from
|
|
31
|
-
# audio samples.
|
|
32
|
-
# recommend `marin` and `cedar` for best quality.
|
|
31
|
+
# audio samples. We recommend `marin` and `cedar` for best quality.
|
|
33
32
|
#
|
|
34
33
|
# @return [String, Symbol, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice::ID, OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice, nil]
|
|
35
34
|
optional :voice, union: -> { OpenAI::Realtime::RealtimeResponseCreateAudioOutput::Output::Voice }
|
|
@@ -44,16 +43,14 @@ module OpenAI
|
|
|
44
43
|
# `cedar`. You may also provide a custom voice object with an `id`, for example
|
|
45
44
|
# `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
|
|
46
45
|
# model has responded with audio at least once. Custom voices must be created from
|
|
47
|
-
# audio samples.
|
|
48
|
-
# recommend `marin` and `cedar` for best quality.
|
|
46
|
+
# audio samples. We recommend `marin` and `cedar` for best quality.
|
|
49
47
|
|
|
50
48
|
# The voice the model uses to respond. Supported built-in voices are `alloy`,
|
|
51
49
|
# `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
|
|
52
50
|
# `cedar`. You may also provide a custom voice object with an `id`, for example
|
|
53
51
|
# `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
|
|
54
52
|
# model has responded with audio at least once. Custom voices must be created from
|
|
55
|
-
# audio samples.
|
|
56
|
-
# recommend `marin` and `cedar` for best quality.
|
|
53
|
+
# audio samples. We recommend `marin` and `cedar` for best quality.
|
|
57
54
|
#
|
|
58
55
|
# @see OpenAI::Models::Realtime::RealtimeResponseCreateAudioOutput::Output#voice
|
|
59
56
|
module Voice
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Webhooks
|
|
6
|
+
class AgentEnvironmentFailedWebhookEvent < 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
|
+
# Identifies the environment whose lifecycle changed.
|
|
21
|
+
#
|
|
22
|
+
# @return [OpenAI::Models::Webhooks::AgentEnvironmentFailedWebhookEvent::Data]
|
|
23
|
+
required :data, -> { OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data }
|
|
24
|
+
|
|
25
|
+
# @!attribute object
|
|
26
|
+
# The object type. Always `event`.
|
|
27
|
+
#
|
|
28
|
+
# @return [Symbol, :event]
|
|
29
|
+
required :object, const: :event
|
|
30
|
+
|
|
31
|
+
# @!attribute type
|
|
32
|
+
# The event type. Always `agent.environment.failed`.
|
|
33
|
+
#
|
|
34
|
+
# @return [Symbol, :"agent.environment.failed"]
|
|
35
|
+
required :type, const: :"agent.environment.failed"
|
|
36
|
+
|
|
37
|
+
# @!method initialize(id:, created_at:, data:, object: :event, type: :"agent.environment.failed")
|
|
38
|
+
# Sent when setup fails for a prewarmed OpenAI-hosted environment before it is
|
|
39
|
+
# attached to a session.
|
|
40
|
+
#
|
|
41
|
+
# @param id [String]
|
|
42
|
+
# The unique ID of the event.
|
|
43
|
+
#
|
|
44
|
+
# @param created_at [Integer]
|
|
45
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
46
|
+
#
|
|
47
|
+
# @param data [OpenAI::Models::Webhooks::AgentEnvironmentFailedWebhookEvent::Data]
|
|
48
|
+
# Identifies the environment whose lifecycle changed.
|
|
49
|
+
#
|
|
50
|
+
# @param object [Symbol, :event]
|
|
51
|
+
# The object type. Always `event`.
|
|
52
|
+
#
|
|
53
|
+
# @param type [Symbol, :"agent.environment.failed"]
|
|
54
|
+
# The event type. Always `agent.environment.failed`.
|
|
55
|
+
|
|
56
|
+
# @see OpenAI::Models::Webhooks::AgentEnvironmentFailedWebhookEvent#data
|
|
57
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
58
|
+
# @!attribute id
|
|
59
|
+
# The ID of the environment.
|
|
60
|
+
#
|
|
61
|
+
# @return [String]
|
|
62
|
+
required :id, String
|
|
63
|
+
|
|
64
|
+
# @!method initialize(id:)
|
|
65
|
+
# Identifies the environment whose lifecycle changed.
|
|
66
|
+
#
|
|
67
|
+
# @param id [String]
|
|
68
|
+
# The ID of the environment.
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Webhooks
|
|
6
|
+
class AgentEnvironmentReadyWebhookEvent < 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
|
+
# Identifies the environment whose lifecycle changed.
|
|
21
|
+
#
|
|
22
|
+
# @return [OpenAI::Models::Webhooks::AgentEnvironmentReadyWebhookEvent::Data]
|
|
23
|
+
required :data, -> { OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data }
|
|
24
|
+
|
|
25
|
+
# @!attribute object
|
|
26
|
+
# The object type. Always `event`.
|
|
27
|
+
#
|
|
28
|
+
# @return [Symbol, :event]
|
|
29
|
+
required :object, const: :event
|
|
30
|
+
|
|
31
|
+
# @!attribute type
|
|
32
|
+
# The event type. Always `agent.environment.ready`.
|
|
33
|
+
#
|
|
34
|
+
# @return [Symbol, :"agent.environment.ready"]
|
|
35
|
+
required :type, const: :"agent.environment.ready"
|
|
36
|
+
|
|
37
|
+
# @!method initialize(id:, created_at:, data:, object: :event, type: :"agent.environment.ready")
|
|
38
|
+
# Sent when a prewarmed OpenAI-hosted environment finishes setup before being
|
|
39
|
+
# attached to a session.
|
|
40
|
+
#
|
|
41
|
+
# @param id [String]
|
|
42
|
+
# The unique ID of the event.
|
|
43
|
+
#
|
|
44
|
+
# @param created_at [Integer]
|
|
45
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
46
|
+
#
|
|
47
|
+
# @param data [OpenAI::Models::Webhooks::AgentEnvironmentReadyWebhookEvent::Data]
|
|
48
|
+
# Identifies the environment whose lifecycle changed.
|
|
49
|
+
#
|
|
50
|
+
# @param object [Symbol, :event]
|
|
51
|
+
# The object type. Always `event`.
|
|
52
|
+
#
|
|
53
|
+
# @param type [Symbol, :"agent.environment.ready"]
|
|
54
|
+
# The event type. Always `agent.environment.ready`.
|
|
55
|
+
|
|
56
|
+
# @see OpenAI::Models::Webhooks::AgentEnvironmentReadyWebhookEvent#data
|
|
57
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
58
|
+
# @!attribute id
|
|
59
|
+
# The ID of the environment.
|
|
60
|
+
#
|
|
61
|
+
# @return [String]
|
|
62
|
+
required :id, String
|
|
63
|
+
|
|
64
|
+
# @!method initialize(id:)
|
|
65
|
+
# Identifies the environment whose lifecycle changed.
|
|
66
|
+
#
|
|
67
|
+
# @param id [String]
|
|
68
|
+
# The ID of the environment.
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -3,13 +3,19 @@
|
|
|
3
3
|
module OpenAI
|
|
4
4
|
module Models
|
|
5
5
|
module Webhooks
|
|
6
|
-
# Sent when
|
|
7
|
-
#
|
|
6
|
+
# Sent when setup fails for a prewarmed OpenAI-hosted environment before it is
|
|
7
|
+
# attached to a session.
|
|
8
8
|
module UnwrapWebhookEvent
|
|
9
9
|
extend OpenAI::Internal::Type::Union
|
|
10
10
|
|
|
11
11
|
discriminator :type
|
|
12
12
|
|
|
13
|
+
# Sent when setup fails for a prewarmed OpenAI-hosted environment before it is attached to a session.
|
|
14
|
+
variant :"agent.environment.failed", -> { OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent }
|
|
15
|
+
|
|
16
|
+
# Sent when a prewarmed OpenAI-hosted environment finishes setup before being attached to a session.
|
|
17
|
+
variant :"agent.environment.ready", -> { OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent }
|
|
18
|
+
|
|
13
19
|
# Sent when an agent session requires an action. Retrieve the session for action details.
|
|
14
20
|
variant :"agent.session.action_required", -> { OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent }
|
|
15
21
|
|
|
@@ -97,7 +103,7 @@ module OpenAI
|
|
|
97
103
|
variant :"safety.warning_issued", -> { OpenAI::Webhooks::SafetyWarningIssuedWebhookEvent }
|
|
98
104
|
|
|
99
105
|
# @!method self.variants
|
|
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)]
|
|
106
|
+
# @return [Array(OpenAI::Models::Webhooks::AgentEnvironmentFailedWebhookEvent, OpenAI::Models::Webhooks::AgentEnvironmentReadyWebhookEvent, 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)]
|
|
101
107
|
end
|
|
102
108
|
end
|
|
103
109
|
end
|
|
@@ -62,6 +62,8 @@ module OpenAI
|
|
|
62
62
|
REALTIME_CALL_INCOMING = :"realtime.call.incoming"
|
|
63
63
|
VIDEO_COMPLETED = :"video.completed"
|
|
64
64
|
VIDEO_FAILED = :"video.failed"
|
|
65
|
+
AGENT_ENVIRONMENT_READY = :"agent.environment.ready"
|
|
66
|
+
AGENT_ENVIRONMENT_FAILED = :"agent.environment.failed"
|
|
65
67
|
AGENT_SESSION_CREATED = :"agent.session.created"
|
|
66
68
|
AGENT_SESSION_ACTION_REQUIRED = :"agent.session.action_required"
|
|
67
69
|
AGENT_SESSION_IN_PROGRESS = :"agent.session.in_progress"
|
|
@@ -48,6 +48,8 @@ module OpenAI
|
|
|
48
48
|
REALTIME_CALL_INCOMING = :"realtime.call.incoming"
|
|
49
49
|
VIDEO_COMPLETED = :"video.completed"
|
|
50
50
|
VIDEO_FAILED = :"video.failed"
|
|
51
|
+
AGENT_ENVIRONMENT_READY = :"agent.environment.ready"
|
|
52
|
+
AGENT_ENVIRONMENT_FAILED = :"agent.environment.failed"
|
|
51
53
|
AGENT_SESSION_CREATED = :"agent.session.created"
|
|
52
54
|
AGENT_SESSION_ACTION_REQUIRED = :"agent.session.action_required"
|
|
53
55
|
AGENT_SESSION_IN_PROGRESS = :"agent.session.in_progress"
|
|
@@ -69,6 +69,8 @@ module OpenAI
|
|
|
69
69
|
REALTIME_CALL_INCOMING = :"realtime.call.incoming"
|
|
70
70
|
VIDEO_COMPLETED = :"video.completed"
|
|
71
71
|
VIDEO_FAILED = :"video.failed"
|
|
72
|
+
AGENT_ENVIRONMENT_READY = :"agent.environment.ready"
|
|
73
|
+
AGENT_ENVIRONMENT_FAILED = :"agent.environment.failed"
|
|
72
74
|
AGENT_SESSION_CREATED = :"agent.session.created"
|
|
73
75
|
AGENT_SESSION_ACTION_REQUIRED = :"agent.session.action_required"
|
|
74
76
|
AGENT_SESSION_IN_PROGRESS = :"agent.session.in_progress"
|
|
@@ -26,8 +26,7 @@ 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.
|
|
30
|
-
# prompts are supported only in Live.
|
|
29
|
+
# Custom voices must be created from audio samples.
|
|
31
30
|
#
|
|
32
31
|
# @param instructions [String]
|
|
33
32
|
# Control the voice of your generated audio with additional instructions. Does not
|
|
@@ -5,21 +5,21 @@ module OpenAI
|
|
|
5
5
|
class Audio
|
|
6
6
|
# Turn audio into text or text into audio.
|
|
7
7
|
class Voices
|
|
8
|
-
#
|
|
9
|
-
# sample
|
|
8
|
+
# Create a custom voice you can use for audio output (for example, in
|
|
9
|
+
# Text-to-Speech and the Realtime API). This requires an audio sample and a
|
|
10
|
+
# previously uploaded consent recording.
|
|
10
11
|
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
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.
|
|
12
|
+
# Send `name`, `audio_sample`, and the `consent` recording ID as multipart form
|
|
13
|
+
# data. The optional `type` defaults to `audio_sample`.
|
|
15
14
|
#
|
|
16
|
-
# Returns the saved voice's metadata.
|
|
17
|
-
#
|
|
18
|
-
#
|
|
15
|
+
# Returns the saved voice's metadata. See the
|
|
16
|
+
# [custom voices guide](https://developers.openai.com/api/docs/guides/text-to-speech#custom-voices)
|
|
17
|
+
# for requirements and best practices. Custom voices are limited to eligible
|
|
18
|
+
# customers.
|
|
19
19
|
#
|
|
20
20
|
# @overload create(body:, request_options: {})
|
|
21
21
|
#
|
|
22
|
-
# @param body [OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample
|
|
22
|
+
# @param body [OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample]
|
|
23
23
|
# Creates a voice from a consent recording and an audio sample. Requires
|
|
24
24
|
# multipart/form-data.
|
|
25
25
|
#
|
|
@@ -59,10 +59,11 @@ module OpenAI
|
|
|
59
59
|
@client.request(
|
|
60
60
|
method: :post,
|
|
61
61
|
path: ["agents/environments/%1$s/files", environment_id],
|
|
62
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
62
63
|
body: parsed[:hosted_environment_file_param],
|
|
63
64
|
model: OpenAI::Beta::Agents::Environments::EnvironmentFile,
|
|
64
65
|
security: {bearer_auth: true},
|
|
65
|
-
options:
|
|
66
|
+
options: options
|
|
66
67
|
)
|
|
67
68
|
end
|
|
68
69
|
|
|
@@ -99,10 +100,11 @@ module OpenAI
|
|
|
99
100
|
method: :get,
|
|
100
101
|
path: ["agents/environments/%1$s/files", environment_id],
|
|
101
102
|
query: query,
|
|
103
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
102
104
|
page: OpenAI::Internal::TokenPage,
|
|
103
105
|
model: OpenAI::Beta::Agents::Environments::EnvironmentFile,
|
|
104
106
|
security: {bearer_auth: true},
|
|
105
|
-
options:
|
|
107
|
+
options: options
|
|
106
108
|
)
|
|
107
109
|
end
|
|
108
110
|
|
|
@@ -56,10 +56,11 @@ module OpenAI
|
|
|
56
56
|
@client.request(
|
|
57
57
|
method: :post,
|
|
58
58
|
path: "agents/environments/templates",
|
|
59
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
59
60
|
body: parsed,
|
|
60
61
|
model: OpenAI::Beta::Agents::Environments::EnvironmentTemplate,
|
|
61
62
|
security: {bearer_auth: true},
|
|
62
|
-
options:
|
|
63
|
+
options: options
|
|
63
64
|
)
|
|
64
65
|
end
|
|
65
66
|
|
|
@@ -81,9 +82,10 @@ module OpenAI
|
|
|
81
82
|
@client.request(
|
|
82
83
|
method: :get,
|
|
83
84
|
path: ["agents/environments/templates/%1$s", environment_template_id],
|
|
85
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
84
86
|
model: OpenAI::Beta::Agents::Environments::EnvironmentTemplate,
|
|
85
87
|
security: {bearer_auth: true},
|
|
86
|
-
options:
|
|
88
|
+
options: params[:request_options]
|
|
87
89
|
)
|
|
88
90
|
end
|
|
89
91
|
|
|
@@ -137,10 +139,11 @@ module OpenAI
|
|
|
137
139
|
@client.request(
|
|
138
140
|
method: :post,
|
|
139
141
|
path: ["agents/environments/templates/%1$s", environment_template_id],
|
|
142
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
140
143
|
body: parsed,
|
|
141
144
|
model: OpenAI::Beta::Agents::Environments::EnvironmentTemplate,
|
|
142
145
|
security: {bearer_auth: true},
|
|
143
|
-
options:
|
|
146
|
+
options: options
|
|
144
147
|
)
|
|
145
148
|
end
|
|
146
149
|
|
|
@@ -170,10 +173,11 @@ module OpenAI
|
|
|
170
173
|
method: :get,
|
|
171
174
|
path: "agents/environments/templates",
|
|
172
175
|
query: query,
|
|
176
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
173
177
|
page: OpenAI::Internal::CursorPage,
|
|
174
178
|
model: OpenAI::Beta::Agents::Environments::EnvironmentTemplate,
|
|
175
179
|
security: {bearer_auth: true},
|
|
176
|
-
options:
|
|
180
|
+
options: options
|
|
177
181
|
)
|
|
178
182
|
end
|
|
179
183
|
|
|
@@ -195,9 +199,10 @@ module OpenAI
|
|
|
195
199
|
@client.request(
|
|
196
200
|
method: :delete,
|
|
197
201
|
path: ["agents/environments/templates/%1$s", environment_template_id],
|
|
202
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
198
203
|
model: OpenAI::Beta::Agents::Environments::EnvironmentTemplateDeleted,
|
|
199
204
|
security: {bearer_auth: true},
|
|
200
|
-
options:
|
|
205
|
+
options: params[:request_options]
|
|
201
206
|
)
|
|
202
207
|
end
|
|
203
208
|
|
|
@@ -11,6 +11,47 @@ module OpenAI
|
|
|
11
11
|
# @return [OpenAI::Resources::Beta::Agents::Environments::Templates]
|
|
12
12
|
attr_reader :templates
|
|
13
13
|
|
|
14
|
+
# Creates an OpenAI-hosted environment before creating a session. Requires access
|
|
15
|
+
# to the prewarming beta.
|
|
16
|
+
#
|
|
17
|
+
# @overload create(environment:, vault_ids: nil, idempotency_key: nil, request_options: {})
|
|
18
|
+
#
|
|
19
|
+
# @param environment [OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment]
|
|
20
|
+
# Body param: The required hosting type and its configuration.
|
|
21
|
+
#
|
|
22
|
+
# @param vault_ids [Array<String>, nil]
|
|
23
|
+
# Body param: The IDs of up to 10 vaults made available to an OpenAI-hosted
|
|
24
|
+
# environment.
|
|
25
|
+
#
|
|
26
|
+
# @param idempotency_key [String]
|
|
27
|
+
# Header param: Deduplicates creation for 24 hours within the authenticated
|
|
28
|
+
# organization, project, and creator. Retry the same JSON parameters with the same
|
|
29
|
+
# key to retrieve the original environment in its current state. Different
|
|
30
|
+
# parameters or an incomplete hosted creation return 409. Deleted environments are
|
|
31
|
+
# not recreated. After retention expires, the key may create a new environment.
|
|
32
|
+
# Without this header, each request creates a new environment.
|
|
33
|
+
#
|
|
34
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
35
|
+
#
|
|
36
|
+
# @return [OpenAI::Models::Beta::Agents::EnvironmentInfo]
|
|
37
|
+
#
|
|
38
|
+
# @see OpenAI::Models::Beta::Agents::EnvironmentCreateParams
|
|
39
|
+
def create(params)
|
|
40
|
+
parsed, options = OpenAI::Beta::Agents::EnvironmentCreateParams.dump_request(params)
|
|
41
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
42
|
+
@client.request(
|
|
43
|
+
method: :post,
|
|
44
|
+
path: "agents/environments",
|
|
45
|
+
headers: {"openai-beta" => "agents=v1"}.merge(
|
|
46
|
+
parsed.slice(*header_params.keys).transform_keys(header_params)
|
|
47
|
+
),
|
|
48
|
+
body: parsed.except(*header_params.keys),
|
|
49
|
+
model: OpenAI::Beta::Agents::EnvironmentInfo,
|
|
50
|
+
security: {bearer_auth: true},
|
|
51
|
+
options: options
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
14
55
|
# Retrieves an execution environment's connection status and safe installed
|
|
15
56
|
# metadata. See
|
|
16
57
|
# [environment lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle).
|
|
@@ -29,9 +70,47 @@ module OpenAI
|
|
|
29
70
|
@client.request(
|
|
30
71
|
method: :get,
|
|
31
72
|
path: ["agents/environments/%1$s", environment_id],
|
|
73
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
74
|
+
model: OpenAI::Beta::Agents::EnvironmentInfo,
|
|
75
|
+
security: {bearer_auth: true},
|
|
76
|
+
options: params[:request_options]
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Lists OpenAI-hosted environments owned by the authenticated principal. Requires
|
|
81
|
+
# access to the prewarming beta.
|
|
82
|
+
#
|
|
83
|
+
# @overload list(after: nil, limit: nil, order: nil, type: nil, request_options: {})
|
|
84
|
+
#
|
|
85
|
+
# @param after [String]
|
|
86
|
+
# Return environments after this environment ID in the selected order.
|
|
87
|
+
#
|
|
88
|
+
# @param limit [Integer]
|
|
89
|
+
# The maximum number of environments to return, between 1 and 100. Defaults to 20.
|
|
90
|
+
#
|
|
91
|
+
# @param order [Symbol, OpenAI::Models::Beta::Agents::EnvironmentListParams::Order]
|
|
92
|
+
# The order in which environments are returned. Defaults to `desc`.
|
|
93
|
+
#
|
|
94
|
+
# @param type [Symbol, OpenAI::Models::Beta::Agents::EnvironmentListParams::Type]
|
|
95
|
+
# The hosting type to list. Defaults to `openai_hosted`.
|
|
96
|
+
#
|
|
97
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
98
|
+
#
|
|
99
|
+
# @return [OpenAI::Internal::CursorPage<OpenAI::Models::Beta::Agents::EnvironmentInfo>]
|
|
100
|
+
#
|
|
101
|
+
# @see OpenAI::Models::Beta::Agents::EnvironmentListParams
|
|
102
|
+
def list(params = {})
|
|
103
|
+
parsed, options = OpenAI::Beta::Agents::EnvironmentListParams.dump_request(params)
|
|
104
|
+
query = OpenAI::Internal::Util.encode_query_params(parsed)
|
|
105
|
+
@client.request(
|
|
106
|
+
method: :get,
|
|
107
|
+
path: "agents/environments",
|
|
108
|
+
query: query,
|
|
109
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
110
|
+
page: OpenAI::Internal::CursorPage,
|
|
32
111
|
model: OpenAI::Beta::Agents::EnvironmentInfo,
|
|
33
112
|
security: {bearer_auth: true},
|
|
34
|
-
options:
|
|
113
|
+
options: options
|
|
35
114
|
)
|
|
36
115
|
end
|
|
37
116
|
|
|
@@ -39,9 +39,10 @@ module OpenAI
|
|
|
39
39
|
@client.request(
|
|
40
40
|
method: :get,
|
|
41
41
|
path: ["agents/sessions/%1$s/artifacts/%2$s", session_id, artifact_id],
|
|
42
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
42
43
|
model: OpenAI::Beta::Agents::Sessions::SessionArtifact,
|
|
43
44
|
security: {bearer_auth: true},
|
|
44
|
-
options:
|
|
45
|
+
options: options
|
|
45
46
|
)
|
|
46
47
|
end
|
|
47
48
|
|
|
@@ -77,10 +78,11 @@ module OpenAI
|
|
|
77
78
|
method: :get,
|
|
78
79
|
path: ["agents/sessions/%1$s/artifacts", session_id],
|
|
79
80
|
query: query,
|
|
81
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
80
82
|
page: OpenAI::Internal::CursorPage,
|
|
81
83
|
model: OpenAI::Beta::Agents::Sessions::SessionArtifact,
|
|
82
84
|
security: {bearer_auth: true},
|
|
83
|
-
options:
|
|
85
|
+
options: options
|
|
84
86
|
)
|
|
85
87
|
end
|
|
86
88
|
|
|
@@ -110,9 +112,10 @@ module OpenAI
|
|
|
110
112
|
@client.request(
|
|
111
113
|
method: :delete,
|
|
112
114
|
path: ["agents/sessions/%1$s/artifacts/%2$s", session_id, artifact_id],
|
|
115
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
113
116
|
model: OpenAI::Beta::Agents::Sessions::SessionArtifactDeleted,
|
|
114
117
|
security: {bearer_auth: true},
|
|
115
|
-
options:
|
|
118
|
+
options: options
|
|
116
119
|
)
|
|
117
120
|
end
|
|
118
121
|
|
|
@@ -142,10 +145,10 @@ module OpenAI
|
|
|
142
145
|
@client.request(
|
|
143
146
|
method: :get,
|
|
144
147
|
path: ["agents/sessions/%1$s/artifacts/%2$s/content", session_id, artifact_id],
|
|
145
|
-
headers: {"accept" => "application/octet-stream"},
|
|
148
|
+
headers: {"openai-beta" => "agents=v1", "accept" => "application/octet-stream"},
|
|
146
149
|
model: StringIO,
|
|
147
150
|
security: {bearer_auth: true},
|
|
148
|
-
options:
|
|
151
|
+
options: options
|
|
149
152
|
)
|
|
150
153
|
end
|
|
151
154
|
|
|
@@ -37,11 +37,13 @@ module OpenAI
|
|
|
37
37
|
@client.request(
|
|
38
38
|
method: :post,
|
|
39
39
|
path: ["agents/sessions/%1$s/events", session_id],
|
|
40
|
-
headers:
|
|
40
|
+
headers: {"openai-beta" => "agents=v1"}.merge(
|
|
41
|
+
parsed.slice(*header_params.keys).transform_keys(header_params)
|
|
42
|
+
),
|
|
41
43
|
body: parsed.except(*header_params.keys),
|
|
42
44
|
model: NilClass,
|
|
43
45
|
security: {bearer_auth: true},
|
|
44
|
-
options:
|
|
46
|
+
options: options
|
|
45
47
|
)
|
|
46
48
|
end
|
|
47
49
|
|
|
@@ -62,11 +64,15 @@ module OpenAI
|
|
|
62
64
|
@client.request(
|
|
63
65
|
method: :get,
|
|
64
66
|
path: ["agents/sessions/%1$s/events", session_id],
|
|
65
|
-
headers: {
|
|
67
|
+
headers: {
|
|
68
|
+
"openai-beta" => "agents=v1",
|
|
69
|
+
"accept" => "text/event-stream",
|
|
70
|
+
"accept-encoding" => "identity"
|
|
71
|
+
},
|
|
66
72
|
stream: OpenAI::Internal::Stream,
|
|
67
73
|
model: OpenAI::Beta::AgentSessionEvent,
|
|
68
74
|
security: {bearer_auth: true},
|
|
69
|
-
options:
|
|
75
|
+
options: params[:request_options]
|
|
70
76
|
)
|
|
71
77
|
end
|
|
72
78
|
|
|
@@ -36,10 +36,11 @@ module OpenAI
|
|
|
36
36
|
method: :get,
|
|
37
37
|
path: ["agents/sessions/%1$s/items", session_id],
|
|
38
38
|
query: query,
|
|
39
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
39
40
|
page: OpenAI::Internal::CursorPage,
|
|
40
41
|
model: OpenAI::Beta::AgentSessionItem,
|
|
41
42
|
security: {bearer_auth: true},
|
|
42
|
-
options:
|
|
43
|
+
options: options
|
|
43
44
|
)
|
|
44
45
|
end
|
|
45
46
|
|
|
@@ -44,10 +44,11 @@ module OpenAI
|
|
|
44
44
|
method: :get,
|
|
45
45
|
path: ["agents/sessions/%1$s/subagents/%2$s/items", session_id, subagent_id],
|
|
46
46
|
query: query,
|
|
47
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
47
48
|
page: OpenAI::Internal::CursorPage,
|
|
48
49
|
model: OpenAI::Beta::AgentSessionItem,
|
|
49
50
|
security: {bearer_auth: true},
|
|
50
|
-
options:
|
|
51
|
+
options: options
|
|
51
52
|
)
|
|
52
53
|
end
|
|
53
54
|
|