Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyxis-harness-web-tools

web_search 与 web_fetch 工具。

项 值
条目 web-tools(web bundle)
服务 WebToolsService,ctx.web
注入 tools

文件

文件 内容
__init__.py 导出
service.py WebToolsService:注册 web_search 与 web_fetch,持有凭据
config.py 插件配置
common.py search.py 与 fetch.py 共用
search.py web_search:DeepSeek 搜索
fetch.py web_fetch:HTTP GET,正文化为可读文本
prompts.toml 模型可见文本;pyxis_harness.package_prompts(__file__) 加载

工具

工具 来源 结果
web_search DeepSeek Search API:每次搜索一个直接请求 来源:标题、url、摘要、日期
web_search,search_provider: deepseek-legacy 一次带 web_search_20250305 服务器工具的 Messages 调用 回答文本与被引用的来源
web_fetch HTTP GET HTML 化为文本(链接保留为 [text](url)),JSON 重新缩进,其余文本原样;截断到 fetch_max_chars

两个工具的输出以一条通知开头:内容是不可信的外部内容。

服务

成员 契约
api_key() api_key_env 凭据
status() {"search": {凭据描述, enabled, provider, model, base_url}, "fetch": {enabled}}
search() search.search
fetch() fetch.fetch
transport 全部请求的 httpx transport 覆盖(测试)

配置

配置 默认 含义
search True 注册 web_search
fetch True 注册 web_fetch
api_key_env DEEPSEEK_API_KEY 搜索 key 的凭据引用
search_provider deepseek-search-api deepseek-search-api 或 deepseek-legacy
search_base_url https://api.deepseek.com/v1/tools Search API 基址;追加 /search
search_requests_per_second 5 每秒发起的 Search API 请求数;5 为账号级上限
max_results 10(1–50) 每次搜索返回的来源数
summary_max_chars 800 工具结果中单个来源摘要的上限
base_url https://api.deepseek.com/anthropic/v1 deepseek-legacy:Anthropic 格式的 Messages 端点
model deepseek-v4-flash deepseek-legacy:搜索模型
max_uses 5(1–20) deepseek-legacy:DeepSeek 每次查询可运行的搜索数
max_tokens 4096(≥ 256) deepseek-legacy:回答预算
search_timeout 90.0 秒
fetch_timeout 30.0 秒
fetch_max_chars 20000(≥ 1000) web_fetch 的文本上限
fetch_max_bytes 5000000(≥ 10000) web_fetch 的正文读取上限
approval False 传给 ctx.tools.register 的审批门

凭据

项 契约
搜索 key api_key_env 凭据(DEEPSEEK_API_KEY)
解析顺序 环境变量,profile 凭据库
写入方 设置 → 模型,DeepSeek 路由
缺失 web_search 返回添加该凭据的说明;回合不失败

搜索(search.py)

search_provider 请求
deepseek-search-api POST {search_base_url}/search {query, count, need_content: false}:一个直接请求,按 search_requests_per_second 限速;来源带摘要
deepseek-legacy 一次 Anthropic 格式的 Messages 调用,带 web_search_20250305 服务器工具:带引用来源的回答
函数 契约
search() {"answer", "sources", "truncated"};失败 → RuntimeError,消息面向用户
map_search_response() Search API 应答的来源:url、title、snippet、summary、published_at
parse_search_response() 带 web_search_tool_result 块的 Messages 应答的回答文本与去重后的来源
format_search() 工具结果:通知、回答、Sources: 列表(每个来源的摘要或片段)、引用指示
search_tool() 绑定到服务的 web_search LangChain 工具

Search API 端点的重定向、HTTP 429:搜索失败。

抓取(fetch.py)

函数 契约
html_to_text() HTML 文档的 (title, text):标题、列表项、段落,链接为 [text](url)
fetch() {"url", "status", "content_type", "title", "text", "truncated"};失败 → RuntimeError
fetch_tool() 绑定到服务的 web_fetch LangChain 工具
正文 处理
读取 至多 fetch_max_bytes
HTML 化为文本
JSON 重新缩进
其余文本类型 原样
二进制 给出描述
文本 在 max_chars 处截断;max_chars 至多 fetch_max_chars

共用(common.py)

名称 契约
NOTICE 每个工具结果的首行:内容是不可信数据
USER_AGENT 每个外发请求的 user-agent 头
Host 两个模块所用的服务视图:配置、API key、client
Pacer 任意一秒窗口内至多 limit 次请求发起

Metadata

Release files for pyxis-harness-web-tools 0.1.0rc2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyxis-harness-web-tools 0.1.0rc2
File Size Uploaded Provenance Actions
pyxis_harness_web_tools-0.1.0rc2.tar.gz 10.8 kB Without provenance Details for pyxis_harness_web_tools-0.1.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyxis-harness-web-tools 0.1.0rc2
File Interpreter ABI Platform Actions
pyxis_harness_web_tools-0.1.0rc2-py3-none-any.whl Python 3 none any Details for pyxis_harness_web_tools-0.1.0rc2-py3-none-any.whl

Total release size: 27.4 kB

Release files / pyxis_harness_web_tools-0.1.0rc2.tar.gz

Download URL pyxis_harness_web_tools-0.1.0rc2.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cde05dcd31ca3508466d689da7e485a38334530ef630e3b9e1e9dc49608b19bc
BLAKE2b-256 checksum
How to use checksums
45a41be2b2ad9a1590584bfb15e957b9780c7739e9be332128e9722d613b87c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pyxis_harness_web_tools-0.1.0rc2-py3-none-any.whl

Download URL pyxis_harness_web_tools-0.1.0rc2-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9ee8015aa2b275ff75b4eda4bf8da59437adfe22a4e4825ca60ab3a1db21935
BLAKE2b-256 checksum
How to use checksums
54a69f282cd53902a29f0ab57e9e4b9d8e6b8399be7dadfec804b31f212c9a39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pyxis-harness-web-tools 0.1.0rc2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page