pi-web-providers 2.2.0 → 2.3.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 +77 -11
  2. package/dist/index.js +792 -207
  3. package/package.json +5 -3
package/README.md CHANGED
@@ -13,14 +13,15 @@ off entirely.
13
13
 
14
14
  ## ✨ Features
15
15
 
16
- - **Multiple providers**: Claude, Cloudflare, Codex, Exa, Firecrawl,
17
- Gemini, Linkup, Perplexity, Parallel, [Tavily](https://tavily.com), Valyu
18
- - **Explicit provider option schemas**: the registered tool schema exposes the
19
- supported `options.provider` fields for the selected provider
20
- - **Batched search and answers**: run several related queries in a single
21
- `web_search` or `web_answer` call and get grouped results back in one response
22
- - **Async contents prefetch**: optionally start background `web_contents`
23
- extraction from `web_search` results and reuse the cached pages later
16
+ - **Provider-aware tool options**: pi only exposes the provider settings that
17
+ actually apply to the backend you selected, so tool calls are easier to
18
+ discover and harder to get wrong
19
+ - **Batched search and answers**: run several related queries or questions in a
20
+ single `web_search` or `web_answer` call and get grouped results back in one
21
+ response
22
+ - **Background contents prefetch**: optionally start `web_contents`
23
+ extraction from `web_search` results in the background and reuse the cached
24
+ pages later for faster follow-up reads
24
25
 
25
26
  ## 📦 Install
26
27
 
@@ -41,17 +42,25 @@ settings UI mirrors the three sections below: tools, providers, and settings.
41
42
 
42
43
  Each tool can be routed to any compatible provider:
43
44
 
45
+ **Built-in local providers**
46
+
47
+ | Provider | search | contents | answer | research | Auth |
48
+ | ---------- | :----: | :------: | :----: | :------: | ---------------------- |
49
+ | **Claude** | ✔ | | ✔ | | Local Claude Code auth |
50
+ | **Codex** | ✔ | | | | Local Codex CLI auth |
51
+
52
+ **API-backed providers**
53
+
44
54
  | Provider | search | contents | answer | research | Auth |
45
55
  | -------------- | :----: | :------: | :----: | :------: | ------------------------------------------------ |
46
- | **Claude** | ✔ | | ✔ | | Local Claude Code auth |
47
56
  | **Cloudflare** | | ✔ | | | `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` |
48
- | **Codex** | ✔ | | | | Local Codex CLI auth |
49
57
  | **Exa** | ✔ | ✔ | ✔ | ✔ | `EXA_API_KEY` |
50
58
  | **Firecrawl** | ✔ | ✔ | | | `FIRECRAWL_API_KEY` |
51
59
  | **Gemini** | ✔ | | ✔ | ✔ | `GOOGLE_API_KEY` |
52
60
  | **Linkup** | ✔ | ✔ | | | `LINKUP_API_KEY` |
53
- | **Perplexity** | ✔ | | ✔ | ✔ | `PERPLEXITY_API_KEY` |
61
+ | **OpenAI** | ✔ | | ✔ | ✔ | `OPENAI_API_KEY` |
54
62
  | **Parallel** | ✔ | ✔ | | | `PARALLEL_API_KEY` |
63
+ | **Perplexity** | ✔ | | ✔ | ✔ | `PERPLEXITY_API_KEY` |
55
64
  | **Tavily** | ✔ | ✔ | | | `TAVILY_API_KEY` |
56
65
  | **Valyu** | ✔ | ✔ | ✔ | ✔ | `VALYU_API_KEY` |
57
66
 
@@ -286,6 +295,63 @@ scope, or account ID is usually wrong.
286
295
 
287
296
  </details>
288
297
 
298
+ <details>
299
+ <summary><strong>OpenAI</strong></summary>
300
+
301
+ - SDK: `openai`
302
+ - Supports `web_search`, `web_answer`, and `web_research`
303
+ - Uses the Responses API for structured web search, grounded answers, and
304
+ deep-research runs
305
+ - Always enables OpenAI's built-in `web_search_preview` tool for search,
306
+ answer, and research calls
307
+ - Exposes `model` and `instructions` for `web_search` and `web_answer`
308
+ - Exposes `model`, `instructions`, and `max_tool_calls` for `web_research`
309
+ - Good fit when you want official OpenAI web-grounded search, answers, and deep
310
+ research behind pi's managed tool abstractions
311
+
312
+ **Setup**
313
+
314
+ 1. Create or reuse an OpenAI API key.
315
+ 2. Configure pi to route `web_search`, `web_answer`, `web_research`, or any
316
+ subset of them to `openai`.
317
+ 3. Optionally set default models under `providers.openai.options.search.model`,
318
+ `providers.openai.options.answer.model`, and
319
+ `providers.openai.options.research.model`.
320
+
321
+ ```json
322
+ {
323
+ "tools": {
324
+ "search": "openai",
325
+ "answer": "openai",
326
+ "research": "openai"
327
+ },
328
+ "providers": {
329
+ "openai": {
330
+ "apiKey": "OPENAI_API_KEY",
331
+ "options": {
332
+ "search": {
333
+ "model": "gpt-4.1"
334
+ },
335
+ "answer": {
336
+ "model": "gpt-4.1"
337
+ },
338
+ "research": {
339
+ "model": "o4-mini-deep-research"
340
+ }
341
+ }
342
+ }
343
+ }
344
+ }
345
+ ```
346
+
347
+ You can also set `instructions` as a provider default under
348
+ `providers.openai.options.search`, `providers.openai.options.answer`, or
349
+ `providers.openai.options.research`, and set `max_tool_calls` under
350
+ `providers.openai.options.research`. All of them can also be overridden per
351
+ call.
352
+
353
+ </details>
354
+
289
355
  <details>
290
356
  <summary><strong>Perplexity</strong></summary>
291
357