修复配置项更换大模型后提交数据重复的问题

This commit is contained in:
ruotongyu 2024-07-05 20:37:43 +08:00
parent db262c2e5e
commit ab0565b033
2 changed files with 6 additions and 4 deletions

View File

@ -27,8 +27,8 @@ export const config = {
id: 0,
options: {
initShow: true,
width: 800,
height: 650,
width: 830,
height: 670,
openDevTools: false,
frame: true,
transparent: false,

View File

@ -19,10 +19,12 @@ export function Setting(){
const onModelChange = (value: string) => {
switch (value) {
case 'openai':
form.setFieldsValue({ model: 'gpt-4-turbo', base_url:"https://api.openai.com/v1"});
form.resetFields(['llm'])
form.setFieldsValue({"llm": {model: 'gpt-4-turbo', base_url:"https://api.openai.com/v1"}});
break;
case 'ollama':
form.setFieldsValue({ model: 'ollama/llama2',api_base: "http://localhost:11434" });
form.resetFields(['llm'])
form.setFieldsValue({"llm": {model: 'ollama/llama2',api_base: "http://localhost:11434" }});
break;
default:
}