fix(provider): filter bailian do not work
This commit is contained in:
@@ -70,12 +70,17 @@ export const ProviderI18nKeyMap: Record<ProviderEnum, string> = {
|
|||||||
[ProviderEnum.ZHIPUAI]: 'ai.provider.zhipuai'
|
[ProviderEnum.ZHIPUAI]: 'ai.provider.zhipuai'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const ProviderDescriptionMap: Record<ProviderEnum, string> = {
|
||||||
|
[ProviderEnum.QWEN]: 'qwen, bailian, ali,alicloud,百炼, 阿里, 阿里云百炼'
|
||||||
|
} as Record<ProviderEnum, string>;
|
||||||
|
|
||||||
// generate provider list: {label: string;value:string}[]
|
// generate provider list: {label: string;value:string}[]
|
||||||
export const maasProviderOptions = Object.entries(ProviderEnum).map(
|
export const maasProviderOptions = Object.entries(ProviderEnum).map(
|
||||||
([key, value]) => ({
|
([key, value]) => ({
|
||||||
locale: true,
|
locale: true,
|
||||||
label: ProviderI18nKeyMap[value],
|
label: ProviderI18nKeyMap[value],
|
||||||
value: value,
|
value: value,
|
||||||
|
description: ProviderDescriptionMap[value] || '',
|
||||||
key: value
|
key: value
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -34,9 +34,11 @@ const Basic: React.FC<{
|
|||||||
};
|
};
|
||||||
|
|
||||||
const filterOption = (input: string, option?: any) => {
|
const filterOption = (input: string, option?: any) => {
|
||||||
|
console.log('filterOption input, option: ', input, option);
|
||||||
return (
|
return (
|
||||||
option?.label?.toLowerCase().includes(input.toLowerCase()) ||
|
option?.label?.toLowerCase().includes(input.toLowerCase()) ||
|
||||||
option?.value?.toLowerCase().includes(input.toLowerCase())
|
option?.value?.toLowerCase().includes(input.toLowerCase()) ||
|
||||||
|
option?.description?.toLowerCase().includes(input.toLowerCase())
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user