From 230a183b1c44475cfbcfe9d6891b68b0bbdd4355 Mon Sep 17 00:00:00 2001 From: tangying1027 <370064808@qq.com> Date: Wed, 23 Jul 2025 10:59:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=85codeStyle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tools/query_antv_document.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/tools/query_antv_document.ts b/src/tools/query_antv_document.ts index 8b4daa2..96ab328 100644 --- a/src/tools/query_antv_document.ts +++ b/src/tools/query_antv_document.ts @@ -129,7 +129,7 @@ async function handleComplexTask( response += `- Check the official ${libraryConfig.name} documentation directly\n\n`; } - response += generateImplementationGuidance(args.intent); + response += generateImplementationGuidance(args.intent, args.library); response += generateFollowUpNotice(); return { response, hasDocumentation }; @@ -160,13 +160,16 @@ function generateSimpleResponse( response += `**User Question**: ${args.query}\n`; response += `**Search Topic**: ${args.topic}\n`; response += `${documentation}\n\n`; - response += generateImplementationGuidance(args.intent); + response += generateImplementationGuidance(args.intent, args.library); response += generateFollowUpNotice(); return response; } -function generateImplementationGuidance(intent: string): string { +function generateImplementationGuidance( + intent: string, + library: AntVLibrary, +): string { switch (intent) { case 'learn': return ( @@ -177,9 +180,12 @@ function generateImplementationGuidance(intent: string): string { ); case 'implement': + const config = getLibraryConfig(library); + return ( `## 🛠️ Implementation Guide\n\n` + `- Follow the code examples and patterns shown above\n` + + ` ${config.codeStyle}\n` + `- Pay attention to required vs optional parameters\n` + `- Test with simple data first, then use your real data\n` + `- Check browser console for any errors during development\n\n`