@myassis/gateway 1.0.63 → 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.
@@ -48,7 +48,7 @@ class Agent {
48
48
  title: config.title || '新会话',
49
49
  selectModelId: config.selectModelId,
50
50
  agentId: this.id, // Associate with this agent
51
- useSystemMode: config.useSystemMode,
51
+ useSystemMode: config.useSystemMode ?? true,
52
52
  });
53
53
  return session;
54
54
  }
@@ -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,
@@ -477,7 +477,6 @@ class Session {
477
477
  */
478
478
  async streamChat(content, attachments = [], res, userMessageId, assistantMessageId, childAgent = false) {
479
479
  // 如果正在生成,等待当前生成完成(最多等待 2 秒)
480
- console.log('------------------------------');
481
480
  if (this.isGenerating) {
482
481
  const maxWait = 2000;
483
482
  const startTime = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myassis/gateway",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "description": "我的助手 Gateway Service - 本地 AI 网关服务,支持认证、WebSocket 实时通信和任务调度",
5
5
  "main": "dist/index.js",
6
6
  "bin": {