Skip to content

Commit

Permalink
fix: 过滤cohere模型列表非对话模型
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Nov 12, 2024
1 parent be5574a commit 568c4ee
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/buildinfo.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/agent/cohere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class Cohere implements ChatAgent {
const data = await fetch(url, {
headers: { Authorization: `Bearer ${context.COHERE_API_KEY}` },
}).then(res => res.json());
return data.models?.map((model: any) => model.name) || [];
return data.models?.filter((model: any) => model.endpoints?.includes('chat')).map((model: any) => model.name) || [];
});
};
}
2 changes: 1 addition & 1 deletion src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class WorkersConfig {
// Text-to-Image Model
WORKERS_IMAGE_MODEL = '@cf/stabilityai/stable-diffusion-xl-base-1.0';
// Workers Chat Models List
WORKERS_CHAT_MODELS_LIST = `["@cf/google/gemma-7b-it-lora", "@cf/meta/llama-2-7b-chat-fp16", "@cf/qwen/qwen1.5-14b-chat-awq"]`;
WORKERS_CHAT_MODELS_LIST = `["@cf/google/gemma-7b-it-lora", "@cf/meta/llama-2-7b-chat-fp16", "@cf/qwen/qwen1.5-14b-chat-awq", "@cf/mistral/mistral-7b-instruct-v0.1"]`;
}

// -- Gemini 配置 --
Expand Down
4 changes: 2 additions & 2 deletions src/config/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const BUILD_TIMESTAMP = 1731381631;
export const BUILD_VERSION = '41e8df5';
export const BUILD_TIMESTAMP = 1731382216;
export const BUILD_VERSION = 'be5574a';

0 comments on commit 568c4ee

Please sign in to comment.