Files
ragflow/web/src/utils/llm-util.ts
balibabu ad77f504f9 Feat: Filter the agent form's large model list by type #3221 (#9049)
### What problem does this PR solve?

Feat: Filter the agent form's large model list by type #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2025-07-25 19:25:19 +08:00

25 lines
658 B
TypeScript

import { IThirdOAIModel } from '@/interfaces/database/llm';
export const getLLMIconName = (fid: string, llm_name: string) => {
if (fid === 'FastEmbed') {
return llm_name.split('/').at(0) ?? '';
}
return fid;
};
export const getLlmNameAndFIdByLlmId = (llmId?: string) => {
const [llmName, fId] = llmId?.split('@') || [];
return { fId, llmName };
};
// The names of the large models returned by the interface are similar to "deepseek-r1___OpenAI-API"
export function getRealModelName(llmName: string) {
return llmName.split('__').at(0) ?? '';
}
export function buildLlmUuid(llm: IThirdOAIModel) {
return `${llm.llm_name}@${llm.fid}`;
}