companionbot 0.13.0 → 0.13.1
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 +5 -11
- package/package.json +1 -1
package/dist/ai/claude.js
CHANGED
|
@@ -86,7 +86,8 @@ export function calculateTokenBudgets(modelId, thinkingLevel, inputTokens) {
|
|
|
86
86
|
}
|
|
87
87
|
return { maxTokens, thinkingBudget };
|
|
88
88
|
}
|
|
89
|
-
export async function chat(messages, systemPrompt, modelId = "sonnet",
|
|
89
|
+
export async function chat(messages, systemPrompt, modelId = "sonnet", _thinkingLevel // 사용 안 함 (non-streaming에서 에러 발생)
|
|
90
|
+
) {
|
|
90
91
|
const client = getClient();
|
|
91
92
|
const modelConfig = MODELS[modelId];
|
|
92
93
|
const toolsUsed = [];
|
|
@@ -111,10 +112,10 @@ export async function chat(messages, systemPrompt, modelId = "sonnet", thinkingL
|
|
|
111
112
|
}
|
|
112
113
|
return total;
|
|
113
114
|
};
|
|
114
|
-
//
|
|
115
|
+
// 토큰 계산 (thinking 비활성화 - non-streaming에서 에러 발생)
|
|
115
116
|
const inputTokens = estimateInputTokens();
|
|
116
|
-
const
|
|
117
|
-
console.log(`[Chat] model=${modelId},
|
|
117
|
+
const maxTokens = 8192;
|
|
118
|
+
console.log(`[Chat] model=${modelId}, input~${inputTokens}, maxTokens=${maxTokens}`);
|
|
118
119
|
// API 요청 파라미터 빌드 (도구 루프에서도 동일하게 사용)
|
|
119
120
|
const buildRequestParams = () => {
|
|
120
121
|
const params = {
|
|
@@ -126,13 +127,6 @@ export async function chat(messages, systemPrompt, modelId = "sonnet", thinkingL
|
|
|
126
127
|
if (systemPrompt) {
|
|
127
128
|
params.system = systemPrompt;
|
|
128
129
|
}
|
|
129
|
-
// thinking 활성화 (budget > 0인 경우)
|
|
130
|
-
if (thinkingBudget > 0) {
|
|
131
|
-
params.thinking = {
|
|
132
|
-
type: "enabled",
|
|
133
|
-
budget_tokens: thinkingBudget,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
130
|
return params;
|
|
137
131
|
};
|
|
138
132
|
let response;
|