mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
feat(ai): link memories to source messages
This commit is contained in:
1 parent
cc240c85f5
commit
f4017b0adf
34 files changed
+1278
-72
No files matched your search
@@ -160,6 +160,7 @@ export function createCliRunAgentStream(
|
||||
maxToolResultTokens: resolveCrossChatToolResultTokenBudget(contextWindow),
|
||||
memoryService: options.memoryService,
|
||||
aiChatId,
|
||||
reportMemoryChange: (memoryId) => onEvent({ type: 'memory_change', memoryId }),
|
||||
})
|
||||
await runCrossChatAgent({
|
||||
userMessage,
|
||||
|
||||
@@ -23,6 +23,7 @@ export function createCliCrossChatTools(options: {
|
||||
maxToolResultTokens: number
|
||||
memoryService: AIMemoryService
|
||||
aiChatId: string
|
||||
reportMemoryChange?: (memoryId: string) => void
|
||||
}): AgentTool<any, any>[] {
|
||||
const context: Omit<CrossChatToolExecutionContext, 'abortSignal' | 'reportProgress'> = {
|
||||
locale: options.locale,
|
||||
@@ -30,6 +31,7 @@ export function createCliCrossChatTools(options: {
|
||||
analysisService: options.analysisService,
|
||||
memoryService: options.memoryService,
|
||||
aiChatId: options.aiChatId,
|
||||
reportMemoryChange: options.reportMemoryChange,
|
||||
maxToolResultTokens: options.maxToolResultTokens,
|
||||
countTokens,
|
||||
preprocessMessagesBySession: (sessionId, messages) =>
|
||||
|
||||
@@ -155,6 +155,7 @@ export function createElectronRunAgentStream(
|
||||
maxToolResultTokens: resolveCrossChatToolResultTokenBudget(resolvedContextWindow),
|
||||
memoryService: crossChatOptions.memoryService,
|
||||
aiChatId,
|
||||
reportMemoryChange: (memoryId) => onEvent({ type: 'memory_change', memoryId }),
|
||||
})
|
||||
await runCrossChatAgent({
|
||||
userMessage,
|
||||
|
||||
@@ -23,6 +23,7 @@ export function createElectronCrossChatTools(options: {
|
||||
maxToolResultTokens: number
|
||||
memoryService: AIMemoryService
|
||||
aiChatId: string
|
||||
reportMemoryChange?: (memoryId: string) => void
|
||||
}): AgentTool<any, any>[] {
|
||||
const context: Omit<CrossChatToolExecutionContext, 'abortSignal' | 'reportProgress'> = {
|
||||
locale: options.locale,
|
||||
@@ -30,6 +31,7 @@ export function createElectronCrossChatTools(options: {
|
||||
analysisService: options.analysisService,
|
||||
memoryService: options.memoryService,
|
||||
aiChatId: options.aiChatId,
|
||||
reportMemoryChange: options.reportMemoryChange,
|
||||
maxToolResultTokens: options.maxToolResultTokens,
|
||||
countTokens,
|
||||
preprocessMessagesBySession: (sessionId, messages) =>
|
||||
|
||||
Reference in new issue
Block a user