Search1API 是一款强大的工具,能实现网络搜索、新闻获取、内容提取等功能。它支持多种搜索引擎,还可自定义搜索参数,满足多样化需求。
Search1API 具备网络搜索、新闻获取、内容提取等功能,支持多种搜索引擎,可自定义搜索参数。
文档未提及安装步骤,故跳过此章节。
# 使用 Search1API 进行网络搜索
from Search1API import search
# 进行搜索
results = search(query="人工智能", max_results=20, search_service="google")
print(results)
# 使用 Search1API 进行新闻搜索
from Search1API import news
# 进行新闻搜索
news_results = news(query="科技新闻", max_results=15, search_service="bing")
print(news_results)
# 使用 Search1API 提取指定 URL 的内容
from Search1API import crawl
# 提取网页内容
content = crawl(url="https://example.com")
print(content)
# 获取指定 URL 的相关链接
from Search1API import sitemap
# 获取站点地图信息
links = sitemap(url="https://example.com")
print(links)
# 使用 Search1API 进行深度思考和复杂问题解决
from Search1API import reasoning
# 进行深度思考
answer = reasoning(content="人工智能的发展趋势如何?")
print(answer)
# 自定义更多搜索参数进行网络搜索
from Search1API import search
results = search(query="人工智能应用案例", max_results=30, search_service="duckduckgo", crawl_results=5, include_sites=["example1.com", "example2.com"], exclude_sites=["example3.com"], time_range="month")
print(results)
| 属性 | 详情 |
|---|---|
| 名称 | search |
| 描述 | 使用 Search1API 进行网络搜索 |
| 参数 | - query (必填): 自然语言查询,尽量具体且简洁以获得更好的结果- max_results (可选,默认值: 10): 返回的结果数量- search_service (可选,默认值: "google"): 使用的搜索引擎(支持 google、bing、duckduckgo、yahoo、x、reddit、github、youtube、arxiv、wechat、bilibili、imdb、wikipedia)- crawl_results (可选,默认值: 0): 需要爬取的网页内容结果数量- include_sites (可选): 需要包含在搜索中的网站列表- exclude_sites (可选): 需要排除的网站列表- time_range (可选): 搜索结果的时间范围("day", "month", "year") |
| 属性 | 详情 |
|---|---|
| 名称 | news |
| 描述 | 使用 Search1API 进行新闻搜索 |
| 参数 | - query (必填): 自然语言查询,尽量具体且简洁以获得更好的结果- max_results (可选,默认值: 10): 返回的结果数量- search_service (可选,默认值: "bing"): 使用的新闻搜索引擎(支持 google、bing、duckduckgo、yahoo、hackernews)- crawl_results (可选,默认值: 0): 需要爬取的网页内容结果数量- include_sites (可选): 需要包含在搜索中的网站列表- exclude_sites (可选): 需要排除的网站列表- time_range (可选): 搜索结果的时间范围("day", "month", "year") |
| 属性 | 详情 |
|---|---|
| 名称 | crawl |
| 描述 | 使用 Search1API 提取指定 URL 的内容 |
| 参数 | - url (必填): 需要爬取的 URL |
| 属性 | 详情 |
|---|---|
| 名称 | sitemap |
| 描述 | 获取指定 URL 的相关链接 |
| 参数 | - url (必填): 需要获取站点地图信息的 URL |
| 属性 | 详情 |
|---|---|
| 名称 | reasoning |
| 描述 | 使用 Search1API 进行深度思考和复杂问题解决(默认使用 fast deepseek r1 模型,支持更换其他模型) |
| 参数 | - content (必填): 需要进行深入思考的问题或陈述 |
.env 文件的支持,提升了 LibreChat 的集成度。Search1API 项目遵循 MIT 许可证。