This commit introduces the hierarchical memory feature, allowing GEMI… (#327)

This commit is contained in:
Allen Hutchison
2025-05-14 12:37:17 -07:00
committed by GitHub
parent 1fa40405ea
commit 1245fe4885
16 changed files with 2047 additions and 73 deletions

View File

@@ -124,10 +124,13 @@ export class GeminiClient {
},
];
try {
const userMemory = this.config.getUserMemory();
const systemInstruction = getCoreSystemPrompt(userMemory);
return this.client.chats.create({
model: this.model,
config: {
systemInstruction: getCoreSystemPrompt(),
systemInstruction,
...this.generateContentConfig,
tools,
},
@@ -197,15 +200,18 @@ export class GeminiClient {
config: GenerateContentConfig = {},
): Promise<Record<string, unknown>> {
try {
const userMemory = this.config.getUserMemory();
const systemInstruction = getCoreSystemPrompt(userMemory);
const requestConfig = {
...this.generateContentConfig,
...config,
};
const result = await this.client.models.generateContent({
model,
config: {
...requestConfig,
systemInstruction: getCoreSystemPrompt(),
systemInstruction,
responseSchema: schema,
responseMimeType: 'application/json',
},