Skip to content

Commit 740f840

Browse files
feat(api): manual updates
1 parent 280c698 commit 740f840

File tree

3 files changed

+26
-32
lines changed

3 files changed

+26
-32
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 97
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-9e41d2d5471d2c28bff0d616f4476f5b0e6c541ef4cb51bdaaef5fdf5e13c8b2.yml
33
openapi_spec_hash: 86f765e18d00e32cf2ce9db7ab84d946
4-
config_hash: fd2af1d5eff0995bb7dc02ac9a34851d
4+
config_hash: dc5515e257676a27cb1ace1784aa92b3

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Response Types:
283283
Methods:
284284

285285
- <code title="post /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions">client.FineTuning.Checkpoints.Permissions.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, fineTunedModelCheckpoint <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionNewParams">FineTuningCheckpointPermissionNewParams</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/packages/pagination#Page">Page</a>[<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionNewResponse">FineTuningCheckpointPermissionNewResponse</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
286-
- <code title="get /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions">client.FineTuning.Checkpoints.Permissions.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, fineTunedModelCheckpoint <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionGetParams">FineTuningCheckpointPermissionGetParams</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionGetResponse">FineTuningCheckpointPermissionGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
286+
- <code title="get /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions">client.FineTuning.Checkpoints.Permissions.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, fineTunedModelCheckpoint <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionGetParams">FineTuningCheckpointPermissionGetParams</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/packages/pagination#CursorPage">CursorPage</a>[<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionGetResponse">FineTuningCheckpointPermissionGetResponse</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
287287
- <code title="delete /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}">client.FineTuning.Checkpoints.Permissions.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, fineTunedModelCheckpoint <a href="https://pkg.go.dev/builtin#string">string</a>, permissionID <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go#FineTuningCheckpointPermissionDeleteResponse">FineTuningCheckpointPermissionDeleteResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
288288

289289
## Alpha

finetuningcheckpointpermission.go

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,33 @@ func (r *FineTuningCheckpointPermissionService) NewAutoPaging(ctx context.Contex
7575
//
7676
// Organization owners can use this endpoint to view all permissions for a
7777
// fine-tuned model checkpoint.
78-
func (r *FineTuningCheckpointPermissionService) Get(ctx context.Context, fineTunedModelCheckpoint string, query FineTuningCheckpointPermissionGetParams, opts ...option.RequestOption) (res *FineTuningCheckpointPermissionGetResponse, err error) {
78+
func (r *FineTuningCheckpointPermissionService) Get(ctx context.Context, fineTunedModelCheckpoint string, query FineTuningCheckpointPermissionGetParams, opts ...option.RequestOption) (res *pagination.CursorPage[FineTuningCheckpointPermissionGetResponse], err error) {
79+
var raw *http.Response
7980
opts = append(r.Options[:], opts...)
81+
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
8082
if fineTunedModelCheckpoint == "" {
8183
err = errors.New("missing required fine_tuned_model_checkpoint parameter")
8284
return
8385
}
8486
path := fmt.Sprintf("fine_tuning/checkpoints/%s/permissions", fineTunedModelCheckpoint)
85-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
86-
return
87+
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
88+
if err != nil {
89+
return nil, err
90+
}
91+
err = cfg.Execute()
92+
if err != nil {
93+
return nil, err
94+
}
95+
res.SetPageConfig(cfg, raw)
96+
return res, nil
97+
}
98+
99+
// **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
100+
//
101+
// Organization owners can use this endpoint to view all permissions for a
102+
// fine-tuned model checkpoint.
103+
func (r *FineTuningCheckpointPermissionService) GetAutoPaging(ctx context.Context, fineTunedModelCheckpoint string, query FineTuningCheckpointPermissionGetParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[FineTuningCheckpointPermissionGetResponse] {
104+
return pagination.NewCursorPageAutoPager(r.Get(ctx, fineTunedModelCheckpoint, query, opts...))
87105
}
88106

89107
// **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).
@@ -133,33 +151,9 @@ func (r *FineTuningCheckpointPermissionNewResponse) UnmarshalJSON(data []byte) e
133151
return apijson.UnmarshalRoot(data, r)
134152
}
135153

136-
type FineTuningCheckpointPermissionGetResponse struct {
137-
Data []FineTuningCheckpointPermissionGetResponseData `json:"data,required"`
138-
HasMore bool `json:"has_more,required"`
139-
Object constant.List `json:"object,required"`
140-
FirstID string `json:"first_id,nullable"`
141-
LastID string `json:"last_id,nullable"`
142-
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
143-
JSON struct {
144-
Data respjson.Field
145-
HasMore respjson.Field
146-
Object respjson.Field
147-
FirstID respjson.Field
148-
LastID respjson.Field
149-
ExtraFields map[string]respjson.Field
150-
raw string
151-
} `json:"-"`
152-
}
153-
154-
// Returns the unmodified JSON received from the API
155-
func (r FineTuningCheckpointPermissionGetResponse) RawJSON() string { return r.JSON.raw }
156-
func (r *FineTuningCheckpointPermissionGetResponse) UnmarshalJSON(data []byte) error {
157-
return apijson.UnmarshalRoot(data, r)
158-
}
159-
160154
// The `checkpoint.permission` object represents a permission for a fine-tuned
161155
// model checkpoint.
162-
type FineTuningCheckpointPermissionGetResponseData struct {
156+
type FineTuningCheckpointPermissionGetResponse struct {
163157
// The permission identifier, which can be referenced in the API endpoints.
164158
ID string `json:"id,required"`
165159
// The Unix timestamp (in seconds) for when the permission was created.
@@ -180,8 +174,8 @@ type FineTuningCheckpointPermissionGetResponseData struct {
180174
}
181175

182176
// Returns the unmodified JSON received from the API
183-
func (r FineTuningCheckpointPermissionGetResponseData) RawJSON() string { return r.JSON.raw }
184-
func (r *FineTuningCheckpointPermissionGetResponseData) UnmarshalJSON(data []byte) error {
177+
func (r FineTuningCheckpointPermissionGetResponse) RawJSON() string { return r.JSON.raw }
178+
func (r *FineTuningCheckpointPermissionGetResponse) UnmarshalJSON(data []byte) error {
185179
return apijson.UnmarshalRoot(data, r)
186180
}
187181

0 commit comments

Comments
 (0)