fix(web): filter vision models for image2text and cleanup tool management
- Add vision capability filter for image2text model options in CreateModal - Filter model options to only include models with 'vision' capability when type is 'image2text' - Remove outdated file header comments from ToolManagement component - Comment out 'market' tab from tabKeys array in ToolManagement - Ensure image2text tool only displays compatible vision-capable models
This commit is contained in:
@@ -672,9 +672,17 @@ const CreateModal = forwardRef<CreateModalRef, CreateModalRefProps>(({
|
||||
{currentType !== 'Folder' && dynamicTypeList.map((tp) => {
|
||||
const fieldKey = typeToFieldKey(tp);
|
||||
// When tp is 'llm', merge llm and chat options
|
||||
const options = tp.toLowerCase() === 'llm' || tp.toLowerCase() === 'image2text'
|
||||
let options = tp.toLowerCase() === 'llm' || tp.toLowerCase() === 'image2text'
|
||||
? [...(modelOptionsByType['llm'] || []), ...(modelOptionsByType['chat'] || [])]
|
||||
: modelOptionsByType[tp] || [];
|
||||
|
||||
// When tp is 'image2text', filter to only include models with 'vision' capability
|
||||
if (tp.toLowerCase() === 'image2text') {
|
||||
options = options.filter((opt: any) => {
|
||||
const model = models?.items?.find((m: any) => m.id === opt.value);
|
||||
return model?.capability?.includes('vision');
|
||||
});
|
||||
}
|
||||
return (
|
||||
<Form.Item
|
||||
key={tp}
|
||||
|
||||
Reference in New Issue
Block a user