openai 0.120.0 → 0.121.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 +13 -0
- data/README.md +1 -1
- data/lib/openai/models/beta/agents/automation.rb +27 -0
- data/lib/openai/models/beta/agents/automation_agent_config.rb +142 -0
- data/lib/openai/models/beta/agents/automation_create_params.rb +27 -0
- data/lib/openai/models/beta/agents/automation_created_by.rb +65 -0
- data/lib/openai/models/beta/agents/automation_delete_params.rb +24 -0
- data/lib/openai/models/beta/agents/automation_deleted.rb +40 -0
- data/lib/openai/models/beta/agents/automation_environment.rb +484 -0
- data/lib/openai/models/beta/agents/automation_list_params.rb +68 -0
- data/lib/openai/models/beta/agents/automation_pause_params.rb +24 -0
- data/lib/openai/models/beta/agents/automation_resume_params.rb +24 -0
- data/lib/openai/models/beta/agents/automation_retrieve_params.rb +24 -0
- data/lib/openai/models/beta/agents/automation_schedule_param.rb +124 -0
- data/lib/openai/models/beta/agents/automation_target.rb +153 -0
- data/lib/openai/models/beta/agents/automation_target_param.rb +312 -0
- data/lib/openai/models/beta/agents/automation_update_params.rb +79 -0
- data/lib/openai/models/beta/agents/automations/automation_invocation.rb +148 -0
- data/lib/openai/models/beta/agents/automations/automation_invocation_source.rb +59 -0
- data/lib/openai/models/beta/agents/automations/invocation_create_params.rb +26 -0
- data/lib/openai/models/beta/agents/automations/invocation_list_params.rb +68 -0
- data/lib/openai/models/beta/agents/automations/invocation_retrieve_params.rb +32 -0
- data/lib/openai/models/beta/agents/environments/file_create_params.rb +11 -1
- data/lib/openai/models/beta/agents/one_time_automation.rb +118 -0
- data/lib/openai/models/beta/agents/periodic_automation.rb +126 -0
- data/lib/openai/models/beta/beta_responses_client_event.rb +3 -0
- data/lib/openai/models/beta/response_compact_params.rb +3 -0
- data/lib/openai/models/beta/response_create_params.rb +3 -0
- data/lib/openai/resources/beta/agents/automations/invocations.rb +103 -0
- data/lib/openai/resources/beta/agents/automations.rb +211 -0
- data/lib/openai/resources/beta/agents.rb +4 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +24 -0
- data/rbi/openai/models/beta/agents/automation.rbi +32 -0
- data/rbi/openai/models/beta/agents/automation_agent_config.rbi +255 -0
- data/rbi/openai/models/beta/agents/automation_create_params.rbi +75 -0
- data/rbi/openai/models/beta/agents/automation_created_by.rbi +124 -0
- data/rbi/openai/models/beta/agents/automation_delete_params.rbi +57 -0
- data/rbi/openai/models/beta/agents/automation_deleted.rbi +71 -0
- data/rbi/openai/models/beta/agents/automation_environment.rbi +795 -0
- data/rbi/openai/models/beta/agents/automation_list_params.rbi +122 -0
- data/rbi/openai/models/beta/agents/automation_pause_params.rbi +57 -0
- data/rbi/openai/models/beta/agents/automation_resume_params.rbi +57 -0
- data/rbi/openai/models/beta/agents/automation_retrieve_params.rbi +57 -0
- data/rbi/openai/models/beta/agents/automation_schedule_param.rbi +228 -0
- data/rbi/openai/models/beta/agents/automation_target.rbi +250 -0
- data/rbi/openai/models/beta/agents/automation_target_param.rbi +564 -0
- data/rbi/openai/models/beta/agents/automation_update_params.rbi +161 -0
- data/rbi/openai/models/beta/agents/automations/automation_invocation.rbi +233 -0
- data/rbi/openai/models/beta/agents/automations/automation_invocation_source.rbi +123 -0
- data/rbi/openai/models/beta/agents/automations/invocation_create_params.rbi +61 -0
- data/rbi/openai/models/beta/agents/automations/invocation_list_params.rbi +125 -0
- data/rbi/openai/models/beta/agents/automations/invocation_retrieve_params.rbi +68 -0
- data/rbi/openai/models/beta/agents/environments/file_create_params.rbi +27 -1
- data/rbi/openai/models/beta/agents/one_time_automation.rbi +168 -0
- data/rbi/openai/models/beta/agents/periodic_automation.rbi +177 -0
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +4 -0
- data/rbi/openai/models/beta/response_compact_params.rbi +1 -0
- data/rbi/openai/models/beta/response_create_params.rbi +1 -0
- data/rbi/openai/resources/beta/agents/automations/invocations.rbi +67 -0
- data/rbi/openai/resources/beta/agents/automations.rbi +141 -0
- data/rbi/openai/resources/beta/agents.rbi +3 -0
- data/sig/openai/models/beta/agent_session_turn_reasoning_summary_part_done_event.rbs +1 -4
- data/sig/openai/models/beta/agents/automation.rbs +17 -0
- data/sig/openai/models/beta/agents/automation_agent_config.rbs +143 -0
- data/sig/openai/models/beta/agents/automation_create_params.rbs +33 -0
- data/sig/openai/models/beta/agents/automation_created_by.rbs +62 -0
- data/sig/openai/models/beta/agents/automation_delete_params.rbs +27 -0
- data/sig/openai/models/beta/agents/automation_deleted.rbs +39 -0
- data/sig/openai/models/beta/agents/automation_environment.rbs +428 -0
- data/sig/openai/models/beta/agents/automation_list_params.rbs +85 -0
- data/sig/openai/models/beta/agents/automation_pause_params.rbs +27 -0
- data/sig/openai/models/beta/agents/automation_resume_params.rbs +27 -0
- data/sig/openai/models/beta/agents/automation_retrieve_params.rbs +27 -0
- data/sig/openai/models/beta/agents/automation_schedule_param.rbs +127 -0
- data/sig/openai/models/beta/agents/automation_target.rbs +157 -0
- data/sig/openai/models/beta/agents/automation_target_param.rbs +299 -0
- data/sig/openai/models/beta/agents/automation_update_params.rbs +97 -0
- data/sig/openai/models/beta/agents/automations/automation_invocation.rbs +134 -0
- data/sig/openai/models/beta/agents/automations/automation_invocation_source.rbs +62 -0
- data/sig/openai/models/beta/agents/automations/invocation_create_params.rbs +29 -0
- data/sig/openai/models/beta/agents/automations/invocation_list_params.rbs +81 -0
- data/sig/openai/models/beta/agents/automations/invocation_retrieve_params.rbs +37 -0
- data/sig/openai/models/beta/agents/environments/file_create_params.rbs +12 -1
- data/sig/openai/models/beta/agents/one_time_automation.rbs +111 -0
- data/sig/openai/models/beta/agents/periodic_automation.rbs +118 -0
- data/sig/openai/models/beta/beta_responses_client_event.rbs +2 -0
- data/sig/openai/models/beta/response_compact_params.rbs +2 -0
- data/sig/openai/models/beta/response_create_params.rbs +2 -0
- data/sig/openai/resources/beta/agents/automations/invocations.rbs +32 -0
- data/sig/openai/resources/beta/agents/automations.rbs +57 -0
- data/sig/openai/resources/beta/agents.rbs +2 -0
- metadata +73 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class Beta
|
|
6
|
+
class Agents
|
|
7
|
+
class Automations
|
|
8
|
+
class Invocations
|
|
9
|
+
# Queues a manual delivery without changing the saved schedule.
|
|
10
|
+
#
|
|
11
|
+
# @overload create(automation_id, request_options: {})
|
|
12
|
+
#
|
|
13
|
+
# @param automation_id [String]
|
|
14
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
15
|
+
#
|
|
16
|
+
# @return [OpenAI::Models::Beta::Agents::Automations::AutomationInvocation]
|
|
17
|
+
#
|
|
18
|
+
# @see OpenAI::Models::Beta::Agents::Automations::InvocationCreateParams
|
|
19
|
+
def create(automation_id, params = {})
|
|
20
|
+
@client.request(
|
|
21
|
+
method: :post,
|
|
22
|
+
path: ["agents/automations/%1$s/invocations", automation_id],
|
|
23
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
24
|
+
model: OpenAI::Beta::Agents::Automations::AutomationInvocation,
|
|
25
|
+
security: {bearer_auth: true},
|
|
26
|
+
options: params[:request_options]
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Retrieves a delivery record for a project-owned automation.
|
|
31
|
+
#
|
|
32
|
+
# @overload retrieve(invocation_id, automation_id:, request_options: {})
|
|
33
|
+
#
|
|
34
|
+
# @param invocation_id [String]
|
|
35
|
+
# @param automation_id [String]
|
|
36
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
37
|
+
#
|
|
38
|
+
# @return [OpenAI::Models::Beta::Agents::Automations::AutomationInvocation]
|
|
39
|
+
#
|
|
40
|
+
# @see OpenAI::Models::Beta::Agents::Automations::InvocationRetrieveParams
|
|
41
|
+
def retrieve(invocation_id, params)
|
|
42
|
+
parsed, options = OpenAI::Beta::Agents::Automations::InvocationRetrieveParams.dump_request(params)
|
|
43
|
+
automation_id = parsed.delete(:automation_id) do
|
|
44
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
@client.request(
|
|
48
|
+
method: :get,
|
|
49
|
+
path: ["agents/automations/%1$s/invocations/%2$s", automation_id, invocation_id],
|
|
50
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
51
|
+
model: OpenAI::Beta::Agents::Automations::AutomationInvocation,
|
|
52
|
+
security: {bearer_auth: true},
|
|
53
|
+
options: options
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Lists delivery records for a project-owned automation.
|
|
58
|
+
#
|
|
59
|
+
# @overload list(automation_id, after: nil, limit: nil, order: nil, request_options: {})
|
|
60
|
+
#
|
|
61
|
+
# @param automation_id [String]
|
|
62
|
+
#
|
|
63
|
+
# @param after [String]
|
|
64
|
+
# Return resources after this resource ID in the selected order.
|
|
65
|
+
#
|
|
66
|
+
# @param limit [Integer]
|
|
67
|
+
# The maximum number of resources to return, between 1 and 100. Defaults to 20.
|
|
68
|
+
#
|
|
69
|
+
# @param order [Symbol, OpenAI::Models::Beta::Agents::Automations::InvocationListParams::Order]
|
|
70
|
+
# The order in which resources are returned. Defaults to `desc`.
|
|
71
|
+
#
|
|
72
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
73
|
+
#
|
|
74
|
+
# @return [OpenAI::Internal::CursorPage<OpenAI::Models::Beta::Agents::Automations::AutomationInvocation>]
|
|
75
|
+
#
|
|
76
|
+
# @see OpenAI::Models::Beta::Agents::Automations::InvocationListParams
|
|
77
|
+
def list(automation_id, params = {})
|
|
78
|
+
parsed, options = OpenAI::Beta::Agents::Automations::InvocationListParams.dump_request(params)
|
|
79
|
+
query = OpenAI::Internal::Util.encode_query_params(parsed)
|
|
80
|
+
@client.request(
|
|
81
|
+
method: :get,
|
|
82
|
+
path: ["agents/automations/%1$s/invocations", automation_id],
|
|
83
|
+
query: query,
|
|
84
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
85
|
+
page: OpenAI::Internal::CursorPage,
|
|
86
|
+
model: OpenAI::Beta::Agents::Automations::AutomationInvocation,
|
|
87
|
+
security: {bearer_auth: true},
|
|
88
|
+
options: options
|
|
89
|
+
)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# @api private
|
|
93
|
+
#
|
|
94
|
+
# @param client [OpenAI::Client]
|
|
95
|
+
def initialize(client:)
|
|
96
|
+
@client = client
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class Beta
|
|
6
|
+
class Agents
|
|
7
|
+
class Automations
|
|
8
|
+
# @return [OpenAI::Resources::Beta::Agents::Automations::Invocations]
|
|
9
|
+
attr_reader :invocations
|
|
10
|
+
|
|
11
|
+
# Saves an active automation without invoking it immediately.
|
|
12
|
+
#
|
|
13
|
+
# @overload create(create_automation_params:, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param create_automation_params [OpenAI::Models::Beta::Agents::AutomationScheduleParam::Periodic, OpenAI::Models::Beta::Agents::AutomationScheduleParam::Once]
|
|
16
|
+
# Creates an automation without invoking it immediately.
|
|
17
|
+
#
|
|
18
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
19
|
+
#
|
|
20
|
+
# @return [OpenAI::Models::Beta::Agents::PeriodicAutomation, OpenAI::Models::Beta::Agents::OneTimeAutomation]
|
|
21
|
+
#
|
|
22
|
+
# @see OpenAI::Models::Beta::Agents::AutomationCreateParams
|
|
23
|
+
def create(params)
|
|
24
|
+
parsed, options = OpenAI::Beta::Agents::AutomationCreateParams.dump_request(params)
|
|
25
|
+
@client.request(
|
|
26
|
+
method: :post,
|
|
27
|
+
path: "agents/automations",
|
|
28
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
29
|
+
body: parsed[:create_automation_params],
|
|
30
|
+
model: OpenAI::Beta::Agents::Automation,
|
|
31
|
+
security: {bearer_auth: true},
|
|
32
|
+
options: options
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Retrieves a project-owned automation.
|
|
37
|
+
#
|
|
38
|
+
# @overload retrieve(automation_id, request_options: {})
|
|
39
|
+
#
|
|
40
|
+
# @param automation_id [String]
|
|
41
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
42
|
+
#
|
|
43
|
+
# @return [OpenAI::Models::Beta::Agents::PeriodicAutomation, OpenAI::Models::Beta::Agents::OneTimeAutomation]
|
|
44
|
+
#
|
|
45
|
+
# @see OpenAI::Models::Beta::Agents::AutomationRetrieveParams
|
|
46
|
+
def retrieve(automation_id, params = {})
|
|
47
|
+
@client.request(
|
|
48
|
+
method: :get,
|
|
49
|
+
path: ["agents/automations/%1$s", automation_id],
|
|
50
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
51
|
+
model: OpenAI::Beta::Agents::Automation,
|
|
52
|
+
security: {bearer_auth: true},
|
|
53
|
+
options: params[:request_options]
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Updates supplied fields; target and metadata replace the whole field.
|
|
58
|
+
#
|
|
59
|
+
# @overload update(automation_id, expression: nil, metadata: nil, name: nil, run_at: nil, target: nil, timezone: nil, request_options: {})
|
|
60
|
+
#
|
|
61
|
+
# @param automation_id [String]
|
|
62
|
+
#
|
|
63
|
+
# @param expression [String]
|
|
64
|
+
# Only accepted for periodic automations.
|
|
65
|
+
#
|
|
66
|
+
# @param metadata [Hash{Symbol=>String}]
|
|
67
|
+
# Replaces all metadata; omit to leave unchanged.
|
|
68
|
+
#
|
|
69
|
+
# @param name [String]
|
|
70
|
+
#
|
|
71
|
+
# @param run_at [Integer]
|
|
72
|
+
# A future Unix timestamp in seconds; accepted only before a one-time scheduled
|
|
73
|
+
# invocation exists.
|
|
74
|
+
#
|
|
75
|
+
# @param target [OpenAI::Models::Beta::Agents::AutomationTargetParam::NewSession, OpenAI::Models::Beta::Agents::AutomationTargetParam::ExistingSession]
|
|
76
|
+
# Replaces the complete target, retaining its type and any creator session.
|
|
77
|
+
#
|
|
78
|
+
# @param timezone [String]
|
|
79
|
+
# Only accepted for periodic automations.
|
|
80
|
+
#
|
|
81
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
82
|
+
#
|
|
83
|
+
# @return [OpenAI::Models::Beta::Agents::PeriodicAutomation, OpenAI::Models::Beta::Agents::OneTimeAutomation]
|
|
84
|
+
#
|
|
85
|
+
# @see OpenAI::Models::Beta::Agents::AutomationUpdateParams
|
|
86
|
+
def update(automation_id, params = {})
|
|
87
|
+
parsed, options = OpenAI::Beta::Agents::AutomationUpdateParams.dump_request(params)
|
|
88
|
+
@client.request(
|
|
89
|
+
method: :post,
|
|
90
|
+
path: ["agents/automations/%1$s", automation_id],
|
|
91
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
92
|
+
body: parsed,
|
|
93
|
+
model: OpenAI::Beta::Agents::Automation,
|
|
94
|
+
security: {bearer_auth: true},
|
|
95
|
+
options: options
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Lists project-owned automations, optionally filtered by target session.
|
|
100
|
+
#
|
|
101
|
+
# @overload list(after: nil, limit: nil, order: nil, session_id: nil, request_options: {})
|
|
102
|
+
#
|
|
103
|
+
# @param after [String]
|
|
104
|
+
# Return resources after this resource ID in the selected order.
|
|
105
|
+
#
|
|
106
|
+
# @param limit [Integer]
|
|
107
|
+
# The maximum number of resources to return, between 1 and 100. Defaults to 20.
|
|
108
|
+
#
|
|
109
|
+
# @param order [Symbol, OpenAI::Models::Beta::Agents::AutomationListParams::Order]
|
|
110
|
+
# The order in which resources are returned. Defaults to `desc`.
|
|
111
|
+
#
|
|
112
|
+
# @param session_id [String]
|
|
113
|
+
# Matches existing-session targets, including agent-created automations.
|
|
114
|
+
#
|
|
115
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
116
|
+
#
|
|
117
|
+
# @return [OpenAI::Internal::CursorPage<OpenAI::Models::Beta::Agents::PeriodicAutomation, OpenAI::Models::Beta::Agents::OneTimeAutomation>]
|
|
118
|
+
#
|
|
119
|
+
# @see OpenAI::Models::Beta::Agents::AutomationListParams
|
|
120
|
+
def list(params = {})
|
|
121
|
+
parsed, options = OpenAI::Beta::Agents::AutomationListParams.dump_request(params)
|
|
122
|
+
query = OpenAI::Internal::Util.encode_query_params(parsed)
|
|
123
|
+
@client.request(
|
|
124
|
+
method: :get,
|
|
125
|
+
path: "agents/automations",
|
|
126
|
+
query: query,
|
|
127
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
128
|
+
page: OpenAI::Internal::CursorPage,
|
|
129
|
+
model: OpenAI::Beta::Agents::Automation,
|
|
130
|
+
security: {bearer_auth: true},
|
|
131
|
+
options: options
|
|
132
|
+
)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Deletes the automation and prevents future invocations without deleting its
|
|
136
|
+
# target session.
|
|
137
|
+
#
|
|
138
|
+
# @overload delete(automation_id, request_options: {})
|
|
139
|
+
#
|
|
140
|
+
# @param automation_id [String]
|
|
141
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
142
|
+
#
|
|
143
|
+
# @return [OpenAI::Models::Beta::Agents::AutomationDeleted]
|
|
144
|
+
#
|
|
145
|
+
# @see OpenAI::Models::Beta::Agents::AutomationDeleteParams
|
|
146
|
+
def delete(automation_id, params = {})
|
|
147
|
+
@client.request(
|
|
148
|
+
method: :delete,
|
|
149
|
+
path: ["agents/automations/%1$s", automation_id],
|
|
150
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
151
|
+
model: OpenAI::Beta::Agents::AutomationDeleted,
|
|
152
|
+
security: {bearer_auth: true},
|
|
153
|
+
options: params[:request_options]
|
|
154
|
+
)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Pauses future scheduled delivery without stopping an active session.
|
|
158
|
+
#
|
|
159
|
+
# @overload pause(automation_id, request_options: {})
|
|
160
|
+
#
|
|
161
|
+
# @param automation_id [String]
|
|
162
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
163
|
+
#
|
|
164
|
+
# @return [OpenAI::Models::Beta::Agents::PeriodicAutomation, OpenAI::Models::Beta::Agents::OneTimeAutomation]
|
|
165
|
+
#
|
|
166
|
+
# @see OpenAI::Models::Beta::Agents::AutomationPauseParams
|
|
167
|
+
def pause(automation_id, params = {})
|
|
168
|
+
@client.request(
|
|
169
|
+
method: :post,
|
|
170
|
+
path: ["agents/automations/%1$s/pause", automation_id],
|
|
171
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
172
|
+
model: OpenAI::Beta::Agents::Automation,
|
|
173
|
+
security: {bearer_auth: true},
|
|
174
|
+
options: params[:request_options]
|
|
175
|
+
)
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Resumes scheduled delivery; one-time automations without a pending invocation
|
|
179
|
+
# require a future run_at.
|
|
180
|
+
#
|
|
181
|
+
# @overload resume(automation_id, request_options: {})
|
|
182
|
+
#
|
|
183
|
+
# @param automation_id [String]
|
|
184
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
185
|
+
#
|
|
186
|
+
# @return [OpenAI::Models::Beta::Agents::PeriodicAutomation, OpenAI::Models::Beta::Agents::OneTimeAutomation]
|
|
187
|
+
#
|
|
188
|
+
# @see OpenAI::Models::Beta::Agents::AutomationResumeParams
|
|
189
|
+
def resume(automation_id, params = {})
|
|
190
|
+
@client.request(
|
|
191
|
+
method: :post,
|
|
192
|
+
path: ["agents/automations/%1$s/resume", automation_id],
|
|
193
|
+
headers: {"openai-beta" => "agents=v1"},
|
|
194
|
+
model: OpenAI::Beta::Agents::Automation,
|
|
195
|
+
security: {bearer_auth: true},
|
|
196
|
+
options: params[:request_options]
|
|
197
|
+
)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# @api private
|
|
201
|
+
#
|
|
202
|
+
# @param client [OpenAI::Client]
|
|
203
|
+
def initialize(client:)
|
|
204
|
+
@client = client
|
|
205
|
+
@invocations = OpenAI::Resources::Beta::Agents::Automations::Invocations.new(client: client)
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
end
|
|
@@ -4,6 +4,9 @@ module OpenAI
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Beta
|
|
6
6
|
class Agents
|
|
7
|
+
# @return [OpenAI::Resources::Beta::Agents::Automations]
|
|
8
|
+
attr_reader :automations
|
|
9
|
+
|
|
7
10
|
# @return [OpenAI::Resources::Beta::Agents::Environments]
|
|
8
11
|
attr_reader :environments
|
|
9
12
|
|
|
@@ -228,6 +231,7 @@ module OpenAI
|
|
|
228
231
|
# @param client [OpenAI::Client]
|
|
229
232
|
def initialize(client:)
|
|
230
233
|
@client = client
|
|
234
|
+
@automations = OpenAI::Resources::Beta::Agents::Automations.new(client: client)
|
|
231
235
|
@environments = OpenAI::Resources::Beta::Agents::Environments.new(client: client)
|
|
232
236
|
@vaults = OpenAI::Resources::Beta::Agents::Vaults.new(client: client)
|
|
233
237
|
@sessions = OpenAI::Resources::Beta::Agents::Sessions.new(client: client)
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
|
@@ -165,6 +165,7 @@ require_relative "openai/models/graders/score_model_grader"
|
|
|
165
165
|
require_relative "openai/models/graders/python_grader"
|
|
166
166
|
require_relative "openai/models/graders/text_similarity_grader"
|
|
167
167
|
require_relative "openai/models/fine_tuning/fine_tuning_job_wandb_integration_object"
|
|
168
|
+
require_relative "openai/models/beta/agents/automation_schedule_param"
|
|
168
169
|
require_relative "openai/models/realtime/realtime_session_create_request"
|
|
169
170
|
require_relative "openai/models/realtime/realtime_translation_client_secret_create_request"
|
|
170
171
|
require_relative "openai/models/responses/response_custom_tool_call"
|
|
@@ -535,6 +536,25 @@ require_relative "openai/models/beta/agent_reasoning_item"
|
|
|
535
536
|
require_relative "openai/models/beta/agent_reasoning_param"
|
|
536
537
|
require_relative "openai/models/beta/agent_resume_subagent_call_item"
|
|
537
538
|
require_relative "openai/models/beta/agent_retrieve_params"
|
|
539
|
+
require_relative "openai/models/beta/agents/automation"
|
|
540
|
+
require_relative "openai/models/beta/agents/automation_agent_config"
|
|
541
|
+
require_relative "openai/models/beta/agents/automation_created_by"
|
|
542
|
+
require_relative "openai/models/beta/agents/automation_create_params"
|
|
543
|
+
require_relative "openai/models/beta/agents/automation_deleted"
|
|
544
|
+
require_relative "openai/models/beta/agents/automation_delete_params"
|
|
545
|
+
require_relative "openai/models/beta/agents/automation_environment"
|
|
546
|
+
require_relative "openai/models/beta/agents/automation_list_params"
|
|
547
|
+
require_relative "openai/models/beta/agents/automation_pause_params"
|
|
548
|
+
require_relative "openai/models/beta/agents/automation_resume_params"
|
|
549
|
+
require_relative "openai/models/beta/agents/automation_retrieve_params"
|
|
550
|
+
require_relative "openai/models/beta/agents/automations/automation_invocation"
|
|
551
|
+
require_relative "openai/models/beta/agents/automations/automation_invocation_source"
|
|
552
|
+
require_relative "openai/models/beta/agents/automations/invocation_create_params"
|
|
553
|
+
require_relative "openai/models/beta/agents/automations/invocation_list_params"
|
|
554
|
+
require_relative "openai/models/beta/agents/automations/invocation_retrieve_params"
|
|
555
|
+
require_relative "openai/models/beta/agents/automation_target"
|
|
556
|
+
require_relative "openai/models/beta/agents/automation_target_param"
|
|
557
|
+
require_relative "openai/models/beta/agents/automation_update_params"
|
|
538
558
|
require_relative "openai/models/beta/agents/environment_create_params"
|
|
539
559
|
require_relative "openai/models/beta/agents/environment_info"
|
|
540
560
|
require_relative "openai/models/beta/agents/environment_list_params"
|
|
@@ -549,6 +569,8 @@ require_relative "openai/models/beta/agents/environments/template_delete_params"
|
|
|
549
569
|
require_relative "openai/models/beta/agents/environments/template_list_params"
|
|
550
570
|
require_relative "openai/models/beta/agents/environments/template_retrieve_params"
|
|
551
571
|
require_relative "openai/models/beta/agents/environments/template_update_params"
|
|
572
|
+
require_relative "openai/models/beta/agents/one_time_automation"
|
|
573
|
+
require_relative "openai/models/beta/agents/periodic_automation"
|
|
552
574
|
require_relative "openai/models/beta/agents/session_create_params"
|
|
553
575
|
require_relative "openai/models/beta/agents/session_delete_params"
|
|
554
576
|
require_relative "openai/models/beta/agents/session_list_params"
|
|
@@ -1618,6 +1640,8 @@ require_relative "openai/resources/audio/voices"
|
|
|
1618
1640
|
require_relative "openai/resources/batches"
|
|
1619
1641
|
require_relative "openai/resources/beta"
|
|
1620
1642
|
require_relative "openai/resources/beta/agents"
|
|
1643
|
+
require_relative "openai/resources/beta/agents/automations"
|
|
1644
|
+
require_relative "openai/resources/beta/agents/automations/invocations"
|
|
1621
1645
|
require_relative "openai/resources/beta/agents/environments"
|
|
1622
1646
|
require_relative "openai/helpers/beta/agents/files"
|
|
1623
1647
|
require_relative "openai/resources/beta/agents/environments/files"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Beta
|
|
7
|
+
|
|
8
|
+
module Agents
|
|
9
|
+
|
|
10
|
+
# A saved automation and its schedule.
|
|
11
|
+
module Automation
|
|
12
|
+
extend OpenAI::Internal::Type::Union
|
|
13
|
+
|
|
14
|
+
Variants = T.type_alias do
|
|
15
|
+
T.any(
|
|
16
|
+
OpenAI::Beta::Agents::PeriodicAutomation,
|
|
17
|
+
OpenAI::Beta::Agents::OneTimeAutomation
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
sig { override.returns(T::Array[OpenAI::Beta::Agents::Automation::Variants]) }
|
|
22
|
+
def self.variants
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Beta
|
|
7
|
+
|
|
8
|
+
module Agents
|
|
9
|
+
|
|
10
|
+
class AutomationAgentConfig < OpenAI::Internal::Type::BaseModel
|
|
11
|
+
|
|
12
|
+
OrHash = T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
OpenAI::Beta::Agents::AutomationAgentConfig,
|
|
15
|
+
OpenAI::Internal::AnyHash
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Custom instructions, or null when absent.
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_accessor :instructions
|
|
22
|
+
|
|
23
|
+
# The requested model name.
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
attr_accessor :model
|
|
26
|
+
|
|
27
|
+
# The configuration for creating and coordinating subagents.
|
|
28
|
+
sig { returns(OpenAI::Beta::MultiAgentConfig) }
|
|
29
|
+
attr_reader :multi_agent
|
|
30
|
+
|
|
31
|
+
sig { params(multi_agent: OpenAI::Beta::MultiAgentConfig::OrHash).void }
|
|
32
|
+
attr_writer :multi_agent
|
|
33
|
+
|
|
34
|
+
# The configured reasoning policy.
|
|
35
|
+
sig { returns(OpenAI::Beta::AgentReasoning) }
|
|
36
|
+
attr_reader :reasoning
|
|
37
|
+
|
|
38
|
+
sig { params(reasoning: OpenAI::Beta::AgentReasoning::OrHash).void }
|
|
39
|
+
attr_writer :reasoning
|
|
40
|
+
|
|
41
|
+
# The configured service-tier policy.
|
|
42
|
+
sig { returns(OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::TaggedSymbol) }
|
|
43
|
+
attr_accessor :service_tier
|
|
44
|
+
|
|
45
|
+
# The configured output format and verbosity.
|
|
46
|
+
sig { returns(OpenAI::Beta::AgentText) }
|
|
47
|
+
attr_reader :text
|
|
48
|
+
|
|
49
|
+
sig { params(text: OpenAI::Beta::AgentText::OrHash).void }
|
|
50
|
+
attr_writer :text
|
|
51
|
+
|
|
52
|
+
# Configured tools, excluding confidential credentials.
|
|
53
|
+
sig { returns(T::Array[OpenAI::Beta::AgentTool::Variants]) }
|
|
54
|
+
attr_accessor :tools
|
|
55
|
+
|
|
56
|
+
# The effective context compaction settings.
|
|
57
|
+
sig { returns(T.nilable(OpenAI::Beta::Agents::AutomationAgentConfig::Compaction)) }
|
|
58
|
+
attr_reader :compaction
|
|
59
|
+
|
|
60
|
+
sig { params(compaction: OpenAI::Beta::Agents::AutomationAgentConfig::Compaction::OrHash).void }
|
|
61
|
+
attr_writer :compaction
|
|
62
|
+
|
|
63
|
+
# The effective experimental settings for the agent.
|
|
64
|
+
sig { returns(T.nilable(OpenAI::Beta::Agents::AutomationAgentConfig::Experimental)) }
|
|
65
|
+
attr_reader :experimental
|
|
66
|
+
|
|
67
|
+
sig { params(experimental: OpenAI::Beta::Agents::AutomationAgentConfig::Experimental::OrHash).void }
|
|
68
|
+
attr_writer :experimental
|
|
69
|
+
|
|
70
|
+
# Inline agent configuration without a generated session-local identity.
|
|
71
|
+
sig do
|
|
72
|
+
params(
|
|
73
|
+
|
|
74
|
+
instructions: T.nilable(String),
|
|
75
|
+
|
|
76
|
+
model: String,
|
|
77
|
+
|
|
78
|
+
multi_agent: OpenAI::Beta::MultiAgentConfig::OrHash,
|
|
79
|
+
|
|
80
|
+
reasoning: OpenAI::Beta::AgentReasoning::OrHash,
|
|
81
|
+
|
|
82
|
+
service_tier: OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::OrSymbol,
|
|
83
|
+
|
|
84
|
+
text: OpenAI::Beta::AgentText::OrHash,
|
|
85
|
+
|
|
86
|
+
tools: T::Array[
|
|
87
|
+
T.any(
|
|
88
|
+
OpenAI::Beta::AgentTool::Function::OrHash,
|
|
89
|
+
OpenAI::Beta::AgentTool::ProgrammaticToolCalling::OrHash,
|
|
90
|
+
OpenAI::Beta::AgentTool::Mcp::OrHash,
|
|
91
|
+
OpenAI::Beta::AgentTool::WebSearch::OrHash,
|
|
92
|
+
OpenAI::Beta::AgentTool::ComputerUse::OrHash,
|
|
93
|
+
OpenAI::Beta::AgentTool::Automations::OrHash
|
|
94
|
+
)
|
|
95
|
+
],
|
|
96
|
+
|
|
97
|
+
compaction: OpenAI::Beta::Agents::AutomationAgentConfig::Compaction::OrHash,
|
|
98
|
+
|
|
99
|
+
experimental: OpenAI::Beta::Agents::AutomationAgentConfig::Experimental::OrHash
|
|
100
|
+
)
|
|
101
|
+
.returns(T.attached_class)
|
|
102
|
+
end
|
|
103
|
+
def self.new(
|
|
104
|
+
|
|
105
|
+
# Custom instructions, or null when absent.
|
|
106
|
+
instructions:,
|
|
107
|
+
|
|
108
|
+
# The requested model name.
|
|
109
|
+
model:,
|
|
110
|
+
|
|
111
|
+
# The configuration for creating and coordinating subagents.
|
|
112
|
+
multi_agent:,
|
|
113
|
+
|
|
114
|
+
# The configured reasoning policy.
|
|
115
|
+
reasoning:,
|
|
116
|
+
|
|
117
|
+
# The configured service-tier policy.
|
|
118
|
+
service_tier:,
|
|
119
|
+
|
|
120
|
+
# The configured output format and verbosity.
|
|
121
|
+
text:,
|
|
122
|
+
|
|
123
|
+
# Configured tools, excluding confidential credentials.
|
|
124
|
+
tools:,
|
|
125
|
+
|
|
126
|
+
# The effective context compaction settings.
|
|
127
|
+
compaction: nil,
|
|
128
|
+
|
|
129
|
+
# The effective experimental settings for the agent.
|
|
130
|
+
|
|
131
|
+
experimental: nil
|
|
132
|
+
)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
sig do
|
|
136
|
+
override.returns(
|
|
137
|
+
{
|
|
138
|
+
instructions: T.nilable(String),
|
|
139
|
+
model: String,
|
|
140
|
+
multi_agent: OpenAI::Beta::MultiAgentConfig,
|
|
141
|
+
reasoning: OpenAI::Beta::AgentReasoning,
|
|
142
|
+
service_tier: OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::TaggedSymbol,
|
|
143
|
+
text: OpenAI::Beta::AgentText,
|
|
144
|
+
tools: T::Array[OpenAI::Beta::AgentTool::Variants],
|
|
145
|
+
compaction: OpenAI::Beta::Agents::AutomationAgentConfig::Compaction,
|
|
146
|
+
experimental: OpenAI::Beta::Agents::AutomationAgentConfig::Experimental
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
end
|
|
150
|
+
def to_hash
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# The configured service-tier policy.
|
|
154
|
+
module ServiceTier
|
|
155
|
+
extend OpenAI::Internal::Type::Enum
|
|
156
|
+
|
|
157
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier) }
|
|
158
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
159
|
+
|
|
160
|
+
AUTO = T.let(:auto, OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::TaggedSymbol)
|
|
161
|
+
DEFAULT = T.let(:default, OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::TaggedSymbol)
|
|
162
|
+
FLEX = T.let(:flex, OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::TaggedSymbol)
|
|
163
|
+
PRIORITY = T.let(:priority, OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::TaggedSymbol)
|
|
164
|
+
FAST = T.let(:fast, OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::TaggedSymbol)
|
|
165
|
+
ULTRAFAST = T.let(:ultrafast, OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::TaggedSymbol)
|
|
166
|
+
|
|
167
|
+
sig { override.returns(T::Array[OpenAI::Beta::Agents::AutomationAgentConfig::ServiceTier::TaggedSymbol]) }
|
|
168
|
+
def self.values
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
class Compaction < OpenAI::Internal::Type::BaseModel
|
|
173
|
+
OrHash = T.type_alias do
|
|
174
|
+
T.any(
|
|
175
|
+
OpenAI::Beta::Agents::AutomationAgentConfig::Compaction,
|
|
176
|
+
OpenAI::Internal::AnyHash
|
|
177
|
+
)
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Whether context is compacted in the background. Defaults to true.
|
|
181
|
+
sig { returns(T::Boolean) }
|
|
182
|
+
attr_accessor :async
|
|
183
|
+
|
|
184
|
+
# The effective context compaction settings.
|
|
185
|
+
sig do
|
|
186
|
+
params(
|
|
187
|
+
|
|
188
|
+
async: T::Boolean
|
|
189
|
+
)
|
|
190
|
+
.returns(T.attached_class)
|
|
191
|
+
end
|
|
192
|
+
def self.new(
|
|
193
|
+
|
|
194
|
+
# Whether context is compacted in the background. Defaults to true.
|
|
195
|
+
|
|
196
|
+
async:
|
|
197
|
+
)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
sig do
|
|
201
|
+
override.returns(
|
|
202
|
+
{async: T::Boolean}
|
|
203
|
+
)
|
|
204
|
+
end
|
|
205
|
+
def to_hash
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
class Experimental < OpenAI::Internal::Type::BaseModel
|
|
211
|
+
OrHash = T.type_alias do
|
|
212
|
+
T.any(
|
|
213
|
+
OpenAI::Beta::Agents::AutomationAgentConfig::Experimental,
|
|
214
|
+
OpenAI::Internal::AnyHash
|
|
215
|
+
)
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Whether the model receives periodic current-time reminders.
|
|
219
|
+
sig { returns(T::Boolean) }
|
|
220
|
+
attr_accessor :time_awareness
|
|
221
|
+
|
|
222
|
+
# The effective experimental settings for the agent.
|
|
223
|
+
sig do
|
|
224
|
+
params(
|
|
225
|
+
|
|
226
|
+
time_awareness: T::Boolean
|
|
227
|
+
)
|
|
228
|
+
.returns(T.attached_class)
|
|
229
|
+
end
|
|
230
|
+
def self.new(
|
|
231
|
+
|
|
232
|
+
# Whether the model receives periodic current-time reminders.
|
|
233
|
+
|
|
234
|
+
time_awareness:
|
|
235
|
+
)
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
sig do
|
|
239
|
+
override.returns(
|
|
240
|
+
{time_awareness: T::Boolean}
|
|
241
|
+
)
|
|
242
|
+
end
|
|
243
|
+
def to_hash
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
end
|
|
255
|
+
end
|