@myassis/gateway 1.0.64 → 1.0.65
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.
|
@@ -531,6 +531,9 @@ class LLMClient {
|
|
|
531
531
|
if (d.finish_reason === 'stop' && !d.content) {
|
|
532
532
|
throw Error('model return empty content');
|
|
533
533
|
}
|
|
534
|
+
if (!d?.content && d?.finish_reason === '') {
|
|
535
|
+
throw new Error('model return empty content with unknown finish_reason');
|
|
536
|
+
}
|
|
534
537
|
const toolCalls = d.toolCalls?.map((tc) => ({
|
|
535
538
|
id: tc.id || '',
|
|
536
539
|
toolName: tc.function?.name || '',
|
|
@@ -552,6 +555,9 @@ class LLMClient {
|
|
|
552
555
|
if (messageData.finish_reason === 'stop' && !messageData.content) {
|
|
553
556
|
throw Error('model return empty content');
|
|
554
557
|
}
|
|
558
|
+
if (!messageData?.content && messageData.finish_reason === '') {
|
|
559
|
+
throw new Error('model return empty content with unknown finish_reason');
|
|
560
|
+
}
|
|
555
561
|
return {
|
|
556
562
|
content: messageData.content || '',
|
|
557
563
|
reasoningContent: messageData.reasoning_content || undefined,
|