import { LlmModelType } from '@/constants/knowledge'; import { useComposeLlmOptionsByModelTypes } from '@/hooks/llm-hooks'; import { Popover as AntPopover, Select as AntSelect } from 'antd'; import LlmSettingItems from '../llm-setting-items'; interface IProps { id?: string; value?: string; onInitialValue?: (value: string, option: any) => void; onChange?: (value: string, option: any) => void; disabled?: boolean; } const LLMSelect = ({ id, value, onInitialValue, onChange, disabled, }: IProps) => { const modelOptions = useComposeLlmOptionsByModelTypes([ LlmModelType.Chat, LlmModelType.Image2text, ]); if (onInitialValue && value) { for (const modelOption of modelOptions) { for (const option of modelOption.options) { if (option.value === value) { onInitialValue(value, option); break; } } } } const content = (
); return ( ); }; export default LLMSelect;