瀏覽代碼

fix: Add model by ollama in model provider page, user can't choose the model in chat window. #2479 (#2529)

### What problem does this PR solve?

fix: Add model by ollama in model provider page, user can't choose the
model in chat window. #2479

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.12.0
balibabu 1 年之前
父節點
當前提交
f6ceb43e36
No account linked to committer's email address
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 8
    0
      web/src/components/llm-select/index.tsx
  2. 1
    1
      web/src/hooks/llm-hooks.ts

+ 8
- 0
web/src/components/llm-select/index.tsx 查看文件

import { LlmModelType } from '@/constants/knowledge';
import { useSelectLlmOptionsByModelType } from '@/hooks/llm-hooks';
import { Popover, Select } from 'antd'; import { Popover, Select } from 'antd';
import LlmSettingItems from '../llm-setting-items'; import LlmSettingItems from '../llm-setting-items';


} }


const LLMSelect = ({ id, value, onChange }: IProps) => { const LLMSelect = ({ id, value, onChange }: IProps) => {
const modelOptions = useSelectLlmOptionsByModelType();

const content = ( const content = (
<div style={{ width: 400 }}> <div style={{ width: 400 }}>
<LlmSettingItems <LlmSettingItems
destroyTooltipOnHide destroyTooltipOnHide
> >
<Select <Select
options={[
...modelOptions[LlmModelType.Chat],
...modelOptions[LlmModelType.Image2text],
]}
style={{ width: '100%' }} style={{ width: '100%' }}
dropdownStyle={{ display: 'none' }} dropdownStyle={{ display: 'none' }}
id={id} id={id}

+ 1
- 1
web/src/hooks/llm-hooks.ts 查看文件

) )
.map((x) => ({ .map((x) => ({
label: x.llm_name, label: x.llm_name,
value: x.llm_name,
value: `${x.llm_name}@${x.fid}`,
disabled: !x.available, disabled: !x.available,
})), })),
}; };

Loading…
取消
儲存