mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-05-06 13:06:09 +08:00
feat: 移除一些废弃逻辑
This commit is contained in:
Vendored
-22
@@ -177,16 +177,6 @@ interface AIServiceConfigDisplay {
|
||||
updatedAt: number
|
||||
}
|
||||
|
||||
// 兼容旧 API 的配置类型
|
||||
interface LLMConfig {
|
||||
provider: string
|
||||
apiKey: string
|
||||
apiKeySet: boolean
|
||||
model?: string
|
||||
baseUrl?: string
|
||||
maxTokens?: number
|
||||
}
|
||||
|
||||
interface LLMChatMessage {
|
||||
role: 'system' | 'user' | 'assistant'
|
||||
content: string
|
||||
@@ -238,18 +228,6 @@ interface LlmApi {
|
||||
validateApiKey: (provider: string, apiKey: string, baseUrl?: string, model?: string) => Promise<boolean>
|
||||
hasConfig: () => Promise<boolean>
|
||||
|
||||
// 兼容旧 API(deprecated)
|
||||
/** @deprecated 使用 getAllConfigs 代替 */
|
||||
getConfig: () => Promise<LLMConfig | null>
|
||||
/** @deprecated 使用 addConfig 或 updateConfig 代替 */
|
||||
saveConfig: (config: {
|
||||
provider: string
|
||||
apiKey: string
|
||||
model?: string
|
||||
baseUrl?: string
|
||||
maxTokens?: number
|
||||
}) => Promise<{ success: boolean; error?: string }>
|
||||
|
||||
// 聊天功能
|
||||
chat: (
|
||||
messages: LLMChatMessage[],
|
||||
|
||||
@@ -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')
|
||||
},
|
||||
|
||||
// ==================== 兼容旧 API(deprecated)====================
|
||||
|
||||
/**
|
||||
* @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 聊天请求(非流式)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user