openai 0.71.0 → 0.72.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 +10 -0
- data/README.md +1 -1
- data/lib/openai/models/admin/organization/organization_spend_limit.rb +151 -0
- data/lib/openai/models/admin/organization/organization_spend_limit_deleted.rb +33 -0
- data/lib/openai/models/admin/organization/projects/project_spend_limit.rb +155 -0
- data/lib/openai/models/admin/organization/projects/project_spend_limit_deleted.rb +35 -0
- data/lib/openai/models/admin/organization/projects/spend_limit_delete_params.rb +26 -0
- data/lib/openai/models/admin/organization/projects/spend_limit_retrieve_params.rb +26 -0
- data/lib/openai/models/admin/organization/projects/spend_limit_update_params.rb +77 -0
- data/lib/openai/models/admin/organization/spend_limit_delete_params.rb +18 -0
- data/lib/openai/models/admin/organization/spend_limit_retrieve_params.rb +18 -0
- data/lib/openai/models/admin/organization/spend_limit_update_params.rb +67 -0
- data/lib/openai/models/beta/beta_response.rb +12 -6
- data/lib/openai/models/beta/beta_response_error.rb +1 -0
- data/lib/openai/models/beta/beta_response_text_config.rb +4 -2
- data/lib/openai/models/beta/beta_responses_client_event.rb +12 -6
- data/lib/openai/models/beta/response_create_params.rb +12 -6
- data/lib/openai/models/beta/responses/input_token_count_params.rb +12 -4
- data/lib/openai/models/chat/completion_create_params.rb +8 -6
- data/lib/openai/models/reasoning.rb +8 -2
- data/lib/openai/models/responses/input_token_count_params.rb +4 -2
- data/lib/openai/models/responses/response.rb +4 -4
- data/lib/openai/models/responses/response_create_params.rb +4 -4
- data/lib/openai/models/responses/response_error.rb +1 -0
- data/lib/openai/models/responses/response_text_config.rb +4 -2
- data/lib/openai/models/responses/responses_client_event.rb +4 -4
- data/lib/openai/resources/admin/organization/projects/spend_limit.rb +95 -0
- data/lib/openai/resources/admin/organization/projects.rb +4 -0
- data/lib/openai/resources/admin/organization/spend_limit.rb +86 -0
- data/lib/openai/resources/admin/organization.rb +4 -0
- data/lib/openai/resources/beta/responses.rb +4 -4
- data/lib/openai/resources/chat/completions.rb +4 -4
- data/lib/openai/resources/responses.rb +4 -4
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +12 -0
- data/rbi/openai/models/admin/organization/organization_spend_limit.rbi +278 -0
- data/rbi/openai/models/admin/organization/organization_spend_limit_deleted.rbi +48 -0
- data/rbi/openai/models/admin/organization/projects/project_spend_limit.rbi +280 -0
- data/rbi/openai/models/admin/organization/projects/project_spend_limit_deleted.rbi +49 -0
- data/rbi/openai/models/admin/organization/projects/spend_limit_delete_params.rbi +44 -0
- data/rbi/openai/models/admin/organization/projects/spend_limit_retrieve_params.rbi +44 -0
- data/rbi/openai/models/admin/organization/projects/spend_limit_update_params.rbi +149 -0
- data/rbi/openai/models/admin/organization/spend_limit_delete_params.rbi +34 -0
- data/rbi/openai/models/admin/organization/spend_limit_retrieve_params.rbi +34 -0
- data/rbi/openai/models/admin/organization/spend_limit_update_params.rbi +141 -0
- data/rbi/openai/models/beta/beta_response.rbi +18 -15
- data/rbi/openai/models/beta/beta_response_error.rbi +5 -0
- data/rbi/openai/models/beta/beta_response_text_config.rbi +6 -3
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +18 -15
- data/rbi/openai/models/beta/response_create_params.rbi +18 -15
- data/rbi/openai/models/beta/responses/input_token_count_params.rbi +18 -6
- data/rbi/openai/models/chat/completion_create_params.rbi +12 -15
- data/rbi/openai/models/reasoning.rbi +12 -3
- data/rbi/openai/models/responses/input_token_count_params.rbi +6 -3
- data/rbi/openai/models/responses/response.rbi +6 -12
- data/rbi/openai/models/responses/response_create_params.rbi +6 -12
- data/rbi/openai/models/responses/response_error.rbi +5 -0
- data/rbi/openai/models/responses/response_text_config.rbi +6 -3
- data/rbi/openai/models/responses/responses_client_event.rbi +6 -12
- data/rbi/openai/resources/admin/organization/projects/spend_limit.rbi +78 -0
- data/rbi/openai/resources/admin/organization/projects.rbi +7 -0
- data/rbi/openai/resources/admin/organization/spend_limit.rbi +57 -0
- data/rbi/openai/resources/admin/organization.rbi +3 -0
- data/rbi/openai/resources/beta/responses.rbi +4 -4
- data/rbi/openai/resources/chat/completions.rbi +8 -6
- data/rbi/openai/resources/responses.rbi +4 -4
- data/sig/openai/models/admin/organization/organization_spend_limit.rbs +94 -0
- data/sig/openai/models/admin/organization/organization_spend_limit_deleted.rbs +28 -0
- data/sig/openai/models/admin/organization/projects/project_spend_limit.rbs +96 -0
- data/sig/openai/models/admin/organization/projects/project_spend_limit_deleted.rbs +30 -0
- data/sig/openai/models/admin/organization/projects/spend_limit_delete_params.rbs +29 -0
- data/sig/openai/models/admin/organization/projects/spend_limit_retrieve_params.rbs +29 -0
- data/sig/openai/models/admin/organization/projects/spend_limit_update_params.rbs +67 -0
- data/sig/openai/models/admin/organization/spend_limit_delete_params.rbs +19 -0
- data/sig/openai/models/admin/organization/spend_limit_retrieve_params.rbs +19 -0
- data/sig/openai/models/admin/organization/spend_limit_update_params.rbs +60 -0
- data/sig/openai/models/beta/beta_response.rbs +8 -12
- data/sig/openai/models/beta/beta_response_error.rbs +2 -0
- data/sig/openai/models/beta/beta_responses_client_event.rbs +8 -12
- data/sig/openai/models/beta/response_create_params.rbs +8 -12
- data/sig/openai/models/chat/completion_create_params.rbs +8 -12
- data/sig/openai/models/responses/response.rbs +8 -12
- data/sig/openai/models/responses/response_create_params.rbs +8 -12
- data/sig/openai/models/responses/response_error.rbs +2 -0
- data/sig/openai/models/responses/responses_client_event.rbs +8 -12
- data/sig/openai/resources/admin/organization/projects/spend_limit.rbs +31 -0
- data/sig/openai/resources/admin/organization/projects.rbs +2 -0
- data/sig/openai/resources/admin/organization/spend_limit.rbs +26 -0
- data/sig/openai/resources/admin/organization.rbs +2 -0
- data/sig/openai/resources/beta/responses.rbs +4 -4
- data/sig/openai/resources/chat/completions.rbs +4 -4
- data/sig/openai/resources/responses.rbs +4 -4
- metadata +38 -2
|
@@ -523,7 +523,8 @@ module OpenAI
|
|
|
523
523
|
|
|
524
524
|
# Constrains the verbosity of the model's response. Lower values will result in
|
|
525
525
|
# more concise responses, while higher values will result in more verbose
|
|
526
|
-
# responses. Currently supported values are `low`, `medium`, and `high`.
|
|
526
|
+
# responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
527
|
+
# default is `medium`.
|
|
527
528
|
sig do
|
|
528
529
|
returns(
|
|
529
530
|
T.nilable(
|
|
@@ -569,7 +570,8 @@ module OpenAI
|
|
|
569
570
|
format_: nil,
|
|
570
571
|
# Constrains the verbosity of the model's response. Lower values will result in
|
|
571
572
|
# more concise responses, while higher values will result in more verbose
|
|
572
|
-
# responses. Currently supported values are `low`, `medium`, and `high`.
|
|
573
|
+
# responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
574
|
+
# default is `medium`.
|
|
573
575
|
verbosity: nil
|
|
574
576
|
)
|
|
575
577
|
end
|
|
@@ -595,7 +597,8 @@ module OpenAI
|
|
|
595
597
|
|
|
596
598
|
# Constrains the verbosity of the model's response. Lower values will result in
|
|
597
599
|
# more concise responses, while higher values will result in more verbose
|
|
598
|
-
# responses. Currently supported values are `low`, `medium`, and `high`.
|
|
600
|
+
# responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
601
|
+
# default is `medium`.
|
|
599
602
|
module Verbosity
|
|
600
603
|
extend OpenAI::Internal::Type::Enum
|
|
601
604
|
|
|
@@ -206,10 +206,7 @@ module OpenAI
|
|
|
206
206
|
# hit rates. Replaces the `user` field.
|
|
207
207
|
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
208
208
|
sig { returns(T.nilable(String)) }
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
sig { params(prompt_cache_key: String).void }
|
|
212
|
-
attr_writer :prompt_cache_key
|
|
209
|
+
attr_accessor :prompt_cache_key
|
|
213
210
|
|
|
214
211
|
# The prompt-caching options that were applied to the response. Supported for
|
|
215
212
|
# `gpt-5.6` and later models.
|
|
@@ -269,10 +266,7 @@ module OpenAI
|
|
|
269
266
|
# identifying information.
|
|
270
267
|
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
271
268
|
sig { returns(T.nilable(String)) }
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
sig { params(safety_identifier: String).void }
|
|
275
|
-
attr_writer :safety_identifier
|
|
269
|
+
attr_accessor :safety_identifier
|
|
276
270
|
|
|
277
271
|
# Specifies the processing type used for serving the request.
|
|
278
272
|
#
|
|
@@ -452,7 +446,7 @@ module OpenAI
|
|
|
452
446
|
T.nilable(OpenAI::Responses::Response::Moderation::OrHash),
|
|
453
447
|
previous_response_id: T.nilable(String),
|
|
454
448
|
prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash),
|
|
455
|
-
prompt_cache_key: String,
|
|
449
|
+
prompt_cache_key: T.nilable(String),
|
|
456
450
|
prompt_cache_options:
|
|
457
451
|
OpenAI::Responses::Response::PromptCacheOptions::OrHash,
|
|
458
452
|
prompt_cache_retention:
|
|
@@ -460,7 +454,7 @@ module OpenAI
|
|
|
460
454
|
OpenAI::Responses::Response::PromptCacheRetention::OrSymbol
|
|
461
455
|
),
|
|
462
456
|
reasoning: T.nilable(OpenAI::Reasoning::OrHash),
|
|
463
|
-
safety_identifier: String,
|
|
457
|
+
safety_identifier: T.nilable(String),
|
|
464
458
|
service_tier:
|
|
465
459
|
T.nilable(OpenAI::Responses::Response::ServiceTier::OrSymbol),
|
|
466
460
|
status: OpenAI::Responses::ResponseStatus::OrSymbol,
|
|
@@ -692,7 +686,7 @@ module OpenAI
|
|
|
692
686
|
moderation: T.nilable(OpenAI::Responses::Response::Moderation),
|
|
693
687
|
previous_response_id: T.nilable(String),
|
|
694
688
|
prompt: T.nilable(OpenAI::Responses::ResponsePrompt),
|
|
695
|
-
prompt_cache_key: String,
|
|
689
|
+
prompt_cache_key: T.nilable(String),
|
|
696
690
|
prompt_cache_options:
|
|
697
691
|
OpenAI::Responses::Response::PromptCacheOptions,
|
|
698
692
|
prompt_cache_retention:
|
|
@@ -700,7 +694,7 @@ module OpenAI
|
|
|
700
694
|
OpenAI::Responses::Response::PromptCacheRetention::TaggedSymbol
|
|
701
695
|
),
|
|
702
696
|
reasoning: T.nilable(OpenAI::Reasoning),
|
|
703
|
-
safety_identifier: String,
|
|
697
|
+
safety_identifier: T.nilable(String),
|
|
704
698
|
service_tier:
|
|
705
699
|
T.nilable(
|
|
706
700
|
OpenAI::Responses::Response::ServiceTier::TaggedSymbol
|
|
@@ -198,10 +198,7 @@ module OpenAI
|
|
|
198
198
|
# hit rates. Replaces the `user` field.
|
|
199
199
|
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
200
200
|
sig { returns(T.nilable(String)) }
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
sig { params(prompt_cache_key: String).void }
|
|
204
|
-
attr_writer :prompt_cache_key
|
|
201
|
+
attr_accessor :prompt_cache_key
|
|
205
202
|
|
|
206
203
|
# Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
207
204
|
# default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
@@ -272,10 +269,7 @@ module OpenAI
|
|
|
272
269
|
# identifying information.
|
|
273
270
|
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
274
271
|
sig { returns(T.nilable(String)) }
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
sig { params(safety_identifier: String).void }
|
|
278
|
-
attr_writer :safety_identifier
|
|
272
|
+
attr_accessor :safety_identifier
|
|
279
273
|
|
|
280
274
|
# Specifies the processing type used for serving the request.
|
|
281
275
|
#
|
|
@@ -543,7 +537,7 @@ module OpenAI
|
|
|
543
537
|
parallel_tool_calls: T.nilable(T::Boolean),
|
|
544
538
|
previous_response_id: T.nilable(String),
|
|
545
539
|
prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash),
|
|
546
|
-
prompt_cache_key: String,
|
|
540
|
+
prompt_cache_key: T.nilable(String),
|
|
547
541
|
prompt_cache_options:
|
|
548
542
|
OpenAI::Responses::ResponseCreateParams::PromptCacheOptions::OrHash,
|
|
549
543
|
prompt_cache_retention:
|
|
@@ -551,7 +545,7 @@ module OpenAI
|
|
|
551
545
|
OpenAI::Responses::ResponseCreateParams::PromptCacheRetention::OrSymbol
|
|
552
546
|
),
|
|
553
547
|
reasoning: T.nilable(OpenAI::Reasoning::OrHash),
|
|
554
|
-
safety_identifier: String,
|
|
548
|
+
safety_identifier: T.nilable(String),
|
|
555
549
|
service_tier:
|
|
556
550
|
T.nilable(
|
|
557
551
|
OpenAI::Responses::ResponseCreateParams::ServiceTier::OrSymbol
|
|
@@ -848,7 +842,7 @@ module OpenAI
|
|
|
848
842
|
parallel_tool_calls: T.nilable(T::Boolean),
|
|
849
843
|
previous_response_id: T.nilable(String),
|
|
850
844
|
prompt: T.nilable(OpenAI::Responses::ResponsePrompt),
|
|
851
|
-
prompt_cache_key: String,
|
|
845
|
+
prompt_cache_key: T.nilable(String),
|
|
852
846
|
prompt_cache_options:
|
|
853
847
|
OpenAI::Responses::ResponseCreateParams::PromptCacheOptions,
|
|
854
848
|
prompt_cache_retention:
|
|
@@ -856,7 +850,7 @@ module OpenAI
|
|
|
856
850
|
OpenAI::Responses::ResponseCreateParams::PromptCacheRetention::OrSymbol
|
|
857
851
|
),
|
|
858
852
|
reasoning: T.nilable(OpenAI::Reasoning),
|
|
859
|
-
safety_identifier: String,
|
|
853
|
+
safety_identifier: T.nilable(String),
|
|
860
854
|
service_tier:
|
|
861
855
|
T.nilable(
|
|
862
856
|
OpenAI::Responses::ResponseCreateParams::ServiceTier::OrSymbol
|
|
@@ -68,6 +68,11 @@ module OpenAI
|
|
|
68
68
|
:invalid_prompt,
|
|
69
69
|
OpenAI::Responses::ResponseError::Code::TaggedSymbol
|
|
70
70
|
)
|
|
71
|
+
DATA_RESIDENCY_MISMATCH =
|
|
72
|
+
T.let(
|
|
73
|
+
:data_residency_mismatch,
|
|
74
|
+
OpenAI::Responses::ResponseError::Code::TaggedSymbol
|
|
75
|
+
)
|
|
71
76
|
BIO_POLICY =
|
|
72
77
|
T.let(
|
|
73
78
|
:bio_policy,
|
|
@@ -52,7 +52,8 @@ module OpenAI
|
|
|
52
52
|
|
|
53
53
|
# Constrains the verbosity of the model's response. Lower values will result in
|
|
54
54
|
# more concise responses, while higher values will result in more verbose
|
|
55
|
-
# responses. Currently supported values are `low`, `medium`, and `high`.
|
|
55
|
+
# responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
56
|
+
# default is `medium`.
|
|
56
57
|
sig do
|
|
57
58
|
returns(
|
|
58
59
|
T.nilable(
|
|
@@ -98,7 +99,8 @@ module OpenAI
|
|
|
98
99
|
format_: nil,
|
|
99
100
|
# Constrains the verbosity of the model's response. Lower values will result in
|
|
100
101
|
# more concise responses, while higher values will result in more verbose
|
|
101
|
-
# responses. Currently supported values are `low`, `medium`, and `high`.
|
|
102
|
+
# responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
103
|
+
# default is `medium`.
|
|
102
104
|
verbosity: nil
|
|
103
105
|
)
|
|
104
106
|
end
|
|
@@ -124,7 +126,8 @@ module OpenAI
|
|
|
124
126
|
|
|
125
127
|
# Constrains the verbosity of the model's response. Lower values will result in
|
|
126
128
|
# more concise responses, while higher values will result in more verbose
|
|
127
|
-
# responses. Currently supported values are `low`, `medium`, and `high`.
|
|
129
|
+
# responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
130
|
+
# default is `medium`.
|
|
128
131
|
module Verbosity
|
|
129
132
|
extend OpenAI::Internal::Type::Enum
|
|
130
133
|
|
|
@@ -199,10 +199,7 @@ module OpenAI
|
|
|
199
199
|
# hit rates. Replaces the `user` field.
|
|
200
200
|
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
|
201
201
|
sig { returns(T.nilable(String)) }
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
sig { params(prompt_cache_key: String).void }
|
|
205
|
-
attr_writer :prompt_cache_key
|
|
202
|
+
attr_accessor :prompt_cache_key
|
|
206
203
|
|
|
207
204
|
# Options for prompt caching. Supported for `gpt-5.6` and later models. By
|
|
208
205
|
# default, OpenAI automatically chooses one implicit cache breakpoint. You can add
|
|
@@ -273,10 +270,7 @@ module OpenAI
|
|
|
273
270
|
# identifying information.
|
|
274
271
|
# [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).
|
|
275
272
|
sig { returns(T.nilable(String)) }
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
sig { params(safety_identifier: String).void }
|
|
279
|
-
attr_writer :safety_identifier
|
|
273
|
+
attr_accessor :safety_identifier
|
|
280
274
|
|
|
281
275
|
# Specifies the processing type used for serving the request.
|
|
282
276
|
#
|
|
@@ -545,7 +539,7 @@ module OpenAI
|
|
|
545
539
|
parallel_tool_calls: T.nilable(T::Boolean),
|
|
546
540
|
previous_response_id: T.nilable(String),
|
|
547
541
|
prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash),
|
|
548
|
-
prompt_cache_key: String,
|
|
542
|
+
prompt_cache_key: T.nilable(String),
|
|
549
543
|
prompt_cache_options:
|
|
550
544
|
OpenAI::Responses::ResponsesClientEvent::PromptCacheOptions::OrHash,
|
|
551
545
|
prompt_cache_retention:
|
|
@@ -553,7 +547,7 @@ module OpenAI
|
|
|
553
547
|
OpenAI::Responses::ResponsesClientEvent::PromptCacheRetention::OrSymbol
|
|
554
548
|
),
|
|
555
549
|
reasoning: T.nilable(OpenAI::Reasoning::OrHash),
|
|
556
|
-
safety_identifier: String,
|
|
550
|
+
safety_identifier: T.nilable(String),
|
|
557
551
|
service_tier:
|
|
558
552
|
T.nilable(
|
|
559
553
|
OpenAI::Responses::ResponsesClientEvent::ServiceTier::OrSymbol
|
|
@@ -860,7 +854,7 @@ module OpenAI
|
|
|
860
854
|
parallel_tool_calls: T.nilable(T::Boolean),
|
|
861
855
|
previous_response_id: T.nilable(String),
|
|
862
856
|
prompt: T.nilable(OpenAI::Responses::ResponsePrompt),
|
|
863
|
-
prompt_cache_key: String,
|
|
857
|
+
prompt_cache_key: T.nilable(String),
|
|
864
858
|
prompt_cache_options:
|
|
865
859
|
OpenAI::Responses::ResponsesClientEvent::PromptCacheOptions,
|
|
866
860
|
prompt_cache_retention:
|
|
@@ -868,7 +862,7 @@ module OpenAI
|
|
|
868
862
|
OpenAI::Responses::ResponsesClientEvent::PromptCacheRetention::OrSymbol
|
|
869
863
|
),
|
|
870
864
|
reasoning: T.nilable(OpenAI::Reasoning),
|
|
871
|
-
safety_identifier: String,
|
|
865
|
+
safety_identifier: T.nilable(String),
|
|
872
866
|
service_tier:
|
|
873
867
|
T.nilable(
|
|
874
868
|
OpenAI::Responses::ResponsesClientEvent::ServiceTier::OrSymbol
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class Admin
|
|
6
|
+
class Organization
|
|
7
|
+
class Projects
|
|
8
|
+
class SpendLimit
|
|
9
|
+
# Get a project's hard spend limit.
|
|
10
|
+
sig do
|
|
11
|
+
params(
|
|
12
|
+
project_id: String,
|
|
13
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
14
|
+
).returns(
|
|
15
|
+
OpenAI::Admin::Organization::Projects::ProjectSpendLimit
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
def retrieve(
|
|
19
|
+
# The ID of the project whose hard spend limit is being managed.
|
|
20
|
+
project_id,
|
|
21
|
+
request_options: {}
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Create or replace a project's hard spend limit.
|
|
26
|
+
sig do
|
|
27
|
+
params(
|
|
28
|
+
project_id: String,
|
|
29
|
+
currency:
|
|
30
|
+
OpenAI::Admin::Organization::Projects::SpendLimitUpdateParams::Currency::OrSymbol,
|
|
31
|
+
interval:
|
|
32
|
+
OpenAI::Admin::Organization::Projects::SpendLimitUpdateParams::Interval::OrSymbol,
|
|
33
|
+
threshold_amount: Integer,
|
|
34
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
35
|
+
).returns(
|
|
36
|
+
OpenAI::Admin::Organization::Projects::ProjectSpendLimit
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
def update(
|
|
40
|
+
# The ID of the project whose hard spend limit is being managed.
|
|
41
|
+
project_id,
|
|
42
|
+
# The currency for the threshold amount. Currently, only `USD` is supported.
|
|
43
|
+
currency:,
|
|
44
|
+
# The time interval for evaluating spend against the threshold. Currently, only
|
|
45
|
+
# `month` is supported.
|
|
46
|
+
interval:,
|
|
47
|
+
# The hard spend limit amount, in cents.
|
|
48
|
+
threshold_amount:,
|
|
49
|
+
request_options: {}
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Delete a project's hard spend limit.
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
project_id: String,
|
|
57
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
58
|
+
).returns(
|
|
59
|
+
OpenAI::Admin::Organization::Projects::ProjectSpendLimitDeleted
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
def delete(
|
|
63
|
+
# The ID of the project whose hard spend limit is being managed.
|
|
64
|
+
project_id,
|
|
65
|
+
request_options: {}
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# @api private
|
|
70
|
+
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
71
|
+
def self.new(client:)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -60,6 +60,13 @@ module OpenAI
|
|
|
60
60
|
end
|
|
61
61
|
attr_reader :data_retention
|
|
62
62
|
|
|
63
|
+
sig do
|
|
64
|
+
returns(
|
|
65
|
+
OpenAI::Resources::Admin::Organization::Projects::SpendLimit
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
attr_reader :spend_limit
|
|
69
|
+
|
|
63
70
|
sig do
|
|
64
71
|
returns(
|
|
65
72
|
OpenAI::Resources::Admin::Organization::Projects::SpendAlerts
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Resources
|
|
5
|
+
class Admin
|
|
6
|
+
class Organization
|
|
7
|
+
class SpendLimit
|
|
8
|
+
# Get the organization's hard spend limit.
|
|
9
|
+
sig do
|
|
10
|
+
params(request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
11
|
+
OpenAI::Admin::Organization::OrganizationSpendLimit
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
def retrieve(request_options: {})
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Create or replace the organization's hard spend limit.
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
currency:
|
|
21
|
+
OpenAI::Admin::Organization::SpendLimitUpdateParams::Currency::OrSymbol,
|
|
22
|
+
interval:
|
|
23
|
+
OpenAI::Admin::Organization::SpendLimitUpdateParams::Interval::OrSymbol,
|
|
24
|
+
threshold_amount: Integer,
|
|
25
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
26
|
+
).returns(OpenAI::Admin::Organization::OrganizationSpendLimit)
|
|
27
|
+
end
|
|
28
|
+
def update(
|
|
29
|
+
# The currency for the threshold amount. Currently, only `USD` is supported.
|
|
30
|
+
currency:,
|
|
31
|
+
# The time interval for evaluating spend against the threshold. Currently, only
|
|
32
|
+
# `month` is supported.
|
|
33
|
+
interval:,
|
|
34
|
+
# The hard spend limit amount, in cents.
|
|
35
|
+
threshold_amount:,
|
|
36
|
+
request_options: {}
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Delete the organization's hard spend limit.
|
|
41
|
+
sig do
|
|
42
|
+
params(request_options: OpenAI::RequestOptions::OrHash).returns(
|
|
43
|
+
OpenAI::Admin::Organization::OrganizationSpendLimitDeleted
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
def delete(request_options: {})
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# @api private
|
|
50
|
+
sig { params(client: OpenAI::Client).returns(T.attached_class) }
|
|
51
|
+
def self.new(client:)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -29,6 +29,9 @@ module OpenAI
|
|
|
29
29
|
sig { returns(OpenAI::Resources::Admin::Organization::DataRetention) }
|
|
30
30
|
attr_reader :data_retention
|
|
31
31
|
|
|
32
|
+
sig { returns(OpenAI::Resources::Admin::Organization::SpendLimit) }
|
|
33
|
+
attr_reader :spend_limit
|
|
34
|
+
|
|
32
35
|
sig { returns(OpenAI::Resources::Admin::Organization::SpendAlerts) }
|
|
33
36
|
attr_reader :spend_alerts
|
|
34
37
|
|
|
@@ -60,7 +60,7 @@ module OpenAI
|
|
|
60
60
|
parallel_tool_calls: T.nilable(T::Boolean),
|
|
61
61
|
previous_response_id: T.nilable(String),
|
|
62
62
|
prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt::OrHash),
|
|
63
|
-
prompt_cache_key: String,
|
|
63
|
+
prompt_cache_key: T.nilable(String),
|
|
64
64
|
prompt_cache_options:
|
|
65
65
|
OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::OrHash,
|
|
66
66
|
prompt_cache_retention:
|
|
@@ -69,7 +69,7 @@ module OpenAI
|
|
|
69
69
|
),
|
|
70
70
|
reasoning:
|
|
71
71
|
T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning::OrHash),
|
|
72
|
-
safety_identifier: String,
|
|
72
|
+
safety_identifier: T.nilable(String),
|
|
73
73
|
service_tier:
|
|
74
74
|
T.nilable(
|
|
75
75
|
OpenAI::Beta::ResponseCreateParams::ServiceTier::OrSymbol
|
|
@@ -399,7 +399,7 @@ module OpenAI
|
|
|
399
399
|
parallel_tool_calls: T.nilable(T::Boolean),
|
|
400
400
|
previous_response_id: T.nilable(String),
|
|
401
401
|
prompt: T.nilable(OpenAI::Beta::BetaResponsePrompt::OrHash),
|
|
402
|
-
prompt_cache_key: String,
|
|
402
|
+
prompt_cache_key: T.nilable(String),
|
|
403
403
|
prompt_cache_options:
|
|
404
404
|
OpenAI::Beta::ResponseCreateParams::PromptCacheOptions::OrHash,
|
|
405
405
|
prompt_cache_retention:
|
|
@@ -408,7 +408,7 @@ module OpenAI
|
|
|
408
408
|
),
|
|
409
409
|
reasoning:
|
|
410
410
|
T.nilable(OpenAI::Beta::ResponseCreateParams::Reasoning::OrHash),
|
|
411
|
-
safety_identifier: String,
|
|
411
|
+
safety_identifier: T.nilable(String),
|
|
412
412
|
service_tier:
|
|
413
413
|
T.nilable(
|
|
414
414
|
OpenAI::Beta::ResponseCreateParams::ServiceTier::OrSymbol
|
|
@@ -76,7 +76,7 @@ module OpenAI
|
|
|
76
76
|
prediction:
|
|
77
77
|
T.nilable(OpenAI::Chat::ChatCompletionPredictionContent::OrHash),
|
|
78
78
|
presence_penalty: T.nilable(Float),
|
|
79
|
-
prompt_cache_key: String,
|
|
79
|
+
prompt_cache_key: T.nilable(String),
|
|
80
80
|
prompt_cache_options:
|
|
81
81
|
OpenAI::Chat::CompletionCreateParams::PromptCacheOptions::OrHash,
|
|
82
82
|
prompt_cache_retention:
|
|
@@ -91,7 +91,7 @@ module OpenAI
|
|
|
91
91
|
OpenAI::StructuredOutput::JsonSchemaConverter,
|
|
92
92
|
OpenAI::ResponseFormatJSONObject::OrHash
|
|
93
93
|
),
|
|
94
|
-
safety_identifier: String,
|
|
94
|
+
safety_identifier: T.nilable(String),
|
|
95
95
|
seed: T.nilable(Integer),
|
|
96
96
|
service_tier:
|
|
97
97
|
T.nilable(
|
|
@@ -363,7 +363,8 @@ module OpenAI
|
|
|
363
363
|
user: nil,
|
|
364
364
|
# Constrains the verbosity of the model's response. Lower values will result in
|
|
365
365
|
# more concise responses, while higher values will result in more verbose
|
|
366
|
-
# responses. Currently supported values are `low`, `medium`, and `high`.
|
|
366
|
+
# responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
367
|
+
# default is `medium`.
|
|
367
368
|
verbosity: nil,
|
|
368
369
|
# This tool searches the web for relevant results to use in a response. Learn more
|
|
369
370
|
# about the
|
|
@@ -441,7 +442,7 @@ module OpenAI
|
|
|
441
442
|
prediction:
|
|
442
443
|
T.nilable(OpenAI::Chat::ChatCompletionPredictionContent::OrHash),
|
|
443
444
|
presence_penalty: T.nilable(Float),
|
|
444
|
-
prompt_cache_key: String,
|
|
445
|
+
prompt_cache_key: T.nilable(String),
|
|
445
446
|
prompt_cache_options:
|
|
446
447
|
OpenAI::Chat::CompletionCreateParams::PromptCacheOptions::OrHash,
|
|
447
448
|
prompt_cache_retention:
|
|
@@ -455,7 +456,7 @@ module OpenAI
|
|
|
455
456
|
OpenAI::ResponseFormatJSONSchema::OrHash,
|
|
456
457
|
OpenAI::ResponseFormatJSONObject::OrHash
|
|
457
458
|
),
|
|
458
|
-
safety_identifier: String,
|
|
459
|
+
safety_identifier: T.nilable(String),
|
|
459
460
|
seed: T.nilable(Integer),
|
|
460
461
|
service_tier:
|
|
461
462
|
T.nilable(
|
|
@@ -726,7 +727,8 @@ module OpenAI
|
|
|
726
727
|
user: nil,
|
|
727
728
|
# Constrains the verbosity of the model's response. Lower values will result in
|
|
728
729
|
# more concise responses, while higher values will result in more verbose
|
|
729
|
-
# responses. Currently supported values are `low`, `medium`, and `high`.
|
|
730
|
+
# responses. Currently supported values are `low`, `medium`, and `high`. The
|
|
731
|
+
# default is `medium`.
|
|
730
732
|
verbosity: nil,
|
|
731
733
|
# This tool searches the web for relevant results to use in a response. Learn more
|
|
732
734
|
# about the
|
|
@@ -60,7 +60,7 @@ module OpenAI
|
|
|
60
60
|
parallel_tool_calls: T.nilable(T::Boolean),
|
|
61
61
|
previous_response_id: T.nilable(String),
|
|
62
62
|
prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash),
|
|
63
|
-
prompt_cache_key: String,
|
|
63
|
+
prompt_cache_key: T.nilable(String),
|
|
64
64
|
prompt_cache_options:
|
|
65
65
|
OpenAI::Responses::ResponseCreateParams::PromptCacheOptions::OrHash,
|
|
66
66
|
prompt_cache_retention:
|
|
@@ -68,7 +68,7 @@ module OpenAI
|
|
|
68
68
|
OpenAI::Responses::ResponseCreateParams::PromptCacheRetention::OrSymbol
|
|
69
69
|
),
|
|
70
70
|
reasoning: T.nilable(OpenAI::Reasoning::OrHash),
|
|
71
|
-
safety_identifier: String,
|
|
71
|
+
safety_identifier: T.nilable(String),
|
|
72
72
|
service_tier:
|
|
73
73
|
T.nilable(
|
|
74
74
|
OpenAI::Responses::ResponseCreateParams::ServiceTier::OrSymbol
|
|
@@ -390,7 +390,7 @@ module OpenAI
|
|
|
390
390
|
parallel_tool_calls: T.nilable(T::Boolean),
|
|
391
391
|
previous_response_id: T.nilable(String),
|
|
392
392
|
prompt: T.nilable(OpenAI::Responses::ResponsePrompt::OrHash),
|
|
393
|
-
prompt_cache_key: String,
|
|
393
|
+
prompt_cache_key: T.nilable(String),
|
|
394
394
|
prompt_cache_options:
|
|
395
395
|
OpenAI::Responses::ResponseCreateParams::PromptCacheOptions::OrHash,
|
|
396
396
|
prompt_cache_retention:
|
|
@@ -398,7 +398,7 @@ module OpenAI
|
|
|
398
398
|
OpenAI::Responses::ResponseCreateParams::PromptCacheRetention::OrSymbol
|
|
399
399
|
),
|
|
400
400
|
reasoning: T.nilable(OpenAI::Reasoning::OrHash),
|
|
401
|
-
safety_identifier: String,
|
|
401
|
+
safety_identifier: T.nilable(String),
|
|
402
402
|
service_tier:
|
|
403
403
|
T.nilable(
|
|
404
404
|
OpenAI::Responses::ResponseCreateParams::ServiceTier::OrSymbol
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
module OpenAI
|
|
2
|
+
module Models
|
|
3
|
+
module Admin
|
|
4
|
+
class OrganizationSpendLimit = Organization::OrganizationSpendLimit
|
|
5
|
+
|
|
6
|
+
module Organization
|
|
7
|
+
type organization_spend_limit =
|
|
8
|
+
{
|
|
9
|
+
currency: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::currency,
|
|
10
|
+
enforcement: OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement,
|
|
11
|
+
interval: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::interval,
|
|
12
|
+
object: :"organization.spend_limit",
|
|
13
|
+
threshold_amount: Integer
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class OrganizationSpendLimit < OpenAI::Internal::Type::BaseModel
|
|
17
|
+
attr_accessor currency: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::currency
|
|
18
|
+
|
|
19
|
+
attr_accessor enforcement: OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement
|
|
20
|
+
|
|
21
|
+
attr_accessor interval: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::interval
|
|
22
|
+
|
|
23
|
+
attr_accessor object: :"organization.spend_limit"
|
|
24
|
+
|
|
25
|
+
attr_accessor threshold_amount: Integer
|
|
26
|
+
|
|
27
|
+
def initialize: (
|
|
28
|
+
currency: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::currency,
|
|
29
|
+
enforcement: OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement,
|
|
30
|
+
interval: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::interval,
|
|
31
|
+
threshold_amount: Integer,
|
|
32
|
+
?object: :"organization.spend_limit"
|
|
33
|
+
) -> void
|
|
34
|
+
|
|
35
|
+
def to_hash: -> {
|
|
36
|
+
currency: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::currency,
|
|
37
|
+
enforcement: OpenAI::Admin::Organization::OrganizationSpendLimit::Enforcement,
|
|
38
|
+
interval: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::interval,
|
|
39
|
+
object: :"organization.spend_limit",
|
|
40
|
+
threshold_amount: Integer
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
type currency = String | :USD
|
|
44
|
+
|
|
45
|
+
module Currency
|
|
46
|
+
extend OpenAI::Internal::Type::Union
|
|
47
|
+
|
|
48
|
+
def self?.variants: -> ::Array[OpenAI::Models::Admin::Organization::OrganizationSpendLimit::currency]
|
|
49
|
+
|
|
50
|
+
USD: :USD
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
type enforcement =
|
|
54
|
+
{
|
|
55
|
+
status: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement::status
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
class Enforcement < OpenAI::Internal::Type::BaseModel
|
|
59
|
+
attr_accessor status: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement::status
|
|
60
|
+
|
|
61
|
+
def initialize: (
|
|
62
|
+
status: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement::status
|
|
63
|
+
) -> void
|
|
64
|
+
|
|
65
|
+
def to_hash: -> {
|
|
66
|
+
status: OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement::status
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
type status = String | :inactive | :enforcing
|
|
70
|
+
|
|
71
|
+
module Status
|
|
72
|
+
extend OpenAI::Internal::Type::Union
|
|
73
|
+
|
|
74
|
+
def self?.variants: -> ::Array[OpenAI::Models::Admin::Organization::OrganizationSpendLimit::Enforcement::status]
|
|
75
|
+
|
|
76
|
+
INACTIVE: :inactive
|
|
77
|
+
ENFORCING: :enforcing
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
type interval = String | :month
|
|
82
|
+
|
|
83
|
+
module Interval
|
|
84
|
+
extend OpenAI::Internal::Type::Union
|
|
85
|
+
|
|
86
|
+
def self?.variants: -> ::Array[OpenAI::Models::Admin::Organization::OrganizationSpendLimit::interval]
|
|
87
|
+
|
|
88
|
+
MONTH: :month
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module OpenAI
|
|
2
|
+
module Models
|
|
3
|
+
module Admin
|
|
4
|
+
class OrganizationSpendLimitDeleted = Organization::OrganizationSpendLimitDeleted
|
|
5
|
+
|
|
6
|
+
module Organization
|
|
7
|
+
type organization_spend_limit_deleted =
|
|
8
|
+
{ deleted: bool, object: :"organization.spend_limit.deleted" }
|
|
9
|
+
|
|
10
|
+
class OrganizationSpendLimitDeleted < OpenAI::Internal::Type::BaseModel
|
|
11
|
+
attr_accessor deleted: bool
|
|
12
|
+
|
|
13
|
+
attr_accessor object: :"organization.spend_limit.deleted"
|
|
14
|
+
|
|
15
|
+
def initialize: (
|
|
16
|
+
deleted: bool,
|
|
17
|
+
?object: :"organization.spend_limit.deleted"
|
|
18
|
+
) -> void
|
|
19
|
+
|
|
20
|
+
def to_hash: -> {
|
|
21
|
+
deleted: bool,
|
|
22
|
+
object: :"organization.spend_limit.deleted"
|
|
23
|
+
}
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|