mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-05-28 10:13:10 +08:00
feat: debug_context 记录完整 LLM 上下文
This commit is contained in:
@@ -41,7 +41,7 @@ export type ContentBlock =
|
||||
}
|
||||
| { type: 'skill'; skillId: string; skillName: string }
|
||||
|
||||
export type AIMessageRole = 'user' | 'assistant' | 'system'
|
||||
export type AIMessageRole = 'user' | 'assistant' | 'summary'
|
||||
|
||||
export interface TokenUsageData {
|
||||
promptTokens: number
|
||||
@@ -541,6 +541,13 @@ export const aiApi = {
|
||||
return ipcRenderer.invoke('ai:showLogFile')
|
||||
},
|
||||
|
||||
/**
|
||||
* 一键清除所有消息的 debug_context 数据
|
||||
*/
|
||||
clearDebugContext: (): Promise<{ success: boolean; cleared: number }> => {
|
||||
return ipcRenderer.invoke('ai:clearDebugContext')
|
||||
},
|
||||
|
||||
getDefaultDesensitizeRules: (locale: string): Promise<DesensitizeRule[]> => {
|
||||
return ipcRenderer.invoke('ai:getDefaultDesensitizeRules', locale)
|
||||
},
|
||||
|
||||
Vendored
+2
-1
@@ -310,7 +310,7 @@ type AIContentBlock =
|
||||
compressedMessageCount: number
|
||||
}
|
||||
|
||||
type AIMessageRole = 'user' | 'assistant' | 'system'
|
||||
type AIMessageRole = 'user' | 'assistant' | 'summary'
|
||||
|
||||
interface AITokenUsageData {
|
||||
promptTokens: number
|
||||
@@ -396,6 +396,7 @@ interface AiApi {
|
||||
getConversationTokenUsage: (conversationId: string) => Promise<AITokenUsageData>
|
||||
deleteMessage: (messageId: string) => Promise<boolean>
|
||||
showAiLogFile: () => Promise<{ success: boolean; path?: string; error?: string }>
|
||||
clearDebugContext: () => Promise<{ success: boolean; cleared: number }>
|
||||
getDefaultDesensitizeRules: (locale: string) => Promise<DesensitizeRule[]>
|
||||
mergeDesensitizeRules: (existingRules: DesensitizeRule[], locale: string) => Promise<DesensitizeRule[]>
|
||||
getToolCatalog: () => Promise<ToolCatalogEntry[]>
|
||||
|
||||
Reference in New Issue
Block a user