feat: 移除一些废弃逻辑

This commit is contained in:
digua
2025-12-06 13:14:20 +08:00
parent cd2dc0b8db
commit 2048d5d70d
7 changed files with 57 additions and 554 deletions

View File

@@ -507,14 +507,6 @@ interface LLMProvider {
models: Array<{ id: string; name: string; description?: string }>
}
interface LLMConfig {
provider: string
apiKey: string
apiKeySet: boolean
model?: string
maxTokens?: number
}
interface ChatMessage {
role: 'system' | 'user' | 'assistant'
content: string
@@ -650,30 +642,6 @@ const llmApi = {
return ipcRenderer.invoke('llm:hasConfig')
},
// ==================== 兼容旧 APIdeprecated====================
/**
* @deprecated 使用 getAllConfigs 代替
* 获取当前 LLM 配置
*/
getConfig: (): Promise<LLMConfig | null> => {
return ipcRenderer.invoke('llm:getConfig')
},
/**
* @deprecated 使用 addConfig 或 updateConfig 代替
* 保存 LLM 配置
*/
saveConfig: (config: {
provider: string
apiKey: string
model?: string
baseUrl?: string
maxTokens?: number
}): Promise<{ success: boolean; error?: string }> => {
return ipcRenderer.invoke('llm:saveConfig', config)
},
/**
* 发送 LLM 聊天请求(非流式)
*/