Install
Install with PiG
pig install npm:@bainianzzz/pi-deepseek-searchInstall with Pi
pi install npm:@bainianzzz/pi-deepseek-searchPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./extensions/index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.2.1 (README.md). PiG does not review it.
pi-deepseek-search
中文 | English
A Pi extension that adds a web search tool powered by the DeepSeek Search API:
search— query the live web, returns ranked results (title / url / site / date / summary), with optional full page content.
The tool ships with a custom TUI renderer (compact result list, ctrl+o to expand).
Install
pi install npm:@bainianzzz/pi-deepseek-search
Or install from GitHub (git source):
pi install git:github.com/Bainianzzz/pi-deepseek-search
Then restart Pi (or run /reload).
Configure
The API key is resolved on every call, first match wins:
DEEPSEEK_SEARCH_API_KEYDEEPSEEK_API_KEY(no extra setup needed if a DeepSeek model provider is already configured)- the
apiKeyof any provider inmodels.jsonwhosebaseUrlhost ends withdeepseek.com
Request URLs are fixed to the official endpoints and are not configurable:
| tool | URL |
|---|---|
search | POST https://api.deepseek.com/v1/tools/search |
models.jsonis read from$PI_CODING_AGENT_DIR(default~/.pi/agent) and from./.pi/models.json.
Tools
Parameters, search operators, response fields and error codes for search are documented upstream:
- English: https://api-docs.deepseek.com/guides/search
- 中文: https://api-docs.deepseek.com/zh-cn/guides/search
Behaviour notes
- Retries on
408 / 429 / 5xxwith exponential backoff (3 attempts), abortable via the tool signal. - HTTP errors are mapped to readable messages (
402 insufficient balance,429 rate limit exceeded, …). - The API key is re-read on every call, so changing env vars or
models.jsondoes not require a reload. - Request URLs are pinned to the official endpoint (
https://api.deepseek.com/v1/tools/search); there is no base URL override.
Why the fetch service is not integrated
DeepSeek also offers a fetch endpoint (retrieve the body of a single URL), but this extension does not integrate it: fetching runs server-side at DeepSeek and is often affected by firewalls, making the tool fail with 404:
DeepSeek API HTTP 404 (no usable page content could be retrieved): failed to fetch URL
404 is a catch-all — a missing page, a site refusing access, an unsupported content type and a page with no extractable body all return the identical failed to fetch URL, with no way to tell them apart.
Package layout
pi-deepseek-search/
├── extensions/
│ ├── index.ts # the extension (registers search)
│ ├── utils.ts # API calls and result formatting
│ ├── render.ts # TUI renderers
│ └── types.ts # shared types (no local imports)
├── package.json # pi manifest + peerDependencies
├── tsconfig.json
└── LICENSE
Host-provided packages (@earendil-works/pi-*, typebox) are declared as peerDependencies with "*", per the Pi packaging rules.
Development
npm install
npm run typecheck
License
MIT