@inductiv/node-red-openai-api 1.85.1 → 1.85.4

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/README.md CHANGED
@@ -40,10 +40,10 @@ After installation, find your node in the **AI** palette category labeled "OpenA
40
40
  - **Configurable and Flexible**: Adapt to a wide range of project requirements, making it easy to integrate AI into your IoT solutions.
41
41
  - **Powerful Combinations**: Utilize Node-RED's diverse nodes to build complex, AI-driven IoT workflows with ease.
42
42
 
43
- ## Release Notes (v1.85.1)
43
+ ## Release Notes (v1.85.4)
44
44
 
45
- - **Ehancement**: Upgraded the OpenAI API Library dependency from [v4.83.0](https://github.com/openai/openai-node/releases/tag/v4.83.0) to [v4.85.1](https://github.com/openai/openai-node/releases/tag/v4.85.1).
46
- - Project versioning now aligns with the OpenAI API Library's minor and patch version numbers for easier feature tracking and compatibility (e.g., x.85.1).
45
+ - **Ehancement:** Upgraded the OpenAI API Library dependency from [v4.85.1](https://github.com/openai/openai-node/releases/tag/v4.85.1) to [v4.85.4](https://github.com/openai/openai-node/releases/tag/v4.85.4).
46
+ - **Enhancement:** Implemented [Chat Completion storage methods](https://platform.openai.com/docs/api-reference/chat).
47
47
 
48
48
  ## What's New in Version 1.x
49
49
 
package/lib.js CHANGED
@@ -250,6 +250,49 @@ let OpenaiApi = (function () {
250
250
  }
251
251
  }
252
252
 
253
+ async getChatCompletion(parameters) {
254
+ const openai = new OpenAI(this.clientParams);
255
+ const { completion_id, ...options } = parameters.payload;
256
+
257
+ const response = await openai.chat.completions.retrieve(completion_id, options);
258
+
259
+ return response;
260
+ }
261
+
262
+ async getChatMessages(parameters) {
263
+ const openai = new OpenAI(this.clientParams);
264
+ const { completion_id, ...options } = parameters.payload;
265
+
266
+ const response = await openai.chat.completions.messages.list(completion_id, options);
267
+
268
+ return response.data;
269
+ }
270
+
271
+ async listChatCompletions(parameters) {
272
+ const openai = new OpenAI(this.clientParams);
273
+ const response = await openai.chat.completions.list(parameters.payload);
274
+
275
+ return response.data;
276
+ }
277
+
278
+ async updateChatCompletion(parameters) {
279
+ const openai = new OpenAI(this.clientParams);
280
+ const { completion_id, ...body } = parameters.payload;
281
+
282
+ const response = await openai.chat.completions.update(completion_id, body);
283
+
284
+ return response;
285
+ }
286
+
287
+ async deleteChatCompletion(parameters) {
288
+ const openai = new OpenAI(this.clientParams);
289
+ const { completion_id, ...options } = parameters.payload;
290
+
291
+ const response = await openai.chat.completions.del(completion_id, options);
292
+
293
+ return response;
294
+ }
295
+
253
296
  async createImage(parameters) {
254
297
  const openai = new OpenAI(this.clientParams);
255
298
  const response = await openai.images.generate(parameters.payload);
@@ -35,6 +35,11 @@
35
35
  "cancelBatch": "cancel batch",
36
36
  "listBatch": "list batch",
37
37
  "createChatCompletion": "create chat completion",
38
+ "getChatCompletion": "get chat completion",
39
+ "getChatMessages": "get chat messages",
40
+ "listChatCompletions": "list chat completions",
41
+ "updateChatCompletion": "update chat completion",
42
+ "deleteChatCompletion": "delete chat completion",
38
43
  "body": "body",
39
44
  "request_body": "Request Body",
40
45
  "data": "data",
@@ -35,6 +35,11 @@
35
35
  "cancelBatch": "cancel batch",
36
36
  "listBatch": "list batch",
37
37
  "createChatCompletion": "create chat completion",
38
+ "getChatCompletion": "get chat completion",
39
+ "getChatMessages": "get chat messages",
40
+ "listChatCompletions": "list chat completions",
41
+ "updateChatCompletion": "update chat completion",
42
+ "deleteChatCompletion": "delete chat completion",
38
43
  "body": "body",
39
44
  "request_body": "Request Body",
40
45
  "data": "data",
@@ -35,6 +35,11 @@
35
35
  "cancelBatch": "cancel batch",
36
36
  "listBatch": "list batch",
37
37
  "createChatCompletion": "create chat completion",
38
+ "getChatCompletion": "get chat completion",
39
+ "getChatMessages": "get chat messages",
40
+ "listChatCompletions": "list chat completions",
41
+ "updateChatCompletion": "update chat completion",
42
+ "deleteChatCompletion": "delete chat completion",
38
43
  "body": "body",
39
44
  "request_body": "Request Body",
40
45
  "data": "data",
@@ -35,6 +35,11 @@
35
35
  "cancelBatch": "cancel batch",
36
36
  "listBatch": "list batch",
37
37
  "createChatCompletion": "create chat completion",
38
+ "getChatCompletion": "get chat completion",
39
+ "getChatMessages": "get chat messages",
40
+ "listChatCompletions": "list chat completions",
41
+ "updateChatCompletion": "update chat completion",
42
+ "deleteChatCompletion": "delete chat completion",
38
43
  "body": "body",
39
44
  "request_body": "Request Body",
40
45
  "data": "data",
@@ -112,9 +117,9 @@
112
117
  "getMessage": "retrieve message",
113
118
  "message_id": "message id",
114
119
  "modifyMessage": "modify message",
115
- "createSession": "create session",
116
120
  "createUpload": "create upload",
117
121
  "addUploadPart": "add upload part",
122
+ "completeUpload": "complete upload",
118
123
  "cancelUpload": "cancel upload",
119
124
  "createThreadAndRun": "create thread and run",
120
125
  "listRuns": "list runs",
package/node.html CHANGED
@@ -158,6 +158,30 @@
158
158
  value="createChatCompletion"
159
159
  data-i18n="OpenaiApi.parameters.createChatCompletion"
160
160
  ></option>
161
+ <option
162
+ value="getChatCompletion"
163
+ data-i18n="OpenaiApi.parameters.getChatCompletion"
164
+ ></option>
165
+ <option
166
+ value="getChatMessages"
167
+ data-i18n="OpenaiApi.parameters.getChatMessages"
168
+ ></option>
169
+
170
+ <option
171
+ value="listChatCompletions"
172
+ data-i18n="OpenaiApi.parameters.listChatCompletions"
173
+ ></option>
174
+
175
+ <option
176
+ value="updateChatCompletion"
177
+ data-i18n="OpenaiApi.parameters.updateChatCompletion"
178
+ ></option>
179
+
180
+ <option
181
+ value="deleteChatCompletion"
182
+ data-i18n="OpenaiApi.parameters.deleteChatCompletion"
183
+ ></option>
184
+
161
185
  </optgroup>
162
186
  <optgroup style="font-style: normal;" label="🔗 Embeddings">
163
187
  <option
@@ -1245,344 +1269,585 @@
1245
1269
 
1246
1270
  <section>
1247
1271
  <details>
1248
- <summary style="font-weight: bold;">🗨️ Chat</summary>
1272
+ <summary style="font-weight: bold;">🗨️ Chat</summary>
1273
+ <a
1274
+ href="https://platform.openai.com/docs/api-reference/chat"
1275
+ target="_blank"
1276
+ >Official Documentation
1277
+ <i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1278
+ ></a>
1279
+ <h4 style="font-weight: bolder;"> ⋙ Create Chat Completion</h4>
1280
+ <p>
1281
+ Creates a model response for the given chat conversation.
1249
1282
  <a
1250
- href="https://platform.openai.com/docs/api-reference/chat"
1283
+ href="https://platform.openai.com/docs/api-reference/chat/create"
1251
1284
  target="_blank"
1252
- >Official Documentation
1253
- <i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1254
- ></a>
1255
- <h4 style="font-weight: bolder;"> ⋙ Create Chat Completion</h4>
1256
- <p>
1257
- Creates a model response for the given chat conversation.
1285
+ >Full documentation.</a
1286
+ >
1287
+ </p>
1288
+ <dl class="message-properties">
1289
+ <h4>msg.payload Properties</h4>
1290
+
1291
+ <dt>
1292
+ messages
1258
1293
  <a
1259
- href="https://platform.openai.com/docs/api-reference/chat/create"
1294
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages"
1260
1295
  target="_blank"
1261
- >Full documentation.</a
1262
- >
1263
- </p>
1264
- <dl class="message-properties">
1265
- <h4>msg.payload Properties</h4>
1266
-
1267
- <dt>
1268
- messages
1269
- <a
1270
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-messages"
1271
- target="_blank"
1272
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1273
- ></a>
1274
- <span class="property-type">array</span>
1275
- </dt>
1276
- <dd>A list of messages comprising the conversation so far.</dd>
1277
- <dt>
1278
- model
1279
- <a
1280
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-model"
1281
- target="_blank"
1282
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1283
- ></a>
1284
- <span class="property-type">string</span>
1285
- </dt>
1286
- <dd>ID of the model to use.</dd>
1296
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1297
+ ></a>
1298
+ <span class="property-type">array</span>
1299
+ </dt>
1300
+ <dd>A list of messages comprising the conversation so far.</dd>
1301
+ <dt>
1302
+ model
1303
+ <a
1304
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-model"
1305
+ target="_blank"
1306
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1307
+ ></a>
1308
+ <span class="property-type">string</span>
1309
+ </dt>
1310
+ <dd>ID of the model to use.</dd>
1287
1311
 
1288
- <dt class="optional">
1289
- store
1290
- <a
1291
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-store"
1292
- target="_blank"
1293
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1294
- ></a>
1295
- <span class="property-type">boolean | null</span>
1296
- </dt>
1297
- <dd>Whether to store the output of this chat completion request.</dd>
1312
+ <dt class="optional">
1313
+ store
1314
+ <a
1315
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-store"
1316
+ target="_blank"
1317
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1318
+ ></a>
1319
+ <span class="property-type">boolean | null</span>
1320
+ </dt>
1321
+ <dd>Whether to store the output of this chat completion request.</dd>
1298
1322
 
1299
- <dt class="optional">
1300
- reasoning_effort
1301
- <a
1302
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-reasoning_effort"
1303
- target="_blank"
1304
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1305
- ></a>
1306
- <span class="property-type">string</span>
1307
- </dt>
1308
- <dd>Constrains effort on reasoning for reasoning models.</dd>
1323
+ <dt class="optional">
1324
+ reasoning_effort
1325
+ <a
1326
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-reasoning_effort"
1327
+ target="_blank"
1328
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1329
+ ></a>
1330
+ <span class="property-type">string</span>
1331
+ </dt>
1332
+ <dd>Constrains effort on reasoning for reasoning models.</dd>
1309
1333
 
1310
- <dt class="optional">
1311
- metadata
1312
- <a
1313
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-metadata"
1314
- target="_blank"
1315
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1316
- ></a>
1317
- <span class="property-type">object or null</span>
1318
- </dt>
1319
- <dd>Developer-defined tags and values used for filtering completions in the dashboard.</dd>
1334
+ <dt class="optional">
1335
+ metadata
1336
+ <a
1337
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-metadata"
1338
+ target="_blank"
1339
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1340
+ ></a>
1341
+ <span class="property-type">object or null</span>
1342
+ </dt>
1343
+ <dd>Developer-defined tags and values used for filtering completions in the dashboard.</dd>
1320
1344
 
1321
- <dt class="optional">
1322
- frequency_penalty
1323
- <a
1324
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-frequency_penalty"
1325
- target="_blank"
1326
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1327
- ></a>
1328
- <span class="property-type">number</span>
1329
- </dt>
1330
- <dd>Number between -2.0 and 2.0.</dd>
1331
- <dt class="optional">
1332
- logit_bias
1333
- <a
1334
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-logit_bias"
1335
- target="_blank"
1336
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1337
- ></a>
1338
- <span class="property-type">object</span>
1339
- </dt>
1340
- <dd>
1341
- Modify the likelihood of specified tokens appearing in the completion.
1342
- </dd>
1343
- <dt class="optional">
1344
- logprobs
1345
- <a
1346
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-logprobs"
1347
- target="_blank"
1348
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1349
- ></a>
1350
- <span class="property-type">boolean</span>
1351
- </dt>
1352
- <dd>Whether to return log probabilities of the output tokens or not.</dd>
1353
- <dt class="optional">
1354
- top_logprobs
1355
- <a
1356
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-top_logprobs"
1357
- target="_blank"
1358
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1359
- ></a>
1360
- <span class="property-type">integer</span>
1361
- </dt>
1362
- <dd>
1363
- An integer between 0 and 5 specifying the number of most likely tokens
1364
- to return at each token position, each with an associated log
1365
- probability.
1366
- </dd>
1367
- <dt class="optional">
1368
- max_tokens
1369
- <a
1370
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens"
1371
- target="_blank"
1372
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1373
- ></a>
1374
- <span class="property-type">integer</span>
1375
- </dt>
1376
- <dd>
1377
- The maximum number of tokens that can be generated in the chat
1378
- completion.
1379
- </dd>
1380
- <dt class="optional">
1381
- n
1382
- <a
1383
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-n"
1384
- target="_blank"
1385
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1386
- ></a>
1387
- <span class="property-type">integer</span>
1388
- </dt>
1389
- <dd>
1390
- How many chat completion choices to generate for each input message.
1391
- </dd>
1345
+ <dt class="optional">
1346
+ frequency_penalty
1347
+ <a
1348
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-frequency_penalty"
1349
+ target="_blank"
1350
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1351
+ ></a>
1352
+ <span class="property-type">number</span>
1353
+ </dt>
1354
+ <dd>Number between -2.0 and 2.0.</dd>
1355
+ <dt class="optional">
1356
+ logit_bias
1357
+ <a
1358
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-logit_bias"
1359
+ target="_blank"
1360
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1361
+ ></a>
1362
+ <span class="property-type">object</span>
1363
+ </dt>
1364
+ <dd>
1365
+ Modify the likelihood of specified tokens appearing in the completion.
1366
+ </dd>
1367
+ <dt class="optional">
1368
+ logprobs
1369
+ <a
1370
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-logprobs"
1371
+ target="_blank"
1372
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1373
+ ></a>
1374
+ <span class="property-type">boolean</span>
1375
+ </dt>
1376
+ <dd>Whether to return log probabilities of the output tokens or not.</dd>
1377
+ <dt class="optional">
1378
+ top_logprobs
1379
+ <a
1380
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-top_logprobs"
1381
+ target="_blank"
1382
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1383
+ ></a>
1384
+ <span class="property-type">integer</span>
1385
+ </dt>
1386
+ <dd>
1387
+ An integer between 0 and 5 specifying the number of most likely tokens
1388
+ to return at each token position, each with an associated log
1389
+ probability.
1390
+ </dd>
1391
+ <dt class="optional">
1392
+ max_tokens [Deprecated]
1393
+ <a
1394
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens"
1395
+ target="_blank"
1396
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1397
+ ></a>
1398
+ <span class="property-type">integer</span>
1399
+ </dt>
1400
+ <dd>
1401
+ The maximum number of tokens that can be generated in the chat
1402
+ completion. This value is now deprecated in favor of max_completion_tokens,
1403
+ and is not compatible with o1 series models.
1404
+ </dd>
1405
+
1406
+ <dt class="optional">
1407
+ max_completion_tokens
1408
+ <a
1409
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_completion_tokens"
1410
+ target="_blank"
1411
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1412
+ ></a>
1413
+ <span class="property-type">integer</span>
1414
+ </dt>
1415
+ <dd>
1416
+ An upper bound for the number of tokens that can be generated for a completion,
1417
+ including visible output tokens and reasoning tokens.
1418
+ </dd>
1419
+
1420
+ <dt class="optional">
1421
+ n
1422
+ <a
1423
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-n"
1424
+ target="_blank"
1425
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1426
+ ></a>
1427
+ <span class="property-type">integer</span>
1428
+ </dt>
1429
+ <dd>
1430
+ How many chat completion choices to generate for each input message.
1431
+ </dd>
1392
1432
 
1393
- <dt class="optional">
1394
- modalities
1395
- <a
1396
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-modalities"
1397
- target="_blank"
1398
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1399
- ></a>
1400
- <span class="property-type">array or null</span>
1401
- </dt>
1402
- <dd>
1403
- Output types that you would like the model to generate for this request.
1404
- </dd>
1433
+ <dt class="optional">
1434
+ modalities
1435
+ <a
1436
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-modalities"
1437
+ target="_blank"
1438
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1439
+ ></a>
1440
+ <span class="property-type">array or null</span>
1441
+ </dt>
1442
+ <dd>
1443
+ Output types that you would like the model to generate for this request.
1444
+ </dd>
1405
1445
 
1406
- <dt class="optional">
1407
- prediction
1408
- <a
1409
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-prediction"
1410
- target="_blank"
1411
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1412
- ></a>
1413
- <span class="property-type">object</span>
1414
- </dt>
1415
- <dd>
1416
- Configuration for a Predicted Output.
1417
- </dd>
1446
+ <dt class="optional">
1447
+ prediction
1448
+ <a
1449
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-prediction"
1450
+ target="_blank"
1451
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1452
+ ></a>
1453
+ <span class="property-type">object</span>
1454
+ </dt>
1455
+ <dd>
1456
+ Configuration for a Predicted Output.
1457
+ </dd>
1418
1458
 
1419
- <dt class="optional">
1420
- audio
1421
- <a
1422
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-audio"
1423
- target="_blank"
1424
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1425
- ></a>
1426
- <span class="property-type">object or null</span>
1427
- </dt>
1428
- <dd>
1429
- Parameters for audio output.
1430
- </dd>
1459
+ <dt class="optional">
1460
+ audio
1461
+ <a
1462
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-audio"
1463
+ target="_blank"
1464
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1465
+ ></a>
1466
+ <span class="property-type">object or null</span>
1467
+ </dt>
1468
+ <dd>
1469
+ Parameters for audio output.
1470
+ </dd>
1431
1471
 
1432
- <dt class="optional">
1433
- presence_penalty
1434
- <a
1435
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-presence_penalty"
1436
- target="_blank"
1437
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1438
- ></a>
1439
- <span class="property-type">number</span>
1440
- </dt>
1441
- <dd>Number between -2.0 and 2.0.</dd>
1442
- <dt class="optional">
1443
- response_format
1444
- <a
1445
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-response_format"
1446
- target="_blank"
1447
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1448
- ></a>
1449
- <span class="property-type">object</span>
1450
- </dt>
1451
- <dd>An object specifying the format that the model must output.</dd>
1452
- <dt class="optional">
1453
- seed
1454
- <a
1455
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-seed"
1456
- target="_blank"
1457
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1458
- ></a>
1459
- <span class="property-type">integer</span>
1460
- </dt>
1461
- <dd>
1462
- This feature is in Beta. If specified, the system will make a best
1463
- effort to sample deterministically, such that repeated requests with the
1464
- same seed and parameters should return the same result.
1465
- </dd>
1472
+ <dt class="optional">
1473
+ presence_penalty
1474
+ <a
1475
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-presence_penalty"
1476
+ target="_blank"
1477
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1478
+ ></a>
1479
+ <span class="property-type">number</span>
1480
+ </dt>
1481
+ <dd>Number between -2.0 and 2.0.</dd>
1466
1482
 
1467
- <dt class="optional">
1468
- service_tier
1469
- <a
1470
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-service_tier"
1471
- target="_blank"
1472
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1473
- ></a>
1474
- <span class="property-type">string or null</span>
1475
- </dt>
1476
- <dd>
1477
- Specifies the latency tier to use for processing the request.
1478
- </dd>
1483
+ <dt class="optional">
1484
+ response_format
1485
+ <a
1486
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-response_format"
1487
+ target="_blank"
1488
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1489
+ ></a>
1490
+ <span class="property-type">object</span>
1491
+ </dt>
1492
+ <dd>An object specifying the format that the model must output.</dd>
1479
1493
 
1480
- <dt class="optional">
1481
- stop
1482
- <a
1483
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-stop"
1484
- target="_blank"
1485
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1486
- ></a>
1487
- <span class="property-type">string | array</span>
1488
- </dt>
1489
- <dd>
1490
- Up to 4 sequences where the API will stop generating further tokens.
1491
- </dd>
1492
- <dt class="optional">
1493
- stream
1494
- <a
1495
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-stream"
1496
- target="_blank"
1497
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1498
- ></a>
1499
- <span class="property-type">boolean</span>
1500
- </dt>
1501
- <dd>If set, partial message deltas will be sent, like in ChatGPT.</dd>
1494
+ <dt class="optional">
1495
+ seed
1496
+ <a
1497
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-seed"
1498
+ target="_blank"
1499
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1500
+ ></a>
1501
+ <span class="property-type">integer</span>
1502
+ </dt>
1503
+ <dd>
1504
+ This feature is in Beta. If specified, the system will make a best
1505
+ effort to sample deterministically, such that repeated requests with the
1506
+ same seed and parameters should return the same result.
1507
+ </dd>
1502
1508
 
1503
- <dt class="optional">
1504
- stream_options
1505
- <a
1506
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-stream_options"
1507
- target="_blank"
1508
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1509
- ></a>
1510
- <span class="property-type">object</span>
1511
- </dt>
1512
- <dd>Options for streaming response. Only set this when you set ```stream: true```.</dd>
1509
+ <dt class="optional">
1510
+ service_tier
1511
+ <a
1512
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-service_tier"
1513
+ target="_blank"
1514
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1515
+ ></a>
1516
+ <span class="property-type">string or null</span>
1517
+ </dt>
1518
+ <dd>
1519
+ Specifies the latency tier to use for processing the request.
1520
+ </dd>
1513
1521
 
1514
- <dt class="optional">
1515
- temperature
1516
- <a
1517
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-temperature"
1518
- target="_blank"
1519
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1520
- ></a>
1521
- <span class="property-type">number</span>
1522
- </dt>
1523
- <dd>What sampling temperature to use, between 0 and 2.</dd>
1524
- <dt class="optional">
1525
- top_p
1526
- <a
1527
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-top_p"
1528
- target="_blank"
1529
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1530
- ></a>
1531
- <span class="property-type">number</span>
1532
- </dt>
1533
- <dd>
1534
- An alternative to sampling with temperature, called nucleus sampling,
1535
- where the model considers the results of the tokens with top_p
1536
- probability mass.
1537
- </dd>
1538
- <dt class="optional">
1539
- tools
1540
- <a
1541
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools"
1542
- target="_blank"
1543
- ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1544
- ></a>
1545
- <span class="property-type">array</span>
1546
- </dt>
1547
- <dd>A list of tools the model may call.</dd>
1548
- <dt class="optional">
1549
- tool_choice
1522
+ <dt class="optional">
1523
+ stop
1524
+ <a
1525
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-stop"
1526
+ target="_blank"
1527
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1528
+ ></a>
1529
+ <span class="property-type">string | array</span>
1530
+ </dt>
1531
+ <dd>
1532
+ Up to 4 sequences where the API will stop generating further tokens.
1533
+ </dd>
1534
+
1535
+ <dt class="optional">
1536
+ stream
1537
+ <a
1538
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-stream"
1539
+ target="_blank"
1540
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1541
+ ></a>
1542
+ <span class="property-type">boolean</span>
1543
+ </dt>
1544
+ <dd>If set, partial message deltas will be sent, like in ChatGPT.</dd>
1545
+
1546
+ <dt class="optional">
1547
+ stream_options
1548
+ <a
1549
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-stream_options"
1550
+ target="_blank"
1551
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1552
+ ></a>
1553
+ <span class="property-type">object</span>
1554
+ </dt>
1555
+ <dd>Options for streaming response. Only set this when you set ```stream: true```.</dd>
1556
+
1557
+ <dt class="optional">
1558
+ temperature
1559
+ <a
1560
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-temperature"
1561
+ target="_blank"
1562
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1563
+ ></a>
1564
+ <span class="property-type">number</span>
1565
+ </dt>
1566
+ <dd>What sampling temperature to use, between 0 and 2.</dd>
1567
+
1568
+ <dt class="optional">
1569
+ top_p
1570
+ <a
1571
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-top_p"
1572
+ target="_blank"
1573
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1574
+ ></a>
1575
+ <span class="property-type">number</span>
1576
+ </dt>
1577
+ <dd>
1578
+ An alternative to sampling with temperature, called nucleus sampling,
1579
+ where the model considers the results of the tokens with top_p
1580
+ probability mass.
1581
+ </dd>
1582
+
1583
+ <dt class="optional">
1584
+ tools
1585
+ <a
1586
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools"
1587
+ target="_blank"
1588
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1589
+ ></a>
1590
+ <span class="property-type">array</span>
1591
+ </dt>
1592
+ <dd>A list of tools the model may call.</dd>
1593
+
1594
+ <dt class="optional">
1595
+ tool_choice
1596
+ <a
1597
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice"
1598
+ target="_blank"
1599
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1600
+ ></a>
1601
+ <span class="property-type">string | object</span>
1602
+ </dt>
1603
+ <dd>Whether to enable parallel function calling during tool use.</dd>
1604
+
1605
+ <dt class="optional">
1606
+ parallel_tool_calls
1607
+ <a
1608
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-parallel_tool_calls"
1609
+ target="_blank"
1610
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1611
+ ></a>
1612
+ <span class="property-type">string | object</span>
1613
+ </dt>
1614
+ <dd>Whether to enable parallel function calling during tool use.</dd>
1615
+
1616
+ <dt class="optional">
1617
+ user
1618
+ <a
1619
+ href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-user"
1620
+ target="_blank"
1621
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1622
+ ></a>
1623
+ <span class="property-type">string</span>
1624
+ </dt>
1625
+ <dd>
1626
+ A unique identifier representing your end-user, which can help OpenAI to
1627
+ monitor and detect abuse.
1628
+ </dd>
1629
+
1630
+ </dl>
1631
+
1632
+
1633
+ <h4 style="font-weight: bolder;"> ⋙ Get Chat Completion</h4>
1634
+ <p>
1635
+ Get a stored chat completion.
1636
+ <a
1637
+ href="https://platform.openai.com/docs/api-reference/chat/get"
1638
+ target="_blank"
1639
+ >Full documentation.</a
1640
+ >
1641
+ </p>
1642
+ <dl class="message-properties">
1643
+ <h4>msg.payload Properties</h4>
1644
+
1645
+ <dt>
1646
+ completion_id
1647
+ <a
1648
+ href="https://platform.openai.com/docs/api-reference/chat/get#chat-get-completion_id"
1649
+ target="_blank"
1650
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1651
+ ></a>
1652
+ <span class="property-type">string</span>
1653
+ </dt>
1654
+ <dd>The ID of the chat completion to retrieve.</dd>
1655
+ </dl>
1656
+
1657
+ <!-- Begin Get Chat Messages -->
1658
+ <h4 style="font-weight: bolder;"> ⋙ Get Chat Messages</h4>
1659
+ <p>
1660
+ Get the messages in a stored chat completion.
1661
+ <a
1662
+ href="https://platform.openai.com/docs/api-reference/chat/getMessages"
1663
+ target="_blank"
1664
+ >Full documentation.</a
1665
+ >
1666
+ </p>
1667
+ <dl class="message-properties">
1668
+ <h4>msg.payload Properties</h4>
1669
+
1670
+ <dt>
1671
+ completion_id
1672
+ <a
1673
+ href="https://platform.openai.com/docs/api-reference/chat/getMessages#chat-getmessages-completion_id"
1674
+ target="_blank"
1675
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1676
+ ></a>
1677
+ <span class="property-type">string</span>
1678
+ </dt>
1679
+ <dd>The ID of the chat completion to retrieve messages from.</dd>
1680
+
1681
+ <dt class="optional">
1682
+ after
1683
+ <a
1684
+ href="https://platform.openai.com/docs/api-reference/chat/getMessages#chat-getmessages-afterf"
1685
+ target="_blank"
1686
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1687
+ ></a>
1688
+ <span class="property-type">string</span>
1689
+ </dt>
1690
+ <dd>Identifier for the last message from the previous pagination request.</dd>
1691
+
1692
+ <dt class="optional">
1693
+ limit
1694
+ <a
1695
+ href="https://platform.openai.com/docs/api-reference/chat/getMessages#chat-getmessages-limit"
1696
+ target="_blank"
1697
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1698
+ ></a>
1699
+ <span class="property-type">integer</span>
1700
+ </dt>
1701
+ <dd>Number of messages to retrieve.</dd>
1702
+
1703
+ <dt class="optional">
1704
+ order
1705
+ <a
1706
+ href="https://platform.openai.com/docs/api-reference/chat/getMessages#chat-getmessages-order"
1707
+ target="_blank"
1708
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1709
+ ></a>
1710
+ <span class="property-type">string</span>
1711
+ </dt>
1712
+ <dd>Sort order for messages by timestamp.</dd>
1713
+ </dl>
1714
+ <!-- END Get Chat Messages -->
1715
+
1716
+ <!-- Begin List Chat Completions -->
1717
+ <dl>
1718
+ <h4 style="font-weight: bolder;"> ⋙ List Chat Completions</h4>
1719
+ <p>
1720
+ List stored chat completions.
1721
+ <a
1722
+ href="https://platform.openai.com/docs/api-reference/chat/list"
1723
+ target="_blank"
1724
+ >Full documentation.</a
1725
+ >
1726
+ </p>
1727
+ <dl class="message-properties">
1728
+ <h4>msg.payload Properties</h4>
1729
+
1730
+ <dt class="optional">
1731
+ model
1732
+ <a
1733
+ href="https://platform.openai.com/docs/api-reference/chat/list#chat-list-model"
1734
+ target="_blank"
1735
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1736
+ ></a>
1737
+ <span class="property-type">string</span>
1738
+ </dt>
1739
+ <dd>The model used to generate the chat completions.</dd>
1740
+
1741
+ <dt class="optional">
1742
+ metadata
1743
+ <a
1744
+ href="https://platform.openai.com/docs/api-reference/chat/list#chat-list-metadata"
1745
+ target="_blank"
1746
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1747
+ ></a>
1748
+ <span class="property-type">object</span>
1749
+ </dt>
1750
+ <dd>A list of metadata keys to filter the chat completions by.</dd>
1751
+
1752
+ <dt class="optional">
1753
+ after
1754
+ <a
1755
+ href="https://platform.openai.com/docs/api-reference/chat/getMessages#chat-getmessages-limit"
1756
+ target="_blank"
1757
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1758
+ ></a>
1759
+ <span class="property-type">string</span>
1760
+ </dt>
1761
+ <dd>Identifier for the last chat completion from the previous pagination request.</dd>
1762
+
1763
+ <dt class="optional">
1764
+ limit
1765
+ <a
1766
+ href="https://platform.openai.com/docs/api-reference/chat/list#chat-list-limit"
1767
+ target="_blank"
1768
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1769
+ ></a>
1770
+ <span class="property-type">integer</span>
1771
+ </dt>
1772
+ <dd>Number of chat completions to retrieve.</dd>
1773
+
1774
+ <dt class="optional">
1775
+ order
1776
+ <a
1777
+ href="https://platform.openai.com/docs/api-reference/chat/list#chat-list-order"
1778
+ target="_blank"
1779
+ ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1780
+ ></a>
1781
+ <span class="property-type">string</span>
1782
+ </dt>
1783
+ <dd>Sort order for chat completions by timestamp.</dd>
1784
+ </dl>
1785
+ <!-- END List Chat Completions -->
1786
+
1787
+ <!-- Begin Update Chat Completions -->
1788
+ <dl>
1789
+ <h4 style="font-weight: bolder;"> ⋙ Update Chat Completion</h4>
1790
+ <p>
1791
+ Modify a stored chat completion.
1792
+ <a
1793
+ href="https://platform.openai.com/docs/api-reference/chat/update"
1794
+ target="_blank"
1795
+ >Full documentation.</a
1796
+ >
1797
+ </p>
1798
+ <dl class="message-properties">
1799
+ <h4>msg.payload Properties</h4>
1800
+
1801
+ <dt>
1802
+ completion_id
1550
1803
  <a
1551
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice"
1804
+ href="https://platform.openai.com/docs/api-reference/chat/update#chat-update-completion_id"
1552
1805
  target="_blank"
1553
1806
  ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1554
1807
  ></a>
1555
- <span class="property-type">string | object</span>
1808
+ <span class="property-type">string</span>
1556
1809
  </dt>
1557
- <dd>Whether to enable parallel function calling during tool use.</dd>
1810
+ <dd>The ID of the chat completion to update.</dd>
1558
1811
 
1559
- <dt class="optional">
1560
- parallel_tool_calls
1812
+ <dt>
1813
+ metadata
1561
1814
  <a
1562
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-parallel_tool_calls"
1815
+ href="https://platform.openai.com/docs/api-reference/chat/getMessages#chat-getmessages-limit"
1563
1816
  target="_blank"
1564
1817
  ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1565
1818
  ></a>
1566
- <span class="property-type">string | object</span>
1819
+ <span class="property-type">object</span>
1567
1820
  </dt>
1568
- <dd>Whether to enable parallel function calling during tool use.</dd>
1821
+ <dd>Set of 16 key-value pairs that can be attached to an object.</dd>
1822
+ </dl>
1823
+ <!-- END Update Chat Completion -->
1569
1824
 
1570
- <dt class="optional">
1571
- user
1825
+ <!-- Begin Delete Chat Completion -->
1826
+ <dl>
1827
+ <h4 style="font-weight: bolder;"> ⋙ Delete Chat Completion</h4>
1828
+ <p>
1829
+ Delete a stored chat completion.
1830
+ <a
1831
+ href="https://platform.openai.com/docs/api-reference/chat/delete"
1832
+ target="_blank"
1833
+ >Full documentation.</a
1834
+ >
1835
+ </p>
1836
+ <dl class="message-properties">
1837
+ <h4>msg.payload Properties</h4>
1838
+
1839
+ <dt>
1840
+ completion_id
1572
1841
  <a
1573
- href="https://platform.openai.com/docs/api-reference/chat/create#chat-create-user"
1842
+ href="https://platform.openai.com/docs/api-reference/chat/delete#chat-delete-completion_id"
1574
1843
  target="_blank"
1575
1844
  ><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
1576
1845
  ></a>
1577
1846
  <span class="property-type">string</span>
1578
1847
  </dt>
1579
- <dd>
1580
- A unique identifier representing your end-user, which can help OpenAI to
1581
- monitor and detect abuse.
1582
- </dd>
1583
-
1848
+ <dd>The ID of the chat completion to delete.</dd>
1584
1849
  </dl>
1585
-
1850
+ <!-- END Delete Chat Completion -->
1586
1851
  </details>
1587
1852
  </section>
1588
1853
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inductiv/node-red-openai-api",
3
- "version": "1.85.1",
3
+ "version": "1.85.4",
4
4
  "description": "Enhance your Node-RED projects with advanced AI capabilities.",
5
5
  "main": "node.js",
6
6
  "engines": {
@@ -30,7 +30,7 @@
30
30
  "low-code"
31
31
  ],
32
32
  "dependencies": {
33
- "openai": "~4.85.1"
33
+ "openai": "~4.85.4"
34
34
  },
35
35
  "author": "Allan Bunch",
36
36
  "license": "MIT",