Skip to content

Commit a64ae5b

Browse files
chore(internal): reduce warnings
1 parent 4f25be4 commit a64ae5b

13 files changed

Lines changed: 531 additions & 3 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 147
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-b879fff3f51e71e4f1ce17f03efc017a46d888a1bfd88eb655a6210a86f02acf.yml
33
openapi_spec_hash: cbf649cc2c944fb3f77450ec752ab1e9
4-
config_hash: 7ce3344e237b57dccafe71cb9413ddd4
4+
config_hash: 9c56fcc7ff64785b5cd448d9a754b4b3

lib/openai.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@
363363
require_relative "openai/models/fine_tuning/checkpoints/permission_create_response"
364364
require_relative "openai/models/fine_tuning/checkpoints/permission_delete_params"
365365
require_relative "openai/models/fine_tuning/checkpoints/permission_delete_response"
366+
require_relative "openai/models/fine_tuning/checkpoints/permission_list_params"
367+
require_relative "openai/models/fine_tuning/checkpoints/permission_list_response"
366368
require_relative "openai/models/fine_tuning/checkpoints/permission_retrieve_params"
367369
require_relative "openai/models/fine_tuning/checkpoints/permission_retrieve_response"
368370
require_relative "openai/models/fine_tuning/dpo_hyperparameters"

lib/openai/internal/conversation_cursor_page.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ module Internal
1010
# end
1111
#
1212
# @example
13-
# conversation_cursor_page.auto_paging_each do |thread|
14-
# puts(thread)
13+
# conversation_cursor_page.auto_paging_each do |permission|
14+
# puts(permission)
1515
# end
1616
class ConversationCursorPage
1717
include OpenAI::Internal::Type::BasePage
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# frozen_string_literal: true
2+
3+
module OpenAI
4+
module Models
5+
module FineTuning
6+
module Checkpoints
7+
# @see OpenAI::Resources::FineTuning::Checkpoints::Permissions#list
8+
class PermissionListParams < OpenAI::Internal::Type::BaseModel
9+
extend OpenAI::Internal::Type::RequestParameters::Converter
10+
include OpenAI::Internal::Type::RequestParameters
11+
12+
# @!attribute after
13+
# Identifier for the last permission ID from the previous pagination request.
14+
#
15+
# @return [String, nil]
16+
optional :after, String
17+
18+
# @!attribute limit
19+
# Number of permissions to retrieve.
20+
#
21+
# @return [Integer, nil]
22+
optional :limit, Integer
23+
24+
# @!attribute order
25+
# The order in which to retrieve permissions.
26+
#
27+
# @return [Symbol, OpenAI::Models::FineTuning::Checkpoints::PermissionListParams::Order, nil]
28+
optional :order, enum: -> { OpenAI::FineTuning::Checkpoints::PermissionListParams::Order }
29+
30+
# @!attribute project_id
31+
# The ID of the project to get permissions for.
32+
#
33+
# @return [String, nil]
34+
optional :project_id, String
35+
36+
# @!method initialize(after: nil, limit: nil, order: nil, project_id: nil, request_options: {})
37+
# @param after [String] Identifier for the last permission ID from the previous pagination request.
38+
#
39+
# @param limit [Integer] Number of permissions to retrieve.
40+
#
41+
# @param order [Symbol, OpenAI::Models::FineTuning::Checkpoints::PermissionListParams::Order] The order in which to retrieve permissions.
42+
#
43+
# @param project_id [String] The ID of the project to get permissions for.
44+
#
45+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
46+
47+
# The order in which to retrieve permissions.
48+
module Order
49+
extend OpenAI::Internal::Type::Enum
50+
51+
ASCENDING = :ascending
52+
DESCENDING = :descending
53+
54+
# @!method self.values
55+
# @return [Array<Symbol>]
56+
end
57+
end
58+
end
59+
end
60+
end
61+
end
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# frozen_string_literal: true
2+
3+
module OpenAI
4+
module Models
5+
module FineTuning
6+
module Checkpoints
7+
# @see OpenAI::Resources::FineTuning::Checkpoints::Permissions#list
8+
class PermissionListResponse < OpenAI::Internal::Type::BaseModel
9+
# @!attribute id
10+
# The permission identifier, which can be referenced in the API endpoints.
11+
#
12+
# @return [String]
13+
required :id, String
14+
15+
# @!attribute created_at
16+
# The Unix timestamp (in seconds) for when the permission was created.
17+
#
18+
# @return [Integer]
19+
required :created_at, Integer
20+
21+
# @!attribute object
22+
# The object type, which is always "checkpoint.permission".
23+
#
24+
# @return [Symbol, :"checkpoint.permission"]
25+
required :object, const: :"checkpoint.permission"
26+
27+
# @!attribute project_id
28+
# The project identifier that the permission is for.
29+
#
30+
# @return [String]
31+
required :project_id, String
32+
33+
# @!method initialize(id:, created_at:, project_id:, object: :"checkpoint.permission")
34+
# The `checkpoint.permission` object represents a permission for a fine-tuned
35+
# model checkpoint.
36+
#
37+
# @param id [String] The permission identifier, which can be referenced in the API endpoints.
38+
#
39+
# @param created_at [Integer] The Unix timestamp (in seconds) for when the permission was created.
40+
#
41+
# @param project_id [String] The project identifier that the permission is for.
42+
#
43+
# @param object [Symbol, :"checkpoint.permission"] The object type, which is always "checkpoint.permission".
44+
end
45+
end
46+
end
47+
end
48+
end

lib/openai/resources/fine_tuning/checkpoints/permissions.rb

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def create(fine_tuned_model_checkpoint, params)
3838
)
3939
end
4040

41+
# @deprecated Retrieve is deprecated. Please swap to the paginated list method instead.
42+
#
4143
# Some parameter documentations has been truncated, see
4244
# {OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveParams} for more
4345
# details.
@@ -76,6 +78,45 @@ def retrieve(fine_tuned_model_checkpoint, params = {})
7678
)
7779
end
7880

81+
# Some parameter documentations has been truncated, see
82+
# {OpenAI::Models::FineTuning::Checkpoints::PermissionListParams} for more
83+
# details.
84+
#
85+
# **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
86+
#
87+
# Organization owners can use this endpoint to view all permissions for a
88+
# fine-tuned model checkpoint.
89+
#
90+
# @overload list(fine_tuned_model_checkpoint, after: nil, limit: nil, order: nil, project_id: nil, request_options: {})
91+
#
92+
# @param fine_tuned_model_checkpoint [String] The ID of the fine-tuned model checkpoint to get permissions for.
93+
#
94+
# @param after [String] Identifier for the last permission ID from the previous pagination request.
95+
#
96+
# @param limit [Integer] Number of permissions to retrieve.
97+
#
98+
# @param order [Symbol, OpenAI::Models::FineTuning::Checkpoints::PermissionListParams::Order] The order in which to retrieve permissions.
99+
#
100+
# @param project_id [String] The ID of the project to get permissions for.
101+
#
102+
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}, nil]
103+
#
104+
# @return [OpenAI::Internal::ConversationCursorPage<OpenAI::Models::FineTuning::Checkpoints::PermissionListResponse>]
105+
#
106+
# @see OpenAI::Models::FineTuning::Checkpoints::PermissionListParams
107+
def list(fine_tuned_model_checkpoint, params = {})
108+
parsed, options = OpenAI::FineTuning::Checkpoints::PermissionListParams.dump_request(params)
109+
query = OpenAI::Internal::Util.encode_query_params(parsed)
110+
@client.request(
111+
method: :get,
112+
path: ["fine_tuning/checkpoints/%1$s/permissions", fine_tuned_model_checkpoint],
113+
query: query,
114+
page: OpenAI::Internal::ConversationCursorPage,
115+
model: OpenAI::Models::FineTuning::Checkpoints::PermissionListResponse,
116+
options: options
117+
)
118+
end
119+
79120
# Some parameter documentations has been truncated, see
80121
# {OpenAI::Models::FineTuning::Checkpoints::PermissionDeleteParams} for more
81122
# details.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# typed: strong
2+
3+
module OpenAI
4+
module Models
5+
module FineTuning
6+
module Checkpoints
7+
class PermissionListParams < OpenAI::Internal::Type::BaseModel
8+
extend OpenAI::Internal::Type::RequestParameters::Converter
9+
include OpenAI::Internal::Type::RequestParameters
10+
11+
OrHash =
12+
T.type_alias do
13+
T.any(
14+
OpenAI::FineTuning::Checkpoints::PermissionListParams,
15+
OpenAI::Internal::AnyHash
16+
)
17+
end
18+
19+
# Identifier for the last permission ID from the previous pagination request.
20+
sig { returns(T.nilable(String)) }
21+
attr_reader :after
22+
23+
sig { params(after: String).void }
24+
attr_writer :after
25+
26+
# Number of permissions to retrieve.
27+
sig { returns(T.nilable(Integer)) }
28+
attr_reader :limit
29+
30+
sig { params(limit: Integer).void }
31+
attr_writer :limit
32+
33+
# The order in which to retrieve permissions.
34+
sig do
35+
returns(
36+
T.nilable(
37+
OpenAI::FineTuning::Checkpoints::PermissionListParams::Order::OrSymbol
38+
)
39+
)
40+
end
41+
attr_reader :order
42+
43+
sig do
44+
params(
45+
order:
46+
OpenAI::FineTuning::Checkpoints::PermissionListParams::Order::OrSymbol
47+
).void
48+
end
49+
attr_writer :order
50+
51+
# The ID of the project to get permissions for.
52+
sig { returns(T.nilable(String)) }
53+
attr_reader :project_id
54+
55+
sig { params(project_id: String).void }
56+
attr_writer :project_id
57+
58+
sig do
59+
params(
60+
after: String,
61+
limit: Integer,
62+
order:
63+
OpenAI::FineTuning::Checkpoints::PermissionListParams::Order::OrSymbol,
64+
project_id: String,
65+
request_options: OpenAI::RequestOptions::OrHash
66+
).returns(T.attached_class)
67+
end
68+
def self.new(
69+
# Identifier for the last permission ID from the previous pagination request.
70+
after: nil,
71+
# Number of permissions to retrieve.
72+
limit: nil,
73+
# The order in which to retrieve permissions.
74+
order: nil,
75+
# The ID of the project to get permissions for.
76+
project_id: nil,
77+
request_options: {}
78+
)
79+
end
80+
81+
sig do
82+
override.returns(
83+
{
84+
after: String,
85+
limit: Integer,
86+
order:
87+
OpenAI::FineTuning::Checkpoints::PermissionListParams::Order::OrSymbol,
88+
project_id: String,
89+
request_options: OpenAI::RequestOptions
90+
}
91+
)
92+
end
93+
def to_hash
94+
end
95+
96+
# The order in which to retrieve permissions.
97+
module Order
98+
extend OpenAI::Internal::Type::Enum
99+
100+
TaggedSymbol =
101+
T.type_alias do
102+
T.all(
103+
Symbol,
104+
OpenAI::FineTuning::Checkpoints::PermissionListParams::Order
105+
)
106+
end
107+
OrSymbol = T.type_alias { T.any(Symbol, String) }
108+
109+
ASCENDING =
110+
T.let(
111+
:ascending,
112+
OpenAI::FineTuning::Checkpoints::PermissionListParams::Order::TaggedSymbol
113+
)
114+
DESCENDING =
115+
T.let(
116+
:descending,
117+
OpenAI::FineTuning::Checkpoints::PermissionListParams::Order::TaggedSymbol
118+
)
119+
120+
sig do
121+
override.returns(
122+
T::Array[
123+
OpenAI::FineTuning::Checkpoints::PermissionListParams::Order::TaggedSymbol
124+
]
125+
)
126+
end
127+
def self.values
128+
end
129+
end
130+
end
131+
end
132+
end
133+
end
134+
end
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# typed: strong
2+
3+
module OpenAI
4+
module Models
5+
module FineTuning
6+
module Checkpoints
7+
class PermissionListResponse < OpenAI::Internal::Type::BaseModel
8+
OrHash =
9+
T.type_alias do
10+
T.any(
11+
OpenAI::Models::FineTuning::Checkpoints::PermissionListResponse,
12+
OpenAI::Internal::AnyHash
13+
)
14+
end
15+
16+
# The permission identifier, which can be referenced in the API endpoints.
17+
sig { returns(String) }
18+
attr_accessor :id
19+
20+
# The Unix timestamp (in seconds) for when the permission was created.
21+
sig { returns(Integer) }
22+
attr_accessor :created_at
23+
24+
# The object type, which is always "checkpoint.permission".
25+
sig { returns(Symbol) }
26+
attr_accessor :object
27+
28+
# The project identifier that the permission is for.
29+
sig { returns(String) }
30+
attr_accessor :project_id
31+
32+
# The `checkpoint.permission` object represents a permission for a fine-tuned
33+
# model checkpoint.
34+
sig do
35+
params(
36+
id: String,
37+
created_at: Integer,
38+
project_id: String,
39+
object: Symbol
40+
).returns(T.attached_class)
41+
end
42+
def self.new(
43+
# The permission identifier, which can be referenced in the API endpoints.
44+
id:,
45+
# The Unix timestamp (in seconds) for when the permission was created.
46+
created_at:,
47+
# The project identifier that the permission is for.
48+
project_id:,
49+
# The object type, which is always "checkpoint.permission".
50+
object: :"checkpoint.permission"
51+
)
52+
end
53+
54+
sig do
55+
override.returns(
56+
{
57+
id: String,
58+
created_at: Integer,
59+
object: Symbol,
60+
project_id: String
61+
}
62+
)
63+
end
64+
def to_hash
65+
end
66+
end
67+
end
68+
end
69+
end
70+
end

0 commit comments

Comments
 (0)