summaryrefslogtreecommitdiff
path: root/packages/server/src/core/client.ts
diff options
context:
space:
mode:
authorAllen Hutchison <[email protected]>2025-05-14 12:37:17 -0700
committerGitHub <[email protected]>2025-05-14 12:37:17 -0700
commit1245fe488510975b774816138e4597603851415f (patch)
tree98028ef3a4bb95d55fadc602375d7f1deb551678 /packages/server/src/core/client.ts
parent1fa40405ea88dc95e0e2b3df1d63c2d7e7ddc8fb (diff)
This commit introduces the hierarchical memory feature, allowing GEMI… (#327)
Diffstat (limited to 'packages/server/src/core/client.ts')
-rw-r--r--packages/server/src/core/client.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/server/src/core/client.ts b/packages/server/src/core/client.ts
index 3b5f7a99..471944f4 100644
--- a/packages/server/src/core/client.ts
+++ b/packages/server/src/core/client.ts
@@ -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',
},