claudish 3.2.1 → 3.2.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/index.js +9 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -61971,15 +61971,23 @@ class OpenAIHandler {
|
|
|
61971
61971
|
const model = this.modelName.toLowerCase();
|
|
61972
61972
|
return model.includes("o1") || model.includes("o3");
|
|
61973
61973
|
}
|
|
61974
|
+
usesMaxCompletionTokens() {
|
|
61975
|
+
const model = this.modelName.toLowerCase();
|
|
61976
|
+
return model.includes("gpt-5") || model.includes("o1") || model.includes("o3") || model.includes("o4");
|
|
61977
|
+
}
|
|
61974
61978
|
buildOpenAIPayload(claudeRequest, messages, tools) {
|
|
61975
61979
|
const payload = {
|
|
61976
61980
|
model: this.modelName,
|
|
61977
61981
|
messages,
|
|
61978
61982
|
temperature: claudeRequest.temperature ?? 1,
|
|
61979
61983
|
stream: true,
|
|
61980
|
-
max_tokens: claudeRequest.max_tokens,
|
|
61981
61984
|
stream_options: { include_usage: true }
|
|
61982
61985
|
};
|
|
61986
|
+
if (this.usesMaxCompletionTokens()) {
|
|
61987
|
+
payload.max_completion_tokens = claudeRequest.max_tokens;
|
|
61988
|
+
} else {
|
|
61989
|
+
payload.max_tokens = claudeRequest.max_tokens;
|
|
61990
|
+
}
|
|
61983
61991
|
if (tools.length > 0) {
|
|
61984
61992
|
payload.tools = tools;
|
|
61985
61993
|
}
|