pi-web-providers 2.5.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +50 -5
  2. package/dist/index.js +1833 -645
  3. package/package.json +8 -7
package/README.md CHANGED
@@ -14,7 +14,7 @@ not as a replacement for source inspection or deeper research.
14
14
 
15
15
  ## ✨ Features
16
16
 
17
- - **Multiple providers**: Claude, Cloudflare, Codex, Exa, Firecrawl,
17
+ - **Multiple providers**: Brave, Claude, Cloudflare, Codex, Exa, Firecrawl,
18
18
  Gemini, Linkup, Ollama, OpenAI, Perplexity, Parallel, Serper,
19
19
  [Tavily](https://tavily.com), Valyu
20
20
  - **Provider-aware tool options**: pi only exposes the provider settings that
@@ -57,6 +57,7 @@ Each tool can be routed to any compatible provider:
57
57
 
58
58
  | Provider | search | contents | answer | research | Auth |
59
59
  | -------------- | :----: | :------: | :----: | :------: | ------------------------------------------------ |
60
+ | **Brave** | ✔ | | ✔ | ✔ | `BRAVE_SEARCH_API_KEY` / `BRAVE_ANSWERS_API_KEY` |
60
61
  | **Cloudflare** | | ✔ | | | `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` |
61
62
  | **Exa** | ✔ | ✔ | ✔ | ✔ | `EXA_API_KEY` |
62
63
  | **Firecrawl** | ✔ | ✔ | | | `FIRECRAWL_API_KEY` |
@@ -187,6 +188,42 @@ report under `.pi/artifacts/research/`.
187
188
 
188
189
  The built-in providers below integrate with official SDKs or documented APIs.
189
190
 
191
+ <details>
192
+ <summary><strong>Brave</strong></summary>
193
+
194
+ - API: Brave Search API and Brave Answers API
195
+ - Supports `web_search` via Web Search, plus optional `llm_context`, `news`, `videos`, `images`, and `places` search modes
196
+ - Supports `web_answer` and `web_research` via Brave Answers streaming chat completions
197
+ - `web_contents` stays routed to URL-fetch providers; Brave LLM Context is query-based retrieval and is exposed as a search mode instead
198
+ - Brave Answers may require a different key or plan than Brave Search
199
+
200
+ **Setup**
201
+
202
+ ```json
203
+ {
204
+ "tools": {
205
+ "search": "brave",
206
+ "answer": "brave",
207
+ "research": "brave"
208
+ },
209
+ "providers": {
210
+ "brave": {
211
+ "credentials": {
212
+ "search": "BRAVE_SEARCH_API_KEY",
213
+ "answers": "BRAVE_ANSWERS_API_KEY"
214
+ }
215
+ }
216
+ }
217
+ }
218
+ ```
219
+
220
+ Use `providers.brave.options.search.mode` or per-call search options to select
221
+ `llm_context`, `news`, `videos`, `images`, or `places`. Places details and
222
+ descriptions are opt-in because they can add calls, latency, and place-specific
223
+ semantics.
224
+
225
+ </details>
226
+
190
227
  <details>
191
228
  <summary><strong>Claude</strong></summary>
192
229
 
@@ -224,7 +261,9 @@ The built-in providers below integrate with official SDKs or documented APIs.
224
261
  },
225
262
  "providers": {
226
263
  "cloudflare": {
227
- "apiToken": "CLOUDFLARE_API_TOKEN",
264
+ "credentials": {
265
+ "api": "CLOUDFLARE_API_TOKEN"
266
+ },
228
267
  "accountId": "CLOUDFLARE_ACCOUNT_ID"
229
268
  }
230
269
  }
@@ -328,7 +367,9 @@ Minimal config:
328
367
  },
329
368
  "providers": {
330
369
  "ollama": {
331
- "apiKey": "OLLAMA_API_KEY"
370
+ "credentials": {
371
+ "api": "OLLAMA_API_KEY"
372
+ }
332
373
  }
333
374
  }
334
375
  }
@@ -368,7 +409,9 @@ Minimal config:
368
409
  },
369
410
  "providers": {
370
411
  "openai": {
371
- "apiKey": "OPENAI_API_KEY",
412
+ "credentials": {
413
+ "api": "OPENAI_API_KEY"
414
+ },
372
415
  "options": {
373
416
  "search": {
374
417
  "model": "gpt-4.1"
@@ -439,7 +482,9 @@ Minimal config:
439
482
  },
440
483
  "providers": {
441
484
  "serper": {
442
- "apiKey": "SERPER_API_KEY"
485
+ "credentials": {
486
+ "api": "SERPER_API_KEY"
487
+ }
443
488
  }
444
489
  }
445
490
  }