/** * multi-models selector */ import { ChatContext } from '@/app/chat-context'; import { MODEL_ICON_MAP } from '@/utils/constants'; import { Select } from 'antd'; import Image from 'next/image'; import { useContext } from 'react'; import { useTranslation } from 'react-i18next'; interface Props { onChange?: (model: string) => void; } const DEFAULT_ICON_URL = '/models/huggingface.svg'; export function renderModelIcon(model?: string, props?: { width: number; height: number }) { const { width, height } = props || {}; if (!model) return null; return ( llm ); } function ModelSelector({ onChange }: Props) { const { t } = useTranslation(); const { modelList, model } = useContext(ChatContext); if (!modelList || modelList.length <= 0) { return null; } return ( ); } export default ModelSelector;