openai 0.66.0 → 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +1 -1
- data/lib/openai/internal/transport/base_client.rb +4 -1
- data/lib/openai/models/admin/organization/admin_api_key.rb +9 -1
- data/lib/openai/models/admin/organization/admin_api_key_create_params.rb +14 -1
- data/lib/openai/models/admin/organization/audit_log_list_params.rb +16 -2
- data/lib/openai/models/admin/organization/audit_log_list_response.rb +241 -1
- data/lib/openai/models/admin/organization/projects/spend_alert_retrieve_params.rb +32 -0
- data/lib/openai/models/admin/organization/spend_alert_retrieve_params.rb +24 -0
- data/lib/openai/models/reasoning.rb +27 -1
- data/lib/openai/models/responses/input_token_count_params.rb +4 -0
- data/lib/openai/models/responses/response_create_params.rb +4 -0
- data/lib/openai/models/responses/responses_client_event.rb +4 -0
- data/lib/openai/resources/admin/organization/admin_api_keys.rb +7 -1
- data/lib/openai/resources/admin/organization/audit_logs.rb +3 -1
- data/lib/openai/resources/admin/organization/projects/spend_alerts.rb +28 -0
- data/lib/openai/resources/admin/organization/spend_alerts.rb +21 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +2 -0
- data/rbi/openai/models/admin/organization/admin_api_key.rbi +8 -0
- data/rbi/openai/models/admin/organization/admin_api_key_create_params.rbi +21 -2
- data/rbi/openai/models/admin/organization/audit_log_list_params.rbi +31 -2
- data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +468 -0
- data/rbi/openai/models/admin/organization/projects/spend_alert_retrieve_params.rbi +52 -0
- data/rbi/openai/models/admin/organization/spend_alert_retrieve_params.rbi +42 -0
- data/rbi/openai/models/reasoning.rbi +34 -0
- data/rbi/openai/resources/admin/organization/admin_api_keys.rbi +8 -1
- data/rbi/openai/resources/admin/organization/audit_logs.rbi +8 -1
- data/rbi/openai/resources/admin/organization/projects/spend_alerts.rbi +19 -0
- data/rbi/openai/resources/admin/organization/spend_alerts.rbi +14 -0
- data/sig/openai/models/admin/organization/admin_api_key.rbs +5 -0
- data/sig/openai/models/admin/organization/admin_api_key_create_params.rbs +8 -1
- data/sig/openai/models/admin/organization/audit_log_list_params.rbs +12 -1
- data/sig/openai/models/admin/organization/audit_log_list_response.rbs +228 -0
- data/sig/openai/models/admin/organization/projects/spend_alert_retrieve_params.rbs +34 -0
- data/sig/openai/models/admin/organization/spend_alert_retrieve_params.rbs +27 -0
- data/sig/openai/models/reasoning.rbs +17 -0
- data/sig/openai/resources/admin/organization/admin_api_keys.rbs +1 -0
- data/sig/openai/resources/admin/organization/audit_logs.rbs +1 -0
- data/sig/openai/resources/admin/organization/projects/spend_alerts.rbs +6 -0
- data/sig/openai/resources/admin/organization/spend_alerts.rbs +5 -0
- metadata +9 -3
|
@@ -11,7 +11,7 @@ module OpenAI
|
|
|
11
11
|
#
|
|
12
12
|
# List user actions and configuration changes within this organization.
|
|
13
13
|
#
|
|
14
|
-
# @overload list(actor_emails: nil, actor_ids: nil, after: nil, before: nil, effective_at: nil, event_types: nil, limit: nil, project_ids: nil, resource_ids: nil, request_options: {})
|
|
14
|
+
# @overload list(actor_emails: nil, actor_ids: nil, after: nil, before: nil, effective_at: nil, event_types: nil, limit: nil, project_ids: nil, resource_ids: nil, tenant_only: nil, request_options: {})
|
|
15
15
|
#
|
|
16
16
|
# @param actor_emails [Array<String>] Return only events performed by users with these emails.
|
|
17
17
|
#
|
|
@@ -31,6 +31,8 @@ module OpenAI
|
|
|
31
31
|
#
|
|
32
32
|
# @param resource_ids [Array<String>] Return only events performed on these targets. For example, a project ID updated
|
|
33
33
|
#
|
|
34
|
+
# @param tenant_only [Boolean] Return only tenant-scoped events associated with this organization. Required for
|
|
35
|
+
#
|
|
34
36
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
35
37
|
#
|
|
36
38
|
# @return [OpenAI::Internal::ConversationCursorPage<OpenAI::Models::Admin::Organization::AuditLogListResponse>]
|
|
@@ -37,6 +37,34 @@ module OpenAI
|
|
|
37
37
|
)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
# Retrieves a project spend alert.
|
|
41
|
+
#
|
|
42
|
+
# @overload retrieve(alert_id, project_id:, request_options: {})
|
|
43
|
+
#
|
|
44
|
+
# @param alert_id [String] The ID of the spend alert to retrieve.
|
|
45
|
+
#
|
|
46
|
+
# @param project_id [String] The ID of the project.
|
|
47
|
+
#
|
|
48
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
49
|
+
#
|
|
50
|
+
# @return [OpenAI::Models::Admin::Organization::Projects::ProjectSpendAlert]
|
|
51
|
+
#
|
|
52
|
+
# @see OpenAI::Models::Admin::Organization::Projects::SpendAlertRetrieveParams
|
|
53
|
+
def retrieve(alert_id, params)
|
|
54
|
+
parsed, options = OpenAI::Admin::Organization::Projects::SpendAlertRetrieveParams.dump_request(params)
|
|
55
|
+
project_id =
|
|
56
|
+
parsed.delete(:project_id) do
|
|
57
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
58
|
+
end
|
|
59
|
+
@client.request(
|
|
60
|
+
method: :get,
|
|
61
|
+
path: ["organization/projects/%1$s/spend_alerts/%2$s", project_id, alert_id],
|
|
62
|
+
model: OpenAI::Admin::Organization::Projects::ProjectSpendAlert,
|
|
63
|
+
security: {admin_api_key_auth: true},
|
|
64
|
+
options: options
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
|
|
40
68
|
# Updates a project spend alert.
|
|
41
69
|
#
|
|
42
70
|
# @overload update(alert_id, project_id:, currency:, interval:, notification_channel:, threshold_amount:, request_options: {})
|
|
@@ -34,6 +34,27 @@ module OpenAI
|
|
|
34
34
|
)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
+
# Retrieves an organization spend alert.
|
|
38
|
+
#
|
|
39
|
+
# @overload retrieve(alert_id, request_options: {})
|
|
40
|
+
#
|
|
41
|
+
# @param alert_id [String] The ID of the spend alert to retrieve.
|
|
42
|
+
#
|
|
43
|
+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
44
|
+
#
|
|
45
|
+
# @return [OpenAI::Models::Admin::Organization::OrganizationSpendAlert]
|
|
46
|
+
#
|
|
47
|
+
# @see OpenAI::Models::Admin::Organization::SpendAlertRetrieveParams
|
|
48
|
+
def retrieve(alert_id, params = {})
|
|
49
|
+
@client.request(
|
|
50
|
+
method: :get,
|
|
51
|
+
path: ["organization/spend_alerts/%1$s", alert_id],
|
|
52
|
+
model: OpenAI::Admin::Organization::OrganizationSpendAlert,
|
|
53
|
+
security: {admin_api_key_auth: true},
|
|
54
|
+
options: params[:request_options]
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
37
58
|
# Updates an organization spend alert.
|
|
38
59
|
#
|
|
39
60
|
# @overload update(alert_id, currency:, interval:, notification_channel:, threshold_amount:, request_options: {})
|
data/lib/openai/version.rb
CHANGED
data/lib/openai.rb
CHANGED
|
@@ -206,6 +206,7 @@ require_relative "openai/models/admin/organization/projects/service_account_upda
|
|
|
206
206
|
require_relative "openai/models/admin/organization/projects/spend_alert_create_params"
|
|
207
207
|
require_relative "openai/models/admin/organization/projects/spend_alert_delete_params"
|
|
208
208
|
require_relative "openai/models/admin/organization/projects/spend_alert_list_params"
|
|
209
|
+
require_relative "openai/models/admin/organization/projects/spend_alert_retrieve_params"
|
|
209
210
|
require_relative "openai/models/admin/organization/projects/spend_alert_update_params"
|
|
210
211
|
require_relative "openai/models/admin/organization/projects/user_create_params"
|
|
211
212
|
require_relative "openai/models/admin/organization/projects/user_delete_params"
|
|
@@ -232,6 +233,7 @@ require_relative "openai/models/admin/organization/role_update_params"
|
|
|
232
233
|
require_relative "openai/models/admin/organization/spend_alert_create_params"
|
|
233
234
|
require_relative "openai/models/admin/organization/spend_alert_delete_params"
|
|
234
235
|
require_relative "openai/models/admin/organization/spend_alert_list_params"
|
|
236
|
+
require_relative "openai/models/admin/organization/spend_alert_retrieve_params"
|
|
235
237
|
require_relative "openai/models/admin/organization/spend_alert_update_params"
|
|
236
238
|
require_relative "openai/models/admin/organization/usage_audio_speeches_params"
|
|
237
239
|
require_relative "openai/models/admin/organization/usage_audio_speeches_response"
|
|
@@ -21,6 +21,10 @@ module OpenAI
|
|
|
21
21
|
sig { returns(Integer) }
|
|
22
22
|
attr_accessor :created_at
|
|
23
23
|
|
|
24
|
+
# The Unix timestamp (in seconds) of when the API key expires
|
|
25
|
+
sig { returns(T.nilable(Integer)) }
|
|
26
|
+
attr_accessor :expires_at
|
|
27
|
+
|
|
24
28
|
# The object type, which is always `organization.admin_api_key`
|
|
25
29
|
sig { returns(Symbol) }
|
|
26
30
|
attr_accessor :object
|
|
@@ -52,6 +56,7 @@ module OpenAI
|
|
|
52
56
|
params(
|
|
53
57
|
id: String,
|
|
54
58
|
created_at: Integer,
|
|
59
|
+
expires_at: T.nilable(Integer),
|
|
55
60
|
owner: OpenAI::Admin::Organization::AdminAPIKey::Owner::OrHash,
|
|
56
61
|
redacted_value: String,
|
|
57
62
|
last_used_at: T.nilable(Integer),
|
|
@@ -64,6 +69,8 @@ module OpenAI
|
|
|
64
69
|
id:,
|
|
65
70
|
# The Unix timestamp (in seconds) of when the API key was created
|
|
66
71
|
created_at:,
|
|
72
|
+
# The Unix timestamp (in seconds) of when the API key expires
|
|
73
|
+
expires_at:,
|
|
67
74
|
owner:,
|
|
68
75
|
# The redacted value of the API key
|
|
69
76
|
redacted_value:,
|
|
@@ -81,6 +88,7 @@ module OpenAI
|
|
|
81
88
|
{
|
|
82
89
|
id: String,
|
|
83
90
|
created_at: Integer,
|
|
91
|
+
expires_at: T.nilable(Integer),
|
|
84
92
|
object: Symbol,
|
|
85
93
|
owner: OpenAI::Admin::Organization::AdminAPIKey::Owner,
|
|
86
94
|
redacted_value: String,
|
|
@@ -19,18 +19,37 @@ module OpenAI
|
|
|
19
19
|
sig { returns(String) }
|
|
20
20
|
attr_accessor :name
|
|
21
21
|
|
|
22
|
+
# The number of seconds until the API key expires. Omit this field for a key that
|
|
23
|
+
# does not expire.
|
|
24
|
+
sig { returns(T.nilable(Integer)) }
|
|
25
|
+
attr_reader :expires_in_seconds
|
|
26
|
+
|
|
27
|
+
sig { params(expires_in_seconds: Integer).void }
|
|
28
|
+
attr_writer :expires_in_seconds
|
|
29
|
+
|
|
22
30
|
sig do
|
|
23
31
|
params(
|
|
24
32
|
name: String,
|
|
33
|
+
expires_in_seconds: Integer,
|
|
25
34
|
request_options: OpenAI::RequestOptions::OrHash
|
|
26
35
|
).returns(T.attached_class)
|
|
27
36
|
end
|
|
28
|
-
def self.new(
|
|
37
|
+
def self.new(
|
|
38
|
+
name:,
|
|
39
|
+
# The number of seconds until the API key expires. Omit this field for a key that
|
|
40
|
+
# does not expire.
|
|
41
|
+
expires_in_seconds: nil,
|
|
42
|
+
request_options: {}
|
|
43
|
+
)
|
|
29
44
|
end
|
|
30
45
|
|
|
31
46
|
sig do
|
|
32
47
|
override.returns(
|
|
33
|
-
{
|
|
48
|
+
{
|
|
49
|
+
name: String,
|
|
50
|
+
expires_in_seconds: Integer,
|
|
51
|
+
request_options: OpenAI::RequestOptions
|
|
52
|
+
}
|
|
34
53
|
)
|
|
35
54
|
end
|
|
36
55
|
def to_hash
|
|
@@ -109,13 +109,24 @@ module OpenAI
|
|
|
109
109
|
attr_writer :project_ids
|
|
110
110
|
|
|
111
111
|
# Return only events performed on these targets. For example, a project ID
|
|
112
|
-
# updated.
|
|
112
|
+
# updated. For ChatGPT connector role events, use the workspace connector resource
|
|
113
|
+
# ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.
|
|
113
114
|
sig { returns(T.nilable(T::Array[String])) }
|
|
114
115
|
attr_reader :resource_ids
|
|
115
116
|
|
|
116
117
|
sig { params(resource_ids: T::Array[String]).void }
|
|
117
118
|
attr_writer :resource_ids
|
|
118
119
|
|
|
120
|
+
# Return only tenant-scoped events associated with this organization. Required for
|
|
121
|
+
# tenant-scoped events such as `role.bound_to_resource` and
|
|
122
|
+
# `role.unbound_from_resource`. When `true`, all supplied event types must be
|
|
123
|
+
# tenant-scoped.
|
|
124
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
125
|
+
attr_reader :tenant_only
|
|
126
|
+
|
|
127
|
+
sig { params(tenant_only: T::Boolean).void }
|
|
128
|
+
attr_writer :tenant_only
|
|
129
|
+
|
|
119
130
|
sig do
|
|
120
131
|
params(
|
|
121
132
|
actor_emails: T::Array[String],
|
|
@@ -131,6 +142,7 @@ module OpenAI
|
|
|
131
142
|
limit: Integer,
|
|
132
143
|
project_ids: T::Array[String],
|
|
133
144
|
resource_ids: T::Array[String],
|
|
145
|
+
tenant_only: T::Boolean,
|
|
134
146
|
request_options: OpenAI::RequestOptions::OrHash
|
|
135
147
|
).returns(T.attached_class)
|
|
136
148
|
end
|
|
@@ -162,8 +174,14 @@ module OpenAI
|
|
|
162
174
|
# Return only events for these projects.
|
|
163
175
|
project_ids: nil,
|
|
164
176
|
# Return only events performed on these targets. For example, a project ID
|
|
165
|
-
# updated.
|
|
177
|
+
# updated. For ChatGPT connector role events, use the workspace connector resource
|
|
178
|
+
# ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.
|
|
166
179
|
resource_ids: nil,
|
|
180
|
+
# Return only tenant-scoped events associated with this organization. Required for
|
|
181
|
+
# tenant-scoped events such as `role.bound_to_resource` and
|
|
182
|
+
# `role.unbound_from_resource`. When `true`, all supplied event types must be
|
|
183
|
+
# tenant-scoped.
|
|
184
|
+
tenant_only: nil,
|
|
167
185
|
request_options: {}
|
|
168
186
|
)
|
|
169
187
|
end
|
|
@@ -184,6 +202,7 @@ module OpenAI
|
|
|
184
202
|
limit: Integer,
|
|
185
203
|
project_ids: T::Array[String],
|
|
186
204
|
resource_ids: T::Array[String],
|
|
205
|
+
tenant_only: T::Boolean,
|
|
187
206
|
request_options: OpenAI::RequestOptions
|
|
188
207
|
}
|
|
189
208
|
)
|
|
@@ -522,6 +541,16 @@ module OpenAI
|
|
|
522
541
|
:"role.assignment.deleted",
|
|
523
542
|
OpenAI::Admin::Organization::AuditLogListParams::EventType::TaggedSymbol
|
|
524
543
|
)
|
|
544
|
+
ROLE_BOUND_TO_RESOURCE =
|
|
545
|
+
T.let(
|
|
546
|
+
:"role.bound_to_resource",
|
|
547
|
+
OpenAI::Admin::Organization::AuditLogListParams::EventType::TaggedSymbol
|
|
548
|
+
)
|
|
549
|
+
ROLE_UNBOUND_FROM_RESOURCE =
|
|
550
|
+
T.let(
|
|
551
|
+
:"role.unbound_from_resource",
|
|
552
|
+
OpenAI::Admin::Organization::AuditLogListParams::EventType::TaggedSymbol
|
|
553
|
+
)
|
|
525
554
|
SCIM_ENABLED =
|
|
526
555
|
T.let(
|
|
527
556
|
:"scim.enabled",
|