feat: add pluggable research provider interface and open-webSearch adapter - #323
Open
foreverlyl-l wants to merge 3 commits into
Open
feat: add pluggable research provider interface and open-webSearch adapter#323foreverlyl-l wants to merge 3 commits into
foreverlyl-l wants to merge 3 commits into
Conversation
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
ResearchProvider调研接口:为调研提供最小化的search和fetch行为契约,解耦具体的搜索引擎与调研 Agent 逻辑。OpenWebSearchProvider适配器:可通过对接https://github.com/Aas-ee/open-webSearch ,为调研 Agent 提供本地的网络检索和网页解析能力。Researcher中支持外部 Provider 注入:更新了runResearchReport依赖项(ResearchDeps),使其能动态解析并使用传入的ResearchProvider。Type of change
Motivation (optional)
为了增强调研 Agent 的检索灵活性,使系统能够摆脱对特定默认网络检索工具的依赖。引入该通用 Provider 接口后,开发者可以很方便地扩展并切换到其他搜索引擎服务商(如
open-websearch实例)。Changes
ResearchProvider抽象接口,包含id,search和fetch声明。open-websearchHTTP 服务端适配的OpenWebSearchProvider,支持/search和/fetch-web接口调用。OpenWebSearchProvider的各个场景(正常搜索、网页抓取、超时控制及异常处理)进行单元测试覆盖。ResearchProvider集成入ResearchDeps,并在执行调研任务时动态绑定和使用它的search/fetch方法。Usage (optional)
通过以下示例代码,可以在调用
runResearchReport时注入并使用本地的open-websearch检索实例: