openai 0.120.0 → 0.122.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 +20 -0
- data/README.md +1 -1
- data/lib/openai/models/beta/agent_tool.rb +10 -1
- data/lib/openai/models/beta/agent_tool_param.rb +12 -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/persisted_agent_tool.rb +10 -1
- data/lib/openai/models/beta/persisted_agent_tool_param.rb +12 -1
- 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/agent_tool.rbi +14 -1
- data/rbi/openai/models/beta/agent_tool_param.rbi +15 -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/persisted_agent_tool.rbi +14 -1
- data/rbi/openai/models/beta/persisted_agent_tool_param.rbi +15 -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/agent_tool.rbs +13 -2
- data/sig/openai/models/beta/agent_tool_param.rbs +14 -0
- 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/persisted_agent_tool.rbs +13 -2
- data/sig/openai/models/beta/persisted_agent_tool_param.rbs +14 -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
|
@@ -411,6 +411,8 @@ module OpenAI
|
|
|
411
411
|
|
|
412
412
|
variant const: -> { OpenAI::Models::Beta::ResponseCompactParams::Model::GPT_ROSALIND_RESEARCH }
|
|
413
413
|
|
|
414
|
+
variant const: -> { OpenAI::Models::Beta::ResponseCompactParams::Model::GPT_6_ROSALIND }
|
|
415
|
+
|
|
414
416
|
variant String
|
|
415
417
|
|
|
416
418
|
# @!method self.variants
|
|
@@ -792,6 +794,7 @@ module OpenAI
|
|
|
792
794
|
GPT_5_6_CYBER = :"gpt-5.6-cyber"
|
|
793
795
|
GPT_6_CYBER = :"gpt-6-cyber"
|
|
794
796
|
GPT_ROSALIND_RESEARCH = :"gpt-rosalind-research"
|
|
797
|
+
GPT_6_ROSALIND = :"gpt-6-rosalind"
|
|
795
798
|
|
|
796
799
|
# @!endgroup
|
|
797
800
|
end
|
|
@@ -1030,6 +1030,8 @@ module OpenAI
|
|
|
1030
1030
|
|
|
1031
1031
|
variant const: -> { OpenAI::Models::Beta::ResponseCreateParams::Model::GPT_ROSALIND_RESEARCH }
|
|
1032
1032
|
|
|
1033
|
+
variant const: -> { OpenAI::Models::Beta::ResponseCreateParams::Model::GPT_6_ROSALIND }
|
|
1034
|
+
|
|
1033
1035
|
variant String
|
|
1034
1036
|
|
|
1035
1037
|
# @!method self.variants
|
|
@@ -1411,6 +1413,7 @@ module OpenAI
|
|
|
1411
1413
|
GPT_5_6_CYBER = :"gpt-5.6-cyber"
|
|
1412
1414
|
GPT_6_CYBER = :"gpt-6-cyber"
|
|
1413
1415
|
GPT_ROSALIND_RESEARCH = :"gpt-rosalind-research"
|
|
1416
|
+
GPT_6_ROSALIND = :"gpt-6-rosalind"
|
|
1414
1417
|
|
|
1415
1418
|
# @!endgroup
|
|
1416
1419
|
end
|
|
@@ -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"
|
|
@@ -48,6 +48,13 @@ module OpenAI
|
|
|
48
48
|
sig { returns(Symbol) }
|
|
49
49
|
attr_accessor :type
|
|
50
50
|
|
|
51
|
+
# Whether the agent continues without waiting for the function result.
|
|
52
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
53
|
+
attr_reader :async
|
|
54
|
+
|
|
55
|
+
sig { params(async: T::Boolean).void }
|
|
56
|
+
attr_writer :async
|
|
57
|
+
|
|
51
58
|
# A function defined by the application.
|
|
52
59
|
sig do
|
|
53
60
|
params(
|
|
@@ -60,6 +67,8 @@ module OpenAI
|
|
|
60
67
|
|
|
61
68
|
parameters: T::Hash[Symbol, T.anything],
|
|
62
69
|
|
|
70
|
+
async: T::Boolean,
|
|
71
|
+
|
|
63
72
|
type: Symbol
|
|
64
73
|
)
|
|
65
74
|
.returns(T.attached_class)
|
|
@@ -78,6 +87,9 @@ module OpenAI
|
|
|
78
87
|
# A JSON Schema object describing the function's arguments.
|
|
79
88
|
parameters:,
|
|
80
89
|
|
|
90
|
+
# Whether the agent continues without waiting for the function result.
|
|
91
|
+
async: nil,
|
|
92
|
+
|
|
81
93
|
# The type of the object. Always `function`.
|
|
82
94
|
|
|
83
95
|
type: :function
|
|
@@ -91,7 +103,8 @@ module OpenAI
|
|
|
91
103
|
description: String,
|
|
92
104
|
name: String,
|
|
93
105
|
parameters: T::Hash[Symbol, T.anything],
|
|
94
|
-
type: Symbol
|
|
106
|
+
type: Symbol,
|
|
107
|
+
async: T::Boolean
|
|
95
108
|
}
|
|
96
109
|
)
|
|
97
110
|
end
|
|
@@ -45,6 +45,14 @@ module OpenAI
|
|
|
45
45
|
sig { returns(Symbol) }
|
|
46
46
|
attr_accessor :type
|
|
47
47
|
|
|
48
|
+
# Whether the agent continues without waiting for the function result. Defaults to
|
|
49
|
+
# `false`.
|
|
50
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
51
|
+
attr_reader :async
|
|
52
|
+
|
|
53
|
+
sig { params(async: T::Boolean).void }
|
|
54
|
+
attr_writer :async
|
|
55
|
+
|
|
48
56
|
# Whether this function is deferred and discovered through tool search. Defaults
|
|
49
57
|
# to `false`.
|
|
50
58
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -63,6 +71,8 @@ module OpenAI
|
|
|
63
71
|
|
|
64
72
|
parameters: T::Hash[Symbol, T.anything],
|
|
65
73
|
|
|
74
|
+
async: T::Boolean,
|
|
75
|
+
|
|
66
76
|
defer_loading: T::Boolean,
|
|
67
77
|
|
|
68
78
|
type: Symbol
|
|
@@ -80,6 +90,10 @@ module OpenAI
|
|
|
80
90
|
# A JSON Schema object describing the function's arguments.
|
|
81
91
|
parameters:,
|
|
82
92
|
|
|
93
|
+
# Whether the agent continues without waiting for the function result. Defaults to
|
|
94
|
+
# `false`.
|
|
95
|
+
async: nil,
|
|
96
|
+
|
|
83
97
|
# Whether this function is deferred and discovered through tool search. Defaults
|
|
84
98
|
# to `false`.
|
|
85
99
|
defer_loading: nil,
|
|
@@ -97,6 +111,7 @@ module OpenAI
|
|
|
97
111
|
name: String,
|
|
98
112
|
parameters: T::Hash[Symbol, T.anything],
|
|
99
113
|
type: Symbol,
|
|
114
|
+
async: T::Boolean,
|
|
100
115
|
defer_loading: T::Boolean
|
|
101
116
|
}
|
|
102
117
|
)
|
|
@@ -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
|