-
Notifications
You must be signed in to change notification settings - Fork 116
feat: add web search tool with Tavily provider integration #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
这个直接按需配置MCP会不会更便捷一些? |
直接按需配置MCP确实更灵活,但当前内置实现提供了更好的开箱即用体验。理想方案是两者结合:保留内置常用提供商确保易用性,同时支持MCP扩展满足个性化需求。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
配置(有 search 配置时)开启吧,如果默认上且用户没配相关的 API Key 时,是不是会失败?
|
感觉这个是不是适合插件 |
|
之前我也想过作为一种插件能力去支持,但是后来又想这种联网搜索功能是一个通用性很强的功能。
|
- 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
主要是费用的问题 大部分应该的不会买 除非公司提供 |
理解你的顾虑。不过换个角度看:项目本身需要配置 LLM API Key 才能运行,这个「付费」门槛其实在使用项目时就已经跨过了,而联网搜索相比 LLM 调用是相对低频的功能。Tavily 每月有 1000 次免费额度,对个人使用来说应该是够的,如果需要也可以接入 Brave Search(每月免费 2000 次)等其他服务。当前的代码逻辑是完全可选的:不配置 search 或 API Key 就会自动禁用,不影响其他功能,相当于为有需求的场景预留能力。 |
增加联网搜索功能,抽象基类封装通用逻辑(请求、重试、错误处理),Tavily 作为具体实现,通过注册表管理,方便扩展新搜索源。
export TAVILY_API_KEY=tvly-dev-***