ForcePilot/backend/package/yuxi/agents/toolkits/buildin/search/models.py
Kris 077de8e6d6 feat(agent-toolkit): add web search and crawl built-in toolkits
实现了完整的网页搜索与抓取内置工具集:
1. 新增搜索工具链:支持SearXNG与Tavily多Provider降级、滑动窗口限流、统一结果格式
2. 新增网页抓取工具:单页抓取、站点递归抓取、内容入库知识库功能
3. 完善安全防护:SSRF校验、robots.txt合规、请求限流
4. 自动注册工具到系统注册表,无需额外配置即可使用
2026-06-22 21:20:02 +08:00

13 lines
489 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""搜索结果数据结构,统一 Tavily 与 SearXNG 的输出格式。"""
from pydantic import BaseModel
class SearchResult(BaseModel):
"""结构化搜索结果,统一 Tavily 与 SearXNG 的输出格式。"""
title: str
url: str
snippet: str # 截断到 500 字符,避免 token 浪费
published_at: str | None = None # ISO 字符串,可能为空
source_provider: str # "searxng" / "tavily"SearXNG 时可附加上游引擎,如 "searxng:bing"