openai 0.117.0 → 0.118.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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/admin/organization/projects/project_optional_service_tier.rb +24 -0
  5. data/lib/openai/models/admin/organization/projects/project_service_tier_settings.rb +88 -0
  6. data/lib/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rb +29 -0
  7. data/lib/openai/models/admin/organization/projects/service_tier_setting_update_params.rb +92 -0
  8. data/lib/openai/models/beta/beta_response.rb +1 -0
  9. data/lib/openai/models/beta/beta_response_usage.rb +33 -1
  10. data/lib/openai/models/beta/beta_responses_client_event.rb +10 -9
  11. data/lib/openai/models/beta/response_compact_params.rb +3 -3
  12. data/lib/openai/models/beta/response_create_params.rb +10 -9
  13. data/lib/openai/models/chat/completion_create_params.rb +3 -3
  14. data/lib/openai/models/responses/response.rb +1 -0
  15. data/lib/openai/models/responses/response_compact_params.rb +3 -3
  16. data/lib/openai/models/responses/response_create_params.rb +10 -9
  17. data/lib/openai/models/responses/response_usage.rb +33 -1
  18. data/lib/openai/models/responses/responses_client_event.rb +10 -9
  19. data/lib/openai/resources/admin/organization/projects/service_tier_settings.rb +77 -0
  20. data/lib/openai/resources/admin/organization/projects.rb +6 -0
  21. data/lib/openai/resources/beta/responses.rb +6 -6
  22. data/lib/openai/resources/chat/completions.rb +2 -2
  23. data/lib/openai/resources/responses.rb +3 -3
  24. data/lib/openai/version.rb +1 -1
  25. data/lib/openai.rb +5 -0
  26. data/rbi/openai/models/admin/organization/projects/project_optional_service_tier.rbi +45 -0
  27. data/rbi/openai/models/admin/organization/projects/project_service_tier_settings.rbi +143 -0
  28. data/rbi/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbi +63 -0
  29. data/rbi/openai/models/admin/organization/projects/service_tier_setting_update_params.rbi +183 -0
  30. data/rbi/openai/models/beta/beta_response.rbi +1 -0
  31. data/rbi/openai/models/beta/beta_response_usage.rbi +66 -3
  32. data/rbi/openai/models/beta/beta_responses_client_event.rbi +13 -9
  33. data/rbi/openai/models/beta/response_compact_params.rbi +3 -3
  34. data/rbi/openai/models/beta/response_create_params.rbi +10 -9
  35. data/rbi/openai/models/chat/completion_create_params.rbi +3 -3
  36. data/rbi/openai/models/responses/response.rbi +1 -0
  37. data/rbi/openai/models/responses/response_compact_params.rbi +3 -3
  38. data/rbi/openai/models/responses/response_create_params.rbi +10 -9
  39. data/rbi/openai/models/responses/response_usage.rbi +66 -3
  40. data/rbi/openai/models/responses/responses_client_event.rbi +13 -9
  41. data/rbi/openai/resources/admin/organization/projects/service_tier_settings.rbi +67 -0
  42. data/rbi/openai/resources/admin/organization/projects.rbi +3 -0
  43. data/rbi/openai/resources/beta/responses.rbi +6 -6
  44. data/rbi/openai/resources/chat/completions.rbi +2 -2
  45. data/rbi/openai/resources/responses.rbi +3 -3
  46. data/sig/openai/models/admin/organization/projects/project_optional_service_tier.rbs +23 -0
  47. data/sig/openai/models/admin/organization/projects/project_service_tier_settings.rbs +72 -0
  48. data/sig/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbs +32 -0
  49. data/sig/openai/models/admin/organization/projects/service_tier_setting_update_params.rbs +91 -0
  50. data/sig/openai/models/beta/beta_response.rbs +2 -1
  51. data/sig/openai/models/beta/beta_response_usage.rbs +40 -3
  52. data/sig/openai/models/beta/beta_responses_client_event.rbs +11 -10
  53. data/sig/openai/models/beta/response_compact_params.rbs +2 -2
  54. data/sig/openai/models/beta/response_create_params.rbs +11 -10
  55. data/sig/openai/models/chat/completion_create_params.rbs +3 -3
  56. data/sig/openai/models/responses/response.rbs +2 -1
  57. data/sig/openai/models/responses/response_compact_params.rbs +2 -2
  58. data/sig/openai/models/responses/response_create_params.rbs +11 -10
  59. data/sig/openai/models/responses/response_usage.rbs +40 -3
  60. data/sig/openai/models/responses/responses_client_event.rbs +11 -10
  61. data/sig/openai/resources/admin/organization/projects/service_tier_settings.rbs +25 -0
  62. data/sig/openai/resources/admin/organization/projects.rbs +2 -0
  63. metadata +16 -1
@@ -68,7 +68,15 @@ module OpenAI
68
68
  # @return [Integer]
69
69
  required :cached_tokens, Integer
70
70
 
71
- # @!method initialize(cache_write_tokens:, cached_tokens:)
71
+ # @!attribute cache_write_tokens_details
72
+ #
73
+ # @return [OpenAI::Models::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails, nil]
74
+ optional(
75
+ :cache_write_tokens_details,
76
+ -> { OpenAI::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails }
77
+ )
78
+
79
+ # @!method initialize(cache_write_tokens:, cached_tokens:, cache_write_tokens_details: nil)
72
80
  # A detailed breakdown of the input tokens.
73
81
  #
74
82
  # @param cache_write_tokens [Integer]
@@ -77,6 +85,30 @@ module OpenAI
77
85
  # @param cached_tokens [Integer]
78
86
  # The number of tokens that were retrieved from the cache.
79
87
  # [More on prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching).
88
+ #
89
+ # @param cache_write_tokens_details [OpenAI::Models::Responses::ResponseUsage::InputTokensDetails::CacheWriteTokensDetails]
90
+
91
+ # @see OpenAI::Models::Responses::ResponseUsage::InputTokensDetails#cache_write_tokens_details
92
+ class CacheWriteTokensDetails < OpenAI::Internal::Type::BaseModel
93
+ # @!attribute ttl_12h_tokens
94
+ # The number of input tokens written with 12-hour retention.
95
+ #
96
+ # @return [Integer]
97
+ required :ttl_12h_tokens, Integer
98
+
99
+ # @!attribute ttl_30m_tokens
100
+ # The number of input tokens written with 30-minute retention.
101
+ #
102
+ # @return [Integer]
103
+ required :ttl_30m_tokens, Integer
104
+
105
+ # @!method initialize(ttl_12h_tokens:, ttl_30m_tokens:)
106
+ # @param ttl_12h_tokens [Integer]
107
+ # The number of input tokens written with 12-hour retention.
108
+ #
109
+ # @param ttl_30m_tokens [Integer]
110
+ # The number of input tokens written with 30-minute retention.
111
+ end
80
112
  end
81
113
 
82
114
  # @see OpenAI::Models::Responses::ResponseUsage#output_tokens_details
@@ -240,7 +240,7 @@ module OpenAI
240
240
  # request can write up to four breakpoints. For cache matching, OpenAI considers
241
241
  # up to the latest 80 breakpoints in the conversation, without a content-block
242
242
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
243
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
243
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
244
244
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
245
245
  # for current details.
246
246
  #
@@ -595,7 +595,7 @@ module OpenAI
595
595
  # request can write up to four breakpoints. For cache matching, OpenAI considers
596
596
  # up to the latest 80 breakpoints in the conversation, without a content-block
597
597
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
598
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
598
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
599
599
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
600
600
  # for current details.
601
601
  #
@@ -1032,8 +1032,8 @@ module OpenAI
1032
1032
 
1033
1033
  # @!attribute ttl
1034
1034
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1035
- # written by the request. Defaults to `30m`, which is currently the only supported
1036
- # value. The backend may retain cache entries for longer.
1035
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1036
+ # backend may retain cache entries for longer.
1037
1037
  #
1038
1038
  # @return [Symbol, OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl, nil]
1039
1039
  optional(
@@ -1048,7 +1048,7 @@ module OpenAI
1048
1048
  # request can write up to four breakpoints. For cache matching, OpenAI considers
1049
1049
  # up to the latest 80 breakpoints in the conversation, without a content-block
1050
1050
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
1051
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
1051
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
1052
1052
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
1053
1053
  # for current details.
1054
1054
  #
@@ -1070,8 +1070,8 @@ module OpenAI
1070
1070
  #
1071
1071
  # @param ttl [Symbol, OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions::Ttl]
1072
1072
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1073
- # written by the request. Defaults to `30m`, which is currently the only supported
1074
- # value. The backend may retain cache entries for longer.
1073
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1074
+ # backend may retain cache entries for longer.
1075
1075
 
1076
1076
  # Controls whether OpenAI automatically creates an implicit cache breakpoint.
1077
1077
  # Defaults to `implicit`. With `implicit`, OpenAI creates one implicit breakpoint
@@ -1092,14 +1092,15 @@ module OpenAI
1092
1092
  end
1093
1093
 
1094
1094
  # The minimum lifetime applied to every implicit and explicit cache breakpoint
1095
- # written by the request. Defaults to `30m`, which is currently the only supported
1096
- # value. The backend may retain cache entries for longer.
1095
+ # written by the request. Supported values are `30m` (the default) and `12h`. The
1096
+ # backend may retain cache entries for longer.
1097
1097
  #
1098
1098
  # @see OpenAI::Models::Responses::ResponsesClientEvent::ResponseCreate::PromptCacheOptions#ttl
1099
1099
  module Ttl
1100
1100
  extend OpenAI::Internal::Type::Enum
1101
1101
 
1102
1102
  TTL_30M = :"30m"
1103
+ TTL_12H = :"12h"
1103
1104
 
1104
1105
  # @!method self.values
1105
1106
  # @return [Array<Symbol>]
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Resources
5
+ class Admin
6
+ class Organization
7
+ class Projects
8
+ class ServiceTierSettings
9
+ # Retrieve the configured default and enabled service tiers for a project.
10
+ #
11
+ # @overload retrieve(project_id, request_options: {})
12
+ #
13
+ # @param project_id [String]
14
+ # The ID of the project
15
+ #
16
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
17
+ #
18
+ # @return [OpenAI::Models::Admin::Organization::Projects::ProjectServiceTierSettings]
19
+ #
20
+ # @see OpenAI::Models::Admin::Organization::Projects::ServiceTierSettingRetrieveParams
21
+ def retrieve(project_id, params = {})
22
+ @client.request(
23
+ method: :get,
24
+ path: ["organization/projects/%1$s/service_tier_settings", project_id],
25
+ model: OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings,
26
+ security: {admin_api_key_auth: true},
27
+ options: params[:request_options]
28
+ )
29
+ end
30
+
31
+ # Update the default or enabled service tiers atomically. Supply at least one
32
+ # field. Omitted fields keep their current values.
33
+ #
34
+ # @overload update(project_id, default: nil, enabled_tiers: nil, request_options: {})
35
+ #
36
+ # @param project_id [String]
37
+ # The ID of the project
38
+ #
39
+ # @param default [Symbol, OpenAI::Models::Admin::Organization::Projects::ServiceTierSettingUpdateParams::Default]
40
+ # Default tier for requests that omit service_tier or use auto.
41
+ #
42
+ # @param enabled_tiers [Symbol, :all, Array<Symbol, OpenAI::Models::Admin::Organization::Projects::ProjectOptionalServiceTier>]
43
+ # Additional service tiers enabled for this project. "all" includes future tiers.
44
+ # An empty array allows only Standard. Organization policy and eligibility still
45
+ # apply.
46
+ #
47
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
48
+ #
49
+ # @return [OpenAI::Models::Admin::Organization::Projects::ProjectServiceTierSettings]
50
+ #
51
+ # @see OpenAI::Models::Admin::Organization::Projects::ServiceTierSettingUpdateParams
52
+ def update(project_id, params = {})
53
+ parsed, options = OpenAI::Admin::Organization::Projects::ServiceTierSettingUpdateParams.dump_request(
54
+ params
55
+ )
56
+ @client.request(
57
+ method: :post,
58
+ path: ["organization/projects/%1$s/service_tier_settings", project_id],
59
+ body: parsed,
60
+ model: OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings,
61
+ security: {admin_api_key_auth: true},
62
+ options: options
63
+ )
64
+ end
65
+
66
+ # @api private
67
+ #
68
+ # @param client [OpenAI::Client]
69
+ def initialize(client:)
70
+ @client = client
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -41,6 +41,9 @@ module OpenAI
41
41
  # @return [OpenAI::Resources::Admin::Organization::Projects::Certificates]
42
42
  attr_reader :certificates
43
43
 
44
+ # @return [OpenAI::Resources::Admin::Organization::Projects::ServiceTierSettings]
45
+ attr_reader :service_tier_settings
46
+
44
47
  # Create a new project in the organization. Projects can be created and archived,
45
48
  # but cannot be deleted.
46
49
  #
@@ -218,6 +221,9 @@ module OpenAI
218
221
  @spend_limit = OpenAI::Resources::Admin::Organization::Projects::SpendLimit.new(client: client)
219
222
  @spend_alerts = OpenAI::Resources::Admin::Organization::Projects::SpendAlerts.new(client: client)
220
223
  @certificates = OpenAI::Resources::Admin::Organization::Projects::Certificates.new(client: client)
224
+ @service_tier_settings = OpenAI::Resources::Admin::Organization::Projects::ServiceTierSettings.new(
225
+ client: client
226
+ )
221
227
  end
222
228
  end
223
229
  end
@@ -161,8 +161,8 @@ module OpenAI
161
161
  # `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For
162
162
  # cache matching, OpenAI considers up to the latest 80 breakpoints in the
163
163
  # conversation, without a content-block lookback limit. Set `mode` to `explicit`
164
- # to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is
165
- # currently the only supported value. See the
164
+ # to disable the implicit breakpoint. The `ttl` defaults to `30m`. Supported
165
+ # lifetimes depend on the API. See the
166
166
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
167
167
  # for current details.
168
168
  #
@@ -462,8 +462,8 @@ module OpenAI
462
462
  # `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For
463
463
  # cache matching, OpenAI considers up to the latest 80 breakpoints in the
464
464
  # conversation, without a content-block lookback limit. Set `mode` to `explicit`
465
- # to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is
466
- # currently the only supported value. See the
465
+ # to disable the implicit breakpoint. The `ttl` defaults to `30m`. Supported
466
+ # lifetimes depend on the API. See the
467
467
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
468
468
  # for current details.
469
469
  #
@@ -855,8 +855,8 @@ module OpenAI
855
855
  # `prompt_cache_breakpoint`. Each request can write up to four breakpoints. For
856
856
  # cache matching, OpenAI considers up to the latest 80 breakpoints in the
857
857
  # conversation, without a content-block lookback limit. Set `mode` to `explicit`
858
- # to disable the implicit breakpoint. The `ttl` defaults to `30m`, which is
859
- # currently the only supported value. See the
858
+ # to disable the implicit breakpoint. The `ttl` defaults to `30m`. Supported
859
+ # lifetimes depend on the API. See the
860
860
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
861
861
  # for current details.
862
862
  #
@@ -171,7 +171,7 @@ module OpenAI
171
171
  # request can write up to four breakpoints. For cache matching, OpenAI considers
172
172
  # up to the latest 80 breakpoints in the conversation, without a content-block
173
173
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
174
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
174
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
175
175
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
176
176
  # for current details.
177
177
  #
@@ -508,7 +508,7 @@ module OpenAI
508
508
  # request can write up to four breakpoints. For cache matching, OpenAI considers
509
509
  # up to the latest 80 breakpoints in the conversation, without a content-block
510
510
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
511
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
511
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
512
512
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
513
513
  # for current details.
514
514
  #
@@ -157,7 +157,7 @@ module OpenAI
157
157
  # request can write up to four breakpoints. For cache matching, OpenAI considers
158
158
  # up to the latest 80 breakpoints in the conversation, without a content-block
159
159
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
160
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
160
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
161
161
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
162
162
  # for current details.
163
163
  #
@@ -450,7 +450,7 @@ module OpenAI
450
450
  # request can write up to four breakpoints. For cache matching, OpenAI considers
451
451
  # up to the latest 80 breakpoints in the conversation, without a content-block
452
452
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
453
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
453
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
454
454
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
455
455
  # for current details.
456
456
  #
@@ -819,7 +819,7 @@ module OpenAI
819
819
  # request can write up to four breakpoints. For cache matching, OpenAI considers
820
820
  # up to the latest 80 breakpoints in the conversation, without a content-block
821
821
  # lookback limit. Set `mode` to `explicit` to disable the implicit breakpoint. The
822
- # `ttl` defaults to `30m`, which is currently the only supported value. See the
822
+ # `ttl` defaults to `30m`. Supported lifetimes depend on the API. See the
823
823
  # [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching)
824
824
  # for current details.
825
825
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.117.0"
4
+ VERSION = "0.118.0"
5
5
  end
data/lib/openai.rb CHANGED
@@ -349,8 +349,10 @@ require_relative "openai/models/admin/organization/projects/project_group"
349
349
  require_relative "openai/models/admin/organization/projects/project_hosted_tool_permissions"
350
350
  require_relative "openai/models/admin/organization/projects/project_model_permissions"
351
351
  require_relative "openai/models/admin/organization/projects/project_model_permissions_deleted"
352
+ require_relative "openai/models/admin/organization/projects/project_optional_service_tier"
352
353
  require_relative "openai/models/admin/organization/projects/project_rate_limit"
353
354
  require_relative "openai/models/admin/organization/projects/project_service_account"
355
+ require_relative "openai/models/admin/organization/projects/project_service_tier_settings"
354
356
  require_relative "openai/models/admin/organization/projects/project_spend_alert"
355
357
  require_relative "openai/models/admin/organization/projects/project_spend_alert_deleted"
356
358
  require_relative "openai/models/admin/organization/projects/project_spend_limit"
@@ -373,6 +375,8 @@ require_relative "openai/models/admin/organization/projects/service_account_retr
373
375
  require_relative "openai/models/admin/organization/projects/service_accounts/api_key_create_params"
374
376
  require_relative "openai/models/admin/organization/projects/service_accounts/api_key_create_response"
375
377
  require_relative "openai/models/admin/organization/projects/service_account_update_params"
378
+ require_relative "openai/models/admin/organization/projects/service_tier_setting_retrieve_params"
379
+ require_relative "openai/models/admin/organization/projects/service_tier_setting_update_params"
376
380
  require_relative "openai/models/admin/organization/projects/spend_alert_create_params"
377
381
  require_relative "openai/models/admin/organization/projects/spend_alert_delete_params"
378
382
  require_relative "openai/models/admin/organization/projects/spend_alert_list_params"
@@ -1592,6 +1596,7 @@ require_relative "openai/resources/admin/organization/projects/rate_limits"
1592
1596
  require_relative "openai/resources/admin/organization/projects/roles"
1593
1597
  require_relative "openai/resources/admin/organization/projects/service_accounts"
1594
1598
  require_relative "openai/resources/admin/organization/projects/service_accounts/api_keys"
1599
+ require_relative "openai/resources/admin/organization/projects/service_tier_settings"
1595
1600
  require_relative "openai/resources/admin/organization/projects/spend_alerts"
1596
1601
  require_relative "openai/resources/admin/organization/projects/spend_limit"
1597
1602
  require_relative "openai/resources/admin/organization/projects/users"
@@ -0,0 +1,45 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Admin
7
+
8
+ module Organization
9
+
10
+ ProjectOptionalServiceTier = Projects::ProjectOptionalServiceTier
11
+
12
+ module Projects
13
+
14
+ module ProjectOptionalServiceTier
15
+ extend OpenAI::Internal::Type::Enum
16
+
17
+ TaggedSymbol = T.type_alias {
18
+ T.all(Symbol, OpenAI::Admin::Organization::Projects::ProjectOptionalServiceTier)
19
+ }
20
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
21
+
22
+ FLEX = T.let(:flex, OpenAI::Admin::Organization::Projects::ProjectOptionalServiceTier::TaggedSymbol)
23
+ FAST = T.let(:fast, OpenAI::Admin::Organization::Projects::ProjectOptionalServiceTier::TaggedSymbol)
24
+ ULTRAFAST = T.let(
25
+ :ultrafast,
26
+ OpenAI::Admin::Organization::Projects::ProjectOptionalServiceTier::TaggedSymbol
27
+ )
28
+
29
+ sig {
30
+ override.returns(
31
+ T::Array[OpenAI::Admin::Organization::Projects::ProjectOptionalServiceTier::TaggedSymbol]
32
+ )
33
+ }
34
+ def self.values
35
+ end
36
+ end
37
+
38
+ end
39
+
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,143 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Admin
7
+
8
+ module Organization
9
+
10
+ ProjectServiceTierSettings = Projects::ProjectServiceTierSettings
11
+
12
+ module Projects
13
+
14
+ class ProjectServiceTierSettings < OpenAI::Internal::Type::BaseModel
15
+
16
+ OrHash = T.type_alias do
17
+ T.any(
18
+ OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings,
19
+ OpenAI::Internal::AnyHash
20
+ )
21
+ end
22
+
23
+ # Default tier for requests that omit service_tier or use auto.
24
+ sig { returns(OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::Default::TaggedSymbol) }
25
+ attr_accessor :default
26
+
27
+ # Additional service tiers enabled for this project. "all" includes future tiers.
28
+ # An empty array allows only Standard. Organization policy and eligibility still
29
+ # apply.
30
+ sig { returns(OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::EnabledTiers::Variants) }
31
+ attr_accessor :enabled_tiers
32
+
33
+ sig { returns(Symbol) }
34
+ attr_accessor :object
35
+
36
+ sig do
37
+ params(
38
+
39
+ default: OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::Default::OrSymbol,
40
+
41
+ enabled_tiers: T.any(
42
+ Symbol,
43
+ T::Array[OpenAI::Admin::Organization::Projects::ProjectOptionalServiceTier::OrSymbol]
44
+ ),
45
+
46
+ object: Symbol
47
+ )
48
+ .returns(T.attached_class)
49
+ end
50
+ def self.new(
51
+
52
+ # Default tier for requests that omit service_tier or use auto.
53
+ default:,
54
+
55
+ # Additional service tiers enabled for this project. "all" includes future tiers.
56
+ # An empty array allows only Standard. Organization policy and eligibility still
57
+ # apply.
58
+ enabled_tiers:,
59
+
60
+ object: :"project.service_tier_settings"
61
+ )
62
+ end
63
+
64
+ sig do
65
+ override.returns(
66
+ {
67
+ default: OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::Default::TaggedSymbol,
68
+ enabled_tiers: OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::EnabledTiers::Variants,
69
+ object: Symbol
70
+ }
71
+ )
72
+ end
73
+ def to_hash
74
+ end
75
+
76
+ # Default tier for requests that omit service_tier or use auto.
77
+ module Default
78
+ extend OpenAI::Internal::Type::Enum
79
+
80
+ TaggedSymbol = T.type_alias {
81
+ T.all(Symbol, OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::Default)
82
+ }
83
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
84
+
85
+ STANDARD = T.let(
86
+ :standard,
87
+ OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::Default::TaggedSymbol
88
+ )
89
+ FAST = T.let(
90
+ :fast,
91
+ OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::Default::TaggedSymbol
92
+ )
93
+ SCALE = T.let(
94
+ :scale,
95
+ OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::Default::TaggedSymbol
96
+ )
97
+
98
+ sig {
99
+ override.returns(
100
+ T::Array[OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::Default::TaggedSymbol]
101
+ )
102
+ }
103
+ def self.values
104
+ end
105
+ end
106
+
107
+ # Additional service tiers enabled for this project. "all" includes future tiers.
108
+ # An empty array allows only Standard. Organization policy and eligibility still
109
+ # apply.
110
+ module EnabledTiers
111
+ extend OpenAI::Internal::Type::Union
112
+
113
+ Variants = T.type_alias {
114
+ T.any(Symbol, T::Array[OpenAI::Admin::Organization::Projects::ProjectOptionalServiceTier::TaggedSymbol])
115
+ }
116
+
117
+ sig {
118
+ override.returns(
119
+ T::Array[OpenAI::Admin::Organization::Projects::ProjectServiceTierSettings::EnabledTiers::Variants]
120
+ )
121
+ }
122
+ def self.variants
123
+ end
124
+
125
+ ProjectOptionalServiceTierArray = T.let(
126
+ OpenAI::Internal::Type::ArrayOf[
127
+ enum: -> { OpenAI::Models::Admin::Organization::Projects::ProjectOptionalServiceTier }
128
+ ],
129
+ OpenAI::Internal::Type::Converter
130
+ )
131
+
132
+ end
133
+
134
+ end
135
+
136
+ end
137
+
138
+ end
139
+
140
+ end
141
+
142
+ end
143
+ end
@@ -0,0 +1,63 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Admin
7
+
8
+ module Organization
9
+
10
+ module Projects
11
+
12
+ class ServiceTierSettingRetrieveParams < OpenAI::Internal::Type::BaseModel
13
+
14
+ extend OpenAI::Internal::Type::RequestParameters::Converter
15
+ include OpenAI::Internal::Type::RequestParameters
16
+
17
+ OrHash = T.type_alias do
18
+ T.any(
19
+ OpenAI::Admin::Organization::Projects::ServiceTierSettingRetrieveParams,
20
+ OpenAI::Internal::AnyHash
21
+ )
22
+ end
23
+
24
+ # The ID of the project
25
+ sig { returns(String) }
26
+ attr_accessor :project_id
27
+
28
+ sig do
29
+ params(
30
+
31
+ project_id: String,
32
+
33
+ request_options: OpenAI::RequestOptions::OrHash
34
+ )
35
+ .returns(T.attached_class)
36
+ end
37
+ def self.new(
38
+
39
+ # The ID of the project
40
+ project_id:,
41
+
42
+ request_options: {}
43
+ )
44
+ end
45
+
46
+ sig do
47
+ override.returns(
48
+ {project_id: String, request_options: OpenAI::RequestOptions}
49
+ )
50
+ end
51
+ def to_hash
52
+ end
53
+
54
+ end
55
+
56
+ end
57
+
58
+ end
59
+
60
+ end
61
+
62
+ end
63
+ end