mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
feat(ai): rank private contacts globally
This commit is contained in:
1 parent
3b50a722c9
commit
6d64333675
19 files changed
+528
-6
No files matched your search
@@ -25,6 +25,7 @@ import {
|
||||
createContactsService,
|
||||
createCrossChatAnalysisService,
|
||||
createDatabaseManagerAdapter,
|
||||
PreferencesManager,
|
||||
} from '@openchatlab/node-runtime'
|
||||
import type { SemanticIndexRuntime } from '@openchatlab/node-runtime'
|
||||
import { createServer } from './server'
|
||||
@@ -146,9 +147,11 @@ export async function startHttpServer(options?: HttpServerOptions): Promise<{
|
||||
runtimeIdentity: runtime,
|
||||
nativeBinding,
|
||||
})
|
||||
const preferencesManager = new PreferencesManager(pathProvider.getSystemDir())
|
||||
const crossChatAnalysisService = createCrossChatAnalysisService({
|
||||
adapter: sessionAdapter,
|
||||
contactsService,
|
||||
getExcludedSessionIds: () => preferencesManager.load().ownerExcludedSessionIds,
|
||||
})
|
||||
|
||||
const aiDataDir = pathProvider.getAiDataDir()
|
||||
@@ -200,6 +203,7 @@ export async function startHttpServer(options?: HttpServerOptions): Promise<{
|
||||
nativeBinding,
|
||||
runtimeIdentity: runtime,
|
||||
contactsService,
|
||||
preferencesManager,
|
||||
semanticIndexService,
|
||||
aiContext: {
|
||||
aiDataDir,
|
||||
|
||||
@@ -30,6 +30,7 @@ import type {
|
||||
CustomProviderStore,
|
||||
CustomModelStore,
|
||||
ContactsService,
|
||||
PreferencesManager,
|
||||
PendingDataDirMigration,
|
||||
RuntimeIdentity,
|
||||
} from '@openchatlab/node-runtime'
|
||||
@@ -73,6 +74,7 @@ export function registerWebRoutes(
|
||||
nativeBinding?: string
|
||||
runtimeIdentity?: RuntimeIdentity
|
||||
contactsService?: ContactsService
|
||||
preferencesManager?: PreferencesManager
|
||||
aiContext?: AiContextOptions
|
||||
/** 由 server 入口注入的共享语义索引运行时;传入时由调用方管理生命周期 */
|
||||
semanticIndexService?: SemanticIndexRuntime
|
||||
@@ -135,6 +137,7 @@ export function registerWebRoutes(
|
||||
nativeBinding: options?.nativeBinding,
|
||||
semanticIndexService,
|
||||
contactsService: options?.contactsService,
|
||||
preferencesManager: options?.preferencesManager,
|
||||
analyticsService,
|
||||
getCurrentAiLogPath: () => getServerAiLogger()?.getExistingLogPath() ?? null,
|
||||
openDirectory: openDirectoryPath,
|
||||
|
||||
Reference in new issue
Block a user