pi-web-search 1.1.0 → 1.2.1

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.
package/README.md CHANGED
@@ -1,23 +1,48 @@
1
1
  # pi-web-search
2
2
 
3
- A pi extension that provides web search and content analysis capabilities powered by Gemini API.
3
+ Provider-native web search for [pi](https://github.com/earendil-works/pi-coding-agent), across Google Gemini, OpenAI, and Anthropic, plus Gemini-only URL Context analysis.
4
4
 
5
- ## Features
5
+ ## Tools
6
6
 
7
- - **🔍 Web Search** - Google search with citations
8
- - **📄 URL Analysis** - Analyze web pages, PDFs, images, and YouTube videos (up to 20 URLs)
7
+ ### `web_search`
9
8
 
10
- ## Installation
9
+ Search the web using your currently selected model. Automatically picks the right provider API:
10
+
11
+ | Provider | API |
12
+ |---|---|
13
+ | Google Gemini | Grounding with Google Search |
14
+ | OpenAI | Responses API web search |
15
+ | Anthropic | Messages API web search |
16
+
17
+ Supports passing up to 20 additional URLs to analyze alongside the query.
18
+
19
+ ### `url_context`
20
+
21
+ Gemini-only. Analyze up to 20 public URLs — web pages, documents, images, and YouTube videos. Uses Gemini's native URL Context retrieval with verified metadata.
22
+
23
+ When using `google-generative-ai`, YouTube URLs are passed as `file_data` for native video understanding.
24
+
25
+ ## Install
11
26
 
12
27
  ```bash
13
28
  pi install npm:pi-web-search
14
29
  ```
15
30
 
16
- ## Configuration
31
+ ## Usage
32
+
33
+ No extra config needed. Just configure any supported provider in pi and the tools auto-detect it.
34
+
35
+ `url_context` is automatically removed from active tools when using a non-Gemini model.
36
+
37
+ ## Test
38
+
39
+ ```bash
40
+ cp .env.example .env # edit with your models
41
+ npm test # unit tests
42
+ npm run test:real:web-search
43
+ npm run test:real:url-context
44
+ ```
17
45
 
18
- No special configuration required. Configure or login to any of the following model providers in pi, and it will be automatically detected and used:
46
+ ## License
19
47
 
20
- - google-antigravity
21
- - google-gemini-cli
22
- - google
23
- - google-generative-ai
48
+ MIT
package/package.json CHANGED
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "pi-web-search",
3
- "version": "1.1.0",
4
- "description": "Web search and content analysis extension for pi, powered by Gemini API",
3
+ "version": "1.2.1",
4
+ "description": "Provider-native web search for pi across Google Gemini, OpenAI, and Anthropic, plus Gemini URL Context",
5
5
  "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
6
+ "main": "src/index.ts",
8
7
  "keywords": [
9
8
  "pi",
10
9
  "pi-extension",
10
+ "pi-package",
11
11
  "web-search",
12
12
  "gemini",
13
13
  "google",
14
+ "openai",
15
+ "anthropic",
16
+ "url-context",
14
17
  "url-analysis",
15
18
  "youtube"
16
19
  ],
@@ -24,15 +27,30 @@
24
27
  "url": "https://github.com/ttttmr/pi-web-search/issues"
25
28
  },
26
29
  "homepage": "https://github.com/ttttmr/pi-web-search#readme",
30
+ "files": [
31
+ "src",
32
+ "README.md"
33
+ ],
34
+ "scripts": {
35
+ "test": "node --test tests/*.test.mjs",
36
+ "test:real:web-search": "node tests/real-web-search.mjs",
37
+ "test:real:url-context": "node tests/real-url-context.mjs"
38
+ },
27
39
  "devDependencies": {
28
- "@mariozechner/pi-coding-agent": "^0.64.0",
29
- "@sinclair/typebox": "^0.32.15",
30
- "@types/node": "^20.0.0",
31
- "typescript": "^5.0.0"
40
+ "@earendil-works/pi-ai": "^0.75.4",
41
+ "@earendil-works/pi-coding-agent": "^0.75.4",
42
+ "@types/node": "^25.9.1",
43
+ "typebox": "^1.1.38",
44
+ "typescript": "^6.0.3"
32
45
  },
33
46
  "pi": {
34
47
  "extensions": [
35
48
  "./src/index.ts"
36
49
  ]
50
+ },
51
+ "peerDependencies": {
52
+ "@earendil-works/pi-ai": "*",
53
+ "@earendil-works/pi-coding-agent": "*",
54
+ "typebox": "*"
37
55
  }
38
56
  }