ExaTools 使 Agent 能够使用 Exa 搜索网络、检索 URL 内容、查找相似内容并获得 AI 驱动的答案。
以下示例需要 exa-py
库和 API 密钥,可在 Exa 获取。
以下 Agent 将在 Exa 中搜索 AAPL 新闻并打印响应。
函数 | 描述 |
---|---|
search_exa | 使用可选的类别过滤搜索 Exa |
get_contents | 从特定 URL 检索详细内容 |
find_similar | 查找与给定 URL 相似的内容 |
exa_answer | 使用 Exa 搜索结果获取 AI 驱动的答案 |
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
search | bool | True | 启用搜索功能 |
get_contents | bool | True | 启用内容检索 |
find_similar | bool | True | 启用查找相似内容功能 |
answer | bool | True | 启用 AI 驱动的答案 |
text | bool | True | 在结果中包含文本内容 |
text_length_limit | int | 1000 | 每个结果的最大文本长度 |
highlights | bool | True | 包含高亮片段 |
summary | bool | False | 包含结果摘要 |
num_results | Optional[int] | None | 默认结果数量 |
livecrawl | str | "always" | Livecrawl 行为 |
start_crawl_date | Optional[str] | None | 包含在此日期之后抓取的结果 (年-月-日) |
end_crawl_date | Optional[str] | None | 包含在此日期之前抓取的结果 (年-月-日) |
start_published_date | Optional[str] | None | 包含在此日期之后发布的结果 (年-月-日) |
end_published_date | Optional[str] | None | 包含在此日期之前发布的the results (年-月-日) |
use_autoprompt | Optional[bool] | None | 启用 autoprompt 功能 |
type | Optional[str] | None | 内容类型过滤 (例如: article, blog, video) |
category | Optional[str] | None | 类别过滤 (例如: news, research paper) |
include_domains | Optional[List[str]] | None | 将结果限制在这些域名内 |
exclude_domains | Optional[List[str]] | None | 排除这些域名的结果 |
show_results | bool | False | 记录搜索结果以用于调试 |
model | Optional[str] | None | 要使用的搜索模型 (‘exa’ or ‘exa-pro’) |
可用于过滤的类别: