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
|
@@ -6,6 +6,7 @@ import { APIPromise } from '../../core';
|
|
|
6
6
|
import * as Core from '../../core';
|
|
7
7
|
import * as CompletionsAPI from './completions';
|
|
8
8
|
import * as ChatAPI from './chat';
|
|
9
|
+
import { OpenAICursorPage, type OpenAICursorPageParams } from '../../pagination';
|
|
9
10
|
import { Stream } from '../../streaming';
|
|
10
11
|
|
|
11
12
|
export class Completions extends APIResource {
|
|
@@ -46,19 +47,30 @@ export class Completions extends APIResource {
|
|
|
46
47
|
/**
|
|
47
48
|
* List all chat completions.
|
|
48
49
|
*/
|
|
49
|
-
list(
|
|
50
|
-
|
|
50
|
+
list(
|
|
51
|
+
query?: CompletionListParams,
|
|
52
|
+
options?: Core.RequestOptions,
|
|
53
|
+
): Core.PagePromise<CompletionListResponsesOpenAICursorPage, CompletionListResponse>;
|
|
54
|
+
list(
|
|
55
|
+
options?: Core.RequestOptions,
|
|
56
|
+
): Core.PagePromise<CompletionListResponsesOpenAICursorPage, CompletionListResponse>;
|
|
51
57
|
list(
|
|
52
58
|
query: CompletionListParams | Core.RequestOptions = {},
|
|
53
59
|
options?: Core.RequestOptions,
|
|
54
|
-
): Core.
|
|
60
|
+
): Core.PagePromise<CompletionListResponsesOpenAICursorPage, CompletionListResponse> {
|
|
55
61
|
if (isRequestOptions(query)) {
|
|
56
62
|
return this.list({}, query);
|
|
57
63
|
}
|
|
58
|
-
return this._client.
|
|
64
|
+
return this._client.getAPIList(
|
|
65
|
+
'/v1/openai/v1/chat/completions',
|
|
66
|
+
CompletionListResponsesOpenAICursorPage,
|
|
67
|
+
{ query, ...options },
|
|
68
|
+
);
|
|
59
69
|
}
|
|
60
70
|
}
|
|
61
71
|
|
|
72
|
+
export class CompletionListResponsesOpenAICursorPage extends OpenAICursorPage<CompletionListResponse> {}
|
|
73
|
+
|
|
62
74
|
/**
|
|
63
75
|
* Response from an OpenAI-compatible chat completion request.
|
|
64
76
|
*/
|
|
@@ -1217,756 +1229,724 @@ export namespace CompletionRetrieveResponse {
|
|
|
1217
1229
|
}
|
|
1218
1230
|
}
|
|
1219
1231
|
|
|
1220
|
-
/**
|
|
1221
|
-
* Response from listing OpenAI-compatible chat completions.
|
|
1222
|
-
*/
|
|
1223
1232
|
export interface CompletionListResponse {
|
|
1224
1233
|
/**
|
|
1225
|
-
*
|
|
1234
|
+
* The ID of the chat completion
|
|
1226
1235
|
*/
|
|
1227
|
-
|
|
1236
|
+
id: string;
|
|
1228
1237
|
|
|
1229
1238
|
/**
|
|
1230
|
-
*
|
|
1239
|
+
* List of choices
|
|
1231
1240
|
*/
|
|
1232
|
-
|
|
1241
|
+
choices: Array<CompletionListResponse.Choice>;
|
|
1233
1242
|
|
|
1234
1243
|
/**
|
|
1235
|
-
*
|
|
1244
|
+
* The Unix timestamp in seconds when the chat completion was created
|
|
1236
1245
|
*/
|
|
1237
|
-
|
|
1246
|
+
created: number;
|
|
1247
|
+
|
|
1248
|
+
input_messages: Array<
|
|
1249
|
+
| CompletionListResponse.OpenAIUserMessageParam
|
|
1250
|
+
| CompletionListResponse.OpenAISystemMessageParam
|
|
1251
|
+
| CompletionListResponse.OpenAIAssistantMessageParam
|
|
1252
|
+
| CompletionListResponse.OpenAIToolMessageParam
|
|
1253
|
+
| CompletionListResponse.OpenAIDeveloperMessageParam
|
|
1254
|
+
>;
|
|
1238
1255
|
|
|
1239
1256
|
/**
|
|
1240
|
-
*
|
|
1257
|
+
* The model that was used to generate the chat completion
|
|
1241
1258
|
*/
|
|
1242
|
-
|
|
1259
|
+
model: string;
|
|
1243
1260
|
|
|
1244
1261
|
/**
|
|
1245
|
-
*
|
|
1262
|
+
* The object type, which will be "chat.completion"
|
|
1246
1263
|
*/
|
|
1247
|
-
object: '
|
|
1264
|
+
object: 'chat.completion';
|
|
1248
1265
|
}
|
|
1249
1266
|
|
|
1250
1267
|
export namespace CompletionListResponse {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
id: string;
|
|
1256
|
-
|
|
1268
|
+
/**
|
|
1269
|
+
* A choice from an OpenAI-compatible chat completion response.
|
|
1270
|
+
*/
|
|
1271
|
+
export interface Choice {
|
|
1257
1272
|
/**
|
|
1258
|
-
*
|
|
1273
|
+
* The reason the model stopped generating
|
|
1259
1274
|
*/
|
|
1260
|
-
|
|
1275
|
+
finish_reason: string;
|
|
1261
1276
|
|
|
1262
1277
|
/**
|
|
1263
|
-
* The
|
|
1278
|
+
* The index of the choice
|
|
1264
1279
|
*/
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
input_messages: Array<
|
|
1268
|
-
| Data.OpenAIUserMessageParam
|
|
1269
|
-
| Data.OpenAISystemMessageParam
|
|
1270
|
-
| Data.OpenAIAssistantMessageParam
|
|
1271
|
-
| Data.OpenAIToolMessageParam
|
|
1272
|
-
| Data.OpenAIDeveloperMessageParam
|
|
1273
|
-
>;
|
|
1280
|
+
index: number;
|
|
1274
1281
|
|
|
1275
1282
|
/**
|
|
1276
|
-
* The
|
|
1283
|
+
* The message from the model
|
|
1277
1284
|
*/
|
|
1278
|
-
|
|
1285
|
+
message:
|
|
1286
|
+
| Choice.OpenAIUserMessageParam
|
|
1287
|
+
| Choice.OpenAISystemMessageParam
|
|
1288
|
+
| Choice.OpenAIAssistantMessageParam
|
|
1289
|
+
| Choice.OpenAIToolMessageParam
|
|
1290
|
+
| Choice.OpenAIDeveloperMessageParam;
|
|
1279
1291
|
|
|
1280
1292
|
/**
|
|
1281
|
-
* The
|
|
1293
|
+
* (Optional) The log probabilities for the tokens in the message
|
|
1282
1294
|
*/
|
|
1283
|
-
|
|
1295
|
+
logprobs?: Choice.Logprobs;
|
|
1284
1296
|
}
|
|
1285
1297
|
|
|
1286
|
-
export namespace
|
|
1298
|
+
export namespace Choice {
|
|
1287
1299
|
/**
|
|
1288
|
-
* A
|
|
1300
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
1289
1301
|
*/
|
|
1290
|
-
export interface
|
|
1291
|
-
/**
|
|
1292
|
-
* The reason the model stopped generating
|
|
1293
|
-
*/
|
|
1294
|
-
finish_reason: string;
|
|
1295
|
-
|
|
1302
|
+
export interface OpenAIUserMessageParam {
|
|
1296
1303
|
/**
|
|
1297
|
-
* The
|
|
1304
|
+
* The content of the message, which can include text and other media
|
|
1298
1305
|
*/
|
|
1299
|
-
|
|
1306
|
+
content:
|
|
1307
|
+
| string
|
|
1308
|
+
| Array<
|
|
1309
|
+
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam
|
|
1310
|
+
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam
|
|
1311
|
+
| OpenAIUserMessageParam.OpenAIFile
|
|
1312
|
+
>;
|
|
1300
1313
|
|
|
1301
1314
|
/**
|
|
1302
|
-
*
|
|
1315
|
+
* Must be "user" to identify this as a user message
|
|
1303
1316
|
*/
|
|
1304
|
-
|
|
1305
|
-
| Choice.OpenAIUserMessageParam
|
|
1306
|
-
| Choice.OpenAISystemMessageParam
|
|
1307
|
-
| Choice.OpenAIAssistantMessageParam
|
|
1308
|
-
| Choice.OpenAIToolMessageParam
|
|
1309
|
-
| Choice.OpenAIDeveloperMessageParam;
|
|
1317
|
+
role: 'user';
|
|
1310
1318
|
|
|
1311
1319
|
/**
|
|
1312
|
-
* (Optional) The
|
|
1320
|
+
* (Optional) The name of the user message participant.
|
|
1313
1321
|
*/
|
|
1314
|
-
|
|
1322
|
+
name?: string;
|
|
1315
1323
|
}
|
|
1316
1324
|
|
|
1317
|
-
export namespace
|
|
1325
|
+
export namespace OpenAIUserMessageParam {
|
|
1318
1326
|
/**
|
|
1319
|
-
*
|
|
1327
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1320
1328
|
*/
|
|
1321
|
-
export interface
|
|
1329
|
+
export interface OpenAIChatCompletionContentPartTextParam {
|
|
1322
1330
|
/**
|
|
1323
|
-
* The content of the message
|
|
1331
|
+
* The text content of the message
|
|
1324
1332
|
*/
|
|
1325
|
-
|
|
1326
|
-
| string
|
|
1327
|
-
| Array<
|
|
1328
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam
|
|
1329
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam
|
|
1330
|
-
| OpenAIUserMessageParam.OpenAIFile
|
|
1331
|
-
>;
|
|
1333
|
+
text: string;
|
|
1332
1334
|
|
|
1333
1335
|
/**
|
|
1334
|
-
* Must be "
|
|
1336
|
+
* Must be "text" to identify this as text content
|
|
1335
1337
|
*/
|
|
1336
|
-
|
|
1338
|
+
type: 'text';
|
|
1339
|
+
}
|
|
1337
1340
|
|
|
1341
|
+
/**
|
|
1342
|
+
* Image content part for OpenAI-compatible chat completion messages.
|
|
1343
|
+
*/
|
|
1344
|
+
export interface OpenAIChatCompletionContentPartImageParam {
|
|
1338
1345
|
/**
|
|
1339
|
-
*
|
|
1346
|
+
* Image URL specification and processing details
|
|
1340
1347
|
*/
|
|
1341
|
-
|
|
1342
|
-
}
|
|
1348
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
1343
1349
|
|
|
1344
|
-
export namespace OpenAIUserMessageParam {
|
|
1345
1350
|
/**
|
|
1346
|
-
*
|
|
1351
|
+
* Must be "image_url" to identify this as image content
|
|
1347
1352
|
*/
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
* The text content of the message
|
|
1351
|
-
*/
|
|
1352
|
-
text: string;
|
|
1353
|
-
|
|
1354
|
-
/**
|
|
1355
|
-
* Must be "text" to identify this as text content
|
|
1356
|
-
*/
|
|
1357
|
-
type: 'text';
|
|
1358
|
-
}
|
|
1353
|
+
type: 'image_url';
|
|
1354
|
+
}
|
|
1359
1355
|
|
|
1356
|
+
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1360
1357
|
/**
|
|
1361
|
-
* Image
|
|
1358
|
+
* Image URL specification and processing details
|
|
1362
1359
|
*/
|
|
1363
|
-
export interface
|
|
1364
|
-
/**
|
|
1365
|
-
* Image URL specification and processing details
|
|
1366
|
-
*/
|
|
1367
|
-
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
1368
|
-
|
|
1360
|
+
export interface ImageURL {
|
|
1369
1361
|
/**
|
|
1370
|
-
*
|
|
1362
|
+
* URL of the image to include in the message
|
|
1371
1363
|
*/
|
|
1372
|
-
|
|
1373
|
-
}
|
|
1364
|
+
url: string;
|
|
1374
1365
|
|
|
1375
|
-
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1376
1366
|
/**
|
|
1377
|
-
*
|
|
1367
|
+
* (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
|
|
1378
1368
|
*/
|
|
1379
|
-
|
|
1380
|
-
/**
|
|
1381
|
-
* URL of the image to include in the message
|
|
1382
|
-
*/
|
|
1383
|
-
url: string;
|
|
1384
|
-
|
|
1385
|
-
/**
|
|
1386
|
-
* (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
|
|
1387
|
-
*/
|
|
1388
|
-
detail?: string;
|
|
1389
|
-
}
|
|
1369
|
+
detail?: string;
|
|
1390
1370
|
}
|
|
1371
|
+
}
|
|
1391
1372
|
|
|
1392
|
-
|
|
1393
|
-
|
|
1373
|
+
export interface OpenAIFile {
|
|
1374
|
+
file: OpenAIFile.File;
|
|
1394
1375
|
|
|
1395
|
-
|
|
1396
|
-
|
|
1376
|
+
type: 'file';
|
|
1377
|
+
}
|
|
1397
1378
|
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1379
|
+
export namespace OpenAIFile {
|
|
1380
|
+
export interface File {
|
|
1381
|
+
file_data?: string;
|
|
1401
1382
|
|
|
1402
|
-
|
|
1383
|
+
file_id?: string;
|
|
1403
1384
|
|
|
1404
|
-
|
|
1405
|
-
}
|
|
1385
|
+
filename?: string;
|
|
1406
1386
|
}
|
|
1407
1387
|
}
|
|
1388
|
+
}
|
|
1408
1389
|
|
|
1390
|
+
/**
|
|
1391
|
+
* A system message providing instructions or context to the model.
|
|
1392
|
+
*/
|
|
1393
|
+
export interface OpenAISystemMessageParam {
|
|
1409
1394
|
/**
|
|
1410
|
-
*
|
|
1395
|
+
* The content of the "system prompt". If multiple system messages are provided,
|
|
1396
|
+
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
1397
|
+
* messages (for example, for formatting tool definitions).
|
|
1411
1398
|
*/
|
|
1412
|
-
|
|
1413
|
-
/**
|
|
1414
|
-
* The content of the "system prompt". If multiple system messages are provided,
|
|
1415
|
-
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
1416
|
-
* messages (for example, for formatting tool definitions).
|
|
1417
|
-
*/
|
|
1418
|
-
content: string | Array<OpenAISystemMessageParam.UnionMember1>;
|
|
1419
|
-
|
|
1420
|
-
/**
|
|
1421
|
-
* Must be "system" to identify this as a system message
|
|
1422
|
-
*/
|
|
1423
|
-
role: 'system';
|
|
1424
|
-
|
|
1425
|
-
/**
|
|
1426
|
-
* (Optional) The name of the system message participant.
|
|
1427
|
-
*/
|
|
1428
|
-
name?: string;
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
export namespace OpenAISystemMessageParam {
|
|
1432
|
-
/**
|
|
1433
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1434
|
-
*/
|
|
1435
|
-
export interface UnionMember1 {
|
|
1436
|
-
/**
|
|
1437
|
-
* The text content of the message
|
|
1438
|
-
*/
|
|
1439
|
-
text: string;
|
|
1440
|
-
|
|
1441
|
-
/**
|
|
1442
|
-
* Must be "text" to identify this as text content
|
|
1443
|
-
*/
|
|
1444
|
-
type: 'text';
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1399
|
+
content: string | Array<OpenAISystemMessageParam.UnionMember1>;
|
|
1447
1400
|
|
|
1448
1401
|
/**
|
|
1449
|
-
*
|
|
1450
|
-
* chat completion request.
|
|
1402
|
+
* Must be "system" to identify this as a system message
|
|
1451
1403
|
*/
|
|
1452
|
-
|
|
1453
|
-
/**
|
|
1454
|
-
* Must be "assistant" to identify this as the model's response
|
|
1455
|
-
*/
|
|
1456
|
-
role: 'assistant';
|
|
1404
|
+
role: 'system';
|
|
1457
1405
|
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1406
|
+
/**
|
|
1407
|
+
* (Optional) The name of the system message participant.
|
|
1408
|
+
*/
|
|
1409
|
+
name?: string;
|
|
1410
|
+
}
|
|
1462
1411
|
|
|
1412
|
+
export namespace OpenAISystemMessageParam {
|
|
1413
|
+
/**
|
|
1414
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1415
|
+
*/
|
|
1416
|
+
export interface UnionMember1 {
|
|
1463
1417
|
/**
|
|
1464
|
-
*
|
|
1418
|
+
* The text content of the message
|
|
1465
1419
|
*/
|
|
1466
|
-
|
|
1420
|
+
text: string;
|
|
1467
1421
|
|
|
1468
1422
|
/**
|
|
1469
|
-
*
|
|
1423
|
+
* Must be "text" to identify this as text content
|
|
1470
1424
|
*/
|
|
1471
|
-
|
|
1425
|
+
type: 'text';
|
|
1472
1426
|
}
|
|
1427
|
+
}
|
|
1473
1428
|
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
/**
|
|
1485
|
-
* Must be "text" to identify this as text content
|
|
1486
|
-
*/
|
|
1487
|
-
type: 'text';
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1490
|
-
/**
|
|
1491
|
-
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1492
|
-
*/
|
|
1493
|
-
export interface ToolCall {
|
|
1494
|
-
/**
|
|
1495
|
-
* Must be "function" to identify this as a function call
|
|
1496
|
-
*/
|
|
1497
|
-
type: 'function';
|
|
1429
|
+
/**
|
|
1430
|
+
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
1431
|
+
* chat completion request.
|
|
1432
|
+
*/
|
|
1433
|
+
export interface OpenAIAssistantMessageParam {
|
|
1434
|
+
/**
|
|
1435
|
+
* Must be "assistant" to identify this as the model's response
|
|
1436
|
+
*/
|
|
1437
|
+
role: 'assistant';
|
|
1498
1438
|
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1439
|
+
/**
|
|
1440
|
+
* The content of the model's response
|
|
1441
|
+
*/
|
|
1442
|
+
content?: string | Array<OpenAIAssistantMessageParam.UnionMember1>;
|
|
1503
1443
|
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1444
|
+
/**
|
|
1445
|
+
* (Optional) The name of the assistant message participant.
|
|
1446
|
+
*/
|
|
1447
|
+
name?: string;
|
|
1508
1448
|
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1449
|
+
/**
|
|
1450
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
1451
|
+
*/
|
|
1452
|
+
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
1453
|
+
}
|
|
1514
1454
|
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1455
|
+
export namespace OpenAIAssistantMessageParam {
|
|
1456
|
+
/**
|
|
1457
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1458
|
+
*/
|
|
1459
|
+
export interface UnionMember1 {
|
|
1460
|
+
/**
|
|
1461
|
+
* The text content of the message
|
|
1462
|
+
*/
|
|
1463
|
+
text: string;
|
|
1524
1464
|
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1465
|
+
/**
|
|
1466
|
+
* Must be "text" to identify this as text content
|
|
1467
|
+
*/
|
|
1468
|
+
type: 'text';
|
|
1531
1469
|
}
|
|
1532
1470
|
|
|
1533
1471
|
/**
|
|
1534
|
-
*
|
|
1535
|
-
* chat completion request.
|
|
1472
|
+
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1536
1473
|
*/
|
|
1537
|
-
export interface
|
|
1474
|
+
export interface ToolCall {
|
|
1538
1475
|
/**
|
|
1539
|
-
*
|
|
1476
|
+
* Must be "function" to identify this as a function call
|
|
1540
1477
|
*/
|
|
1541
|
-
|
|
1478
|
+
type: 'function';
|
|
1542
1479
|
|
|
1543
1480
|
/**
|
|
1544
|
-
*
|
|
1481
|
+
* (Optional) Unique identifier for the tool call
|
|
1545
1482
|
*/
|
|
1546
|
-
|
|
1483
|
+
id?: string;
|
|
1547
1484
|
|
|
1548
1485
|
/**
|
|
1549
|
-
*
|
|
1486
|
+
* (Optional) Function call details
|
|
1550
1487
|
*/
|
|
1551
|
-
|
|
1488
|
+
function?: ToolCall.Function;
|
|
1489
|
+
|
|
1490
|
+
/**
|
|
1491
|
+
* (Optional) Index of the tool call in the list
|
|
1492
|
+
*/
|
|
1493
|
+
index?: number;
|
|
1552
1494
|
}
|
|
1553
1495
|
|
|
1554
|
-
export namespace
|
|
1496
|
+
export namespace ToolCall {
|
|
1555
1497
|
/**
|
|
1556
|
-
*
|
|
1498
|
+
* (Optional) Function call details
|
|
1557
1499
|
*/
|
|
1558
|
-
export interface
|
|
1500
|
+
export interface Function {
|
|
1559
1501
|
/**
|
|
1560
|
-
*
|
|
1502
|
+
* (Optional) Arguments to pass to the function as a JSON string
|
|
1561
1503
|
*/
|
|
1562
|
-
|
|
1504
|
+
arguments?: string;
|
|
1563
1505
|
|
|
1564
1506
|
/**
|
|
1565
|
-
*
|
|
1507
|
+
* (Optional) Name of the function to call
|
|
1566
1508
|
*/
|
|
1567
|
-
|
|
1509
|
+
name?: string;
|
|
1568
1510
|
}
|
|
1569
1511
|
}
|
|
1512
|
+
}
|
|
1570
1513
|
|
|
1514
|
+
/**
|
|
1515
|
+
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
1516
|
+
* chat completion request.
|
|
1517
|
+
*/
|
|
1518
|
+
export interface OpenAIToolMessageParam {
|
|
1571
1519
|
/**
|
|
1572
|
-
*
|
|
1520
|
+
* The response content from the tool
|
|
1573
1521
|
*/
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1522
|
+
content: string | Array<OpenAIToolMessageParam.UnionMember1>;
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* Must be "tool" to identify this as a tool response
|
|
1526
|
+
*/
|
|
1527
|
+
role: 'tool';
|
|
1528
|
+
|
|
1529
|
+
/**
|
|
1530
|
+
* Unique identifier for the tool call this response is for
|
|
1531
|
+
*/
|
|
1532
|
+
tool_call_id: string;
|
|
1533
|
+
}
|
|
1579
1534
|
|
|
1535
|
+
export namespace OpenAIToolMessageParam {
|
|
1536
|
+
/**
|
|
1537
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1538
|
+
*/
|
|
1539
|
+
export interface UnionMember1 {
|
|
1580
1540
|
/**
|
|
1581
|
-
*
|
|
1541
|
+
* The text content of the message
|
|
1582
1542
|
*/
|
|
1583
|
-
|
|
1543
|
+
text: string;
|
|
1584
1544
|
|
|
1585
1545
|
/**
|
|
1586
|
-
*
|
|
1546
|
+
* Must be "text" to identify this as text content
|
|
1587
1547
|
*/
|
|
1588
|
-
|
|
1548
|
+
type: 'text';
|
|
1589
1549
|
}
|
|
1550
|
+
}
|
|
1590
1551
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
text: string;
|
|
1552
|
+
/**
|
|
1553
|
+
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1554
|
+
*/
|
|
1555
|
+
export interface OpenAIDeveloperMessageParam {
|
|
1556
|
+
/**
|
|
1557
|
+
* The content of the developer message
|
|
1558
|
+
*/
|
|
1559
|
+
content: string | Array<OpenAIDeveloperMessageParam.UnionMember1>;
|
|
1600
1560
|
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Must be "developer" to identify this as a developer message
|
|
1563
|
+
*/
|
|
1564
|
+
role: 'developer';
|
|
1607
1565
|
|
|
1608
1566
|
/**
|
|
1609
|
-
* (Optional) The
|
|
1567
|
+
* (Optional) The name of the developer message participant.
|
|
1610
1568
|
*/
|
|
1611
|
-
|
|
1569
|
+
name?: string;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
export namespace OpenAIDeveloperMessageParam {
|
|
1573
|
+
/**
|
|
1574
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1575
|
+
*/
|
|
1576
|
+
export interface UnionMember1 {
|
|
1612
1577
|
/**
|
|
1613
|
-
*
|
|
1578
|
+
* The text content of the message
|
|
1614
1579
|
*/
|
|
1615
|
-
|
|
1580
|
+
text: string;
|
|
1616
1581
|
|
|
1617
1582
|
/**
|
|
1618
|
-
*
|
|
1583
|
+
* Must be "text" to identify this as text content
|
|
1619
1584
|
*/
|
|
1620
|
-
|
|
1585
|
+
type: 'text';
|
|
1621
1586
|
}
|
|
1587
|
+
}
|
|
1622
1588
|
|
|
1623
|
-
|
|
1589
|
+
/**
|
|
1590
|
+
* (Optional) The log probabilities for the tokens in the message
|
|
1591
|
+
*/
|
|
1592
|
+
export interface Logprobs {
|
|
1593
|
+
/**
|
|
1594
|
+
* (Optional) The log probabilities for the tokens in the message
|
|
1595
|
+
*/
|
|
1596
|
+
content?: Array<Logprobs.Content>;
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* (Optional) The log probabilities for the tokens in the message
|
|
1600
|
+
*/
|
|
1601
|
+
refusal?: Array<Logprobs.Refusal>;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
export namespace Logprobs {
|
|
1605
|
+
/**
|
|
1606
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1607
|
+
* response.
|
|
1608
|
+
*/
|
|
1609
|
+
export interface Content {
|
|
1610
|
+
token: string;
|
|
1611
|
+
|
|
1612
|
+
logprob: number;
|
|
1613
|
+
|
|
1614
|
+
top_logprobs: Array<Content.TopLogprob>;
|
|
1615
|
+
|
|
1616
|
+
bytes?: Array<number>;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
export namespace Content {
|
|
1624
1620
|
/**
|
|
1625
|
-
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1621
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1626
1622
|
* response.
|
|
1627
1623
|
*/
|
|
1628
|
-
export interface
|
|
1624
|
+
export interface TopLogprob {
|
|
1629
1625
|
token: string;
|
|
1630
1626
|
|
|
1631
1627
|
logprob: number;
|
|
1632
1628
|
|
|
1633
|
-
top_logprobs: Array<Content.TopLogprob>;
|
|
1634
|
-
|
|
1635
1629
|
bytes?: Array<number>;
|
|
1636
1630
|
}
|
|
1631
|
+
}
|
|
1637
1632
|
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
token: string;
|
|
1633
|
+
/**
|
|
1634
|
+
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1635
|
+
* response.
|
|
1636
|
+
*/
|
|
1637
|
+
export interface Refusal {
|
|
1638
|
+
token: string;
|
|
1645
1639
|
|
|
1646
|
-
|
|
1640
|
+
logprob: number;
|
|
1647
1641
|
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1642
|
+
top_logprobs: Array<Refusal.TopLogprob>;
|
|
1643
|
+
|
|
1644
|
+
bytes?: Array<number>;
|
|
1645
|
+
}
|
|
1651
1646
|
|
|
1647
|
+
export namespace Refusal {
|
|
1652
1648
|
/**
|
|
1653
|
-
* The log probability for a token from an OpenAI-compatible chat completion
|
|
1649
|
+
* The top log probability for a token from an OpenAI-compatible chat completion
|
|
1654
1650
|
* response.
|
|
1655
1651
|
*/
|
|
1656
|
-
export interface
|
|
1652
|
+
export interface TopLogprob {
|
|
1657
1653
|
token: string;
|
|
1658
1654
|
|
|
1659
1655
|
logprob: number;
|
|
1660
1656
|
|
|
1661
|
-
top_logprobs: Array<Refusal.TopLogprob>;
|
|
1662
|
-
|
|
1663
1657
|
bytes?: Array<number>;
|
|
1664
1658
|
}
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1665
1662
|
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1663
|
+
/**
|
|
1664
|
+
* A message from the user in an OpenAI-compatible chat completion request.
|
|
1665
|
+
*/
|
|
1666
|
+
export interface OpenAIUserMessageParam {
|
|
1667
|
+
/**
|
|
1668
|
+
* The content of the message, which can include text and other media
|
|
1669
|
+
*/
|
|
1670
|
+
content:
|
|
1671
|
+
| string
|
|
1672
|
+
| Array<
|
|
1673
|
+
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam
|
|
1674
|
+
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam
|
|
1675
|
+
| OpenAIUserMessageParam.OpenAIFile
|
|
1676
|
+
>;
|
|
1673
1677
|
|
|
1674
|
-
|
|
1678
|
+
/**
|
|
1679
|
+
* Must be "user" to identify this as a user message
|
|
1680
|
+
*/
|
|
1681
|
+
role: 'user';
|
|
1675
1682
|
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1683
|
+
/**
|
|
1684
|
+
* (Optional) The name of the user message participant.
|
|
1685
|
+
*/
|
|
1686
|
+
name?: string;
|
|
1687
|
+
}
|
|
1681
1688
|
|
|
1689
|
+
export namespace OpenAIUserMessageParam {
|
|
1682
1690
|
/**
|
|
1683
|
-
*
|
|
1691
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1684
1692
|
*/
|
|
1685
|
-
export interface
|
|
1693
|
+
export interface OpenAIChatCompletionContentPartTextParam {
|
|
1686
1694
|
/**
|
|
1687
|
-
* The content of the message
|
|
1695
|
+
* The text content of the message
|
|
1688
1696
|
*/
|
|
1689
|
-
|
|
1690
|
-
| string
|
|
1691
|
-
| Array<
|
|
1692
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartTextParam
|
|
1693
|
-
| OpenAIUserMessageParam.OpenAIChatCompletionContentPartImageParam
|
|
1694
|
-
| OpenAIUserMessageParam.OpenAIFile
|
|
1695
|
-
>;
|
|
1697
|
+
text: string;
|
|
1696
1698
|
|
|
1697
1699
|
/**
|
|
1698
|
-
* Must be "
|
|
1700
|
+
* Must be "text" to identify this as text content
|
|
1699
1701
|
*/
|
|
1700
|
-
|
|
1702
|
+
type: 'text';
|
|
1703
|
+
}
|
|
1701
1704
|
|
|
1705
|
+
/**
|
|
1706
|
+
* Image content part for OpenAI-compatible chat completion messages.
|
|
1707
|
+
*/
|
|
1708
|
+
export interface OpenAIChatCompletionContentPartImageParam {
|
|
1702
1709
|
/**
|
|
1703
|
-
*
|
|
1710
|
+
* Image URL specification and processing details
|
|
1704
1711
|
*/
|
|
1705
|
-
|
|
1706
|
-
}
|
|
1712
|
+
image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
|
|
1707
1713
|
|
|
1708
|
-
export namespace OpenAIUserMessageParam {
|
|
1709
1714
|
/**
|
|
1710
|
-
*
|
|
1715
|
+
* Must be "image_url" to identify this as image content
|
|
1711
1716
|
*/
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
* The text content of the message
|
|
1715
|
-
*/
|
|
1716
|
-
text: string;
|
|
1717
|
-
|
|
1718
|
-
/**
|
|
1719
|
-
* Must be "text" to identify this as text content
|
|
1720
|
-
*/
|
|
1721
|
-
type: 'text';
|
|
1722
|
-
}
|
|
1717
|
+
type: 'image_url';
|
|
1718
|
+
}
|
|
1723
1719
|
|
|
1720
|
+
export namespace OpenAIChatCompletionContentPartImageParam {
|
|
1724
1721
|
/**
|
|
1725
|
-
* Image
|
|
1722
|
+
* Image URL specification and processing details
|
|
1726
1723
|
*/
|
|
1727
|
-
export interface
|
|
1724
|
+
export interface ImageURL {
|
|
1728
1725
|
/**
|
|
1729
|
-
*
|
|
1726
|
+
* URL of the image to include in the message
|
|
1730
1727
|
*/
|
|
1731
|
-
|
|
1728
|
+
url: string;
|
|
1732
1729
|
|
|
1733
1730
|
/**
|
|
1734
|
-
*
|
|
1731
|
+
* (Optional) Level of detail for image processing. Can be "low", "high", or "auto"
|
|
1735
1732
|
*/
|
|
1736
|
-
|
|
1733
|
+
detail?: string;
|
|
1737
1734
|
}
|
|
1735
|
+
}
|
|
1738
1736
|
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
* Image URL specification and processing details
|
|
1742
|
-
*/
|
|
1743
|
-
export interface ImageURL {
|
|
1744
|
-
/**
|
|
1745
|
-
* URL of the image to include in the message
|
|
1746
|
-
*/
|
|
1747
|
-
url: string;
|
|
1737
|
+
export interface OpenAIFile {
|
|
1738
|
+
file: OpenAIFile.File;
|
|
1748
1739
|
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
*/
|
|
1752
|
-
detail?: string;
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1740
|
+
type: 'file';
|
|
1741
|
+
}
|
|
1755
1742
|
|
|
1756
|
-
|
|
1757
|
-
|
|
1743
|
+
export namespace OpenAIFile {
|
|
1744
|
+
export interface File {
|
|
1745
|
+
file_data?: string;
|
|
1758
1746
|
|
|
1759
|
-
|
|
1747
|
+
file_id?: string;
|
|
1748
|
+
|
|
1749
|
+
filename?: string;
|
|
1760
1750
|
}
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1761
1753
|
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1754
|
+
/**
|
|
1755
|
+
* A system message providing instructions or context to the model.
|
|
1756
|
+
*/
|
|
1757
|
+
export interface OpenAISystemMessageParam {
|
|
1758
|
+
/**
|
|
1759
|
+
* The content of the "system prompt". If multiple system messages are provided,
|
|
1760
|
+
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
1761
|
+
* messages (for example, for formatting tool definitions).
|
|
1762
|
+
*/
|
|
1763
|
+
content: string | Array<OpenAISystemMessageParam.UnionMember1>;
|
|
1765
1764
|
|
|
1766
|
-
|
|
1765
|
+
/**
|
|
1766
|
+
* Must be "system" to identify this as a system message
|
|
1767
|
+
*/
|
|
1768
|
+
role: 'system';
|
|
1767
1769
|
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1770
|
+
/**
|
|
1771
|
+
* (Optional) The name of the system message participant.
|
|
1772
|
+
*/
|
|
1773
|
+
name?: string;
|
|
1774
|
+
}
|
|
1772
1775
|
|
|
1776
|
+
export namespace OpenAISystemMessageParam {
|
|
1773
1777
|
/**
|
|
1774
|
-
*
|
|
1778
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1775
1779
|
*/
|
|
1776
|
-
export interface
|
|
1780
|
+
export interface UnionMember1 {
|
|
1777
1781
|
/**
|
|
1778
|
-
* The content of the
|
|
1779
|
-
* they are concatenated. The underlying Llama Stack code may also add other system
|
|
1780
|
-
* messages (for example, for formatting tool definitions).
|
|
1782
|
+
* The text content of the message
|
|
1781
1783
|
*/
|
|
1782
|
-
|
|
1784
|
+
text: string;
|
|
1783
1785
|
|
|
1784
1786
|
/**
|
|
1785
|
-
* Must be "
|
|
1787
|
+
* Must be "text" to identify this as text content
|
|
1786
1788
|
*/
|
|
1787
|
-
|
|
1789
|
+
type: 'text';
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* A message containing the model's (assistant) response in an OpenAI-compatible
|
|
1795
|
+
* chat completion request.
|
|
1796
|
+
*/
|
|
1797
|
+
export interface OpenAIAssistantMessageParam {
|
|
1798
|
+
/**
|
|
1799
|
+
* Must be "assistant" to identify this as the model's response
|
|
1800
|
+
*/
|
|
1801
|
+
role: 'assistant';
|
|
1802
|
+
|
|
1803
|
+
/**
|
|
1804
|
+
* The content of the model's response
|
|
1805
|
+
*/
|
|
1806
|
+
content?: string | Array<OpenAIAssistantMessageParam.UnionMember1>;
|
|
1788
1807
|
|
|
1808
|
+
/**
|
|
1809
|
+
* (Optional) The name of the assistant message participant.
|
|
1810
|
+
*/
|
|
1811
|
+
name?: string;
|
|
1812
|
+
|
|
1813
|
+
/**
|
|
1814
|
+
* List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object.
|
|
1815
|
+
*/
|
|
1816
|
+
tool_calls?: Array<OpenAIAssistantMessageParam.ToolCall>;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
export namespace OpenAIAssistantMessageParam {
|
|
1820
|
+
/**
|
|
1821
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1822
|
+
*/
|
|
1823
|
+
export interface UnionMember1 {
|
|
1789
1824
|
/**
|
|
1790
|
-
*
|
|
1825
|
+
* The text content of the message
|
|
1791
1826
|
*/
|
|
1792
|
-
|
|
1793
|
-
}
|
|
1827
|
+
text: string;
|
|
1794
1828
|
|
|
1795
|
-
export namespace OpenAISystemMessageParam {
|
|
1796
1829
|
/**
|
|
1797
|
-
*
|
|
1830
|
+
* Must be "text" to identify this as text content
|
|
1798
1831
|
*/
|
|
1799
|
-
|
|
1800
|
-
/**
|
|
1801
|
-
* The text content of the message
|
|
1802
|
-
*/
|
|
1803
|
-
text: string;
|
|
1804
|
-
|
|
1805
|
-
/**
|
|
1806
|
-
* Must be "text" to identify this as text content
|
|
1807
|
-
*/
|
|
1808
|
-
type: 'text';
|
|
1809
|
-
}
|
|
1832
|
+
type: 'text';
|
|
1810
1833
|
}
|
|
1811
1834
|
|
|
1812
1835
|
/**
|
|
1813
|
-
*
|
|
1814
|
-
* chat completion request.
|
|
1836
|
+
* Tool call specification for OpenAI-compatible chat completion responses.
|
|
1815
1837
|
*/
|
|
1816
|
-
export interface
|
|
1838
|
+
export interface ToolCall {
|
|
1817
1839
|
/**
|
|
1818
|
-
* Must be "
|
|
1840
|
+
* Must be "function" to identify this as a function call
|
|
1819
1841
|
*/
|
|
1820
|
-
|
|
1842
|
+
type: 'function';
|
|
1821
1843
|
|
|
1822
1844
|
/**
|
|
1823
|
-
*
|
|
1845
|
+
* (Optional) Unique identifier for the tool call
|
|
1824
1846
|
*/
|
|
1825
|
-
|
|
1847
|
+
id?: string;
|
|
1826
1848
|
|
|
1827
1849
|
/**
|
|
1828
|
-
* (Optional)
|
|
1850
|
+
* (Optional) Function call details
|
|
1829
1851
|
*/
|
|
1830
|
-
|
|
1852
|
+
function?: ToolCall.Function;
|
|
1831
1853
|
|
|
1832
1854
|
/**
|
|
1833
|
-
*
|
|
1855
|
+
* (Optional) Index of the tool call in the list
|
|
1834
1856
|
*/
|
|
1835
|
-
|
|
1857
|
+
index?: number;
|
|
1836
1858
|
}
|
|
1837
1859
|
|
|
1838
|
-
export namespace
|
|
1839
|
-
/**
|
|
1840
|
-
* Text content part for OpenAI-compatible chat completion messages.
|
|
1841
|
-
*/
|
|
1842
|
-
export interface UnionMember1 {
|
|
1843
|
-
/**
|
|
1844
|
-
* The text content of the message
|
|
1845
|
-
*/
|
|
1846
|
-
text: string;
|
|
1847
|
-
|
|
1848
|
-
/**
|
|
1849
|
-
* Must be "text" to identify this as text content
|
|
1850
|
-
*/
|
|
1851
|
-
type: 'text';
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1860
|
+
export namespace ToolCall {
|
|
1854
1861
|
/**
|
|
1855
|
-
*
|
|
1862
|
+
* (Optional) Function call details
|
|
1856
1863
|
*/
|
|
1857
|
-
export interface
|
|
1858
|
-
/**
|
|
1859
|
-
* Must be "function" to identify this as a function call
|
|
1860
|
-
*/
|
|
1861
|
-
type: 'function';
|
|
1862
|
-
|
|
1863
|
-
/**
|
|
1864
|
-
* (Optional) Unique identifier for the tool call
|
|
1865
|
-
*/
|
|
1866
|
-
id?: string;
|
|
1867
|
-
|
|
1864
|
+
export interface Function {
|
|
1868
1865
|
/**
|
|
1869
|
-
* (Optional)
|
|
1866
|
+
* (Optional) Arguments to pass to the function as a JSON string
|
|
1870
1867
|
*/
|
|
1871
|
-
|
|
1868
|
+
arguments?: string;
|
|
1872
1869
|
|
|
1873
1870
|
/**
|
|
1874
|
-
* (Optional)
|
|
1871
|
+
* (Optional) Name of the function to call
|
|
1875
1872
|
*/
|
|
1876
|
-
|
|
1873
|
+
name?: string;
|
|
1877
1874
|
}
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1878
1877
|
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1878
|
+
/**
|
|
1879
|
+
* A message representing the result of a tool invocation in an OpenAI-compatible
|
|
1880
|
+
* chat completion request.
|
|
1881
|
+
*/
|
|
1882
|
+
export interface OpenAIToolMessageParam {
|
|
1883
|
+
/**
|
|
1884
|
+
* The response content from the tool
|
|
1885
|
+
*/
|
|
1886
|
+
content: string | Array<OpenAIToolMessageParam.UnionMember1>;
|
|
1888
1887
|
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
}
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Must be "tool" to identify this as a tool response
|
|
1890
|
+
*/
|
|
1891
|
+
role: 'tool';
|
|
1896
1892
|
|
|
1897
1893
|
/**
|
|
1898
|
-
*
|
|
1899
|
-
* chat completion request.
|
|
1894
|
+
* Unique identifier for the tool call this response is for
|
|
1900
1895
|
*/
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
* The response content from the tool
|
|
1904
|
-
*/
|
|
1905
|
-
content: string | Array<OpenAIToolMessageParam.UnionMember1>;
|
|
1896
|
+
tool_call_id: string;
|
|
1897
|
+
}
|
|
1906
1898
|
|
|
1899
|
+
export namespace OpenAIToolMessageParam {
|
|
1900
|
+
/**
|
|
1901
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1902
|
+
*/
|
|
1903
|
+
export interface UnionMember1 {
|
|
1907
1904
|
/**
|
|
1908
|
-
*
|
|
1905
|
+
* The text content of the message
|
|
1909
1906
|
*/
|
|
1910
|
-
|
|
1907
|
+
text: string;
|
|
1911
1908
|
|
|
1912
1909
|
/**
|
|
1913
|
-
*
|
|
1910
|
+
* Must be "text" to identify this as text content
|
|
1914
1911
|
*/
|
|
1915
|
-
|
|
1912
|
+
type: 'text';
|
|
1916
1913
|
}
|
|
1914
|
+
}
|
|
1917
1915
|
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
text: string;
|
|
1927
|
-
|
|
1928
|
-
/**
|
|
1929
|
-
* Must be "text" to identify this as text content
|
|
1930
|
-
*/
|
|
1931
|
-
type: 'text';
|
|
1932
|
-
}
|
|
1933
|
-
}
|
|
1916
|
+
/**
|
|
1917
|
+
* A message from the developer in an OpenAI-compatible chat completion request.
|
|
1918
|
+
*/
|
|
1919
|
+
export interface OpenAIDeveloperMessageParam {
|
|
1920
|
+
/**
|
|
1921
|
+
* The content of the developer message
|
|
1922
|
+
*/
|
|
1923
|
+
content: string | Array<OpenAIDeveloperMessageParam.UnionMember1>;
|
|
1934
1924
|
|
|
1935
1925
|
/**
|
|
1936
|
-
*
|
|
1926
|
+
* Must be "developer" to identify this as a developer message
|
|
1937
1927
|
*/
|
|
1938
|
-
|
|
1939
|
-
/**
|
|
1940
|
-
* The content of the developer message
|
|
1941
|
-
*/
|
|
1942
|
-
content: string | Array<OpenAIDeveloperMessageParam.UnionMember1>;
|
|
1928
|
+
role: 'developer';
|
|
1943
1929
|
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1930
|
+
/**
|
|
1931
|
+
* (Optional) The name of the developer message participant.
|
|
1932
|
+
*/
|
|
1933
|
+
name?: string;
|
|
1934
|
+
}
|
|
1948
1935
|
|
|
1936
|
+
export namespace OpenAIDeveloperMessageParam {
|
|
1937
|
+
/**
|
|
1938
|
+
* Text content part for OpenAI-compatible chat completion messages.
|
|
1939
|
+
*/
|
|
1940
|
+
export interface UnionMember1 {
|
|
1949
1941
|
/**
|
|
1950
|
-
*
|
|
1942
|
+
* The text content of the message
|
|
1951
1943
|
*/
|
|
1952
|
-
|
|
1953
|
-
}
|
|
1944
|
+
text: string;
|
|
1954
1945
|
|
|
1955
|
-
export namespace OpenAIDeveloperMessageParam {
|
|
1956
1946
|
/**
|
|
1957
|
-
*
|
|
1947
|
+
* Must be "text" to identify this as text content
|
|
1958
1948
|
*/
|
|
1959
|
-
|
|
1960
|
-
/**
|
|
1961
|
-
* The text content of the message
|
|
1962
|
-
*/
|
|
1963
|
-
text: string;
|
|
1964
|
-
|
|
1965
|
-
/**
|
|
1966
|
-
* Must be "text" to identify this as text content
|
|
1967
|
-
*/
|
|
1968
|
-
type: 'text';
|
|
1969
|
-
}
|
|
1949
|
+
type: 'text';
|
|
1970
1950
|
}
|
|
1971
1951
|
}
|
|
1972
1952
|
}
|
|
@@ -2471,17 +2451,7 @@ export interface CompletionCreateParamsStreaming extends CompletionCreateParamsB
|
|
|
2471
2451
|
stream: true;
|
|
2472
2452
|
}
|
|
2473
2453
|
|
|
2474
|
-
export interface CompletionListParams {
|
|
2475
|
-
/**
|
|
2476
|
-
* The ID of the last chat completion to return.
|
|
2477
|
-
*/
|
|
2478
|
-
after?: string;
|
|
2479
|
-
|
|
2480
|
-
/**
|
|
2481
|
-
* The maximum number of chat completions to return.
|
|
2482
|
-
*/
|
|
2483
|
-
limit?: number;
|
|
2484
|
-
|
|
2454
|
+
export interface CompletionListParams extends OpenAICursorPageParams {
|
|
2485
2455
|
/**
|
|
2486
2456
|
* The model to filter by.
|
|
2487
2457
|
*/
|
|
@@ -2493,11 +2463,14 @@ export interface CompletionListParams {
|
|
|
2493
2463
|
order?: 'asc' | 'desc';
|
|
2494
2464
|
}
|
|
2495
2465
|
|
|
2466
|
+
Completions.CompletionListResponsesOpenAICursorPage = CompletionListResponsesOpenAICursorPage;
|
|
2467
|
+
|
|
2496
2468
|
export declare namespace Completions {
|
|
2497
2469
|
export {
|
|
2498
2470
|
type CompletionCreateResponse as CompletionCreateResponse,
|
|
2499
2471
|
type CompletionRetrieveResponse as CompletionRetrieveResponse,
|
|
2500
2472
|
type CompletionListResponse as CompletionListResponse,
|
|
2473
|
+
CompletionListResponsesOpenAICursorPage as CompletionListResponsesOpenAICursorPage,
|
|
2501
2474
|
type CompletionCreateParams as CompletionCreateParams,
|
|
2502
2475
|
type CompletionCreateParamsNonStreaming as CompletionCreateParamsNonStreaming,
|
|
2503
2476
|
type CompletionCreateParamsStreaming as CompletionCreateParamsStreaming,
|