llama-stack-client 0.2.18 → 0.2.19-rc2
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.
- package/CHANGELOG.md +26 -0
- package/index.d.mts +12 -11
- package/index.d.ts +12 -11
- package/index.d.ts.map +1 -1
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/index.mjs +6 -3
- package/index.mjs.map +1 -1
- package/package.json +4 -1
- package/pagination.d.ts +19 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +42 -1
- package/pagination.js.map +1 -1
- package/pagination.mjs +40 -0
- package/pagination.mjs.map +1 -1
- package/resources/chat/chat.d.ts +2 -2
- package/resources/chat/chat.d.ts.map +1 -1
- package/resources/chat/chat.js +1 -0
- package/resources/chat/chat.js.map +1 -1
- package/resources/chat/chat.mjs +2 -1
- package/resources/chat/chat.mjs.map +1 -1
- package/resources/chat/completions.d.ts +414 -446
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/chat/completions.js +7 -2
- package/resources/chat/completions.js.map +1 -1
- package/resources/chat/completions.mjs +5 -1
- package/resources/chat/completions.mjs.map +1 -1
- package/resources/chat/index.d.ts +1 -1
- package/resources/chat/index.d.ts.map +1 -1
- package/resources/chat/index.js +2 -1
- package/resources/chat/index.js.map +1 -1
- package/resources/chat/index.mjs +1 -1
- package/resources/chat/index.mjs.map +1 -1
- package/resources/files.d.ts +10 -19
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +7 -2
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +5 -1
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.ts +4 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -3
- package/resources/index.mjs.map +1 -1
- package/resources/inference.d.ts +2 -38
- package/resources/inference.d.ts.map +1 -1
- package/resources/moderations.d.ts +1 -5
- package/resources/moderations.d.ts.map +1 -1
- package/resources/responses/index.d.ts +1 -1
- package/resources/responses/index.d.ts.map +1 -1
- package/resources/responses/index.js +2 -1
- package/resources/responses/index.js.map +1 -1
- package/resources/responses/index.mjs +1 -1
- package/resources/responses/index.mjs.map +1 -1
- package/resources/responses/input-items.d.ts +30 -3
- package/resources/responses/input-items.d.ts.map +1 -1
- package/resources/responses/responses.d.ts +604 -470
- package/resources/responses/responses.d.ts.map +1 -1
- package/resources/responses/responses.js +10 -2
- package/resources/responses/responses.js.map +1 -1
- package/resources/responses/responses.mjs +8 -1
- package/resources/responses/responses.mjs.map +1 -1
- package/resources/scoring-functions.d.ts +12 -3
- package/resources/scoring-functions.d.ts.map +1 -1
- package/resources/scoring-functions.js.map +1 -1
- package/resources/scoring-functions.mjs.map +1 -1
- package/resources/shared.d.ts +19 -28
- package/resources/shared.d.ts.map +1 -1
- package/resources/telemetry.d.ts +98 -1
- package/resources/telemetry.d.ts.map +1 -1
- package/resources/telemetry.js +6 -0
- package/resources/telemetry.js.map +1 -1
- package/resources/telemetry.mjs +6 -0
- package/resources/telemetry.mjs.map +1 -1
- package/resources/vector-stores/files.d.ts +7 -39
- package/resources/vector-stores/files.d.ts.map +1 -1
- package/resources/vector-stores/files.js +7 -2
- package/resources/vector-stores/files.js.map +1 -1
- package/resources/vector-stores/files.mjs +5 -1
- package/resources/vector-stores/files.mjs.map +1 -1
- package/resources/vector-stores/index.d.ts +2 -2
- package/resources/vector-stores/index.d.ts.map +1 -1
- package/resources/vector-stores/index.js +3 -1
- package/resources/vector-stores/index.js.map +1 -1
- package/resources/vector-stores/index.mjs +2 -2
- package/resources/vector-stores/index.mjs.map +1 -1
- package/resources/vector-stores/vector-stores.d.ts +9 -16
- package/resources/vector-stores/vector-stores.d.ts.map +1 -1
- package/resources/vector-stores/vector-stores.js +11 -2
- package/resources/vector-stores/vector-stores.js.map +1 -1
- package/resources/vector-stores/vector-stores.mjs +10 -2
- package/resources/vector-stores/vector-stores.mjs.map +1 -1
- package/src/index.ts +27 -3
- package/src/pagination.ts +70 -0
- package/src/resources/chat/chat.ts +3 -0
- package/src/resources/chat/completions.ts +483 -510
- package/src/resources/chat/index.ts +1 -0
- package/src/resources/files.ts +14 -22
- package/src/resources/index.ts +5 -0
- package/src/resources/inference.ts +2 -44
- package/src/resources/moderations.ts +1 -5
- package/src/resources/responses/index.ts +1 -0
- package/src/resources/responses/input-items.ts +33 -1
- package/src/resources/responses/responses.ts +700 -532
- package/src/resources/scoring-functions.ts +34 -3
- package/src/resources/shared.ts +22 -43
- package/src/resources/telemetry.ts +128 -0
- package/src/resources/vector-stores/files.ts +18 -48
- package/src/resources/vector-stores/index.ts +2 -1
- package/src/resources/vector-stores/vector-stores.ts +16 -19
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/resources/files.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import { isRequestOptions } from '../core';
|
|
5
5
|
import * as Core from '../core';
|
|
6
|
+
import { OpenAICursorPage, type OpenAICursorPageParams } from '../pagination';
|
|
6
7
|
|
|
7
8
|
export class Files extends APIResource {
|
|
8
9
|
/**
|
|
@@ -26,16 +27,16 @@ export class Files extends APIResource {
|
|
|
26
27
|
/**
|
|
27
28
|
* Returns a list of files that belong to the user's organization.
|
|
28
29
|
*/
|
|
29
|
-
list(query?: FileListParams, options?: Core.RequestOptions): Core.
|
|
30
|
-
list(options?: Core.RequestOptions): Core.
|
|
30
|
+
list(query?: FileListParams, options?: Core.RequestOptions): Core.PagePromise<FilesOpenAICursorPage, File>;
|
|
31
|
+
list(options?: Core.RequestOptions): Core.PagePromise<FilesOpenAICursorPage, File>;
|
|
31
32
|
list(
|
|
32
33
|
query: FileListParams | Core.RequestOptions = {},
|
|
33
34
|
options?: Core.RequestOptions,
|
|
34
|
-
): Core.
|
|
35
|
+
): Core.PagePromise<FilesOpenAICursorPage, File> {
|
|
35
36
|
if (isRequestOptions(query)) {
|
|
36
37
|
return this.list({}, query);
|
|
37
38
|
}
|
|
38
|
-
return this._client.
|
|
39
|
+
return this._client.getAPIList('/v1/openai/v1/files', FilesOpenAICursorPage, { query, ...options });
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/**
|
|
@@ -53,6 +54,8 @@ export class Files extends APIResource {
|
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
56
|
|
|
57
|
+
export class FilesOpenAICursorPage extends OpenAICursorPage<File> {}
|
|
58
|
+
|
|
56
59
|
/**
|
|
57
60
|
* Response for deleting a file in OpenAI Files API.
|
|
58
61
|
*/
|
|
@@ -110,7 +113,7 @@ export interface File {
|
|
|
110
113
|
/**
|
|
111
114
|
* The intended purpose of the file
|
|
112
115
|
*/
|
|
113
|
-
purpose: 'assistants';
|
|
116
|
+
purpose: 'assistants' | 'batch';
|
|
114
117
|
}
|
|
115
118
|
|
|
116
119
|
/**
|
|
@@ -151,24 +154,10 @@ export interface FileCreateParams {
|
|
|
151
154
|
/**
|
|
152
155
|
* Valid purpose values for OpenAI Files API.
|
|
153
156
|
*/
|
|
154
|
-
purpose: 'assistants';
|
|
157
|
+
purpose: 'assistants' | 'batch';
|
|
155
158
|
}
|
|
156
159
|
|
|
157
|
-
export interface FileListParams {
|
|
158
|
-
/**
|
|
159
|
-
* A cursor for use in pagination. `after` is an object ID that defines your place
|
|
160
|
-
* in the list. For instance, if you make a list request and receive 100 objects,
|
|
161
|
-
* ending with obj_foo, your subsequent call can include after=obj_foo in order to
|
|
162
|
-
* fetch the next page of the list.
|
|
163
|
-
*/
|
|
164
|
-
after?: string;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* A limit on the number of objects to be returned. Limit can range between 1 and
|
|
168
|
-
* 10,000, and the default is 10,000.
|
|
169
|
-
*/
|
|
170
|
-
limit?: number;
|
|
171
|
-
|
|
160
|
+
export interface FileListParams extends OpenAICursorPageParams {
|
|
172
161
|
/**
|
|
173
162
|
* Sort order by the `created_at` timestamp of the objects. `asc` for ascending
|
|
174
163
|
* order and `desc` for descending order.
|
|
@@ -178,15 +167,18 @@ export interface FileListParams {
|
|
|
178
167
|
/**
|
|
179
168
|
* Only return files with the given purpose.
|
|
180
169
|
*/
|
|
181
|
-
purpose?: 'assistants';
|
|
170
|
+
purpose?: 'assistants' | 'batch';
|
|
182
171
|
}
|
|
183
172
|
|
|
173
|
+
Files.FilesOpenAICursorPage = FilesOpenAICursorPage;
|
|
174
|
+
|
|
184
175
|
export declare namespace Files {
|
|
185
176
|
export {
|
|
186
177
|
type DeleteFileResponse as DeleteFileResponse,
|
|
187
178
|
type File as File,
|
|
188
179
|
type ListFilesResponse as ListFilesResponse,
|
|
189
180
|
type FileContentResponse as FileContentResponse,
|
|
181
|
+
FilesOpenAICursorPage as FilesOpenAICursorPage,
|
|
190
182
|
type FileCreateParams as FileCreateParams,
|
|
191
183
|
type FileListParams as FileListParams,
|
|
192
184
|
};
|
package/src/resources/index.ts
CHANGED
|
@@ -53,6 +53,7 @@ export {
|
|
|
53
53
|
type EvalRunEvalAlphaParams,
|
|
54
54
|
} from './eval/eval';
|
|
55
55
|
export {
|
|
56
|
+
FilesOpenAICursorPage,
|
|
56
57
|
Files,
|
|
57
58
|
type DeleteFileResponse,
|
|
58
59
|
type File,
|
|
@@ -97,6 +98,7 @@ export {
|
|
|
97
98
|
} from './post-training/post-training';
|
|
98
99
|
export { Providers, type ListProvidersResponse, type ProviderListResponse } from './providers';
|
|
99
100
|
export {
|
|
101
|
+
ResponseListResponsesOpenAICursorPage,
|
|
100
102
|
Responses,
|
|
101
103
|
type ResponseObject,
|
|
102
104
|
type ResponseObjectStream,
|
|
@@ -144,10 +146,12 @@ export {
|
|
|
144
146
|
type Trace,
|
|
145
147
|
type TelemetryGetSpanResponse,
|
|
146
148
|
type TelemetryGetSpanTreeResponse,
|
|
149
|
+
type TelemetryQueryMetricsResponse,
|
|
147
150
|
type TelemetryQuerySpansResponse,
|
|
148
151
|
type TelemetryQueryTracesResponse,
|
|
149
152
|
type TelemetryGetSpanTreeParams,
|
|
150
153
|
type TelemetryLogEventParams,
|
|
154
|
+
type TelemetryQueryMetricsParams,
|
|
151
155
|
type TelemetryQuerySpansParams,
|
|
152
156
|
type TelemetryQueryTracesParams,
|
|
153
157
|
type TelemetrySaveSpansToDatasetParams,
|
|
@@ -189,6 +193,7 @@ export {
|
|
|
189
193
|
type VectorIoQueryParams,
|
|
190
194
|
} from './vector-io';
|
|
191
195
|
export {
|
|
196
|
+
VectorStoresOpenAICursorPage,
|
|
192
197
|
VectorStores,
|
|
193
198
|
type ListVectorStoresResponse,
|
|
194
199
|
type VectorStore,
|
|
@@ -109,7 +109,7 @@ export interface ChatCompletionResponseStreamChunk {
|
|
|
109
109
|
/**
|
|
110
110
|
* (Optional) List of metrics associated with the API response
|
|
111
111
|
*/
|
|
112
|
-
metrics?: Array<
|
|
112
|
+
metrics?: Array<Shared.Metric>;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
export namespace ChatCompletionResponseStreamChunk {
|
|
@@ -138,26 +138,6 @@ export namespace ChatCompletionResponseStreamChunk {
|
|
|
138
138
|
*/
|
|
139
139
|
stop_reason?: 'end_of_turn' | 'end_of_message' | 'out_of_tokens';
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* A metric value included in API responses.
|
|
144
|
-
*/
|
|
145
|
-
export interface Metric {
|
|
146
|
-
/**
|
|
147
|
-
* The name of the metric
|
|
148
|
-
*/
|
|
149
|
-
metric: string;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* The numeric value of the metric
|
|
153
|
-
*/
|
|
154
|
-
value: number;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* (Optional) The unit of measurement for the metric value
|
|
158
|
-
*/
|
|
159
|
-
unit?: string;
|
|
160
|
-
}
|
|
161
141
|
}
|
|
162
142
|
|
|
163
143
|
/**
|
|
@@ -182,29 +162,7 @@ export interface CompletionResponse {
|
|
|
182
162
|
/**
|
|
183
163
|
* (Optional) List of metrics associated with the API response
|
|
184
164
|
*/
|
|
185
|
-
metrics?: Array<
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export namespace CompletionResponse {
|
|
189
|
-
/**
|
|
190
|
-
* A metric value included in API responses.
|
|
191
|
-
*/
|
|
192
|
-
export interface Metric {
|
|
193
|
-
/**
|
|
194
|
-
* The name of the metric
|
|
195
|
-
*/
|
|
196
|
-
metric: string;
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* The numeric value of the metric
|
|
200
|
-
*/
|
|
201
|
-
value: number;
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* (Optional) The unit of measurement for the metric value
|
|
205
|
-
*/
|
|
206
|
-
unit?: string;
|
|
207
|
-
}
|
|
165
|
+
metrics?: Array<Shared.Metric>;
|
|
208
166
|
}
|
|
209
167
|
|
|
210
168
|
/**
|
|
@@ -55,11 +55,7 @@ export namespace CreateResponse {
|
|
|
55
55
|
category_applied_input_types?: { [key: string]: Array<string> };
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* A list of the categories along with their scores as predicted by model.
|
|
59
|
-
* set of categories that need to be in response - violence - violence/graphic -
|
|
60
|
-
* harassment - harassment/threatening - hate - hate/threatening - illicit -
|
|
61
|
-
* illicit/violent - sexual - sexual/minors - self-harm - self-harm/intent -
|
|
62
|
-
* self-harm/instructions
|
|
58
|
+
* A list of the categories along with their scores as predicted by model.
|
|
63
59
|
*/
|
|
64
60
|
category_scores?: { [key: string]: number };
|
|
65
61
|
|
|
@@ -95,7 +95,39 @@ export namespace InputItemListResponse {
|
|
|
95
95
|
/**
|
|
96
96
|
* (Optional) Search results returned by the file search operation
|
|
97
97
|
*/
|
|
98
|
-
results?: Array<
|
|
98
|
+
results?: Array<OpenAIResponseOutputMessageFileSearchToolCall.Result>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export namespace OpenAIResponseOutputMessageFileSearchToolCall {
|
|
102
|
+
/**
|
|
103
|
+
* Search results returned by the file search operation.
|
|
104
|
+
*/
|
|
105
|
+
export interface Result {
|
|
106
|
+
/**
|
|
107
|
+
* (Optional) Key-value attributes associated with the file
|
|
108
|
+
*/
|
|
109
|
+
attributes: { [key: string]: boolean | number | string | Array<unknown> | unknown | null };
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Unique identifier of the file containing the result
|
|
113
|
+
*/
|
|
114
|
+
file_id: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Name of the file containing the result
|
|
118
|
+
*/
|
|
119
|
+
filename: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Relevance score for this search result (between 0 and 1)
|
|
123
|
+
*/
|
|
124
|
+
score: number;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Text content of the search result
|
|
128
|
+
*/
|
|
129
|
+
text: string;
|
|
130
|
+
}
|
|
99
131
|
}
|
|
100
132
|
|
|
101
133
|
/**
|