openai 0.101.1 → 0.103.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/beta/agent_session_environment_expired_event.rb +57 -0
- data/lib/openai/models/beta/agent_session_environment_state.rb +6 -0
- data/lib/openai/models/beta/agent_session_environment_suspended_event.rb +57 -0
- data/lib/openai/models/beta/agent_session_event.rb +7 -1
- data/lib/openai/models/beta/agents/environment_create_params.rb +300 -0
- data/lib/openai/models/beta/agents/environment_info.rb +7 -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/webhooks/agent_environment_expired_webhook_event.rb +72 -0
- 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/agent_environment_suspended_webhook_event.rb +72 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +14 -3
- data/lib/openai/models/webhooks/webhook_create_params.rb +4 -0
- data/lib/openai/models/webhooks/webhook_test_params.rb +4 -0
- data/lib/openai/models/webhooks/webhook_update_params.rb +4 -0
- 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 +11 -5
- 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 +8 -0
- data/rbi/openai/models/beta/agent_session_environment_expired_event.rbi +95 -0
- data/rbi/openai/models/beta/agent_session_environment_state.rbi +6 -0
- data/rbi/openai/models/beta/agent_session_environment_suspended_event.rbi +95 -0
- data/rbi/openai/models/beta/agent_session_event.rbi +2 -0
- data/rbi/openai/models/beta/agents/environment_create_params.rbi +499 -0
- data/rbi/openai/models/beta/agents/environment_info.rbi +6 -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/webhooks/agent_environment_expired_webhook_event.rbi +133 -0
- 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/agent_environment_suspended_webhook_event.rbi +133 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +5 -2
- data/rbi/openai/models/webhooks/webhook_create_params.rbi +16 -0
- data/rbi/openai/models/webhooks/webhook_test_params.rbi +16 -0
- data/rbi/openai/models/webhooks/webhook_update_params.rbi +16 -0
- data/rbi/openai/resources/beta/agents/environments.rbi +53 -0
- data/rbi/openai/resources/webhooks.rbi +4 -0
- data/sig/openai/models/beta/agent_session_environment_expired_event.rbs +57 -0
- data/sig/openai/models/beta/agent_session_environment_state.rbs +14 -1
- data/sig/openai/models/beta/agent_session_environment_suspended_event.rbs +57 -0
- data/sig/openai/models/beta/agent_session_event.rbs +2 -0
- data/sig/openai/models/beta/agents/environment_create_params.rbs +268 -0
- data/sig/openai/models/beta/agents/environment_info.rbs +15 -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/webhooks/agent_environment_expired_webhook_event.rbs +70 -0
- 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/agent_environment_suspended_webhook_event.rbs +70 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +5 -1
- data/sig/openai/models/webhooks/webhook_create_params.rbs +8 -0
- data/sig/openai/models/webhooks/webhook_test_params.rbs +8 -0
- data/sig/openai/models/webhooks/webhook_update_params.rbs +8 -0
- data/sig/openai/resources/beta/agents/environments.rbs +15 -0
- data/sig/openai/resources/webhooks.rbs +5 -1
- metadata +25 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class AgentEnvironmentExpiredWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::AgentEnvironmentExpiredWebhookEvent,
|
|
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
|
+
# Identifies the environment whose lifecycle changed.
|
|
26
|
+
sig { returns(OpenAI::Webhooks::AgentEnvironmentExpiredWebhookEvent::Data) }
|
|
27
|
+
attr_reader :data
|
|
28
|
+
|
|
29
|
+
sig { params(data: OpenAI::Webhooks::AgentEnvironmentExpiredWebhookEvent::Data::OrHash).void }
|
|
30
|
+
attr_writer :data
|
|
31
|
+
|
|
32
|
+
# The object type. Always `event`.
|
|
33
|
+
sig { returns(Symbol) }
|
|
34
|
+
attr_accessor :object
|
|
35
|
+
|
|
36
|
+
# The event type. Always `agent.environment.expired`.
|
|
37
|
+
sig { returns(Symbol) }
|
|
38
|
+
attr_accessor :type
|
|
39
|
+
|
|
40
|
+
# Sent when an agent environment expires and can no longer resume from a snapshot.
|
|
41
|
+
sig do
|
|
42
|
+
params(
|
|
43
|
+
|
|
44
|
+
id: String,
|
|
45
|
+
|
|
46
|
+
created_at: Integer,
|
|
47
|
+
|
|
48
|
+
data: OpenAI::Webhooks::AgentEnvironmentExpiredWebhookEvent::Data::OrHash,
|
|
49
|
+
|
|
50
|
+
object: Symbol,
|
|
51
|
+
|
|
52
|
+
type: Symbol
|
|
53
|
+
)
|
|
54
|
+
.returns(T.attached_class)
|
|
55
|
+
end
|
|
56
|
+
def self.new(
|
|
57
|
+
|
|
58
|
+
# The unique ID of the event.
|
|
59
|
+
id:,
|
|
60
|
+
|
|
61
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
62
|
+
created_at:,
|
|
63
|
+
|
|
64
|
+
# Identifies the environment whose lifecycle changed.
|
|
65
|
+
data:,
|
|
66
|
+
|
|
67
|
+
# The object type. Always `event`.
|
|
68
|
+
object: :event,
|
|
69
|
+
|
|
70
|
+
# The event type. Always `agent.environment.expired`.
|
|
71
|
+
|
|
72
|
+
type: :"agent.environment.expired"
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
sig do
|
|
77
|
+
override.returns(
|
|
78
|
+
{
|
|
79
|
+
id: String,
|
|
80
|
+
created_at: Integer,
|
|
81
|
+
data: OpenAI::Webhooks::AgentEnvironmentExpiredWebhookEvent::Data,
|
|
82
|
+
object: Symbol,
|
|
83
|
+
type: Symbol
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
def to_hash
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
91
|
+
OrHash = T.type_alias do
|
|
92
|
+
T.any(
|
|
93
|
+
OpenAI::Webhooks::AgentEnvironmentExpiredWebhookEvent::Data,
|
|
94
|
+
OpenAI::Internal::AnyHash
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# The ID of the environment.
|
|
99
|
+
sig { returns(String) }
|
|
100
|
+
attr_accessor :id
|
|
101
|
+
|
|
102
|
+
# Identifies the environment whose lifecycle changed.
|
|
103
|
+
sig do
|
|
104
|
+
params(
|
|
105
|
+
|
|
106
|
+
id: String
|
|
107
|
+
)
|
|
108
|
+
.returns(T.attached_class)
|
|
109
|
+
end
|
|
110
|
+
def self.new(
|
|
111
|
+
|
|
112
|
+
# The ID of the environment.
|
|
113
|
+
|
|
114
|
+
id:
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
sig do
|
|
119
|
+
override.returns(
|
|
120
|
+
{id: String}
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
def to_hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
end
|
|
133
|
+
end
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class AgentEnvironmentFailedWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent,
|
|
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
|
+
# Identifies the environment whose lifecycle changed.
|
|
26
|
+
sig { returns(OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data) }
|
|
27
|
+
attr_reader :data
|
|
28
|
+
|
|
29
|
+
sig { params(data: OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data::OrHash).void }
|
|
30
|
+
attr_writer :data
|
|
31
|
+
|
|
32
|
+
# The object type. Always `event`.
|
|
33
|
+
sig { returns(Symbol) }
|
|
34
|
+
attr_accessor :object
|
|
35
|
+
|
|
36
|
+
# The event type. Always `agent.environment.failed`.
|
|
37
|
+
sig { returns(Symbol) }
|
|
38
|
+
attr_accessor :type
|
|
39
|
+
|
|
40
|
+
# Sent when setup fails for a prewarmed OpenAI-hosted environment before it is
|
|
41
|
+
# attached to a session.
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
|
|
45
|
+
id: String,
|
|
46
|
+
|
|
47
|
+
created_at: Integer,
|
|
48
|
+
|
|
49
|
+
data: OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data::OrHash,
|
|
50
|
+
|
|
51
|
+
object: Symbol,
|
|
52
|
+
|
|
53
|
+
type: Symbol
|
|
54
|
+
)
|
|
55
|
+
.returns(T.attached_class)
|
|
56
|
+
end
|
|
57
|
+
def self.new(
|
|
58
|
+
|
|
59
|
+
# The unique ID of the event.
|
|
60
|
+
id:,
|
|
61
|
+
|
|
62
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
63
|
+
created_at:,
|
|
64
|
+
|
|
65
|
+
# Identifies the environment whose lifecycle changed.
|
|
66
|
+
data:,
|
|
67
|
+
|
|
68
|
+
# The object type. Always `event`.
|
|
69
|
+
object: :event,
|
|
70
|
+
|
|
71
|
+
# The event type. Always `agent.environment.failed`.
|
|
72
|
+
|
|
73
|
+
type: :"agent.environment.failed"
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
sig do
|
|
78
|
+
override.returns(
|
|
79
|
+
{
|
|
80
|
+
id: String,
|
|
81
|
+
created_at: Integer,
|
|
82
|
+
data: OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data,
|
|
83
|
+
object: Symbol,
|
|
84
|
+
type: Symbol
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
def to_hash
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
92
|
+
OrHash = T.type_alias do
|
|
93
|
+
T.any(
|
|
94
|
+
OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data,
|
|
95
|
+
OpenAI::Internal::AnyHash
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# The ID of the environment.
|
|
100
|
+
sig { returns(String) }
|
|
101
|
+
attr_accessor :id
|
|
102
|
+
|
|
103
|
+
# Identifies the environment whose lifecycle changed.
|
|
104
|
+
sig do
|
|
105
|
+
params(
|
|
106
|
+
|
|
107
|
+
id: String
|
|
108
|
+
)
|
|
109
|
+
.returns(T.attached_class)
|
|
110
|
+
end
|
|
111
|
+
def self.new(
|
|
112
|
+
|
|
113
|
+
# The ID of the environment.
|
|
114
|
+
|
|
115
|
+
id:
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
sig do
|
|
120
|
+
override.returns(
|
|
121
|
+
{id: String}
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
def to_hash
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
end
|
|
134
|
+
end
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class AgentEnvironmentReadyWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent,
|
|
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
|
+
# Identifies the environment whose lifecycle changed.
|
|
26
|
+
sig { returns(OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data) }
|
|
27
|
+
attr_reader :data
|
|
28
|
+
|
|
29
|
+
sig { params(data: OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data::OrHash).void }
|
|
30
|
+
attr_writer :data
|
|
31
|
+
|
|
32
|
+
# The object type. Always `event`.
|
|
33
|
+
sig { returns(Symbol) }
|
|
34
|
+
attr_accessor :object
|
|
35
|
+
|
|
36
|
+
# The event type. Always `agent.environment.ready`.
|
|
37
|
+
sig { returns(Symbol) }
|
|
38
|
+
attr_accessor :type
|
|
39
|
+
|
|
40
|
+
# Sent when a prewarmed OpenAI-hosted environment finishes setup before being
|
|
41
|
+
# attached to a session.
|
|
42
|
+
sig do
|
|
43
|
+
params(
|
|
44
|
+
|
|
45
|
+
id: String,
|
|
46
|
+
|
|
47
|
+
created_at: Integer,
|
|
48
|
+
|
|
49
|
+
data: OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data::OrHash,
|
|
50
|
+
|
|
51
|
+
object: Symbol,
|
|
52
|
+
|
|
53
|
+
type: Symbol
|
|
54
|
+
)
|
|
55
|
+
.returns(T.attached_class)
|
|
56
|
+
end
|
|
57
|
+
def self.new(
|
|
58
|
+
|
|
59
|
+
# The unique ID of the event.
|
|
60
|
+
id:,
|
|
61
|
+
|
|
62
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
63
|
+
created_at:,
|
|
64
|
+
|
|
65
|
+
# Identifies the environment whose lifecycle changed.
|
|
66
|
+
data:,
|
|
67
|
+
|
|
68
|
+
# The object type. Always `event`.
|
|
69
|
+
object: :event,
|
|
70
|
+
|
|
71
|
+
# The event type. Always `agent.environment.ready`.
|
|
72
|
+
|
|
73
|
+
type: :"agent.environment.ready"
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
sig do
|
|
78
|
+
override.returns(
|
|
79
|
+
{
|
|
80
|
+
id: String,
|
|
81
|
+
created_at: Integer,
|
|
82
|
+
data: OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data,
|
|
83
|
+
object: Symbol,
|
|
84
|
+
type: Symbol
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
def to_hash
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
92
|
+
OrHash = T.type_alias do
|
|
93
|
+
T.any(
|
|
94
|
+
OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data,
|
|
95
|
+
OpenAI::Internal::AnyHash
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# The ID of the environment.
|
|
100
|
+
sig { returns(String) }
|
|
101
|
+
attr_accessor :id
|
|
102
|
+
|
|
103
|
+
# Identifies the environment whose lifecycle changed.
|
|
104
|
+
sig do
|
|
105
|
+
params(
|
|
106
|
+
|
|
107
|
+
id: String
|
|
108
|
+
)
|
|
109
|
+
.returns(T.attached_class)
|
|
110
|
+
end
|
|
111
|
+
def self.new(
|
|
112
|
+
|
|
113
|
+
# The ID of the environment.
|
|
114
|
+
|
|
115
|
+
id:
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
sig do
|
|
120
|
+
override.returns(
|
|
121
|
+
{id: String}
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
def to_hash
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
end
|
|
134
|
+
end
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Webhooks
|
|
7
|
+
|
|
8
|
+
class AgentEnvironmentSuspendedWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Webhooks::AgentEnvironmentSuspendedWebhookEvent,
|
|
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
|
+
# Identifies the environment whose lifecycle changed.
|
|
26
|
+
sig { returns(OpenAI::Webhooks::AgentEnvironmentSuspendedWebhookEvent::Data) }
|
|
27
|
+
attr_reader :data
|
|
28
|
+
|
|
29
|
+
sig { params(data: OpenAI::Webhooks::AgentEnvironmentSuspendedWebhookEvent::Data::OrHash).void }
|
|
30
|
+
attr_writer :data
|
|
31
|
+
|
|
32
|
+
# The object type. Always `event`.
|
|
33
|
+
sig { returns(Symbol) }
|
|
34
|
+
attr_accessor :object
|
|
35
|
+
|
|
36
|
+
# The event type. Always `agent.environment.suspended`.
|
|
37
|
+
sig { returns(Symbol) }
|
|
38
|
+
attr_accessor :type
|
|
39
|
+
|
|
40
|
+
# Sent when an agent environment is suspended and can resume from a snapshot.
|
|
41
|
+
sig do
|
|
42
|
+
params(
|
|
43
|
+
|
|
44
|
+
id: String,
|
|
45
|
+
|
|
46
|
+
created_at: Integer,
|
|
47
|
+
|
|
48
|
+
data: OpenAI::Webhooks::AgentEnvironmentSuspendedWebhookEvent::Data::OrHash,
|
|
49
|
+
|
|
50
|
+
object: Symbol,
|
|
51
|
+
|
|
52
|
+
type: Symbol
|
|
53
|
+
)
|
|
54
|
+
.returns(T.attached_class)
|
|
55
|
+
end
|
|
56
|
+
def self.new(
|
|
57
|
+
|
|
58
|
+
# The unique ID of the event.
|
|
59
|
+
id:,
|
|
60
|
+
|
|
61
|
+
# The Unix timestamp, in seconds, when the event was created.
|
|
62
|
+
created_at:,
|
|
63
|
+
|
|
64
|
+
# Identifies the environment whose lifecycle changed.
|
|
65
|
+
data:,
|
|
66
|
+
|
|
67
|
+
# The object type. Always `event`.
|
|
68
|
+
object: :event,
|
|
69
|
+
|
|
70
|
+
# The event type. Always `agent.environment.suspended`.
|
|
71
|
+
|
|
72
|
+
type: :"agent.environment.suspended"
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
sig do
|
|
77
|
+
override.returns(
|
|
78
|
+
{
|
|
79
|
+
id: String,
|
|
80
|
+
created_at: Integer,
|
|
81
|
+
data: OpenAI::Webhooks::AgentEnvironmentSuspendedWebhookEvent::Data,
|
|
82
|
+
object: Symbol,
|
|
83
|
+
type: Symbol
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
def to_hash
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
91
|
+
OrHash = T.type_alias do
|
|
92
|
+
T.any(
|
|
93
|
+
OpenAI::Webhooks::AgentEnvironmentSuspendedWebhookEvent::Data,
|
|
94
|
+
OpenAI::Internal::AnyHash
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# The ID of the environment.
|
|
99
|
+
sig { returns(String) }
|
|
100
|
+
attr_accessor :id
|
|
101
|
+
|
|
102
|
+
# Identifies the environment whose lifecycle changed.
|
|
103
|
+
sig do
|
|
104
|
+
params(
|
|
105
|
+
|
|
106
|
+
id: String
|
|
107
|
+
)
|
|
108
|
+
.returns(T.attached_class)
|
|
109
|
+
end
|
|
110
|
+
def self.new(
|
|
111
|
+
|
|
112
|
+
# The ID of the environment.
|
|
113
|
+
|
|
114
|
+
id:
|
|
115
|
+
)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
sig do
|
|
119
|
+
override.returns(
|
|
120
|
+
{id: String}
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
def to_hash
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
end
|
|
133
|
+
end
|
|
@@ -5,13 +5,16 @@ module OpenAI
|
|
|
5
5
|
|
|
6
6
|
module Webhooks
|
|
7
7
|
|
|
8
|
-
# Sent when an agent
|
|
9
|
-
# details.
|
|
8
|
+
# Sent when an agent environment expires and can no longer resume from a snapshot.
|
|
10
9
|
module UnwrapWebhookEvent
|
|
11
10
|
extend OpenAI::Internal::Type::Union
|
|
12
11
|
|
|
13
12
|
Variants = T.type_alias do
|
|
14
13
|
T.any(
|
|
14
|
+
OpenAI::Webhooks::AgentEnvironmentExpiredWebhookEvent,
|
|
15
|
+
OpenAI::Webhooks::AgentEnvironmentSuspendedWebhookEvent,
|
|
16
|
+
OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent,
|
|
17
|
+
OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent,
|
|
15
18
|
OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent,
|
|
16
19
|
OpenAI::Webhooks::AgentSessionCreatedWebhookEvent,
|
|
17
20
|
OpenAI::Webhooks::AgentSessionFailedWebhookEvent,
|
|
@@ -121,6 +121,22 @@ 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_ENVIRONMENT_READY = T.let(
|
|
125
|
+
:"agent.environment.ready",
|
|
126
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
127
|
+
)
|
|
128
|
+
AGENT_ENVIRONMENT_FAILED = T.let(
|
|
129
|
+
:"agent.environment.failed",
|
|
130
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
131
|
+
)
|
|
132
|
+
AGENT_ENVIRONMENT_SUSPENDED = T.let(
|
|
133
|
+
:"agent.environment.suspended",
|
|
134
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
135
|
+
)
|
|
136
|
+
AGENT_ENVIRONMENT_EXPIRED = T.let(
|
|
137
|
+
:"agent.environment.expired",
|
|
138
|
+
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
139
|
+
)
|
|
124
140
|
AGENT_SESSION_CREATED = T.let(
|
|
125
141
|
:"agent.session.created",
|
|
126
142
|
OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
|
|
@@ -106,6 +106,22 @@ 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_ENVIRONMENT_READY = T.let(
|
|
110
|
+
:"agent.environment.ready",
|
|
111
|
+
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
112
|
+
)
|
|
113
|
+
AGENT_ENVIRONMENT_FAILED = T.let(
|
|
114
|
+
:"agent.environment.failed",
|
|
115
|
+
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
116
|
+
)
|
|
117
|
+
AGENT_ENVIRONMENT_SUSPENDED = T.let(
|
|
118
|
+
:"agent.environment.suspended",
|
|
119
|
+
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
120
|
+
)
|
|
121
|
+
AGENT_ENVIRONMENT_EXPIRED = T.let(
|
|
122
|
+
:"agent.environment.expired",
|
|
123
|
+
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
124
|
+
)
|
|
109
125
|
AGENT_SESSION_CREATED = T.let(
|
|
110
126
|
:"agent.session.created",
|
|
111
127
|
OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
|
|
@@ -138,6 +138,22 @@ 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_ENVIRONMENT_READY = T.let(
|
|
142
|
+
:"agent.environment.ready",
|
|
143
|
+
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
144
|
+
)
|
|
145
|
+
AGENT_ENVIRONMENT_FAILED = T.let(
|
|
146
|
+
:"agent.environment.failed",
|
|
147
|
+
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
148
|
+
)
|
|
149
|
+
AGENT_ENVIRONMENT_SUSPENDED = T.let(
|
|
150
|
+
:"agent.environment.suspended",
|
|
151
|
+
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
152
|
+
)
|
|
153
|
+
AGENT_ENVIRONMENT_EXPIRED = T.let(
|
|
154
|
+
:"agent.environment.expired",
|
|
155
|
+
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
156
|
+
)
|
|
141
157
|
AGENT_SESSION_CREATED = T.let(
|
|
142
158
|
:"agent.session.created",
|
|
143
159
|
OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
|
|
@@ -15,6 +15,34 @@ module OpenAI
|
|
|
15
15
|
sig { returns(OpenAI::Resources::Beta::Agents::Environments::Templates) }
|
|
16
16
|
attr_reader :templates
|
|
17
17
|
|
|
18
|
+
# Creates an OpenAI-hosted environment before creating a session. Requires access
|
|
19
|
+
# to the prewarming beta.
|
|
20
|
+
sig {
|
|
21
|
+
params(
|
|
22
|
+
environment: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::OrHash,
|
|
23
|
+
vault_ids: T.nilable(T::Array[String]),
|
|
24
|
+
idempotency_key: String,
|
|
25
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
26
|
+
)
|
|
27
|
+
.returns(OpenAI::Beta::Agents::EnvironmentInfo)
|
|
28
|
+
}
|
|
29
|
+
def create(
|
|
30
|
+
# Body param: The required hosting type and its configuration.
|
|
31
|
+
environment:,
|
|
32
|
+
# Body param: The IDs of up to 10 vaults made available to an OpenAI-hosted
|
|
33
|
+
# environment.
|
|
34
|
+
vault_ids: nil,
|
|
35
|
+
# Header param: Deduplicates creation for 24 hours within the authenticated
|
|
36
|
+
# organization, project, and creator. Retry the same JSON parameters with the same
|
|
37
|
+
# key to retrieve the original environment in its current state. Different
|
|
38
|
+
# parameters or an incomplete hosted creation return 409. Deleted environments are
|
|
39
|
+
# not recreated. After retention expires, the key may create a new environment.
|
|
40
|
+
# Without this header, each request creates a new environment.
|
|
41
|
+
idempotency_key: nil,
|
|
42
|
+
request_options: {}
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
18
46
|
# Retrieves an execution environment's connection status and safe installed
|
|
19
47
|
# metadata. See
|
|
20
48
|
# [environment lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle).
|
|
@@ -30,6 +58,31 @@ module OpenAI
|
|
|
30
58
|
)
|
|
31
59
|
end
|
|
32
60
|
|
|
61
|
+
# Lists OpenAI-hosted environments owned by the authenticated principal. Requires
|
|
62
|
+
# access to the prewarming beta.
|
|
63
|
+
sig {
|
|
64
|
+
params(
|
|
65
|
+
after: String,
|
|
66
|
+
limit: Integer,
|
|
67
|
+
order: OpenAI::Beta::Agents::EnvironmentListParams::Order::OrSymbol,
|
|
68
|
+
type: OpenAI::Beta::Agents::EnvironmentListParams::Type::OrSymbol,
|
|
69
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
70
|
+
)
|
|
71
|
+
.returns(OpenAI::Internal::CursorPage[OpenAI::Beta::Agents::EnvironmentInfo])
|
|
72
|
+
}
|
|
73
|
+
def list(
|
|
74
|
+
# Return environments after this environment ID in the selected order.
|
|
75
|
+
after: nil,
|
|
76
|
+
# The maximum number of environments to return, between 1 and 100. Defaults to 20.
|
|
77
|
+
limit: nil,
|
|
78
|
+
# The order in which environments are returned. Defaults to `desc`.
|
|
79
|
+
order: nil,
|
|
80
|
+
# The hosting type to list. Defaults to `openai_hosted`.
|
|
81
|
+
type: nil,
|
|
82
|
+
request_options: {}
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
|
|
33
86
|
# @api private
|
|
34
87
|
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
35
88
|
def self.new(client:)
|
|
@@ -140,6 +140,10 @@ module OpenAI
|
|
|
140
140
|
)
|
|
141
141
|
.returns(
|
|
142
142
|
T.any(
|
|
143
|
+
OpenAI::Webhooks::AgentEnvironmentExpiredWebhookEvent,
|
|
144
|
+
OpenAI::Webhooks::AgentEnvironmentSuspendedWebhookEvent,
|
|
145
|
+
OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent,
|
|
146
|
+
OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent,
|
|
143
147
|
OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent,
|
|
144
148
|
OpenAI::Webhooks::AgentSessionCreatedWebhookEvent,
|
|
145
149
|
OpenAI::Webhooks::AgentSessionFailedWebhookEvent,
|