refactor(hiagent-knowledge): 精简 search 冗余参数、list_datasets 支持按名搜索、明确 user_info 语义 - #432
Open
yooyea wants to merge 5 commits into
Open
refactor(hiagent-knowledge): 精简 search 冗余参数、list_datasets 支持按名搜索、明确 user_info 语义#432yooyea wants to merge 5 commits into
yooyea wants to merge 5 commits into
Conversation
…_k/score_threshold/rerank_id)
… (only None omits Filter)
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.
改动内容
对 HiAgent Knowledge MCP server(
server/mcp_server_hiagent_knowledge)的三处改进:search_knowledge的无效参数 —— 移除top_k/score_threshold/rerank_id。这几个参数后端知识引擎调用从不使用,只会让工具 schema 变冗余;检索参数由各知识库自身配置决定。list_datasets支持按名称模糊搜索 —— 新增可选参数name,透传为后端Filter.Name,让调用方可按关键词定位知识库,而不必翻遍所有知识库分页查找。user_info的权限语义 —— 在工具描述与中英 README 中说明:透传的user_info仅当UserChannel为"IAM"(或后端可映射为 IAM 用户的"Lark")且UserID为租户内真实用户时,才据此做知识库/文档级权限过滤;其它渠道按游客处理。为什么
search_knowledge是薄适配层,暴露后端会忽略的参数会误导调用方。list_datasets此前只能翻分页找库;Filter.Name(后端对名称/描述做模糊匹配)才是预期的检索方式。user_info很容易被传了却不生效。把渠道要求写清楚,让调用方知道如何让检索遵循终端用户自身的访问权限,同时避免在薄适配层里硬编码某个渠道值。测试
list_datasets的过滤测试(传 / 不传name)。75 个测试全部通过。user_info语义保持一致。403被拒。说明
user_info仍为可选、原样透传。