Skip to content

Commit cebcabf

Browse files
fix(api): add missing file rank enum + more metadata (#1360)
1 parent 8389546 commit cebcabf

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 74
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-5d30684c3118d049682ea30cdb4dbef39b97d51667da484689193dc40162af32.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-b524aed1c2c5c928aa4e2c546f5dbb364e7b4d5027daf05e42e210b05a97c3c6.yml

src/resources/beta/threads/runs/steps.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,10 @@ export namespace FileSearchToolCall {
279279
*/
280280
export interface RankingOptions {
281281
/**
282-
* The ranker used for the file search.
282+
* The ranker to use for the file search. If not specified will use the `auto`
283+
* ranker.
283284
*/
284-
ranker: 'default_2024_08_21';
285+
ranker: 'auto' | 'default_2024_08_21';
285286

286287
/**
287288
* The score threshold for the file search. All values must be a floating point

src/resources/fine-tuning/jobs/jobs.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { APIResource } from '../../../resource';
44
import { isRequestOptions } from '../../../core';
55
import * as Core from '../../../core';
6+
import * as Shared from '../../shared';
67
import * as CheckpointsAPI from './checkpoints';
78
import {
89
CheckpointListParams,
@@ -195,6 +196,16 @@ export interface FineTuningJob {
195196
*/
196197
integrations?: Array<FineTuningJobWandbIntegrationObject> | null;
197198

199+
/**
200+
* Set of 16 key-value pairs that can be attached to an object. This can be useful
201+
* for storing additional information about the object in a structured format, and
202+
* querying for objects via API or the dashboard.
203+
*
204+
* Keys are strings with a maximum length of 64 characters. Values are strings with
205+
* a maximum length of 512 characters.
206+
*/
207+
metadata?: Shared.Metadata | null;
208+
198209
/**
199210
* The method used for fine-tuning.
200211
*/
@@ -476,6 +487,16 @@ export interface JobCreateParams {
476487
*/
477488
integrations?: Array<JobCreateParams.Integration> | null;
478489

490+
/**
491+
* Set of 16 key-value pairs that can be attached to an object. This can be useful
492+
* for storing additional information about the object in a structured format, and
493+
* querying for objects via API or the dashboard.
494+
*
495+
* Keys are strings with a maximum length of 64 characters. Values are strings with
496+
* a maximum length of 512 characters.
497+
*/
498+
metadata?: Shared.Metadata | null;
499+
479500
/**
480501
* The method used for fine-tuning.
481502
*/
@@ -690,7 +711,13 @@ export namespace JobCreateParams {
690711
}
691712
}
692713

693-
export interface JobListParams extends CursorPageParams {}
714+
export interface JobListParams extends CursorPageParams {
715+
/**
716+
* Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
717+
* Alternatively, set `metadata=null` to indicate no metadata.
718+
*/
719+
metadata?: Record<string, string> | null;
720+
}
694721

695722
export interface JobListEventsParams extends CursorPageParams {}
696723

tests/api-resources/fine-tuning/jobs/jobs.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('resource jobs', () => {
3434
wandb: { project: 'my-wandb-project', entity: 'entity', name: 'name', tags: ['custom-tag'] },
3535
},
3636
],
37+
metadata: { foo: 'string' },
3738
method: {
3839
dpo: {
3940
hyperparameters: {
@@ -93,7 +94,10 @@ describe('resource jobs', () => {
9394
test('list: request options and params are passed correctly', async () => {
9495
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
9596
await expect(
96-
client.fineTuning.jobs.list({ after: 'after', limit: 0 }, { path: '/_stainless_unknown_path' }),
97+
client.fineTuning.jobs.list(
98+
{ after: 'after', limit: 0, metadata: { foo: 'string' } },
99+
{ path: '/_stainless_unknown_path' },
100+
),
97101
).rejects.toThrow(OpenAI.NotFoundError);
98102
});
99103

0 commit comments

Comments
 (0)