claudish 4.6.6 → 4.6.7
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 +26 -3
- package/package.json +1 -1
- package/recommended-models.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33192,7 +33192,7 @@ var getRemoteProviders = () => [
|
|
|
33192
33192
|
prefixes: ["gc/"],
|
|
33193
33193
|
capabilities: {
|
|
33194
33194
|
supportsTools: true,
|
|
33195
|
-
supportsVision:
|
|
33195
|
+
supportsVision: false,
|
|
33196
33196
|
supportsStreaming: true,
|
|
33197
33197
|
supportsJsonMode: true,
|
|
33198
33198
|
supportsReasoning: true
|
|
@@ -34890,7 +34890,7 @@ async function fetchGLMCodingModels2() {
|
|
|
34890
34890
|
return [];
|
|
34891
34891
|
}
|
|
34892
34892
|
}
|
|
34893
|
-
var __filename5, __dirname5, VERSION = "4.6.
|
|
34893
|
+
var __filename5, __dirname5, VERSION = "4.6.7", CACHE_MAX_AGE_DAYS3 = 2, MODELS_JSON_PATH, CLAUDISH_CACHE_DIR3, ALL_MODELS_JSON_PATH2;
|
|
34894
34894
|
var init_cli = __esm(() => {
|
|
34895
34895
|
init_config();
|
|
34896
34896
|
init_model_loader();
|
|
@@ -62704,9 +62704,32 @@ class OpenAIHandler {
|
|
|
62704
62704
|
this.sessionTotalCost += cost;
|
|
62705
62705
|
this.writeTokenFile(Math.max(inputTokens, this.sessionInputTokens), this.sessionOutputTokens, pricing.isEstimate);
|
|
62706
62706
|
}
|
|
62707
|
+
supportsVision() {
|
|
62708
|
+
if (this.provider.capabilities && !this.provider.capabilities.supportsVision) {
|
|
62709
|
+
return false;
|
|
62710
|
+
}
|
|
62711
|
+
const model = this.modelName.toLowerCase();
|
|
62712
|
+
if (model.startsWith("glm-") && !/\d+\.?\d*v/.test(model)) {
|
|
62713
|
+
return false;
|
|
62714
|
+
}
|
|
62715
|
+
return true;
|
|
62716
|
+
}
|
|
62707
62717
|
convertMessages(claudeRequest) {
|
|
62708
62718
|
const useSimpleFormat = this.provider.name === "ollamacloud";
|
|
62709
|
-
|
|
62719
|
+
const messages = convertMessagesToOpenAI(claudeRequest, `openai/${this.modelName}`, filterIdentity, useSimpleFormat);
|
|
62720
|
+
if (!this.supportsVision()) {
|
|
62721
|
+
for (const msg of messages) {
|
|
62722
|
+
if (Array.isArray(msg.content)) {
|
|
62723
|
+
msg.content = msg.content.filter((part) => part.type !== "image_url");
|
|
62724
|
+
if (msg.content.length === 1 && msg.content[0].type === "text") {
|
|
62725
|
+
msg.content = msg.content[0].text;
|
|
62726
|
+
} else if (msg.content.length === 0) {
|
|
62727
|
+
msg.content = "";
|
|
62728
|
+
}
|
|
62729
|
+
}
|
|
62730
|
+
}
|
|
62731
|
+
}
|
|
62732
|
+
return messages;
|
|
62710
62733
|
}
|
|
62711
62734
|
convertTools(claudeRequest) {
|
|
62712
62735
|
return convertToolsToOpenAI(claudeRequest);
|
package/package.json
CHANGED