companionbot 0.12.1 → 0.12.2
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/ai/claude.js +4 -3
- package/package.json +1 -1
package/dist/ai/claude.js
CHANGED
|
@@ -307,7 +307,8 @@ export async function chatSmart(messages, systemPrompt, modelId, thinkingLevel =
|
|
|
307
307
|
console.warn("[Stream] Tool start callback error (ignored):", err);
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
|
|
310
|
+
// 도구 사용 시 thinking 비활성화 (API 에러 방지)
|
|
311
|
+
const result = await chat(messages, systemPrompt, modelId, "off");
|
|
311
312
|
return { text: result.text, usedTools: true, toolsUsed: result.toolsUsed };
|
|
312
313
|
}
|
|
313
314
|
// 성공적으로 스트리밍 완료
|
|
@@ -320,8 +321,8 @@ export async function chatSmart(messages, systemPrompt, modelId, thinkingLevel =
|
|
|
320
321
|
if (error.status === 429 || error.status >= 500) {
|
|
321
322
|
console.log(`[Stream] Pre-stream error (${error.status}), retrying with withRetry...`);
|
|
322
323
|
return await withRetry(async () => {
|
|
323
|
-
// 재시도 시 일반 chat 사용 (스트리밍
|
|
324
|
-
const result = await chat(messages, systemPrompt, modelId,
|
|
324
|
+
// 재시도 시 일반 chat 사용 (스트리밍 대신, thinking 비활성화)
|
|
325
|
+
const result = await chat(messages, systemPrompt, modelId, "off");
|
|
325
326
|
return { text: result.text, usedTools: false, toolsUsed: result.toolsUsed };
|
|
326
327
|
});
|
|
327
328
|
}
|