openai 0.83.0 → 0.84.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 +29 -0
- data/README.md +1 -1
- data/lib/openai/auth/workload_identity_auth.rb +17 -2
- data/lib/openai/client.rb +20 -6
- data/lib/openai/errors.rb +1 -1
- data/lib/openai/helpers/streaming/chat_completion_stream.rb +1 -2
- data/lib/openai/helpers/streaming/response_events.rb +2 -2
- data/lib/openai/helpers/streaming/response_stream.rb +73 -42
- data/lib/openai/helpers/structured_output/chat_completion_parser.rb +6 -0
- data/lib/openai/helpers/structured_output/response_parser.rb +1 -1
- data/lib/openai/internal/type/base_model.rb +2 -2
- data/lib/openai/internal/type/converter.rb +1 -1
- data/lib/openai/internal/util.rb +2 -2
- data/lib/openai/models/admin/organization/usage_costs_params.rb +10 -1
- data/lib/openai/models/batch.rb +4 -4
- data/lib/openai/models/beta/beta_response.rb +9 -12
- data/lib/openai/models/beta/beta_response_usage.rb +1 -12
- data/lib/openai/models/beta/beta_responses_client_event.rb +8 -12
- data/lib/openai/models/beta/response_compact_params.rb +7 -7
- data/lib/openai/models/beta/response_create_params.rb +8 -12
- data/lib/openai/models/chat/completion_create_params.rb +8 -8
- data/lib/openai/models/completion_usage.rb +1 -12
- 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/evals/create_eval_completions_run_data_source.rb +2 -2
- data/lib/openai/models/reasoning.rb +0 -2
- data/lib/openai/models/responses/response.rb +6 -7
- data/lib/openai/models/responses/response_compact_params.rb +7 -7
- data/lib/openai/models/responses/response_create_params.rb +5 -7
- data/lib/openai/models/responses/response_usage.rb +1 -12
- data/lib/openai/models/responses/responses_client_event.rb +5 -7
- data/lib/openai/resources/admin/organization/usage.rb +3 -1
- data/lib/openai/resources/beta/responses.rb +5 -5
- data/lib/openai/resources/chat/completions.rb +2 -2
- data/lib/openai/resources/responses.rb +7 -6
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +1 -0
- data/rbi/openai/errors.rbi +1 -1
- data/rbi/openai/helpers/streaming/events.rbi +2 -2
- data/rbi/openai/helpers/streaming/response_stream.rbi +3 -3
- data/rbi/openai/models/admin/organization/usage_costs_params.rbi +15 -0
- data/rbi/openai/models/batch.rbi +6 -6
- data/rbi/openai/models/beta/beta_response.rbi +10 -15
- data/rbi/openai/models/beta/beta_response_usage.rbi +3 -13
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +9 -15
- data/rbi/openai/models/beta/response_compact_params.rbi +9 -9
- data/rbi/openai/models/beta/response_create_params.rbi +9 -15
- data/rbi/openai/models/chat/completion_create_params.rbi +9 -9
- data/rbi/openai/models/completion_usage.rbi +0 -10
- 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/evals/create_eval_completions_run_data_source.rbi +2 -2
- data/rbi/openai/models/reasoning.rbi +0 -2
- data/rbi/openai/models/responses/response.rbi +7 -10
- data/rbi/openai/models/responses/response_compact_params.rbi +9 -9
- data/rbi/openai/models/responses/response_create_params.rbi +6 -10
- data/rbi/openai/models/responses/response_usage.rbi +3 -13
- data/rbi/openai/models/responses/responses_client_event.rbi +6 -10
- data/rbi/openai/resources/admin/organization/usage.rbi +4 -0
- data/rbi/openai/resources/beta/responses.rbi +7 -11
- data/rbi/openai/resources/chat/completions.rbi +6 -6
- data/rbi/openai/resources/responses.rbi +9 -13
- data/sig/openai/errors.rbs +1 -1
- data/sig/openai/internal/transport/base_client.rbs +4 -19
- data/sig/openai/models/admin/organization/usage_costs_params.rbs +7 -0
- data/sig/openai/models/beta/beta_response.rbs +2 -1
- data/sig/openai/models/beta/beta_response_usage.rbs +3 -8
- data/sig/openai/models/completion_usage.rbs +0 -5
- data/sig/openai/models/responses/response.rbs +2 -1
- data/sig/openai/models/responses/response_usage.rbs +3 -8
- data/sig/openai/resources/admin/organization/usage.rbs +1 -0
- metadata +1 -1
|
@@ -48,7 +48,7 @@ module OpenAI
|
|
|
48
48
|
#
|
|
49
49
|
# @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be
|
|
50
50
|
#
|
|
51
|
-
# @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] Model ID used to generate the response, like `gpt-
|
|
51
|
+
# @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI
|
|
52
52
|
#
|
|
53
53
|
# @param moderation [OpenAI::Models::Responses::ResponseCreateParams::Moderation, nil] Configuration for running moderation on the input and output of this response.
|
|
54
54
|
#
|
|
@@ -64,7 +64,7 @@ module OpenAI
|
|
|
64
64
|
#
|
|
65
65
|
# @param prompt_cache_retention [Symbol, OpenAI::Models::Responses::ResponseCreateParams::PromptCacheRetention, nil] Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
66
66
|
#
|
|
67
|
-
# @param reasoning [OpenAI::Models::Reasoning, nil]
|
|
67
|
+
# @param reasoning [OpenAI::Models::Reasoning, nil] Configuration options for
|
|
68
68
|
#
|
|
69
69
|
# @param safety_identifier [String, nil] A stable identifier used to help detect users of your application that may be vi
|
|
70
70
|
#
|
|
@@ -156,7 +156,7 @@ module OpenAI
|
|
|
156
156
|
#
|
|
157
157
|
# @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be
|
|
158
158
|
#
|
|
159
|
-
# @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] Model ID used to generate the response, like `gpt-
|
|
159
|
+
# @param model [String, Symbol, OpenAI::Models::ChatModel, OpenAI::Models::ResponsesModel::ResponsesOnlyModel] Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI
|
|
160
160
|
#
|
|
161
161
|
# @param moderation [OpenAI::Models::Responses::ResponseCreateParams::Moderation, nil] Configuration for running moderation on the input and output of this response.
|
|
162
162
|
#
|
|
@@ -220,7 +220,8 @@ module OpenAI
|
|
|
220
220
|
end
|
|
221
221
|
|
|
222
222
|
if response_id
|
|
223
|
-
retrieve_params =
|
|
223
|
+
retrieve_params = parsed.slice(:include, :starting_after)
|
|
224
|
+
retrieve_params[:request_options] = options
|
|
224
225
|
|
|
225
226
|
raw_stream = retrieve_streaming_internal(
|
|
226
227
|
response_id,
|
|
@@ -297,7 +298,7 @@ module OpenAI
|
|
|
297
298
|
#
|
|
298
299
|
# @param prompt_cache_retention [Symbol, OpenAI::Models::Responses::ResponseCreateParams::PromptCacheRetention, nil] Deprecated. Use `prompt_cache_options.ttl` instead.
|
|
299
300
|
#
|
|
300
|
-
# @param reasoning [OpenAI::Models::Reasoning, nil]
|
|
301
|
+
# @param reasoning [OpenAI::Models::Reasoning, nil] Configuration options for
|
|
301
302
|
#
|
|
302
303
|
# @param safety_identifier [String, nil] A stable identifier used to help detect users of your application that may be vi
|
|
303
304
|
#
|
|
@@ -503,7 +504,7 @@ module OpenAI
|
|
|
503
504
|
#
|
|
504
505
|
# @overload compact(model:, input: nil, instructions: nil, previous_response_id: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, service_tier: nil, request_options: {})
|
|
505
506
|
#
|
|
506
|
-
# @param model [Symbol, String, OpenAI::Models::Responses::ResponseCompactParams::Model, nil] Model ID used to generate the response, like `gpt-5
|
|
507
|
+
# @param model [Symbol, String, OpenAI::Models::Responses::ResponseCompactParams::Model, nil] Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
507
508
|
#
|
|
508
509
|
# @param input [String, Array<OpenAI::Models::Responses::EasyInputMessage, OpenAI::Models::Responses::ResponseInputItem::Message, OpenAI::Models::Responses::ResponseOutputMessage, OpenAI::Models::Responses::ResponseFileSearchToolCall, OpenAI::Models::Responses::ResponseComputerToolCall, OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput, OpenAI::Models::Responses::ResponseFunctionWebSearch, OpenAI::Models::Responses::ResponseFunctionToolCall, OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput, OpenAI::Models::Responses::ResponseInputItem::ToolSearchCall, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam, OpenAI::Models::Responses::ResponseInputItem::AdditionalTools, OpenAI::Models::Responses::ResponseReasoningItem, OpenAI::Models::Responses::ResponseCompactionItemParam, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall, OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Models::Responses::ResponseInputItem::LocalShellCall, OpenAI::Models::Responses::ResponseInputItem::LocalShellCallOutput, OpenAI::Models::Responses::ResponseInputItem::ShellCall, OpenAI::Models::Responses::ResponseInputItem::ShellCallOutput, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCallOutput, OpenAI::Models::Responses::ResponseInputItem::McpListTools, OpenAI::Models::Responses::ResponseInputItem::McpApprovalRequest, OpenAI::Models::Responses::ResponseInputItem::McpApprovalResponse, OpenAI::Models::Responses::ResponseInputItem::McpCall, OpenAI::Models::Responses::ResponseCustomToolCallOutput, OpenAI::Models::Responses::ResponseCustomToolCall, OpenAI::Models::Responses::ResponseInputItem::CompactionTrigger, OpenAI::Models::Responses::ResponseInputItem::ItemReference, OpenAI::Models::Responses::ResponseInputItem::Program, OpenAI::Models::Responses::ResponseInputItem::ProgramOutput>, nil] Text, image, or file inputs to the model, used to generate a response
|
|
509
510
|
#
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
|
@@ -14,6 +14,7 @@ require "securerandom"
|
|
|
14
14
|
require "stringio"
|
|
15
15
|
require "time"
|
|
16
16
|
require "uri"
|
|
17
|
+
require "yaml"
|
|
17
18
|
|
|
18
19
|
# We already ship the preferred sorbet manifests in the package itself.
|
|
19
20
|
# `tapioca` currently does not offer us a way to opt out of unnecessary compilation.
|
data/rbi/openai/errors.rbi
CHANGED
|
@@ -4,7 +4,7 @@ module OpenAI
|
|
|
4
4
|
module Helpers
|
|
5
5
|
module Streaming
|
|
6
6
|
class ResponseTextDeltaEvent < OpenAI::Models::Responses::ResponseTextDeltaEvent
|
|
7
|
-
sig { returns(String) }
|
|
7
|
+
sig { returns(T.nilable(String)) }
|
|
8
8
|
def snapshot
|
|
9
9
|
end
|
|
10
10
|
end
|
|
@@ -16,7 +16,7 @@ module OpenAI
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
class ResponseFunctionCallArgumentsDeltaEvent < OpenAI::Models::Responses::ResponseFunctionCallArgumentsDeltaEvent
|
|
19
|
-
sig { returns(String) }
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
20
|
def snapshot
|
|
21
21
|
end
|
|
22
22
|
end
|
|
@@ -78,8 +78,8 @@ module OpenAI
|
|
|
78
78
|
sig { returns(T.nilable(OpenAI::Models::Responses::Response)) }
|
|
79
79
|
attr_reader :completed_response
|
|
80
80
|
|
|
81
|
-
sig { params(text_format: T.untyped).void }
|
|
82
|
-
def initialize(text_format:)
|
|
81
|
+
sig { params(text_format: T.untyped, starting_after: T.nilable(Integer)).void }
|
|
82
|
+
def initialize(text_format:, starting_after: nil)
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
sig { params(event: T.untyped).returns(T::Array[T.untyped]) }
|
|
@@ -91,7 +91,7 @@ module OpenAI
|
|
|
91
91
|
event: T.untyped,
|
|
92
92
|
current_snapshot: T.nilable(OpenAI::Models::Responses::Response)
|
|
93
93
|
)
|
|
94
|
-
.returns(OpenAI::Models::Responses::Response)
|
|
94
|
+
.returns(T.nilable(OpenAI::Models::Responses::Response))
|
|
95
95
|
end
|
|
96
96
|
def accumulate_event(event:, current_snapshot:)
|
|
97
97
|
end
|
|
@@ -61,6 +61,14 @@ module OpenAI
|
|
|
61
61
|
sig { params(limit: Integer).void }
|
|
62
62
|
attr_writer :limit
|
|
63
63
|
|
|
64
|
+
# Return only costs for these exact line item names. Each value must match the
|
|
65
|
+
# complete `line_item` value, for example `gpt-5.6-sol, input_tokens`.
|
|
66
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
67
|
+
attr_reader :line_items
|
|
68
|
+
|
|
69
|
+
sig { params(line_items: T::Array[String]).void }
|
|
70
|
+
attr_writer :line_items
|
|
71
|
+
|
|
64
72
|
# A cursor for use in pagination. Corresponding to the `next_page` field from the
|
|
65
73
|
# previous response.
|
|
66
74
|
sig { returns(T.nilable(String)) }
|
|
@@ -91,6 +99,8 @@ module OpenAI
|
|
|
91
99
|
|
|
92
100
|
limit: Integer,
|
|
93
101
|
|
|
102
|
+
line_items: T::Array[String],
|
|
103
|
+
|
|
94
104
|
page: String,
|
|
95
105
|
|
|
96
106
|
project_ids: T::Array[String],
|
|
@@ -122,6 +132,10 @@ module OpenAI
|
|
|
122
132
|
# 180, and the default is 7.
|
|
123
133
|
limit: nil,
|
|
124
134
|
|
|
135
|
+
# Return only costs for these exact line item names. Each value must match the
|
|
136
|
+
# complete `line_item` value, for example `gpt-5.6-sol, input_tokens`.
|
|
137
|
+
line_items: nil,
|
|
138
|
+
|
|
125
139
|
# A cursor for use in pagination. Corresponding to the `next_page` field from the
|
|
126
140
|
# previous response.
|
|
127
141
|
page: nil,
|
|
@@ -142,6 +156,7 @@ module OpenAI
|
|
|
142
156
|
end_time: Integer,
|
|
143
157
|
group_by: T::Array[OpenAI::Admin::Organization::UsageCostsParams::GroupBy::OrSymbol],
|
|
144
158
|
limit: Integer,
|
|
159
|
+
line_items: T::Array[String],
|
|
145
160
|
page: String,
|
|
146
161
|
project_ids: T::Array[String],
|
|
147
162
|
request_options: OpenAI::RequestOptions
|
data/rbi/openai/models/batch.rbi
CHANGED
|
@@ -117,9 +117,9 @@ module OpenAI
|
|
|
117
117
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
118
118
|
attr_accessor :metadata
|
|
119
119
|
|
|
120
|
-
# Model ID used to process the batch, like `gpt-5-
|
|
121
|
-
#
|
|
122
|
-
#
|
|
120
|
+
# Model ID used to process the batch, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
121
|
+
# range of models with different capabilities, performance characteristics, and
|
|
122
|
+
# price points. Refer to the
|
|
123
123
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
124
124
|
# available models.
|
|
125
125
|
sig { returns(T.nilable(String)) }
|
|
@@ -256,9 +256,9 @@ module OpenAI
|
|
|
256
256
|
# a maximum length of 512 characters.
|
|
257
257
|
metadata: nil,
|
|
258
258
|
|
|
259
|
-
# Model ID used to process the batch, like `gpt-5-
|
|
260
|
-
#
|
|
261
|
-
#
|
|
259
|
+
# Model ID used to process the batch, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
260
|
+
# range of models with different capabilities, performance characteristics, and
|
|
261
|
+
# price points. Refer to the
|
|
262
262
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
263
263
|
# available models.
|
|
264
264
|
model: nil,
|
|
@@ -55,9 +55,9 @@ module OpenAI
|
|
|
55
55
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
56
56
|
attr_accessor :metadata
|
|
57
57
|
|
|
58
|
-
# Model ID used to generate the response, like `gpt-
|
|
59
|
-
#
|
|
60
|
-
#
|
|
58
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
59
|
+
# range of models with different capabilities, performance characteristics, and
|
|
60
|
+
# price points. Refer to the
|
|
61
61
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
62
62
|
# available models.
|
|
63
63
|
sig { returns(OpenAI::Beta::BetaResponse::Model::Variants) }
|
|
@@ -212,8 +212,6 @@ module OpenAI
|
|
|
212
212
|
sig { returns(T.nilable(OpenAI::Beta::BetaResponse::PromptCacheRetention::TaggedSymbol)) }
|
|
213
213
|
attr_accessor :prompt_cache_retention
|
|
214
214
|
|
|
215
|
-
# **gpt-5 and o-series models only**
|
|
216
|
-
#
|
|
217
215
|
# Configuration options for
|
|
218
216
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
219
217
|
sig { returns(T.nilable(OpenAI::Beta::BetaResponse::Reasoning)) }
|
|
@@ -477,9 +475,9 @@ module OpenAI
|
|
|
477
475
|
# a maximum length of 512 characters.
|
|
478
476
|
metadata:,
|
|
479
477
|
|
|
480
|
-
# Model ID used to generate the response, like `gpt-
|
|
481
|
-
#
|
|
482
|
-
#
|
|
478
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
479
|
+
# range of models with different capabilities, performance characteristics, and
|
|
480
|
+
# price points. Refer to the
|
|
483
481
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
484
482
|
# available models.
|
|
485
483
|
model:,
|
|
@@ -600,8 +598,6 @@ module OpenAI
|
|
|
600
598
|
# `prompt_cache_retention` is not specified.
|
|
601
599
|
prompt_cache_retention: nil,
|
|
602
600
|
|
|
603
|
-
# **gpt-5 and o-series models only**
|
|
604
|
-
#
|
|
605
601
|
# Configuration options for
|
|
606
602
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
607
603
|
reasoning: nil,
|
|
@@ -775,6 +771,7 @@ module OpenAI
|
|
|
775
771
|
:max_output_tokens,
|
|
776
772
|
OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::TaggedSymbol
|
|
777
773
|
)
|
|
774
|
+
MAX_MESSAGES = T.let(:max_messages, OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::TaggedSymbol)
|
|
778
775
|
CONTENT_FILTER = T.let(:content_filter, OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::TaggedSymbol)
|
|
779
776
|
|
|
780
777
|
sig { override.returns(T::Array[OpenAI::Beta::BetaResponse::IncompleteDetails::Reason::TaggedSymbol]) }
|
|
@@ -804,9 +801,9 @@ module OpenAI
|
|
|
804
801
|
|
|
805
802
|
end
|
|
806
803
|
|
|
807
|
-
# Model ID used to generate the response, like `gpt-
|
|
808
|
-
#
|
|
809
|
-
#
|
|
804
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
805
|
+
# range of models with different capabilities, performance characteristics, and
|
|
806
|
+
# price points. Refer to the
|
|
810
807
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
811
808
|
# available models.
|
|
812
809
|
module Model
|
|
@@ -1714,8 +1711,6 @@ module OpenAI
|
|
|
1714
1711
|
sig { returns(T.nilable(OpenAI::Beta::BetaResponse::Reasoning::Summary::TaggedSymbol)) }
|
|
1715
1712
|
attr_accessor :summary
|
|
1716
1713
|
|
|
1717
|
-
# **gpt-5 and o-series models only**
|
|
1718
|
-
#
|
|
1719
1714
|
# Configuration options for
|
|
1720
1715
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
1721
1716
|
sig do
|
|
@@ -42,10 +42,6 @@ module OpenAI
|
|
|
42
42
|
sig { returns(Integer) }
|
|
43
43
|
attr_accessor :total_tokens
|
|
44
44
|
|
|
45
|
-
# Compute units for the request. Currently null when available.
|
|
46
|
-
sig { returns(T.nilable(Integer)) }
|
|
47
|
-
attr_accessor :compute_units
|
|
48
|
-
|
|
49
45
|
# Represents token usage details including input tokens, output tokens, a
|
|
50
46
|
# breakdown of output tokens, and the total tokens used.
|
|
51
47
|
sig do
|
|
@@ -59,9 +55,7 @@ module OpenAI
|
|
|
59
55
|
|
|
60
56
|
output_tokens_details: OpenAI::Beta::BetaResponseUsage::OutputTokensDetails::OrHash,
|
|
61
57
|
|
|
62
|
-
total_tokens: Integer
|
|
63
|
-
|
|
64
|
-
compute_units: T.nilable(Integer)
|
|
58
|
+
total_tokens: Integer
|
|
65
59
|
)
|
|
66
60
|
.returns(T.attached_class)
|
|
67
61
|
end
|
|
@@ -80,11 +74,8 @@ module OpenAI
|
|
|
80
74
|
output_tokens_details:,
|
|
81
75
|
|
|
82
76
|
# The total number of tokens used.
|
|
83
|
-
total_tokens:,
|
|
84
|
-
|
|
85
|
-
# Compute units for the request. Currently null when available.
|
|
86
77
|
|
|
87
|
-
|
|
78
|
+
total_tokens:
|
|
88
79
|
)
|
|
89
80
|
end
|
|
90
81
|
|
|
@@ -95,8 +86,7 @@ module OpenAI
|
|
|
95
86
|
input_tokens_details: OpenAI::Beta::BetaResponseUsage::InputTokensDetails,
|
|
96
87
|
output_tokens: Integer,
|
|
97
88
|
output_tokens_details: OpenAI::Beta::BetaResponseUsage::OutputTokensDetails,
|
|
98
|
-
total_tokens: Integer
|
|
99
|
-
compute_units: T.nilable(Integer)
|
|
89
|
+
total_tokens: Integer
|
|
100
90
|
}
|
|
101
91
|
)
|
|
102
92
|
end
|
|
@@ -114,9 +114,9 @@ module OpenAI
|
|
|
114
114
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
115
115
|
attr_accessor :metadata
|
|
116
116
|
|
|
117
|
-
# Model ID used to generate the response, like `gpt-
|
|
118
|
-
#
|
|
119
|
-
#
|
|
117
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
118
|
+
# range of models with different capabilities, performance characteristics, and
|
|
119
|
+
# price points. Refer to the
|
|
120
120
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
121
121
|
# available models.
|
|
122
122
|
sig {
|
|
@@ -216,8 +216,6 @@ module OpenAI
|
|
|
216
216
|
}
|
|
217
217
|
attr_accessor :prompt_cache_retention
|
|
218
218
|
|
|
219
|
-
# **gpt-5 and o-series models only**
|
|
220
|
-
#
|
|
221
219
|
# Configuration options for
|
|
222
220
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
223
221
|
sig { returns(T.nilable(OpenAI::Beta::BetaResponsesClientEvent::ResponseCreate::Reasoning)) }
|
|
@@ -654,9 +652,9 @@ module OpenAI
|
|
|
654
652
|
# a maximum length of 512 characters.
|
|
655
653
|
metadata: nil,
|
|
656
654
|
|
|
657
|
-
# Model ID used to generate the response, like `gpt-
|
|
658
|
-
#
|
|
659
|
-
#
|
|
655
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
656
|
+
# range of models with different capabilities, performance characteristics, and
|
|
657
|
+
# price points. Refer to the
|
|
660
658
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
661
659
|
# available models.
|
|
662
660
|
model: nil,
|
|
@@ -715,8 +713,6 @@ module OpenAI
|
|
|
715
713
|
# `prompt_cache_retention` is not specified.
|
|
716
714
|
prompt_cache_retention: nil,
|
|
717
715
|
|
|
718
|
-
# **gpt-5 and o-series models only**
|
|
719
|
-
#
|
|
720
716
|
# Configuration options for
|
|
721
717
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
722
718
|
reasoning: nil,
|
|
@@ -1008,9 +1004,9 @@ module OpenAI
|
|
|
1008
1004
|
|
|
1009
1005
|
end
|
|
1010
1006
|
|
|
1011
|
-
# Model ID used to generate the response, like `gpt-
|
|
1012
|
-
#
|
|
1013
|
-
#
|
|
1007
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
1008
|
+
# range of models with different capabilities, performance characteristics, and
|
|
1009
|
+
# price points. Refer to the
|
|
1014
1010
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
1015
1011
|
# available models.
|
|
1016
1012
|
module Model
|
|
@@ -1998,8 +1994,6 @@ module OpenAI
|
|
|
1998
1994
|
}
|
|
1999
1995
|
attr_accessor :summary
|
|
2000
1996
|
|
|
2001
|
-
# **gpt-5 and o-series models only**
|
|
2002
|
-
#
|
|
2003
1997
|
# Configuration options for
|
|
2004
1998
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
2005
1999
|
sig do
|
|
@@ -17,9 +17,9 @@ module OpenAI
|
|
|
17
17
|
)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
# Model ID used to generate the response, like `gpt-5
|
|
21
|
-
#
|
|
22
|
-
#
|
|
20
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
21
|
+
# range of models with different capabilities, performance characteristics, and
|
|
22
|
+
# price points. Refer to the
|
|
23
23
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
24
24
|
# available models.
|
|
25
25
|
sig { returns(T.nilable(T.any(OpenAI::Beta::ResponseCompactParams::Model::OrSymbol, String))) }
|
|
@@ -119,9 +119,9 @@ module OpenAI
|
|
|
119
119
|
end
|
|
120
120
|
def self.new(
|
|
121
121
|
|
|
122
|
-
# Model ID used to generate the response, like `gpt-5
|
|
123
|
-
#
|
|
124
|
-
#
|
|
122
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
123
|
+
# range of models with different capabilities, performance characteristics, and
|
|
124
|
+
# price points. Refer to the
|
|
125
125
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
126
126
|
# available models.
|
|
127
127
|
model:,
|
|
@@ -200,9 +200,9 @@ module OpenAI
|
|
|
200
200
|
def to_hash
|
|
201
201
|
end
|
|
202
202
|
|
|
203
|
-
# Model ID used to generate the response, like `gpt-5
|
|
204
|
-
#
|
|
205
|
-
#
|
|
203
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
204
|
+
# range of models with different capabilities, performance characteristics, and
|
|
205
|
+
# price points. Refer to the
|
|
206
206
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
207
207
|
# available models.
|
|
208
208
|
module Model
|
|
@@ -99,9 +99,9 @@ module OpenAI
|
|
|
99
99
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
100
100
|
attr_accessor :metadata
|
|
101
101
|
|
|
102
|
-
# Model ID used to generate the response, like `gpt-
|
|
103
|
-
#
|
|
104
|
-
#
|
|
102
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
103
|
+
# range of models with different capabilities, performance characteristics, and
|
|
104
|
+
# price points. Refer to the
|
|
105
105
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
106
106
|
# available models.
|
|
107
107
|
sig { returns(T.nilable(T.any(OpenAI::Beta::ResponseCreateParams::Model::OrSymbol, String))) }
|
|
@@ -184,8 +184,6 @@ module OpenAI
|
|
|
184
184
|
sig { returns(T.nilable(OpenAI::Beta::ResponseCreateParams::PromptCacheRetention::OrSymbol)) }
|
|
185
185
|
attr_accessor :prompt_cache_retention
|
|
186
186
|
|
|
187
|
-
# **gpt-5 and o-series models only**
|
|
188
|
-
#
|
|
189
187
|
# Configuration options for
|
|
190
188
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
191
189
|
sig { returns(T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning)) }
|
|
@@ -586,9 +584,9 @@ module OpenAI
|
|
|
586
584
|
# a maximum length of 512 characters.
|
|
587
585
|
metadata: nil,
|
|
588
586
|
|
|
589
|
-
# Model ID used to generate the response, like `gpt-
|
|
590
|
-
#
|
|
591
|
-
#
|
|
587
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
588
|
+
# range of models with different capabilities, performance characteristics, and
|
|
589
|
+
# price points. Refer to the
|
|
592
590
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
593
591
|
# available models.
|
|
594
592
|
model: nil,
|
|
@@ -647,8 +645,6 @@ module OpenAI
|
|
|
647
645
|
# `prompt_cache_retention` is not specified.
|
|
648
646
|
prompt_cache_retention: nil,
|
|
649
647
|
|
|
650
|
-
# **gpt-5 and o-series models only**
|
|
651
|
-
#
|
|
652
648
|
# Configuration options for
|
|
653
649
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
654
650
|
reasoning: nil,
|
|
@@ -918,9 +914,9 @@ module OpenAI
|
|
|
918
914
|
|
|
919
915
|
end
|
|
920
916
|
|
|
921
|
-
# Model ID used to generate the response, like `gpt-
|
|
922
|
-
#
|
|
923
|
-
#
|
|
917
|
+
# Model ID used to generate the response, like `gpt-5.6-sol`. OpenAI offers a wide
|
|
918
|
+
# range of models with different capabilities, performance characteristics, and
|
|
919
|
+
# price points. Refer to the
|
|
924
920
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
925
921
|
# available models.
|
|
926
922
|
module Model
|
|
@@ -1611,8 +1607,6 @@ module OpenAI
|
|
|
1611
1607
|
sig { returns(T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning::Summary::OrSymbol)) }
|
|
1612
1608
|
attr_accessor :summary
|
|
1613
1609
|
|
|
1614
|
-
# **gpt-5 and o-series models only**
|
|
1615
|
-
#
|
|
1616
1610
|
# Configuration options for
|
|
1617
1611
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
1618
1612
|
sig do
|
|
@@ -40,9 +40,9 @@ module OpenAI
|
|
|
40
40
|
|
|
41
41
|
attr_accessor :messages
|
|
42
42
|
|
|
43
|
-
# Model ID used to generate the response, like `gpt-
|
|
44
|
-
# wide range of models with different capabilities, performance
|
|
45
|
-
# and price points. Refer to the
|
|
43
|
+
# Model ID used to generate the response, like `gpt-5.6-sol` or `o3`. OpenAI
|
|
44
|
+
# offers a wide range of models with different capabilities, performance
|
|
45
|
+
# characteristics, and price points. Refer to the
|
|
46
46
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
47
47
|
# available models.
|
|
48
48
|
sig { returns(T.any(String, OpenAI::ChatModel::OrSymbol)) }
|
|
@@ -583,9 +583,9 @@ module OpenAI
|
|
|
583
583
|
# [audio](https://platform.openai.com/docs/guides/audio).
|
|
584
584
|
messages:,
|
|
585
585
|
|
|
586
|
-
# Model ID used to generate the response, like `gpt-
|
|
587
|
-
# wide range of models with different capabilities, performance
|
|
588
|
-
# and price points. Refer to the
|
|
586
|
+
# Model ID used to generate the response, like `gpt-5.6-sol` or `o3`. OpenAI
|
|
587
|
+
# offers a wide range of models with different capabilities, performance
|
|
588
|
+
# characteristics, and price points. Refer to the
|
|
589
589
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
590
590
|
# available models.
|
|
591
591
|
model:,
|
|
@@ -930,9 +930,9 @@ module OpenAI
|
|
|
930
930
|
def to_hash
|
|
931
931
|
end
|
|
932
932
|
|
|
933
|
-
# Model ID used to generate the response, like `gpt-
|
|
934
|
-
# wide range of models with different capabilities, performance
|
|
935
|
-
# and price points. Refer to the
|
|
933
|
+
# Model ID used to generate the response, like `gpt-5.6-sol` or `o3`. OpenAI
|
|
934
|
+
# offers a wide range of models with different capabilities, performance
|
|
935
|
+
# characteristics, and price points. Refer to the
|
|
936
936
|
# [model guide](https://platform.openai.com/docs/models) to browse and compare
|
|
937
937
|
# available models.
|
|
938
938
|
module Model
|
|
@@ -31,10 +31,6 @@ module OpenAI
|
|
|
31
31
|
sig { params(completion_tokens_details: OpenAI::CompletionUsage::CompletionTokensDetails::OrHash).void }
|
|
32
32
|
attr_writer :completion_tokens_details
|
|
33
33
|
|
|
34
|
-
# Compute units for the request. Currently null when available.
|
|
35
|
-
sig { returns(T.nilable(Integer)) }
|
|
36
|
-
attr_accessor :compute_units
|
|
37
|
-
|
|
38
34
|
# Breakdown of tokens used in the prompt.
|
|
39
35
|
sig { returns(T.nilable(OpenAI::CompletionUsage::PromptTokensDetails)) }
|
|
40
36
|
attr_reader :prompt_tokens_details
|
|
@@ -54,8 +50,6 @@ module OpenAI
|
|
|
54
50
|
|
|
55
51
|
completion_tokens_details: OpenAI::CompletionUsage::CompletionTokensDetails::OrHash,
|
|
56
52
|
|
|
57
|
-
compute_units: T.nilable(Integer),
|
|
58
|
-
|
|
59
53
|
prompt_tokens_details: OpenAI::CompletionUsage::PromptTokensDetails::OrHash
|
|
60
54
|
)
|
|
61
55
|
.returns(T.attached_class)
|
|
@@ -74,9 +68,6 @@ module OpenAI
|
|
|
74
68
|
# Breakdown of tokens used in a completion.
|
|
75
69
|
completion_tokens_details: nil,
|
|
76
70
|
|
|
77
|
-
# Compute units for the request. Currently null when available.
|
|
78
|
-
compute_units: nil,
|
|
79
|
-
|
|
80
71
|
# Breakdown of tokens used in the prompt.
|
|
81
72
|
|
|
82
73
|
prompt_tokens_details: nil
|
|
@@ -90,7 +81,6 @@ module OpenAI
|
|
|
90
81
|
prompt_tokens: Integer,
|
|
91
82
|
total_tokens: Integer,
|
|
92
83
|
completion_tokens_details: OpenAI::CompletionUsage::CompletionTokensDetails,
|
|
93
|
-
compute_units: T.nilable(Integer),
|
|
94
84
|
prompt_tokens_details: OpenAI::CompletionUsage::PromptTokensDetails
|
|
95
85
|
}
|
|
96
86
|
)
|
|
@@ -50,7 +50,7 @@ module OpenAI
|
|
|
50
50
|
#
|
|
51
51
|
# - Improve the quality of my chatbot
|
|
52
52
|
# - See how well my chatbot handles customer support
|
|
53
|
-
# - Check if o4-mini is better at my usecase than gpt-
|
|
53
|
+
# - Check if o4-mini is better at my usecase than gpt-5.6-sol
|
|
54
54
|
sig do
|
|
55
55
|
params(
|
|
56
56
|
|
|
@@ -50,7 +50,7 @@ module OpenAI
|
|
|
50
50
|
#
|
|
51
51
|
# - Improve the quality of my chatbot
|
|
52
52
|
# - See how well my chatbot handles customer support
|
|
53
|
-
# - Check if o4-mini is better at my usecase than gpt-
|
|
53
|
+
# - Check if o4-mini is better at my usecase than gpt-5.6-sol
|
|
54
54
|
sig do
|
|
55
55
|
params(
|
|
56
56
|
|
|
@@ -50,7 +50,7 @@ module OpenAI
|
|
|
50
50
|
#
|
|
51
51
|
# - Improve the quality of my chatbot
|
|
52
52
|
# - See how well my chatbot handles customer support
|
|
53
|
-
# - Check if o4-mini is better at my usecase than gpt-
|
|
53
|
+
# - Check if o4-mini is better at my usecase than gpt-5.6-sol
|
|
54
54
|
sig do
|
|
55
55
|
params(
|
|
56
56
|
|
|
@@ -50,7 +50,7 @@ module OpenAI
|
|
|
50
50
|
#
|
|
51
51
|
# - Improve the quality of my chatbot
|
|
52
52
|
# - See how well my chatbot handles customer support
|
|
53
|
-
# - Check if o4-mini is better at my usecase than gpt-
|
|
53
|
+
# - Check if o4-mini is better at my usecase than gpt-5.6-sol
|
|
54
54
|
sig do
|
|
55
55
|
params(
|
|
56
56
|
|
|
@@ -320,7 +320,7 @@ module OpenAI
|
|
|
320
320
|
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
321
321
|
attr_accessor :metadata
|
|
322
322
|
|
|
323
|
-
# An optional model to filter by (e.g., 'gpt-
|
|
323
|
+
# An optional model to filter by (e.g., 'gpt-5.6-sol').
|
|
324
324
|
sig { returns(T.nilable(String)) }
|
|
325
325
|
attr_accessor :model
|
|
326
326
|
|
|
@@ -361,7 +361,7 @@ module OpenAI
|
|
|
361
361
|
# a maximum length of 512 characters.
|
|
362
362
|
metadata: nil,
|
|
363
363
|
|
|
364
|
-
# An optional model to filter by (e.g., 'gpt-
|
|
364
|
+
# An optional model to filter by (e.g., 'gpt-5.6-sol').
|
|
365
365
|
model: nil,
|
|
366
366
|
|
|
367
367
|
# The type of source. Always `stored_completions`.
|
|
@@ -56,8 +56,6 @@ module OpenAI
|
|
|
56
56
|
sig { returns(T.nilable(OpenAI::Reasoning::Summary::OrSymbol)) }
|
|
57
57
|
attr_accessor :summary
|
|
58
58
|
|
|
59
|
-
# **gpt-5 and o-series models only**
|
|
60
|
-
#
|
|
61
59
|
# Configuration options for
|
|
62
60
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
|
63
61
|
sig do
|