feat: simplify the code and optimize prompts for complex tasks - #6
Merged
Conversation
interstellarmt
commented
Jul 18, 2025
Member
- simplify the code
- optimize prompts for complex tasks
…mpts for complex tasks
| 2. Second: Extract relevant technical topics and user intent for the determined library` | ||
| } | ||
|
|
||
| ## User Query |
Contributor
There was a problem hiding this comment.
提示次变化挺多的,要不详细描述一下去掉了哪些
Contributor
There was a problem hiding this comment.
我看出来 generateExamplesSection 没有了
interstellarmt
commented
Jul 18, 2025
| maxTopics: number, | ||
| libraryContext?: { id: AntVLibrary; name: string }, | ||
| ): string { | ||
| const isLibrarySpecified = !!libraryContext; |
Member
Author
There was a problem hiding this comment.
原来的分发函数太复杂了,直接在prompt里用三元表达式做处理
|
|
||
| ${outputFormatSection} | ||
|
|
||
| ## Examples |
Member
Author
There was a problem hiding this comment.
因为有format,感觉example不是很必要,反而会增加token消耗,所以去掉了
|
|
||
| **Your first task is to determine the most suitable AntV library for this query.** | ||
| // Get library-specific context if specified | ||
| const libraryContext = library |
Member
Author
There was a problem hiding this comment.
prompt里避免重复引入library name和config,直接合并了
|
|
||
| **Output the recommended library and reason before proceeding to Phase 2.**`; | ||
| } | ||
| ### Phase 1: Library Detection ${library ? '(Skipped - Library Specified)' : ''} |
Member
Author
There was a problem hiding this comment.
对于需要推断library的,直接填入Auto-detect,让大模型去推断,mcp里不写过多冗余的逻辑
|
|
||
| function generateExtractionRulesSection( | ||
| maxTopics: number, | ||
| libraryContext?: { id: AntVLibrary; name: string }, |
Member
Author
There was a problem hiding this comment.
推断 library 的冗余提示词
Member
|
删代码,赞👍🏻~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.