fix issue#7 问题2

This commit is contained in:
锦恢 2025-04-18 19:08:57 +08:00
parent 96772ad422
commit b1a083dcd4
5 changed files with 75 additions and 6 deletions

View File

@ -1,5 +1,9 @@
# Change Log
## [main] 0.0.4
- 修复选择模型后点击确认跳转回 deepseek 的 bug
## [main] 0.0.3
- 增加每一条信息的成本统计信息

View File

@ -35,9 +35,9 @@
## TODO
- [x] 完成最基本的各类基础设施
- [ ] chat 模式下支持进行成本分析
- [x] chat 模式下支持进行成本分析
- [ ] 支持同时调试多个 MCP Server
- [ ] 支持通过大模型进行在线验证
- [x] 支持通过大模型进行在线验证
- [ ] 支持 completion/complete 协议字段
- [x] 支持 对用户对应服务器的调试工作内容进行保存
- [ ] 高危操作权限确认

View File

@ -130,6 +130,7 @@ import { allTools, ChatSetting, ChatStorage, getToolSchema } from './chat';
import { useMessageBridge } from '@/api/message-bridge';
import { CasualRestAPI, ToolItem, ToolsListResponse } from '@/hook/type';
import { markdownToHtml } from './markdown';
import { saveSetting } from '@/hook/setting';
const props = defineProps({
tabId: {
@ -174,7 +175,9 @@ if (!tabStorage.settings) {
} as ChatSetting;
}
const selectedModelIndex = ref(llmManager.currentModelIndex);
// 使
const currentModel = llms[llmManager.currentModelIndex].userModel;
const selectedModelIndex = ref(llms[llmManager.currentModelIndex].models.indexOf(currentModel));
const availableModels = computed(() => {
return llms[llmManager.currentModelIndex].models;
@ -203,13 +206,13 @@ const toggleWebSearch = () => {
};
const confirmModelChange = () => {
llmManager.currentModelIndex = selectedModelIndex.value;
showModelDialog.value = false;
};
const onRadioGroupChange = () => {
const currentModel = llms[llmManager.currentModelIndex].models[selectedModelIndex.value];
llms[llmManager.currentModelIndex].userModel = currentModel;
saveSetting();
};
const bridge = useMessageBridge();

View File

@ -10,4 +10,5 @@ export const llmManager = reactive({
export function onmodelchange() {
pinkLog('切换模型到:' + llms[llmManager.currentModelIndex].id);
saveSetting();
}

View File

@ -1,4 +1,65 @@
{
"tabs": [],
"currentIndex": -1
"currentIndex": 0,
"tabs": [
{
"name": "交互测试",
"icon": "icon-robot",
"type": "blank",
"componentIndex": 3,
"storage": {
"messages": [
{
"role": "user",
"content": "float 9.9 and float 9.11, which one is bigger",
"extraInfo": {
"created": 1744971603852,
"serverName": "openai"
}
},
{
"role": "assistant",
"content": "错误: OpenAI API error: 401 Incorrect API key provided: AK-e5ecb***************************1f37. You can find your API key at https://platform.openai.com/account/api-keys.",
"extraInfo": {
"created": 1744971604583,
"serverName": "openai"
}
}
],
"settings": {
"modelIndex": 0,
"enableTools": [
{
"name": "add",
"description": "对两个数字进行实数域的加法",
"enabled": true
},
{
"name": "multiply",
"description": "对两个数字进行实数域的乘法运算",
"enabled": true
},
{
"name": "is_even",
"description": "判断一个整数是否为偶数",
"enabled": true
},
{
"name": "capitalize",
"description": "将字符串首字母大写",
"enabled": true
},
{
"name": "get_weather_by_city_code",
"description": "根据城市天气预报的城市编码 (int),获取指定城市的天气信息",
"enabled": true
}
],
"enableWebSearch": false,
"temperature": 0.7,
"contextLength": 10,
"systemPrompt": ""
}
}
}
]
}