✨ Feature: Recommend and prefill bound NL2Agent tools - #3783
Open
RedShakespeare wants to merge 5 commits into
Open
✨ Feature: Recommend and prefill bound NL2Agent tools#3783RedShakespeare wants to merge 5 commits into
RedShakespeare wants to merge 5 commits into
Conversation
RedShakespeare
requested review from
Dallas98,
WMC001 and
jeffwu-1999
as code owners
August 26, 2026 06:38
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
xuyaqist
reviewed
Aug 26, 2026
xuyaqist
reviewed
Aug 26, 2026
xuyaqist
reviewed
Aug 26, 2026
Comment on lines
+396
to
+425
| def _normalize_nl2agent_tool_config( | ||
| *, | ||
| tool_name: str, | ||
| params: Any, | ||
| ) -> list[dict[str, Any]]: | ||
| config = _normalize_tool_config(params) | ||
| if tool_name != "knowledge_base_search": | ||
| return config | ||
|
|
||
| index_names = next( | ||
| (param for param in config if param["name"] == "index_names"), | ||
| None, | ||
| ) | ||
| if index_names is None: | ||
| config.append( | ||
| { | ||
| "name": "index_names", | ||
| "type": "array", | ||
| "required": True, | ||
| "value": [], | ||
| "description": "The list of index names to search", | ||
| "description_zh": "要索引的知识库", | ||
| } | ||
| ) | ||
| else: | ||
| index_names["type"] = "array" | ||
| index_names["required"] = True | ||
| if not isinstance(index_names.get("value"), list): | ||
| index_names["value"] = [] | ||
| return config |
Contributor
There was a problem hiding this comment.
为什么这里要单独判断?这个工具和其他工具没有区别,用户选择某个知识库=用户向input框里填入一些参数,无论对于哪个工具,对params的操作都是一样的?
Contributor
|
效果要求:如果用户预先自己已经绑定一些tool,然后在nl2agent的过程中,推荐工具的时候,要知道哪些已经绑定过,要有个已绑定的标识。并且点击配置的时候,能够看到之前用户绑定工具的配置,用户可以修改。数据库始终只有一条数据。 |
RedShakespeare
force-pushed
the
dyx/nl2a-kb
branch
from
August 26, 2026 09:32
7602e4f to
72529c1
Compare
xuyaqist
approved these changes
Aug 26, 2026
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.
Summary
Enable NL2Agent to recommend already-bound Tools again and restore their current configuration in the installed-resource binding card.
This change also exposes
knowledge_base_searchspecifically to NL2Agent resource discovery and requires users to select an accessible knowledge base before confirming the binding.What changed
Support knowledge base search in NL2Agent
knowledge_base_searchto participate in NL2Agent installed-resource search even though it is not globally user-selectable.aidp_search, hidden.index_namesas a required array configuration field.knowledge_base_searchout of the ordinary Tool binding list on the right side.Re-recommend already-bound Tools
knowledge_base_searchto be recommended again.Restore existing configuration
knowledge_base_search.Update NL2Agent orchestration
bound_resources.Why
NL2Agent previously hid
knowledge_base_searchand could discard Tools that were already bound to the Agent. Users therefore could not reliably add knowledge base retrieval through the conversation or review and update an existing Tool configuration.This change lets users confirm or revise existing bindings while preserving the distinction between the dedicated Knowledge Base configuration and the ordinary Tool list.
Impact
knowledge_base_search.Validation
index_namesnormalization and knowledge base search discovery.git diff --checkpassed.Known limitations
Screenshots