This commit is contained in:
lychang
2026-05-21 11:50:39 +08:00
parent 4073fe7ead
commit 54438f40ad
3 changed files with 38 additions and 83 deletions

View File

@@ -317,15 +317,16 @@
<label for="llmProviderSelect">Provider:</label>
<select id="llmProviderSelect">
<option value="default">default</option>
<option value="ollama">Ollama</option>
<option value="openai">OpenAI</option>
</select>
<label for="llmBaseUrlInput">Base URL:</label>
<input type="text" id="llmBaseUrlInput" placeholder="输入API基础URL" value="http://localhost:11434">
<input type="text" id="llmBaseUrlInput" placeholder="https://api.deepseek.com" value="">
<label for="llmModelInput">Model:</label>
<input type="text" id="llmModelInput" placeholder="输入模型名称" value="qwen3.5:9b">
<input type="text" id="llmModelInput" placeholder="deepseek-v4-flash" value="">
<label for="llmApiKeyInput">API Key:</label>
<input type="password" id="llmApiKeyInput" placeholder="输入API密钥(如果需要)">
@@ -897,13 +898,13 @@
try {
const config = JSON.parse(savedConfig);
if (document.getElementById('llmProviderSelect')) {
document.getElementById('llmProviderSelect').value = config.provider || 'ollama';
document.getElementById('llmProviderSelect').value = config.provider || 'default';
}
if (document.getElementById('llmBaseUrlInput')) {
document.getElementById('llmBaseUrlInput').value = config.base_url || 'http://localhost:11434';
document.getElementById('llmBaseUrlInput').value = config.base_url || '';
}
if (document.getElementById('llmModelInput')) {
document.getElementById('llmModelInput').value = config.model || 'qwen3.5:9b';
document.getElementById('llmModelInput').value = config.model || '';
}
if (document.getElementById('llmApiKeyInput')) {
document.getElementById('llmApiKeyInput').value = config.api_key || '';
@@ -932,9 +933,9 @@
// 返回默认配置
return {
provider: 'ollama',
base_url: 'http://localhost:11434',
model: 'qwen3.5:9b',
provider: 'default',
base_url: '',
model: '',
api_key: ''
};
}