llama-stack-client 0.1.7 → 0.1.9

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 (94) hide show
  1. package/core.js.map +1 -1
  2. package/core.mjs.map +1 -1
  3. package/index.d.mts +6 -5
  4. package/index.d.ts +6 -5
  5. package/index.d.ts.map +1 -1
  6. package/index.js +1 -3
  7. package/index.js.map +1 -1
  8. package/index.mjs +1 -3
  9. package/index.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/pagination.d.ts +19 -0
  12. package/pagination.d.ts.map +1 -0
  13. package/pagination.js +40 -0
  14. package/pagination.js.map +1 -0
  15. package/pagination.mjs +36 -0
  16. package/pagination.mjs.map +1 -0
  17. package/resources/benchmarks.d.ts +1 -1
  18. package/resources/benchmarks.d.ts.map +1 -1
  19. package/resources/datasets.d.ts +190 -16
  20. package/resources/datasets.d.ts.map +1 -1
  21. package/resources/datasets.js +11 -5
  22. package/resources/datasets.js.map +1 -1
  23. package/resources/datasets.mjs +11 -5
  24. package/resources/datasets.mjs.map +1 -1
  25. package/resources/eval/eval.d.ts +3 -2
  26. package/resources/eval/eval.d.ts.map +1 -1
  27. package/resources/eval/eval.js.map +1 -1
  28. package/resources/eval/eval.mjs.map +1 -1
  29. package/resources/eval/index.d.ts +1 -1
  30. package/resources/eval/index.d.ts.map +1 -1
  31. package/resources/eval/index.js.map +1 -1
  32. package/resources/eval/index.mjs.map +1 -1
  33. package/resources/eval/jobs.d.ts +1 -5
  34. package/resources/eval/jobs.d.ts.map +1 -1
  35. package/resources/eval/jobs.js.map +1 -1
  36. package/resources/eval/jobs.mjs.map +1 -1
  37. package/resources/index.d.ts +1 -2
  38. package/resources/index.d.ts.map +1 -1
  39. package/resources/index.js +1 -3
  40. package/resources/index.js.map +1 -1
  41. package/resources/index.mjs +0 -1
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/models.d.ts +1 -1
  44. package/resources/models.d.ts.map +1 -1
  45. package/resources/post-training/job.d.ts +2 -2
  46. package/resources/post-training/job.d.ts.map +1 -1
  47. package/resources/post-training/job.js.map +1 -1
  48. package/resources/post-training/job.mjs.map +1 -1
  49. package/resources/scoring-functions.d.ts +4 -4
  50. package/resources/scoring-functions.d.ts.map +1 -1
  51. package/resources/shared.d.ts +15 -2
  52. package/resources/shared.d.ts.map +1 -1
  53. package/resources/shields.d.ts +1 -1
  54. package/resources/shields.d.ts.map +1 -1
  55. package/resources/tool-runtime/tool-runtime.d.ts +1 -1
  56. package/resources/tool-runtime/tool-runtime.d.ts.map +1 -1
  57. package/resources/vector-dbs.d.ts +1 -1
  58. package/resources/vector-dbs.d.ts.map +1 -1
  59. package/resources/vector-dbs.js.map +1 -1
  60. package/resources/vector-dbs.mjs.map +1 -1
  61. package/resources.d.ts +2 -0
  62. package/resources.d.ts.map +1 -0
  63. package/resources.js +18 -0
  64. package/resources.js.map +1 -0
  65. package/resources.mjs +2 -0
  66. package/resources.mjs.map +1 -0
  67. package/src/core.ts +1 -1
  68. package/src/index.ts +14 -15
  69. package/src/pagination.ts +62 -0
  70. package/src/resources/benchmarks.ts +1 -1
  71. package/src/resources/datasets.ts +240 -29
  72. package/src/resources/eval/eval.ts +4 -2
  73. package/src/resources/eval/index.ts +1 -1
  74. package/src/resources/eval/jobs.ts +1 -11
  75. package/src/resources/index.ts +3 -6
  76. package/src/resources/models.ts +1 -1
  77. package/src/resources/post-training/job.ts +2 -5
  78. package/src/resources/scoring-functions.ts +10 -4
  79. package/src/resources/shared.ts +25 -9
  80. package/src/resources/shields.ts +1 -1
  81. package/src/resources/tool-runtime/tool-runtime.ts +1 -1
  82. package/src/resources/vector-dbs.ts +1 -4
  83. package/src/resources.ts +1 -0
  84. package/src/version.ts +1 -1
  85. package/version.d.ts +1 -1
  86. package/version.js +1 -1
  87. package/version.mjs +1 -1
  88. package/resources/datasetio.d.ts +0 -52
  89. package/resources/datasetio.d.ts.map +0 -1
  90. package/resources/datasetio.js +0 -22
  91. package/resources/datasetio.js.map +0 -1
  92. package/resources/datasetio.mjs +0 -18
  93. package/resources/datasetio.mjs.map +0 -1
  94. package/src/resources/datasetio.ts +0 -80
@@ -1,14 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../resource';
4
+ import { isRequestOptions } from '../core';
4
5
  import * as Core from '../core';
5
- import * as Shared from './shared';
6
6
 
7
7
  export class Datasets extends APIResource {
8
- retrieve(
9
- datasetId: string,
10
- options?: Core.RequestOptions,
11
- ): Core.APIPromise<DatasetRetrieveResponse | null> {
8
+ retrieve(datasetId: string, options?: Core.RequestOptions): Core.APIPromise<DatasetRetrieveResponse> {
12
9
  return this._client.get(`/v1/datasets/${datasetId}`, options);
13
10
  }
14
11
 
@@ -18,12 +15,34 @@ export class Datasets extends APIResource {
18
15
  )._thenUnwrap((obj) => obj.data);
19
16
  }
20
17
 
21
- register(body: DatasetRegisterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
22
- return this._client.post('/v1/datasets', {
23
- body,
24
- ...options,
25
- headers: { Accept: '*/*', ...options?.headers },
26
- });
18
+ /**
19
+ * Get a paginated list of rows from a dataset. Uses cursor-based pagination.
20
+ */
21
+ iterrows(
22
+ datasetId: string,
23
+ query?: DatasetIterrowsParams,
24
+ options?: Core.RequestOptions,
25
+ ): Core.APIPromise<DatasetIterrowsResponse>;
26
+ iterrows(datasetId: string, options?: Core.RequestOptions): Core.APIPromise<DatasetIterrowsResponse>;
27
+ iterrows(
28
+ datasetId: string,
29
+ query: DatasetIterrowsParams | Core.RequestOptions = {},
30
+ options?: Core.RequestOptions,
31
+ ): Core.APIPromise<DatasetIterrowsResponse> {
32
+ if (isRequestOptions(query)) {
33
+ return this.iterrows(datasetId, {}, query);
34
+ }
35
+ return this._client.get(`/v1/datasetio/iterrows/${datasetId}`, { query, ...options });
36
+ }
37
+
38
+ /**
39
+ * Register a new dataset.
40
+ */
41
+ register(
42
+ body: DatasetRegisterParams,
43
+ options?: Core.RequestOptions,
44
+ ): Core.APIPromise<DatasetRegisterResponse> {
45
+ return this._client.post('/v1/datasets', { body, ...options });
27
46
  }
28
47
 
29
48
  unregister(datasetId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
@@ -39,8 +58,6 @@ export interface ListDatasetsResponse {
39
58
  }
40
59
 
41
60
  export interface DatasetRetrieveResponse {
42
- dataset_schema: Record<string, Shared.ParamType>;
43
-
44
61
  identifier: string;
45
62
 
46
63
  metadata: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
@@ -49,23 +66,53 @@ export interface DatasetRetrieveResponse {
49
66
 
50
67
  provider_resource_id: string;
51
68
 
52
- type: 'dataset';
69
+ /**
70
+ * Purpose of the dataset. Each purpose has a required input data schema.
71
+ */
72
+ purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
73
+
74
+ /**
75
+ * A dataset that can be obtained from a URI.
76
+ */
77
+ source: DatasetRetrieveResponse.UriDataSource | DatasetRetrieveResponse.RowsDataSource;
53
78
 
54
- url: DatasetRetrieveResponse.URL;
79
+ type: 'dataset';
55
80
  }
56
81
 
57
82
  export namespace DatasetRetrieveResponse {
58
- export interface URL {
83
+ /**
84
+ * A dataset that can be obtained from a URI.
85
+ */
86
+ export interface UriDataSource {
87
+ type: 'uri';
88
+
89
+ /**
90
+ * The dataset can be obtained from a URI. E.g. -
91
+ * "https://mywebsite.com/mydata.jsonl" - "lsfs://mydata.jsonl" -
92
+ * "data:csv;base64,{base64_content}"
93
+ */
59
94
  uri: string;
60
95
  }
96
+
97
+ /**
98
+ * A dataset stored in rows.
99
+ */
100
+ export interface RowsDataSource {
101
+ /**
102
+ * The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user",
103
+ * "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}
104
+ * ]
105
+ */
106
+ rows: Array<Record<string, boolean | number | string | Array<unknown> | unknown | null>>;
107
+
108
+ type: 'rows';
109
+ }
61
110
  }
62
111
 
63
112
  export type DatasetListResponse = Array<DatasetListResponse.DatasetListResponseItem>;
64
113
 
65
114
  export namespace DatasetListResponse {
66
115
  export interface DatasetListResponseItem {
67
- dataset_schema: Record<string, Shared.ParamType>;
68
-
69
116
  identifier: string;
70
117
 
71
118
  metadata: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
@@ -74,36 +121,197 @@ export namespace DatasetListResponse {
74
121
 
75
122
  provider_resource_id: string;
76
123
 
77
- type: 'dataset';
124
+ /**
125
+ * Purpose of the dataset. Each purpose has a required input data schema.
126
+ */
127
+ purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
128
+
129
+ /**
130
+ * A dataset that can be obtained from a URI.
131
+ */
132
+ source: DatasetListResponseItem.UriDataSource | DatasetListResponseItem.RowsDataSource;
78
133
 
79
- url: DatasetListResponseItem.URL;
134
+ type: 'dataset';
80
135
  }
81
136
 
82
137
  export namespace DatasetListResponseItem {
83
- export interface URL {
138
+ /**
139
+ * A dataset that can be obtained from a URI.
140
+ */
141
+ export interface UriDataSource {
142
+ type: 'uri';
143
+
144
+ /**
145
+ * The dataset can be obtained from a URI. E.g. -
146
+ * "https://mywebsite.com/mydata.jsonl" - "lsfs://mydata.jsonl" -
147
+ * "data:csv;base64,{base64_content}"
148
+ */
84
149
  uri: string;
85
150
  }
151
+
152
+ /**
153
+ * A dataset stored in rows.
154
+ */
155
+ export interface RowsDataSource {
156
+ /**
157
+ * The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user",
158
+ * "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}
159
+ * ]
160
+ */
161
+ rows: Array<Record<string, boolean | number | string | Array<unknown> | unknown | null>>;
162
+
163
+ type: 'rows';
164
+ }
86
165
  }
87
166
  }
88
167
 
89
- export interface DatasetRegisterParams {
90
- dataset_id: string;
168
+ /**
169
+ * A paginated list of rows from a dataset.
170
+ */
171
+ export interface DatasetIterrowsResponse {
172
+ /**
173
+ * The rows in the current page.
174
+ */
175
+ data: Array<Record<string, boolean | number | string | Array<unknown> | unknown | null>>;
176
+
177
+ /**
178
+ * Index into dataset for the first row in the next page. None if there are no more
179
+ * rows.
180
+ */
181
+ next_start_index?: number;
182
+ }
91
183
 
92
- dataset_schema: Record<string, Shared.ParamType>;
184
+ export interface DatasetRegisterResponse {
185
+ identifier: string;
93
186
 
94
- url: DatasetRegisterParams.URL;
187
+ metadata: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
95
188
 
96
- metadata?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
189
+ provider_id: string;
190
+
191
+ provider_resource_id: string;
192
+
193
+ /**
194
+ * Purpose of the dataset. Each purpose has a required input data schema.
195
+ */
196
+ purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
97
197
 
98
- provider_dataset_id?: string;
198
+ /**
199
+ * A dataset that can be obtained from a URI.
200
+ */
201
+ source: DatasetRegisterResponse.UriDataSource | DatasetRegisterResponse.RowsDataSource;
99
202
 
100
- provider_id?: string;
203
+ type: 'dataset';
204
+ }
205
+
206
+ export namespace DatasetRegisterResponse {
207
+ /**
208
+ * A dataset that can be obtained from a URI.
209
+ */
210
+ export interface UriDataSource {
211
+ type: 'uri';
212
+
213
+ /**
214
+ * The dataset can be obtained from a URI. E.g. -
215
+ * "https://mywebsite.com/mydata.jsonl" - "lsfs://mydata.jsonl" -
216
+ * "data:csv;base64,{base64_content}"
217
+ */
218
+ uri: string;
219
+ }
220
+
221
+ /**
222
+ * A dataset stored in rows.
223
+ */
224
+ export interface RowsDataSource {
225
+ /**
226
+ * The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user",
227
+ * "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}
228
+ * ]
229
+ */
230
+ rows: Array<Record<string, boolean | number | string | Array<unknown> | unknown | null>>;
231
+
232
+ type: 'rows';
233
+ }
234
+ }
235
+
236
+ export interface DatasetIterrowsParams {
237
+ /**
238
+ * The number of rows to get.
239
+ */
240
+ limit?: number;
241
+
242
+ /**
243
+ * Index into dataset for the first row to get. Get all rows if None.
244
+ */
245
+ start_index?: number;
246
+ }
247
+
248
+ export interface DatasetRegisterParams {
249
+ /**
250
+ * The purpose of the dataset. One of - "post-training/messages": The dataset
251
+ * contains a messages column with list of messages for post-training. {
252
+ * "messages": [ {"role": "user", "content": "Hello, world!"}, {"role":
253
+ * "assistant", "content": "Hello, world!"}, ] } - "eval/question-answer": The
254
+ * dataset contains a question column and an answer column for evaluation. {
255
+ * "question": "What is the capital of France?", "answer": "Paris" } -
256
+ * "eval/messages-answer": The dataset contains a messages column with list of
257
+ * messages and an answer column for evaluation. { "messages": [ {"role": "user",
258
+ * "content": "Hello, my name is John Doe."}, {"role": "assistant", "content":
259
+ * "Hello, John Doe. How can I help you today?"}, {"role": "user", "content":
260
+ * "What's my name?"}, ], "answer": "John Doe" }
261
+ */
262
+ purpose: 'post-training/messages' | 'eval/question-answer' | 'eval/messages-answer';
263
+
264
+ /**
265
+ * The data source of the dataset. Ensure that the data source schema is compatible
266
+ * with the purpose of the dataset. Examples: - { "type": "uri", "uri":
267
+ * "https://mywebsite.com/mydata.jsonl" } - { "type": "uri", "uri":
268
+ * "lsfs://mydata.jsonl" } - { "type": "uri", "uri":
269
+ * "data:csv;base64,{base64_content}" } - { "type": "uri", "uri":
270
+ * "huggingface://llamastack/simpleqa?split=train" } - { "type": "rows", "rows": [
271
+ * { "messages": [ {"role": "user", "content": "Hello, world!"}, {"role":
272
+ * "assistant", "content": "Hello, world!"}, ] } ] }
273
+ */
274
+ source: DatasetRegisterParams.UriDataSource | DatasetRegisterParams.RowsDataSource;
275
+
276
+ /**
277
+ * The ID of the dataset. If not provided, an ID will be generated.
278
+ */
279
+ dataset_id?: string;
280
+
281
+ /**
282
+ * The metadata for the dataset. - E.g. {"description": "My dataset"}
283
+ */
284
+ metadata?: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
101
285
  }
102
286
 
103
287
  export namespace DatasetRegisterParams {
104
- export interface URL {
288
+ /**
289
+ * A dataset that can be obtained from a URI.
290
+ */
291
+ export interface UriDataSource {
292
+ type: 'uri';
293
+
294
+ /**
295
+ * The dataset can be obtained from a URI. E.g. -
296
+ * "https://mywebsite.com/mydata.jsonl" - "lsfs://mydata.jsonl" -
297
+ * "data:csv;base64,{base64_content}"
298
+ */
105
299
  uri: string;
106
300
  }
301
+
302
+ /**
303
+ * A dataset stored in rows.
304
+ */
305
+ export interface RowsDataSource {
306
+ /**
307
+ * The dataset is stored in rows. E.g. - [ {"messages": [{"role": "user",
308
+ * "content": "Hello, world!"}, {"role": "assistant", "content": "Hello, world!"}]}
309
+ * ]
310
+ */
311
+ rows: Array<Record<string, boolean | number | string | Array<unknown> | unknown | null>>;
312
+
313
+ type: 'rows';
314
+ }
107
315
  }
108
316
 
109
317
  export declare namespace Datasets {
@@ -111,6 +319,9 @@ export declare namespace Datasets {
111
319
  type ListDatasetsResponse as ListDatasetsResponse,
112
320
  type DatasetRetrieveResponse as DatasetRetrieveResponse,
113
321
  type DatasetListResponse as DatasetListResponse,
322
+ type DatasetIterrowsResponse as DatasetIterrowsResponse,
323
+ type DatasetRegisterResponse as DatasetRegisterResponse,
324
+ type DatasetIterrowsParams as DatasetIterrowsParams,
114
325
  type DatasetRegisterParams as DatasetRegisterParams,
115
326
  };
116
327
  }
@@ -5,7 +5,7 @@ import * as Core from '../../core';
5
5
  import * as ScoringFunctionsAPI from '../scoring-functions';
6
6
  import * as Shared from '../shared';
7
7
  import * as JobsAPI from './jobs';
8
- import { JobStatusResponse, Jobs } from './jobs';
8
+ import { Jobs } from './jobs';
9
9
 
10
10
  export class Eval extends APIResource {
11
11
  jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client);
@@ -131,6 +131,8 @@ export interface EvaluateResponse {
131
131
 
132
132
  export interface Job {
133
133
  job_id: string;
134
+
135
+ status: 'completed' | 'in_progress' | 'failed' | 'scheduled';
134
136
  }
135
137
 
136
138
  export interface EvalEvaluateRowsParams {
@@ -195,5 +197,5 @@ export declare namespace Eval {
195
197
  type EvalRunEvalAlphaParams as EvalRunEvalAlphaParams,
196
198
  };
197
199
 
198
- export { Jobs as Jobs, type JobStatusResponse as JobStatusResponse };
200
+ export { Jobs as Jobs };
199
201
  }
@@ -11,4 +11,4 @@ export {
11
11
  type EvalRunEvalParams,
12
12
  type EvalRunEvalAlphaParams,
13
13
  } from './eval';
14
- export { Jobs, type JobStatusResponse } from './jobs';
14
+ export { Jobs } from './jobs';
@@ -29,17 +29,7 @@ export class Jobs extends APIResource {
29
29
  /**
30
30
  * Get the status of a job.
31
31
  */
32
- status(
33
- benchmarkId: string,
34
- jobId: string,
35
- options?: Core.RequestOptions,
36
- ): Core.APIPromise<JobStatusResponse | null> {
32
+ status(benchmarkId: string, jobId: string, options?: Core.RequestOptions): Core.APIPromise<EvalAPI.Job> {
37
33
  return this._client.get(`/v1/eval/benchmarks/${benchmarkId}/jobs/${jobId}`, options);
38
34
  }
39
35
  }
40
-
41
- export type JobStatusResponse = 'completed' | 'in_progress' | 'failed' | 'scheduled' | null;
42
-
43
- export declare namespace Jobs {
44
- export { type JobStatusResponse as JobStatusResponse };
45
- }
@@ -24,17 +24,14 @@ export {
24
24
  type BenchmarkListResponse,
25
25
  type BenchmarkRegisterParams,
26
26
  } from './benchmarks';
27
- export {
28
- Datasetio,
29
- type PaginatedRowsResult,
30
- type DatasetioAppendRowsParams,
31
- type DatasetioGetRowsPaginatedParams,
32
- } from './datasetio';
33
27
  export {
34
28
  Datasets,
35
29
  type ListDatasetsResponse,
36
30
  type DatasetRetrieveResponse,
37
31
  type DatasetListResponse,
32
+ type DatasetIterrowsResponse,
33
+ type DatasetRegisterResponse,
34
+ type DatasetIterrowsParams,
38
35
  type DatasetRegisterParams,
39
36
  } from './datasets';
40
37
  export {
@@ -4,7 +4,7 @@ import { APIResource } from '../resource';
4
4
  import * as Core from '../core';
5
5
 
6
6
  export class Models extends APIResource {
7
- retrieve(modelId: string, options?: Core.RequestOptions): Core.APIPromise<Model | null> {
7
+ retrieve(modelId: string, options?: Core.RequestOptions): Core.APIPromise<Model> {
8
8
  return this._client.get(`/v1/models/${modelId}`, options);
9
9
  }
10
10
 
@@ -16,10 +16,7 @@ export class Job extends APIResource {
16
16
  )._thenUnwrap((obj) => obj.data);
17
17
  }
18
18
 
19
- artifacts(
20
- query: JobArtifactsParams,
21
- options?: Core.RequestOptions,
22
- ): Core.APIPromise<JobArtifactsResponse | null> {
19
+ artifacts(query: JobArtifactsParams, options?: Core.RequestOptions): Core.APIPromise<JobArtifactsResponse> {
23
20
  return this._client.get('/v1/post-training/job/artifacts', { query, ...options });
24
21
  }
25
22
 
@@ -31,7 +28,7 @@ export class Job extends APIResource {
31
28
  });
32
29
  }
33
30
 
34
- status(query: JobStatusParams, options?: Core.RequestOptions): Core.APIPromise<JobStatusResponse | null> {
31
+ status(query: JobStatusParams, options?: Core.RequestOptions): Core.APIPromise<JobStatusResponse> {
35
32
  return this._client.get('/v1/post-training/job/status', { query, ...options });
36
33
  }
37
34
  }
@@ -5,7 +5,7 @@ import * as Core from '../core';
5
5
  import * as Shared from './shared';
6
6
 
7
7
  export class ScoringFunctions extends APIResource {
8
- retrieve(scoringFnId: string, options?: Core.RequestOptions): Core.APIPromise<ScoringFn | null> {
8
+ retrieve(scoringFnId: string, options?: Core.RequestOptions): Core.APIPromise<ScoringFn> {
9
9
  return this._client.get(`/v1/scoring-functions/${scoringFnId}`, options);
10
10
  }
11
11
 
@@ -59,7 +59,9 @@ export namespace ScoringFnParams {
59
59
 
60
60
  type: 'llm_as_judge';
61
61
 
62
- aggregation_functions?: Array<'average' | 'median' | 'categorical_count' | 'accuracy'>;
62
+ aggregation_functions?: Array<
63
+ 'average' | 'weighted_average' | 'median' | 'categorical_count' | 'accuracy'
64
+ >;
63
65
 
64
66
  judge_score_regexes?: Array<string>;
65
67
 
@@ -69,7 +71,9 @@ export namespace ScoringFnParams {
69
71
  export interface RegexParserScoringFnParams {
70
72
  type: 'regex_parser';
71
73
 
72
- aggregation_functions?: Array<'average' | 'median' | 'categorical_count' | 'accuracy'>;
74
+ aggregation_functions?: Array<
75
+ 'average' | 'weighted_average' | 'median' | 'categorical_count' | 'accuracy'
76
+ >;
73
77
 
74
78
  parsing_regexes?: Array<string>;
75
79
  }
@@ -77,7 +81,9 @@ export namespace ScoringFnParams {
77
81
  export interface BasicScoringFnParams {
78
82
  type: 'basic';
79
83
 
80
- aggregation_functions?: Array<'average' | 'median' | 'categorical_count' | 'accuracy'>;
84
+ aggregation_functions?: Array<
85
+ 'average' | 'weighted_average' | 'median' | 'categorical_count' | 'accuracy'
86
+ >;
81
87
  }
82
88
  }
83
89
 
@@ -170,9 +170,12 @@ export namespace ContentDelta {
170
170
  }
171
171
  }
172
172
 
173
+ /**
174
+ * A document to be used for document ingestion in the RAG Tool.
175
+ */
173
176
  export interface Document {
174
177
  /**
175
- * A image content item
178
+ * The content of the document.
176
179
  */
177
180
  content:
178
181
  | string
@@ -181,10 +184,19 @@ export interface Document {
181
184
  | Array<InterleavedContentItem>
182
185
  | Document.URL;
183
186
 
187
+ /**
188
+ * The unique identifier for the document.
189
+ */
184
190
  document_id: string;
185
191
 
192
+ /**
193
+ * Additional metadata for the document.
194
+ */
186
195
  metadata: Record<string, boolean | number | string | Array<unknown> | unknown | null>;
187
196
 
197
+ /**
198
+ * The MIME type of the document.
199
+ */
188
200
  mime_type?: string;
189
201
  }
190
202
 
@@ -608,19 +620,23 @@ export interface SystemMessage {
608
620
  }
609
621
 
610
622
  export interface ToolCall {
611
- arguments: Record<
612
- string,
623
+ arguments:
613
624
  | string
614
- | number
615
- | boolean
616
- | Array<string | number | boolean | null>
617
- | Record<string, string | number | boolean | null>
618
- | null
619
- >;
625
+ | Record<
626
+ string,
627
+ | string
628
+ | number
629
+ | boolean
630
+ | Array<string | number | boolean | null>
631
+ | Record<string, string | number | boolean | null>
632
+ | null
633
+ >;
620
634
 
621
635
  call_id: string;
622
636
 
623
637
  tool_name: 'brave_search' | 'wolfram_alpha' | 'photogen' | 'code_interpreter' | (string & {});
638
+
639
+ arguments_json?: string;
624
640
  }
625
641
 
626
642
  export type ToolCallOrString = string | ToolCall;
@@ -4,7 +4,7 @@ import { APIResource } from '../resource';
4
4
  import * as Core from '../core';
5
5
 
6
6
  export class Shields extends APIResource {
7
- retrieve(identifier: string, options?: Core.RequestOptions): Core.APIPromise<Shield | null> {
7
+ retrieve(identifier: string, options?: Core.RequestOptions): Core.APIPromise<Shield> {
8
8
  return this._client.get(`/v1/shields/${identifier}`, options);
9
9
  }
10
10
 
@@ -72,7 +72,7 @@ export interface ToolInvocationResult {
72
72
  /**
73
73
  * A image content item
74
74
  */
75
- content: Shared.InterleavedContent;
75
+ content?: Shared.InterleavedContent;
76
76
 
77
77
  error_code?: number;
78
78
 
@@ -4,10 +4,7 @@ import { APIResource } from '../resource';
4
4
  import * as Core from '../core';
5
5
 
6
6
  export class VectorDBs extends APIResource {
7
- retrieve(
8
- vectorDBId: string,
9
- options?: Core.RequestOptions,
10
- ): Core.APIPromise<VectorDBRetrieveResponse | null> {
7
+ retrieve(vectorDBId: string, options?: Core.RequestOptions): Core.APIPromise<VectorDBRetrieveResponse> {
11
8
  return this._client.get(`/v1/vector-dbs/${vectorDBId}`, options);
12
9
  }
13
10
 
@@ -0,0 +1 @@
1
+ export * from './resources/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.1.7';
1
+ export const VERSION = '0.1.9';
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.1.7";
1
+ export declare const VERSION = "0.1.9";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.1.7';
4
+ exports.VERSION = '0.1.9';
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.1.7';
1
+ export const VERSION = '0.1.9';
2
2
  //# sourceMappingURL=version.mjs.map
@@ -1,52 +0,0 @@
1
- import { APIResource } from "../resource.js";
2
- import * as Core from "../core.js";
3
- export declare class Datasetio extends APIResource {
4
- appendRows(body: DatasetioAppendRowsParams, options?: Core.RequestOptions): Core.APIPromise<void>;
5
- /**
6
- * Get a paginated list of rows from a dataset.
7
- */
8
- getRowsPaginated(query: DatasetioGetRowsPaginatedParams, options?: Core.RequestOptions): Core.APIPromise<PaginatedRowsResult>;
9
- }
10
- /**
11
- * A paginated list of rows from a dataset.
12
- */
13
- export interface PaginatedRowsResult {
14
- /**
15
- * The rows in the current page.
16
- */
17
- rows: Array<Record<string, boolean | number | string | Array<unknown> | unknown | null>>;
18
- /**
19
- * The total number of rows in the dataset.
20
- */
21
- total_count: number;
22
- /**
23
- * The token to get the next page of rows.
24
- */
25
- next_page_token?: string;
26
- }
27
- export interface DatasetioAppendRowsParams {
28
- dataset_id: string;
29
- rows: Array<Record<string, boolean | number | string | Array<unknown> | unknown | null>>;
30
- }
31
- export interface DatasetioGetRowsPaginatedParams {
32
- /**
33
- * The ID of the dataset to get the rows from.
34
- */
35
- dataset_id: string;
36
- /**
37
- * The number of rows to get per page.
38
- */
39
- rows_in_page: number;
40
- /**
41
- * (Optional) A condition to filter the rows by.
42
- */
43
- filter_condition?: string;
44
- /**
45
- * The token to get the next page of rows.
46
- */
47
- page_token?: string;
48
- }
49
- export declare namespace Datasetio {
50
- export { type PaginatedRowsResult as PaginatedRowsResult, type DatasetioAppendRowsParams as DatasetioAppendRowsParams, type DatasetioGetRowsPaginatedParams as DatasetioGetRowsPaginatedParams, };
51
- }
52
- //# sourceMappingURL=datasetio.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datasetio.d.ts","sourceRoot":"","sources":["../src/resources/datasetio.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,SAAU,SAAQ,WAAW;IACxC,UAAU,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAQjG;;OAEG;IACH,gBAAgB,CACd,KAAK,EAAE,+BAA+B,EACtC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;CAGxC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC;IAEzF;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC;CAC1F;AAED,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}