openai 0.99.0 → 0.100.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 +19 -0
- data/README.md +1 -1
- data/bedrock.md +17 -1
- data/lib/openai/client.rb +9 -0
- data/lib/openai/helpers/agents/session_stream.rb +11 -36
- data/lib/openai/helpers/agents/tools.rb +34 -4
- data/lib/openai/helpers/beta/agents/creation_stream.rb +26 -0
- data/lib/openai/helpers/beta/agents/function_tool.rb +11 -4
- data/lib/openai/helpers/beta/agents/tool_dispatcher.rb +74 -0
- data/lib/openai/helpers/beta/agents/tool_error.rb +28 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_completions_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_completions_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_costs_params.rb +16 -4
- data/lib/openai/models/admin/organization/usage_costs_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_images_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +125 -3
- data/lib/openai/models/admin/organization/usage_web_search_calls_params.rb +9 -4
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +125 -3
- data/lib/openai/models/beta/agents/environments/template_create_params.rb +6 -6
- data/lib/openai/models/beta/agents/environments/template_update_params.rb +3 -6
- data/lib/openai/models/beta/agents/sessions/turns/item_list_params.rb +79 -0
- data/lib/openai/models/beta/beta_response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/beta/beta_response_error.rb +12 -1
- data/lib/openai/models/beta/beta_responses_server_event.rb +12 -1
- data/lib/openai/models/beta/beta_tool.rb +12 -9
- data/lib/openai/models/beta/environment_param.rb +6 -6
- data/lib/openai/models/beta/session_turn_error.rb +9 -0
- data/lib/openai/models/chat/chat_completion_chunk.rb +85 -18
- data/lib/openai/models/error_object.rb +12 -1
- data/lib/openai/models/eval_create_params.rb +1 -1
- data/lib/openai/models/eval_create_response.rb +1 -1
- data/lib/openai/models/eval_list_response.rb +1 -1
- data/lib/openai/models/eval_retrieve_response.rb +1 -1
- data/lib/openai/models/eval_update_response.rb +1 -1
- data/lib/openai/models/fine_tuning/job_list_params.rb +14 -4
- data/lib/openai/models/graders/score_model_grader.rb +2 -2
- data/lib/openai/models/image_edit_params.rb +12 -9
- data/lib/openai/models/realtime/realtime_client_event.rb +9 -0
- data/lib/openai/models/realtime/session_update_event.rb +16 -0
- data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +2 -2
- data/lib/openai/models/responses/response_error.rb +12 -1
- data/lib/openai/models/responses/responses_server_event.rb +12 -1
- data/lib/openai/models/responses/tool.rb +12 -9
- data/lib/openai/models/video_create_error.rb +12 -1
- data/lib/openai/providers/bedrock.rb +20 -1
- data/lib/openai/resources/admin/organization/usage.rb +15 -6
- data/lib/openai/resources/beta/agents/environments/templates.rb +3 -4
- data/lib/openai/resources/beta/agents/sessions/turns/items.rb +68 -0
- data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -2
- data/lib/openai/resources/fine_tuning/jobs.rb +7 -2
- data/lib/openai/resources/images.rb +8 -6
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +2 -0
- data/rbi/openai/helpers/agents.rbi +2 -0
- data/rbi/openai/helpers/beta/agents/function_tool.rbi +8 -3
- data/rbi/openai/helpers/beta/agents/tool_error.rbi +19 -0
- data/rbi/openai/helpers/beta/agents.rbi +12 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_completions_params.rbi +9 -4
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +16 -4
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +194 -1
- data/rbi/openai/models/admin/organization/usage_web_search_calls_params.rbi +12 -4
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +194 -1
- data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +6 -6
- data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +3 -6
- data/rbi/openai/models/beta/agents/sessions/turns/item_list_params.rbi +139 -0
- data/rbi/openai/models/beta/beta_response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/beta/beta_response_error.rbi +12 -0
- data/rbi/openai/models/beta/beta_responses_server_event.rbi +12 -0
- data/rbi/openai/models/beta/beta_tool.rbi +12 -9
- data/rbi/openai/models/beta/environment_param.rbi +6 -6
- data/rbi/openai/models/beta/session_turn_error.rbi +18 -0
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +123 -17
- data/rbi/openai/models/error_object.rbi +12 -0
- data/rbi/openai/models/eval_create_params.rbi +1 -1
- data/rbi/openai/models/eval_create_response.rbi +1 -1
- data/rbi/openai/models/eval_list_response.rbi +1 -1
- data/rbi/openai/models/eval_retrieve_response.rbi +1 -1
- data/rbi/openai/models/eval_update_response.rbi +1 -1
- data/rbi/openai/models/fine_tuning/job_list_params.rbi +14 -4
- data/rbi/openai/models/graders/score_model_grader.rbi +2 -2
- data/rbi/openai/models/image_edit_params.rbi +12 -9
- data/rbi/openai/models/realtime/session_update_event.rbi +16 -0
- data/rbi/openai/models/responses/response_computer_tool_call_output_item.rbi +2 -2
- data/rbi/openai/models/responses/response_error.rbi +12 -0
- data/rbi/openai/models/responses/responses_server_event.rbi +12 -0
- data/rbi/openai/models/responses/tool.rbi +12 -9
- data/rbi/openai/models/video_create_error.rbi +12 -0
- data/rbi/openai/resources/admin/organization/usage.rbi +15 -6
- data/rbi/openai/resources/beta/agents/environments/templates.rbi +3 -4
- data/rbi/openai/resources/beta/agents/sessions/turns/items.rbi +62 -0
- data/rbi/openai/resources/beta/agents/sessions/turns.rbi +3 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +2 -0
- data/rbi/openai/resources/fine_tuning/jobs.rbi +7 -2
- data/rbi/openai/resources/images.rbi +8 -6
- data/sig/openai/helpers/agents.rbs +3 -0
- data/sig/openai/helpers/beta/agents/function_tool.rbs +5 -2
- data/sig/openai/helpers/beta/agents/tool_error.rbs +17 -0
- data/sig/openai/helpers/beta/agents.rbs +5 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_completions_params.rbs +14 -6
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_costs_params.rbs +25 -7
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_images_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +87 -2
- data/sig/openai/models/admin/organization/usage_web_search_calls_params.rbs +19 -7
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +87 -2
- data/sig/openai/models/beta/agents/environments/template_create_params.rbs +4 -4
- data/sig/openai/models/beta/agents/environments/template_update_params.rbs +2 -4
- data/sig/openai/models/beta/agents/sessions/turns/item_list_params.rbs +91 -0
- data/sig/openai/models/beta/beta_response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/beta/beta_response_error.rbs +10 -0
- data/sig/openai/models/beta/beta_responses_server_event.rbs +10 -0
- data/sig/openai/models/beta/beta_tool.rbs +8 -6
- data/sig/openai/models/beta/environment_param.rbs +4 -4
- data/sig/openai/models/beta/session_turn_error.rbs +12 -0
- data/sig/openai/models/chat/chat_completion_chunk.rbs +96 -12
- data/sig/openai/models/error_object.rbs +10 -0
- data/sig/openai/models/eval_create_params.rbs +1 -1
- data/sig/openai/models/eval_create_response.rbs +1 -1
- data/sig/openai/models/eval_list_response.rbs +1 -1
- data/sig/openai/models/eval_retrieve_response.rbs +1 -1
- data/sig/openai/models/eval_update_response.rbs +1 -1
- data/sig/openai/models/fine_tuning/job_list_params.rbs +14 -4
- data/sig/openai/models/graders/score_model_grader.rbs +3 -3
- data/sig/openai/models/image_edit_params.rbs +8 -6
- data/sig/openai/models/responses/response_computer_tool_call_output_item.rbs +2 -2
- data/sig/openai/models/responses/response_error.rbs +10 -0
- data/sig/openai/models/responses/responses_server_event.rbs +10 -0
- data/sig/openai/models/responses/tool.rbs +8 -6
- data/sig/openai/models/video_create_error.rbs +10 -0
- data/sig/openai/resources/beta/agents/sessions/turns/items.rbs +24 -0
- data/sig/openai/resources/beta/agents/sessions/turns.rbs +2 -0
- data/sig/openai/resources/beta/agents/sessions.rbs +1 -0
- metadata +11 -1
|
@@ -30,8 +30,8 @@ module OpenAI
|
|
|
30
30
|
# An optional human-readable display name for the template.
|
|
31
31
|
#
|
|
32
32
|
# @param network [OpenAI::Models::Beta::Agents::Environments::TemplateCreateParams::Network, nil]
|
|
33
|
-
# Network access policy for the environment.
|
|
34
|
-
#
|
|
33
|
+
# Network access policy for the environment. If omitted, the API version
|
|
34
|
+
# determines whether network access is enabled or disabled.
|
|
35
35
|
#
|
|
36
36
|
# @param packages [OpenAI::Models::Beta::Agents::Environments::TemplateCreateParams::Packages, nil]
|
|
37
37
|
# Packages to install in the environment. Defaults to empty package lists.
|
|
@@ -113,8 +113,7 @@ module OpenAI
|
|
|
113
113
|
#
|
|
114
114
|
# @param network [OpenAI::Models::Beta::Agents::Environments::TemplateUpdateParams::Network, nil]
|
|
115
115
|
# Network access available after setup completes. Omit to preserve the current
|
|
116
|
-
# policy, or pass `null` to reset to
|
|
117
|
-
# requests.
|
|
116
|
+
# policy, or pass `null` to reset to the default policy.
|
|
118
117
|
#
|
|
119
118
|
# @param packages [OpenAI::Models::Beta::Agents::Environments::TemplateUpdateParams::Packages, nil]
|
|
120
119
|
# Packages installed before the runtime network policy applies.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class Beta
|
|
6
|
+
class Agents
|
|
7
|
+
class Sessions
|
|
8
|
+
class Turns
|
|
9
|
+
class Items
|
|
10
|
+
# Lists items belonging to one root-agent turn, including its interactions with
|
|
11
|
+
# subagents. See
|
|
12
|
+
# [inspecting agent output](https://developers.openai.com/api/docs/guides/agents-api/observability).
|
|
13
|
+
#
|
|
14
|
+
# @overload list(turn_id, session_id:, after: nil, limit: nil, order: nil, request_options: {})
|
|
15
|
+
#
|
|
16
|
+
# @param turn_id [String]
|
|
17
|
+
# Path param: The ID of the turn.
|
|
18
|
+
#
|
|
19
|
+
# @param session_id [String]
|
|
20
|
+
# Path param: The ID of the session that owns the turn.
|
|
21
|
+
#
|
|
22
|
+
# @param after [String]
|
|
23
|
+
# Query param: Return items after this cursor in the selected order. Pass the
|
|
24
|
+
# previous response's last_id, which can differ from the last item's ID.
|
|
25
|
+
#
|
|
26
|
+
# @param limit [Integer]
|
|
27
|
+
# Query param: The maximum number of resources to return, between 1 and 100.
|
|
28
|
+
# Defaults to 20.
|
|
29
|
+
#
|
|
30
|
+
# @param order [Symbol, OpenAI::Models::Beta::Agents::Sessions::Turns::ItemListParams::Order]
|
|
31
|
+
# Query param: The order in which resources are returned. Defaults to `desc`.
|
|
32
|
+
#
|
|
33
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
34
|
+
#
|
|
35
|
+
# @return [OpenAI::Internal::ConversationCursorPage<OpenAI::Models::Beta::AgentSessionMessage, OpenAI::Models::Beta::AgentReasoningItem, OpenAI::Models::Beta::AgentFunctionCallItem, OpenAI::Models::Beta::AgentSessionItem::FunctionCallOutput, OpenAI::Models::Beta::AgentSessionItem::AgentMessage, OpenAI::Models::Beta::AgentMcpCallItem, OpenAI::Models::Beta::AgentSessionItem::ComputerUseCall, OpenAI::Models::Beta::AgentSessionItem::ComputerUseApprovalRequest, OpenAI::Models::Beta::AgentSessionItem::ComputerUseApprovalRequestResult, OpenAI::Models::Beta::AgentWebSearchCallItem, OpenAI::Models::Beta::AgentCommandExecutionItem, OpenAI::Models::Beta::AgentCreateSubagentCallItem, OpenAI::Models::Beta::AgentSendSubagentInputCallItem, OpenAI::Models::Beta::AgentResumeSubagentCallItem, OpenAI::Models::Beta::AgentWaitForSubagentsCallItem, OpenAI::Models::Beta::AgentInterruptSubagentCallItem, OpenAI::Models::Beta::AgentCloseSubagentCallItem>]
|
|
36
|
+
#
|
|
37
|
+
# @see OpenAI::Models::Beta::Agents::Sessions::Turns::ItemListParams
|
|
38
|
+
def list(turn_id, params)
|
|
39
|
+
parsed, options = OpenAI::Beta::Agents::Sessions::Turns::ItemListParams.dump_request(params)
|
|
40
|
+
session_id = parsed.delete(:session_id) do
|
|
41
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
query = OpenAI::Internal::Util.encode_query_params(parsed)
|
|
45
|
+
@client.request(
|
|
46
|
+
method: :get,
|
|
47
|
+
path: ["agents/sessions/%1$s/turns/%2$s/items", session_id, turn_id],
|
|
48
|
+
query: query,
|
|
49
|
+
page: OpenAI::Internal::ConversationCursorPage,
|
|
50
|
+
model: OpenAI::Beta::AgentSessionItem,
|
|
51
|
+
security: {bearer_auth: true},
|
|
52
|
+
options: {extra_headers: {"OpenAI-Beta" => "agents=v1"}, **options}
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# @api private
|
|
57
|
+
#
|
|
58
|
+
# @param client [OpenAI::Client]
|
|
59
|
+
def initialize(client:)
|
|
60
|
+
@client = client
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -6,6 +6,9 @@ module OpenAI
|
|
|
6
6
|
class Agents
|
|
7
7
|
class Sessions
|
|
8
8
|
class Turns
|
|
9
|
+
# @return [OpenAI::Resources::Beta::Agents::Sessions::Turns::Items]
|
|
10
|
+
attr_reader :items
|
|
11
|
+
|
|
9
12
|
# Retrieves a turn's current status, timestamps, usage, and error. Returns 404 if
|
|
10
13
|
# the turn does not belong to the session. See
|
|
11
14
|
# [session turns](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#inspect-session-turns).
|
|
@@ -80,6 +83,7 @@ module OpenAI
|
|
|
80
83
|
# @param client [OpenAI::Client]
|
|
81
84
|
def initialize(client:)
|
|
82
85
|
@client = client
|
|
86
|
+
@items = OpenAI::Resources::Beta::Agents::Sessions::Turns::Items.new(client: client)
|
|
83
87
|
end
|
|
84
88
|
end
|
|
85
89
|
end
|
|
@@ -85,7 +85,7 @@ module OpenAI
|
|
|
85
85
|
# the session or streams its events when stream is true. See
|
|
86
86
|
# [running sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions).
|
|
87
87
|
#
|
|
88
|
-
# @overload create_streaming(environment:, agent: nil, agent_id: nil, input: nil, output_type: nil, metadata: nil, vault_ids: nil, request_options: {})
|
|
88
|
+
# @overload create_streaming(environment:, agent: nil, agent_id: nil, input: nil, output_type: nil, tool_handlers: {}, metadata: nil, vault_ids: nil, request_options: {})
|
|
89
89
|
#
|
|
90
90
|
# @param environment [OpenAI::Models::Beta::EnvironmentParam::None, OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted, OpenAI::Models::Beta::EnvironmentParam::SelfHosted]
|
|
91
91
|
# An inline execution environment or a reference to an environment template.
|
|
@@ -112,6 +112,7 @@ module OpenAI
|
|
|
112
112
|
# The IDs of vaults made available to the session.
|
|
113
113
|
#
|
|
114
114
|
# @param output_type [Class<OpenAI::BaseModel>, nil] Beta: configure and parse a structured answer.
|
|
115
|
+
# @param tool_handlers [Hash{String=>Proc}] Local handlers for initial-turn function calls (not sent to the API).
|
|
115
116
|
#
|
|
116
117
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
117
118
|
#
|
|
@@ -121,6 +122,7 @@ module OpenAI
|
|
|
121
122
|
def create_streaming(params)
|
|
122
123
|
params = params.to_h.transform_keys { _1.is_a?(String) ? _1.to_sym : _1 }
|
|
123
124
|
output_type = params.delete(:output_type)
|
|
125
|
+
tool_handlers = params.delete(:tool_handlers)
|
|
124
126
|
parser = OpenAI::Helpers::Beta::Agents::OutputParser.new(output_type) unless output_type.nil?
|
|
125
127
|
parsed, options = OpenAI::Beta::Agents::SessionCreateParams.dump_request(params)
|
|
126
128
|
unless parsed.fetch(:stream, true)
|
|
@@ -140,6 +142,10 @@ module OpenAI
|
|
|
140
142
|
security: {bearer_auth: true},
|
|
141
143
|
options: {extra_headers: {"OpenAI-Beta" => "agents=v1"}, **options}
|
|
142
144
|
)
|
|
145
|
+
if tool_handlers
|
|
146
|
+
stream.configure_tool_handlers(sessions: self, tool_handlers: tool_handlers, request_options: options)
|
|
147
|
+
end
|
|
148
|
+
|
|
143
149
|
stream.configure_output_parser(parser)
|
|
144
150
|
end
|
|
145
151
|
|
|
@@ -274,17 +280,31 @@ module OpenAI
|
|
|
274
280
|
# @param session_id [String]
|
|
275
281
|
# @param input [String, Array<OpenAI::Models::Beta::AgentSessionInputMessageParam>]
|
|
276
282
|
# @param tool_handlers [Hash{String=>Proc}]
|
|
283
|
+
# @param on_tool_error [Proc, nil]
|
|
284
|
+
# Beta: use with tool_handlers to log or monitor argument parsing, handler
|
|
285
|
+
# execution, and output conversion failures locally. Receives ToolError;
|
|
286
|
+
# API/transport errors still propagate normally. Ordinary observer errors
|
|
287
|
+
# are ignored, and the submitted tool failure stays generic.
|
|
277
288
|
# @param idempotency_key [String, nil] Applies only to the input submission.
|
|
278
289
|
# @param output_type [Class<OpenAI::BaseModel>, nil] Beta: parse output without changing session configuration.
|
|
279
290
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
280
291
|
# @yieldparam stream [OpenAI::Helpers::Agents::SessionStream]
|
|
281
292
|
# @return [OpenAI::Helpers::Agents::SessionStream]
|
|
282
|
-
def stream(
|
|
293
|
+
def stream(
|
|
294
|
+
session_id,
|
|
295
|
+
input:,
|
|
296
|
+
tool_handlers: {},
|
|
297
|
+
on_tool_error: nil,
|
|
298
|
+
idempotency_key: nil,
|
|
299
|
+
output_type: nil,
|
|
300
|
+
request_options: {}
|
|
301
|
+
)
|
|
283
302
|
stream = OpenAI::Helpers::Agents::SessionStream.new(
|
|
284
303
|
sessions: self,
|
|
285
304
|
session_id: session_id,
|
|
286
305
|
input: input,
|
|
287
306
|
tool_handlers: tool_handlers,
|
|
307
|
+
on_tool_error: on_tool_error,
|
|
288
308
|
idempotency_key: idempotency_key,
|
|
289
309
|
output_type: output_type,
|
|
290
310
|
request_options: request_options
|
|
@@ -141,8 +141,13 @@ module OpenAI
|
|
|
141
141
|
# Number of fine-tuning jobs to retrieve.
|
|
142
142
|
#
|
|
143
143
|
# @param metadata [Hash{Symbol=>String}, nil]
|
|
144
|
-
# Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
|
|
145
|
-
#
|
|
144
|
+
# Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Omitting
|
|
145
|
+
# the parameter or passing an empty object applies no metadata filter. An empty
|
|
146
|
+
# value, such as `metadata[k]=`, filters for that key with an empty string value.
|
|
147
|
+
# To select jobs with null metadata, send the literal query string
|
|
148
|
+
# `metadata=null`. Nullable caller types do not specify how a client serializes
|
|
149
|
+
# null for a deep-object parameter. Use a raw query parameter if the client omits
|
|
150
|
+
# null. Do not combine the two query forms.
|
|
146
151
|
#
|
|
147
152
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
148
153
|
#
|
|
@@ -104,9 +104,10 @@ module OpenAI
|
|
|
104
104
|
# set the output format to `png` or `webp`.
|
|
105
105
|
#
|
|
106
106
|
# @param input_fidelity [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil]
|
|
107
|
-
#
|
|
108
|
-
#
|
|
109
|
-
# `gpt-image-
|
|
107
|
+
# Control how much effort the model will exert to match the style and features,
|
|
108
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
109
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
110
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
110
111
|
#
|
|
111
112
|
# @param mask [Pathname, StringIO, IO, String, OpenAI::FilePart]
|
|
112
113
|
# An additional image whose fully transparent areas (e.g. where alpha is zero)
|
|
@@ -238,9 +239,10 @@ module OpenAI
|
|
|
238
239
|
# set the output format to `png` or `webp`.
|
|
239
240
|
#
|
|
240
241
|
# @param input_fidelity [Symbol, OpenAI::Models::ImageEditParams::InputFidelity, nil]
|
|
241
|
-
#
|
|
242
|
-
#
|
|
243
|
-
# `gpt-image-
|
|
242
|
+
# Control how much effort the model will exert to match the style and features,
|
|
243
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
244
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
245
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
244
246
|
#
|
|
245
247
|
# @param mask [Pathname, StringIO, IO, String, OpenAI::FilePart]
|
|
246
248
|
# An additional image whose fully transparent areas (e.g. where alpha is zero)
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
|
@@ -529,6 +529,7 @@ require_relative "openai/models/beta/agents/sessions/trace_list_params"
|
|
|
529
529
|
require_relative "openai/models/beta/agents/sessions/turn"
|
|
530
530
|
require_relative "openai/models/beta/agents/sessions/turn_list_params"
|
|
531
531
|
require_relative "openai/models/beta/agents/sessions/turn_retrieve_params"
|
|
532
|
+
require_relative "openai/models/beta/agents/sessions/turns/item_list_params"
|
|
532
533
|
require_relative "openai/models/beta/agents/session_update_params"
|
|
533
534
|
require_relative "openai/models/beta/agents/vault"
|
|
534
535
|
require_relative "openai/models/beta/agents/vault_create_params"
|
|
@@ -1534,6 +1535,7 @@ require_relative "openai/resources/beta/agents/sessions/subagents/turns"
|
|
|
1534
1535
|
require_relative "openai/resources/beta/agents/sessions/subagents/turns/items"
|
|
1535
1536
|
require_relative "openai/resources/beta/agents/sessions/traces"
|
|
1536
1537
|
require_relative "openai/resources/beta/agents/sessions/turns"
|
|
1538
|
+
require_relative "openai/resources/beta/agents/sessions/turns/items"
|
|
1537
1539
|
require_relative "openai/resources/beta/agents/vaults"
|
|
1538
1540
|
require_relative "openai/resources/beta/agents/vaults/credentials"
|
|
1539
1541
|
require_relative "openai/resources/beta/assistants"
|
|
@@ -56,6 +56,7 @@ module OpenAI
|
|
|
56
56
|
session_id: String,
|
|
57
57
|
input: T.any(String, T::Array[OpenAI::Models::Beta::AgentSessionInputMessageParam::OrHash]),
|
|
58
58
|
tool_handlers: T::Hash[String, OpenAI::Helpers::Agents::ToolHandler],
|
|
59
|
+
on_tool_error: T.nilable(T.proc.params(failure: OpenAI::Helpers::Beta::Agents::ToolError).void),
|
|
59
60
|
idempotency_key: T.nilable(String),
|
|
60
61
|
output_type: T.nilable(T.class_of(OpenAI::Helpers::StructuredOutput::BaseModel)),
|
|
61
62
|
request_options: T.nilable(OpenAI::RequestOptions::OrHash),
|
|
@@ -67,6 +68,7 @@ module OpenAI
|
|
|
67
68
|
session_id,
|
|
68
69
|
input:,
|
|
69
70
|
tool_handlers: {},
|
|
71
|
+
on_tool_error: nil,
|
|
70
72
|
idempotency_key: nil,
|
|
71
73
|
output_type: nil,
|
|
72
74
|
request_options: {},
|
|
@@ -13,11 +13,12 @@ module OpenAI
|
|
|
13
13
|
name: String,
|
|
14
14
|
arguments: T.class_of(OpenAI::BaseModel),
|
|
15
15
|
description: String,
|
|
16
|
+
defer_loading: T.nilable(T::Boolean),
|
|
16
17
|
handler: T.proc.params(arguments: T.untyped).returns(OpenAI::Helpers::Agents::ToolOutput)
|
|
17
18
|
)
|
|
18
19
|
.void
|
|
19
20
|
end
|
|
20
|
-
def initialize(name:, arguments:, description: "", &handler)
|
|
21
|
+
def initialize(name:, arguments:, description: "", defer_loading: nil, &handler)
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
sig { returns(OpenAI::Internal::AnyHash) }
|
|
@@ -29,9 +30,13 @@ module OpenAI
|
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
sig {
|
|
32
|
-
params(
|
|
33
|
+
params(
|
|
34
|
+
arguments: T.any(String, OpenAI::Internal::AnyHash),
|
|
35
|
+
report_stage: T.nilable(T.proc.params(stage: Symbol).void)
|
|
36
|
+
)
|
|
37
|
+
.returns(OpenAI::Helpers::Agents::ToolOutput)
|
|
33
38
|
}
|
|
34
|
-
def call(arguments)
|
|
39
|
+
def call(arguments, &report_stage)
|
|
35
40
|
end
|
|
36
41
|
end
|
|
37
42
|
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Helpers
|
|
5
|
+
module Beta
|
|
6
|
+
module Agents
|
|
7
|
+
# Beta, local-only tool failure diagnostic.
|
|
8
|
+
class ToolError
|
|
9
|
+
sig { returns(StandardError) }
|
|
10
|
+
attr_reader :error
|
|
11
|
+
sig { returns(String) }
|
|
12
|
+
attr_reader :tool_name, :session_id, :turn_id, :call_id
|
|
13
|
+
sig { returns(Symbol) }
|
|
14
|
+
attr_reader :stage
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -139,6 +139,18 @@ module OpenAI
|
|
|
139
139
|
sig { params(parser: T.nilable(OutputParser)).returns(T.self_type) }
|
|
140
140
|
def configure_output_parser(parser)
|
|
141
141
|
end
|
|
142
|
+
|
|
143
|
+
# @api private
|
|
144
|
+
sig do
|
|
145
|
+
params(
|
|
146
|
+
sessions: OpenAI::Resources::Beta::Agents::Sessions,
|
|
147
|
+
tool_handlers: T::Hash[String, OpenAI::Helpers::Agents::ToolHandler],
|
|
148
|
+
request_options: T.untyped
|
|
149
|
+
)
|
|
150
|
+
.returns(T.self_type)
|
|
151
|
+
end
|
|
152
|
+
def configure_tool_handlers(sessions:, tool_handlers:, request_options:)
|
|
153
|
+
end
|
|
142
154
|
end
|
|
143
155
|
end
|
|
144
156
|
end
|
|
@@ -194,6 +194,19 @@ module OpenAI
|
|
|
194
194
|
sig { returns(T.nilable(String)) }
|
|
195
195
|
attr_accessor :api_key_id
|
|
196
196
|
|
|
197
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
198
|
+
# activity and `unlabeled` includes all records without published source
|
|
199
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
200
|
+
# direct API usage. Without source grouping, this field is null.
|
|
201
|
+
sig {
|
|
202
|
+
returns(
|
|
203
|
+
T.nilable(
|
|
204
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
205
|
+
)
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
attr_accessor :api_source
|
|
209
|
+
|
|
197
210
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
198
211
|
# batch or not.
|
|
199
212
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -327,6 +340,10 @@ module OpenAI
|
|
|
327
340
|
|
|
328
341
|
api_key_id: T.nilable(String),
|
|
329
342
|
|
|
343
|
+
api_source: T.nilable(
|
|
344
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::OrSymbol
|
|
345
|
+
),
|
|
346
|
+
|
|
330
347
|
batch: T.nilable(T::Boolean),
|
|
331
348
|
|
|
332
349
|
input_audio_tokens: Integer,
|
|
@@ -386,6 +403,12 @@ module OpenAI
|
|
|
386
403
|
# usage result.
|
|
387
404
|
api_key_id: nil,
|
|
388
405
|
|
|
406
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
407
|
+
# activity and `unlabeled` includes all records without published source
|
|
408
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
409
|
+
# direct API usage. Without source grouping, this field is null.
|
|
410
|
+
api_source: nil,
|
|
411
|
+
|
|
389
412
|
# When `group_by=batch`, this field tells whether the grouped usage result is
|
|
390
413
|
# batch or not.
|
|
391
414
|
batch: nil,
|
|
@@ -462,6 +485,9 @@ module OpenAI
|
|
|
462
485
|
object: Symbol,
|
|
463
486
|
output_tokens: Integer,
|
|
464
487
|
api_key_id: T.nilable(String),
|
|
488
|
+
api_source: T.nilable(
|
|
489
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
490
|
+
),
|
|
465
491
|
batch: T.nilable(T::Boolean),
|
|
466
492
|
input_audio_tokens: Integer,
|
|
467
493
|
input_cache_write_12h_tokens: Integer,
|
|
@@ -486,6 +512,40 @@ module OpenAI
|
|
|
486
512
|
def to_hash
|
|
487
513
|
end
|
|
488
514
|
|
|
515
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
516
|
+
# activity and `unlabeled` includes all records without published source
|
|
517
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
518
|
+
# direct API usage. Without source grouping, this field is null.
|
|
519
|
+
module APISource
|
|
520
|
+
extend OpenAI::Internal::Type::Enum
|
|
521
|
+
|
|
522
|
+
TaggedSymbol = T.type_alias {
|
|
523
|
+
T.all(
|
|
524
|
+
Symbol,
|
|
525
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource
|
|
526
|
+
)
|
|
527
|
+
}
|
|
528
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
529
|
+
|
|
530
|
+
AGENTS_API = T.let(
|
|
531
|
+
:agents_api,
|
|
532
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
533
|
+
)
|
|
534
|
+
UNLABELED = T.let(
|
|
535
|
+
:unlabeled,
|
|
536
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
sig {
|
|
540
|
+
override.returns(
|
|
541
|
+
T::Array[
|
|
542
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageCompletionsResult::APISource::TaggedSymbol
|
|
543
|
+
]
|
|
544
|
+
)
|
|
545
|
+
}
|
|
546
|
+
def self.values
|
|
547
|
+
end
|
|
548
|
+
end
|
|
489
549
|
end
|
|
490
550
|
|
|
491
551
|
class OrganizationUsageEmbeddingsResult < OpenAI::Internal::Type::BaseModel
|
|
@@ -1267,6 +1327,19 @@ module OpenAI
|
|
|
1267
1327
|
sig { returns(T.nilable(String)) }
|
|
1268
1328
|
attr_accessor :api_key_id
|
|
1269
1329
|
|
|
1330
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1331
|
+
# activity and `unlabeled` includes all records without published source
|
|
1332
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1333
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1334
|
+
sig {
|
|
1335
|
+
returns(
|
|
1336
|
+
T.nilable(
|
|
1337
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1338
|
+
)
|
|
1339
|
+
)
|
|
1340
|
+
}
|
|
1341
|
+
attr_accessor :api_source
|
|
1342
|
+
|
|
1270
1343
|
# When `group_by=context_level`, this field provides the search context size of
|
|
1271
1344
|
# the grouped usage result.
|
|
1272
1345
|
sig { returns(T.nilable(String)) }
|
|
@@ -1297,6 +1370,10 @@ module OpenAI
|
|
|
1297
1370
|
|
|
1298
1371
|
api_key_id: T.nilable(String),
|
|
1299
1372
|
|
|
1373
|
+
api_source: T.nilable(
|
|
1374
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::OrSymbol
|
|
1375
|
+
),
|
|
1376
|
+
|
|
1300
1377
|
context_level: T.nilable(String),
|
|
1301
1378
|
|
|
1302
1379
|
model: T.nilable(String),
|
|
@@ -1321,6 +1398,12 @@ module OpenAI
|
|
|
1321
1398
|
# usage result.
|
|
1322
1399
|
api_key_id: nil,
|
|
1323
1400
|
|
|
1401
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1402
|
+
# activity and `unlabeled` includes all records without published source
|
|
1403
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1404
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1405
|
+
api_source: nil,
|
|
1406
|
+
|
|
1324
1407
|
# When `group_by=context_level`, this field provides the search context size of
|
|
1325
1408
|
# the grouped usage result.
|
|
1326
1409
|
context_level: nil,
|
|
@@ -1348,6 +1431,9 @@ module OpenAI
|
|
|
1348
1431
|
num_requests: Integer,
|
|
1349
1432
|
object: Symbol,
|
|
1350
1433
|
api_key_id: T.nilable(String),
|
|
1434
|
+
api_source: T.nilable(
|
|
1435
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1436
|
+
),
|
|
1351
1437
|
context_level: T.nilable(String),
|
|
1352
1438
|
model: T.nilable(String),
|
|
1353
1439
|
project_id: T.nilable(String),
|
|
@@ -1358,6 +1444,40 @@ module OpenAI
|
|
|
1358
1444
|
def to_hash
|
|
1359
1445
|
end
|
|
1360
1446
|
|
|
1447
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1448
|
+
# activity and `unlabeled` includes all records without published source
|
|
1449
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1450
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1451
|
+
module APISource
|
|
1452
|
+
extend OpenAI::Internal::Type::Enum
|
|
1453
|
+
|
|
1454
|
+
TaggedSymbol = T.type_alias {
|
|
1455
|
+
T.all(
|
|
1456
|
+
Symbol,
|
|
1457
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource
|
|
1458
|
+
)
|
|
1459
|
+
}
|
|
1460
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1461
|
+
|
|
1462
|
+
AGENTS_API = T.let(
|
|
1463
|
+
:agents_api,
|
|
1464
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1465
|
+
)
|
|
1466
|
+
UNLABELED = T.let(
|
|
1467
|
+
:unlabeled,
|
|
1468
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1469
|
+
)
|
|
1470
|
+
|
|
1471
|
+
sig {
|
|
1472
|
+
override.returns(
|
|
1473
|
+
T::Array[
|
|
1474
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationUsageWebSearchesResult::APISource::TaggedSymbol
|
|
1475
|
+
]
|
|
1476
|
+
)
|
|
1477
|
+
}
|
|
1478
|
+
def self.values
|
|
1479
|
+
end
|
|
1480
|
+
end
|
|
1361
1481
|
end
|
|
1362
1482
|
|
|
1363
1483
|
class OrganizationCostsResult < OpenAI::Internal::Type::BaseModel
|
|
@@ -1394,6 +1514,19 @@ module OpenAI
|
|
|
1394
1514
|
sig { returns(T.nilable(String)) }
|
|
1395
1515
|
attr_accessor :api_key_id
|
|
1396
1516
|
|
|
1517
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1518
|
+
# activity and `unlabeled` includes all records without published source
|
|
1519
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1520
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1521
|
+
sig {
|
|
1522
|
+
returns(
|
|
1523
|
+
T.nilable(
|
|
1524
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1525
|
+
)
|
|
1526
|
+
)
|
|
1527
|
+
}
|
|
1528
|
+
attr_accessor :api_source
|
|
1529
|
+
|
|
1397
1530
|
# When `group_by=line_item`, this field provides the line item of the grouped
|
|
1398
1531
|
# costs result.
|
|
1399
1532
|
sig { returns(T.nilable(String)) }
|
|
@@ -1414,6 +1547,11 @@ module OpenAI
|
|
|
1414
1547
|
sig { returns(T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol))) }
|
|
1415
1548
|
attr_accessor :quantity_unit
|
|
1416
1549
|
|
|
1550
|
+
# When `group_by=user_id`, this field provides the user ID of the grouped costs
|
|
1551
|
+
# result.
|
|
1552
|
+
sig { returns(T.nilable(String)) }
|
|
1553
|
+
attr_accessor :user_id
|
|
1554
|
+
|
|
1417
1555
|
# The aggregated costs details of the specific time bucket.
|
|
1418
1556
|
sig do
|
|
1419
1557
|
params(
|
|
@@ -1422,6 +1560,10 @@ module OpenAI
|
|
|
1422
1560
|
|
|
1423
1561
|
api_key_id: T.nilable(String),
|
|
1424
1562
|
|
|
1563
|
+
api_source: T.nilable(
|
|
1564
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::OrSymbol
|
|
1565
|
+
),
|
|
1566
|
+
|
|
1425
1567
|
line_item: T.nilable(String),
|
|
1426
1568
|
|
|
1427
1569
|
project_id: T.nilable(String),
|
|
@@ -1430,6 +1572,8 @@ module OpenAI
|
|
|
1430
1572
|
|
|
1431
1573
|
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol)),
|
|
1432
1574
|
|
|
1575
|
+
user_id: T.nilable(String),
|
|
1576
|
+
|
|
1433
1577
|
object: Symbol
|
|
1434
1578
|
)
|
|
1435
1579
|
.returns(T.attached_class)
|
|
@@ -1443,6 +1587,12 @@ module OpenAI
|
|
|
1443
1587
|
# costs result.
|
|
1444
1588
|
api_key_id: nil,
|
|
1445
1589
|
|
|
1590
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1591
|
+
# activity and `unlabeled` includes all records without published source
|
|
1592
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1593
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1594
|
+
api_source: nil,
|
|
1595
|
+
|
|
1446
1596
|
# When `group_by=line_item`, this field provides the line item of the grouped
|
|
1447
1597
|
# costs result.
|
|
1448
1598
|
line_item: nil,
|
|
@@ -1459,6 +1609,10 @@ module OpenAI
|
|
|
1459
1609
|
# result, this field is `null`.
|
|
1460
1610
|
quantity_unit: nil,
|
|
1461
1611
|
|
|
1612
|
+
# When `group_by=user_id`, this field provides the user ID of the grouped costs
|
|
1613
|
+
# result.
|
|
1614
|
+
user_id: nil,
|
|
1615
|
+
|
|
1462
1616
|
object: :"organization.costs.result"
|
|
1463
1617
|
)
|
|
1464
1618
|
end
|
|
@@ -1469,10 +1623,14 @@ module OpenAI
|
|
|
1469
1623
|
object: Symbol,
|
|
1470
1624
|
amount: OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::Amount,
|
|
1471
1625
|
api_key_id: T.nilable(String),
|
|
1626
|
+
api_source: T.nilable(
|
|
1627
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1628
|
+
),
|
|
1472
1629
|
line_item: T.nilable(String),
|
|
1473
1630
|
project_id: T.nilable(String),
|
|
1474
1631
|
quantity: T.nilable(Float),
|
|
1475
|
-
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol))
|
|
1632
|
+
quantity_unit: T.nilable(T.any(String, OpenAI::Admin::Organization::CostQuantityUnit::OrSymbol)),
|
|
1633
|
+
user_id: T.nilable(String)
|
|
1476
1634
|
}
|
|
1477
1635
|
)
|
|
1478
1636
|
end
|
|
@@ -1531,6 +1689,41 @@ module OpenAI
|
|
|
1531
1689
|
end
|
|
1532
1690
|
|
|
1533
1691
|
end
|
|
1692
|
+
|
|
1693
|
+
# When grouped by `api_source`, `agents_api` identifies attributed Agents API
|
|
1694
|
+
# activity and `unlabeled` includes all records without published source
|
|
1695
|
+
# attribution, including historical and unknown origins. Unlabeled does not imply
|
|
1696
|
+
# direct API usage. Without source grouping, this field is null.
|
|
1697
|
+
module APISource
|
|
1698
|
+
extend OpenAI::Internal::Type::Enum
|
|
1699
|
+
|
|
1700
|
+
TaggedSymbol = T.type_alias {
|
|
1701
|
+
T.all(
|
|
1702
|
+
Symbol,
|
|
1703
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource
|
|
1704
|
+
)
|
|
1705
|
+
}
|
|
1706
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1707
|
+
|
|
1708
|
+
AGENTS_API = T.let(
|
|
1709
|
+
:agents_api,
|
|
1710
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1711
|
+
)
|
|
1712
|
+
UNLABELED = T.let(
|
|
1713
|
+
:unlabeled,
|
|
1714
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1715
|
+
)
|
|
1716
|
+
|
|
1717
|
+
sig {
|
|
1718
|
+
override.returns(
|
|
1719
|
+
T::Array[
|
|
1720
|
+
OpenAI::Models::Admin::Organization::UsageAudioSpeechesResponse::Data::Result::OrganizationCostsResult::APISource::TaggedSymbol
|
|
1721
|
+
]
|
|
1722
|
+
)
|
|
1723
|
+
}
|
|
1724
|
+
def self.values
|
|
1725
|
+
end
|
|
1726
|
+
end
|
|
1534
1727
|
end
|
|
1535
1728
|
|
|
1536
1729
|
sig {
|