mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
This commit introduces the hierarchical memory feature, allowing GEMI… (#327)
This commit is contained in:
@@ -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',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user