@saltcorn/large-language-model 0.9.3 → 0.9.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/generate.js +2 -2
- package/package.json +1 -1
package/generate.js
CHANGED
|
@@ -375,8 +375,8 @@ const getCompletionOpenAICompatible = async (
|
|
|
375
375
|
dataDone = true;
|
|
376
376
|
break;
|
|
377
377
|
}
|
|
378
|
-
if (value.error) {
|
|
379
|
-
throw new Error(value
|
|
378
|
+
if (typeof value === "string" && value.startsWith('{\n "error": {')) {
|
|
379
|
+
throw new Error(value);
|
|
380
380
|
}
|
|
381
381
|
process_stream_data(value);
|
|
382
382
|
if (dataDone) break;
|