ai 2.2.3 → 2.2.6
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/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/react/dist/index.js +0 -1
- package/react/dist/index.mjs +0 -1
package/dist/index.js
CHANGED
@@ -335,10 +335,10 @@ function chunkToText() {
|
|
335
335
|
}
|
336
336
|
var __internal__OpenAIFnMessagesSymbol = Symbol("internal_openai_fn_messages");
|
337
337
|
function isChatCompletionChunk(data) {
|
338
|
-
return "choices" in data && "delta" in data.choices[0];
|
338
|
+
return "choices" in data && data.choices && data.choices[0] && "delta" in data.choices[0];
|
339
339
|
}
|
340
340
|
function isCompletion(data) {
|
341
|
-
return "choices" in data && "text" in data.choices[0];
|
341
|
+
return "choices" in data && data.choices && data.choices[0] && "text" in data.choices[0];
|
342
342
|
}
|
343
343
|
function OpenAIStream(res, callbacks) {
|
344
344
|
const cb = callbacks;
|
package/dist/index.mjs
CHANGED
@@ -290,10 +290,10 @@ function chunkToText() {
|
|
290
290
|
}
|
291
291
|
var __internal__OpenAIFnMessagesSymbol = Symbol("internal_openai_fn_messages");
|
292
292
|
function isChatCompletionChunk(data) {
|
293
|
-
return "choices" in data && "delta" in data.choices[0];
|
293
|
+
return "choices" in data && data.choices && data.choices[0] && "delta" in data.choices[0];
|
294
294
|
}
|
295
295
|
function isCompletion(data) {
|
296
|
-
return "choices" in data && "text" in data.choices[0];
|
296
|
+
return "choices" in data && data.choices && data.choices[0] && "text" in data.choices[0];
|
297
297
|
}
|
298
298
|
function OpenAIStream(res, callbacks) {
|
299
299
|
const cb = callbacks;
|
package/package.json
CHANGED
package/react/dist/index.js
CHANGED