omp packages

@weclio/pi-web-search0.2.0

Pi extension for native web search with Tavily search and fetch fallback.

GitHub Actions Published 10 days ago MIT ~48 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

@weclio/pi-web-search

Standalone Pi extension for native web search, with Tavily search and page extraction as a fallback. No separate Tavily extension is needed.

Install

pi install -l npm:@weclio/pi-web-search

After installation, restart Pi from the project directory.

Routing

  • OpenAI OAuth (openai-codex) on the official https://chatgpt.com/backend-api endpoint uses native search by default, regardless of model ID.

  • Other endpoints opt in with web-search.json in the Pi agent directory (usually ~/.pi/agent, or PI_CODING_AGENT_DIR). Match the provider, effective base URL and model ID. Example for a gateway already verified to support Responses web search:

    [
      { "provider": "my-gateway", "baseUrl": "https://gateway.example/v1", "modelId": "verified-model-id" }
    ]
    
  • Without a matching native route, configuring Tavily enables both web_search (find pages) and web_fetch (read a known public URL). On the native route neither Tavily tool is active. Tavily receives the query or URL(s), not the conversation.

  • Tools Off or PI_WEB_SEARCH=0 disables both routes. Routing happens before requests; it does not retry a rejected native request with Tavily.

Native injection currently supports OpenAI Responses, Codex Responses and Azure OpenAI Responses. A listed endpoint on another protocol falls back to Tavily if available. The extension does not infer web search support from the protocol alone.

Results keep source URLs without an extra plugin. With Weclio citations loaded, successful Tavily search and fetch results also receive citation markers next to their evidence.

Tavily API key

  1. Copy the bundled tavily.example.json to tavily.json in your Pi agent directory (usually ~/.pi/agent, or PI_CODING_AGENT_DIR if set).
  2. Set the apiKey field to your Tavily API key. The next turn reads the file; no restart is needed.

A non-empty TAVILY_API_KEY environment variable takes precedence. tavily.json stores the key in plaintext: keep it private. Share the empty example, not a file with a live key.

Development

Requires Pi >=1.0.2. Run npm run check from the workspace or npm run typecheck / npm test from this directory.