feat(search): 添加SearXNG搜索引擎支持

在Web搜索工具中集成了SearXNG作为新的搜索引擎选项。

- 在 `WebSearchConfig` 中添加了 `searxng_instances` 和 `searxng_api_keys` 配置项。
- 更新了配置文件模板以包含新的SearXNG设置。
- 修复了 `main.py` 中管理器异步初始化调用方式的错误。
This commit is contained in:
minecraft1024a
2025-10-05 20:50:11 +08:00
committed by Windpicker-owo
parent f8e62d0253
commit b45261288f
4 changed files with 10 additions and 6 deletions

View File

@@ -548,6 +548,8 @@ class WebSearchConfig(ValidatedConfigBase):
enable_url_tool: bool = Field(default=True, description="启用URL工具")
tavily_api_keys: list[str] = Field(default_factory=lambda: [], description="Tavily API密钥列表支持轮询机制")
exa_api_keys: list[str] = Field(default_factory=lambda: [], description="exa API密钥列表支持轮询机制")
searxng_instances: list[str] = Field(default_factory=list, description="SearXNG 实例 URL 列表")
searxng_api_keys: list[str] = Field(default_factory=list, description="SearXNG 实例 API 密钥列表")
enabled_engines: list[str] = Field(default_factory=lambda: ["ddg"], description="启用的搜索引擎")
search_strategy: Literal["fallback", "single", "parallel"] = Field(default="single", description="搜索策略")