mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 10:00:39 +00:00
fix: update zai model API and baseUrl in generate-models script
This commit is contained in:
parent
c193ef74d2
commit
93ea8298ab
1 changed files with 24 additions and 21 deletions
|
|
@ -260,28 +260,31 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
|
||||||
|
|
||||||
// Process xAi models
|
// Process xAi models
|
||||||
if (data.zai?.models) {
|
if (data.zai?.models) {
|
||||||
for (const [modelId, model] of Object.entries(data.zai.models)) {
|
for (const [modelId, model] of Object.entries(data.zai.models)) {
|
||||||
const m = model as ModelsDevModel;
|
const m = model as ModelsDevModel;
|
||||||
if (m.tool_call !== true) continue;
|
if (m.tool_call !== true) continue;
|
||||||
|
|
||||||
models.push({
|
models.push({
|
||||||
id: modelId,
|
id: modelId,
|
||||||
name: m.name || modelId,
|
name: m.name || modelId,
|
||||||
api: "anthropic-messages",
|
api: "openai-completions",
|
||||||
provider: "zai",
|
provider: "zai",
|
||||||
baseUrl: "https://api.z.ai/api/anthropic",
|
baseUrl: "https://api.z.ai/api/coding/paas/v4",
|
||||||
reasoning: m.reasoning === true,
|
reasoning: m.reasoning === true,
|
||||||
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
|
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
input: m.cost?.input || 0,
|
input: m.cost?.input || 0,
|
||||||
output: m.cost?.output || 0,
|
output: m.cost?.output || 0,
|
||||||
cacheRead: m.cost?.cache_read || 0,
|
cacheRead: m.cost?.cache_read || 0,
|
||||||
cacheWrite: m.cost?.cache_write || 0,
|
cacheWrite: m.cost?.cache_write || 0,
|
||||||
},
|
},
|
||||||
contextWindow: m.limit?.context || 4096,
|
compat: {
|
||||||
maxTokens: m.limit?.output || 4096,
|
supportsDeveloperRole: false,
|
||||||
});
|
},
|
||||||
}
|
contextWindow: m.limit?.context || 4096,
|
||||||
|
maxTokens: m.limit?.output || 4096,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process Mistral models
|
// Process Mistral models
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue