mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-13 19:20:04 +00:00
🔨 chore(memory-user-memory): add benchmark agent config (#14779)
This commit is contained in:
@@ -46,6 +46,7 @@ export type MemoryLayerExtractorConfig = MemoryLayerExtractorPublicConfig &
|
||||
};
|
||||
|
||||
export interface MemoryExtractionPrivateConfig {
|
||||
agentBenchmarkLoCoMo: MemoryAgentConfig;
|
||||
agentGateKeeper: MemoryAgentConfig;
|
||||
agentGateKeeperPreferredModels?: string[];
|
||||
agentGateKeeperPreferredProviders?: string[];
|
||||
@@ -94,6 +95,22 @@ const parseGateKeeperAgent = (): MemoryAgentConfig => {
|
||||
};
|
||||
};
|
||||
|
||||
const parseBenchmarkLoCoMoAgent = (fallback: MemoryAgentConfig): MemoryAgentConfig => {
|
||||
const model = process.env.MEMORY_USER_MEMORY_BENCHMARK_LOCOMO_AGENT_MODEL || fallback.model;
|
||||
const provider =
|
||||
process.env.MEMORY_USER_MEMORY_BENCHMARK_LOCOMO_AGENT_PROVIDER ||
|
||||
fallback.provider ||
|
||||
DEFAULT_MINI_PROVIDER;
|
||||
|
||||
return {
|
||||
apiKey: process.env.MEMORY_USER_MEMORY_BENCHMARK_LOCOMO_AGENT_API_KEY ?? fallback.apiKey,
|
||||
baseURL: process.env.MEMORY_USER_MEMORY_BENCHMARK_LOCOMO_AGENT_BASE_URL ?? fallback.baseURL,
|
||||
language: process.env.MEMORY_USER_MEMORY_BENCHMARK_LOCOMO_AGENT_LANGUAGE ?? fallback.language,
|
||||
model,
|
||||
provider,
|
||||
};
|
||||
};
|
||||
|
||||
const parseLayerExtractorAgent = (fallbackModel: string): MemoryLayerExtractorConfig => {
|
||||
const apiKey = process.env.MEMORY_USER_MEMORY_LAYER_EXTRACTOR_API_KEY;
|
||||
const baseURL = process.env.MEMORY_USER_MEMORY_LAYER_EXTRACTOR_BASE_URL;
|
||||
@@ -214,6 +231,7 @@ const parsePreferredList = (value?: string) =>
|
||||
|
||||
export const parseMemoryExtractionConfig = (): MemoryExtractionPrivateConfig => {
|
||||
const agentGateKeeper = parseGateKeeperAgent();
|
||||
const agentBenchmarkLoCoMo = parseBenchmarkLoCoMoAgent(agentGateKeeper);
|
||||
const agentLayerExtractor = parseLayerExtractorAgent(agentGateKeeper.model);
|
||||
const agentPersonaWriter = parsePersonaWriterAgent(agentGateKeeper.model);
|
||||
const embedding = parseEmbeddingAgent(
|
||||
@@ -279,6 +297,7 @@ export const parseMemoryExtractionConfig = (): MemoryExtractionPrivateConfig =>
|
||||
);
|
||||
|
||||
return {
|
||||
agentBenchmarkLoCoMo,
|
||||
agentGateKeeper,
|
||||
agentGateKeeperPreferredModels,
|
||||
agentGateKeeperPreferredProviders,
|
||||
|
||||
Reference in New Issue
Block a user