@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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myassis/gateway",
3
- "version": "1.0.64",
3
+ "version": "1.0.65",
4
4
  "description": "我的助手 Gateway Service - 本地 AI 网关服务,支持认证、WebSocket 实时通信和任务调度",
5
5
  "main": "dist/index.js",
6
6
  "bin": {