Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/memory/__tests__/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,13 +445,15 @@ describe('场景7: 记忆抽取 (Qwen)', () => {
我会在后续开发中注意这些约定。`;

const response = await client.chat.completions.create({
model: 'qwen3.5-plus',
model: process.env.MEMORY_EXTRACTION_MODEL || 'qwen3.5-flash',
messages: [
{ role: 'system', content: extractionPrompt },
{ role: 'user', content: conversation },
],
temperature: 0.1,
});
// DashScope extension: 关闭思考模式加速响应
enable_thinking: false,
} as never);

const rawContent = response.choices?.[0]?.message?.content ?? '';
console.log('\n🧠 Qwen 抽取原始输出:');
Expand Down
8 changes: 5 additions & 3 deletions src/memory/__tests__/quality.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ describe('Part 2: 抽取质量', () => {
const scorecard: { name: string; expectedCount: number; actualCount: number; typeMatch: number; keywordMatch: number }[] = [];

for (const tc of EXTRACTION_CASES) {
it(tc.name, { timeout: 120000 }, async () => {
it(tc.name, { timeout: 240000 }, async () => {
if (!HAS_KEY) {
console.log('⏭️ 跳过: 需要 DASHSCOPE_API_KEY');
return;
Expand Down Expand Up @@ -351,13 +351,15 @@ describe('Part 2: 抽取质量', () => {
`;

const response = await client.chat.completions.create({
model: 'qwen3.5-plus',
model: process.env.MEMORY_EXTRACTION_MODEL || 'qwen3.5-flash',
messages: [
{ role: 'system', content: extractionPrompt },
{ role: 'user', content: tc.conversation },
],
temperature: 0.1,
});
// DashScope extension: 关闭思考模式加速响应
enable_thinking: false,
} as never);

const rawContent = response.choices?.[0]?.message?.content ?? '';
const memories = parseExtractionResponse(rawContent);
Expand Down
4 changes: 3 additions & 1 deletion src/memory/extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export async function extractMemories(
{ role: 'user', content: conversation },
],
temperature: 0.1,
});
// DashScope extension: 记忆抽取是结构化输出任务,关闭思考模式加速响应
enable_thinking: false,
} as never);

const rawContent = response.choices?.[0]?.message?.content;
if (!rawContent) return;
Expand Down
Loading