summaryrefslogtreecommitdiff
path: root/packages/server/src/core/client.ts
diff options
context:
space:
mode:
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',
},