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
可选 http:设置路由,前缀 /api/web-tools;webui:设置分区

文件

文件 内容
__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__) 加载
client.js 浏览器模块:设置分区「网页搜索」

工具

工具 来源 结果
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 覆盖(测试)
settings() 设置与搜索密钥的状态(不含密钥的值)
save(fields) 更改设置并写入 profile 补丁;GET、PUT /api/web-tools/settings
save 的字段 生效
search_provider、search_base_url、base_url、max_results、max_uses 立即:下一次搜索
api_key 立即;存入 profile 的凭据文件;空串:删除
search、fetch 下一代;请求重启

配置

配置 默认 含义
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.1.dev6

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.1.dev6
File Size Uploaded Provenance Actions
pyxis_harness_web_tools-0.1.1.dev6.tar.gz 14.8 kB Without provenance Details for pyxis_harness_web_tools-0.1.1.dev6.tar.gz

Built distribution (wheel)

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

Total release size: 36.3 kB

Release files / pyxis_harness_web_tools-0.1.1.dev6.tar.gz

Download URL pyxis_harness_web_tools-0.1.1.dev6.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
acc03f69a9db3fbe7ee2fff513af37a8238d321226664672b78f17ef431569cc
BLAKE2b-256 checksum
How to use checksums
70eb604da92a516d55fe03ab97670cc7888e8f88b2b3818fb86ccac2eaef65ef
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.1.dev6-py3-none-any.whl

Download URL pyxis_harness_web_tools-0.1.1.dev6-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d124f4d1a01de5c37839132f1b1c6e6f74377d36cc5e0b6d2d021b9d81739035
BLAKE2b-256 checksum
How to use checksums
737b74d82bc7b37760a10a0a61ffa655589cccdfe8859e924334dd2c758f802d
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.1.dev6

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