feat: add web search tool with Tavily provider integration#496
Open
lyw405 wants to merge 6 commits intoneovateai:masterfrom
Open
feat: add web search tool with Tavily provider integration#496lyw405 wants to merge 6 commits intoneovateai:masterfrom
lyw405 wants to merge 6 commits intoneovateai:masterfrom
Conversation
Contributor
|
这个直接按需配置MCP会不会更便捷一些? |
Contributor
Author
直接按需配置MCP确实更灵活,但当前内置实现提供了更好的开箱即用体验。理想方案是两者结合:保留内置常用提供商确保易用性,同时支持MCP扩展满足个性化需求。 |
sorrycc
requested changes
Dec 8, 2025
Member
|
感觉这个是不是适合插件 |
Contributor
Author
|
之前我也想过作为一种插件能力去支持,但是后来又想这种联网搜索功能是一个通用性很强的功能。
|
- Add conditional registration for search tool based on config and API key - Prevent runtime errors when search is configured but API key is missing - Silently skip registration to follow graceful degradation pattern - Import getProviderApiKey helper for API key validation
Member
主要是费用的问题 大部分应该的不会买 除非公司提供 |
Contributor
Author
理解你的顾虑。不过换个角度看:项目本身需要配置 LLM API Key 才能运行,这个「付费」门槛其实在使用项目时就已经跨过了,而联网搜索相比 LLM 调用是相对低频的功能。Tavily 每月有 1000 次免费额度,对个人使用来说应该是够的,如果需要也可以接入 Brave Search(每月免费 2000 次)等其他服务。当前的代码逻辑是完全可选的:不配置 search 或 API Key 就会自动禁用,不影响其他功能,相当于为有需求的场景预留能力。 |
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.
增加联网搜索功能,抽象基类封装通用逻辑(请求、重试、错误处理),Tavily 作为具体实现,通过注册表管理,方便扩展新搜索源。
export TAVILY_API_KEY=tvly-dev-***