@bizmyth/pi-vertex-gemini-search

中文文档
0.2.0发布于 2026/10/09MITES Module零依赖构建来源已验证近 30 天下载 1966

Vertex AI Gemini grounded web search and research tools for Pi, using Pi's google-vertex provider

原始使用文档
文档目录8 节
  1. Install
  2. Tools
  3. Vertex AI setup
  4. Configuration
  5. Pricing tier
  6. Development
  7. Releasing
  8. License

@bizmyth/pi-vertex-gemini-search

Web search and research tools for the Pi coding agent, backed by Vertex AI Gemini with Google Search grounding through Pi's built-in google-vertex provider.

Forked from @nilskluewer/pi-vertex-gemini-search. This fork drops its own token handling, endpoint, and environment configuration and uses whatever Vertex AI setup Pi's chat models use.

Install

pi install npm:@bizmyth/pi-vertex-gemini-search

Restart Pi after installation. Review extensions before installing them; Pi extensions run with your full user permissions.

Tools

  • web_search: quick fact-check or verification. Returns a concise answer and source URLs.
  • web_research: in-depth research on complex topics. Returns a structured answer and source URLs.

Both tools:

  • Ground answers with Google Search and read URLs passed in the query via Gemini url_context.
  • Resolve vertexaisearch.cloud.google.com redirect links to their destination URLs.
  • Return the answer and source URLs to the model, and structured results (answer, sources, searchQueries, model, location, serviceTier, costUsd) to codemode scripts.
  • Stream the answer into the transcript while Gemini writes it, then show a model/cost/pricing-tier summary with a collapsed preview; expand the result for the full answer and sources.
  • Report their token and grounding cost as tool usage, so searches count toward the session cost.

Vertex AI setup

The tools need Pi's google-vertex provider to be configured, exactly as for Vertex AI chat models. See Google Vertex AI in Pi's provider docs. For example, with Application Default Credentials:

export GOOGLE_CLOUD_PROJECT=your-project
export GOOGLE_CLOUD_LOCATION=global
gcloud auth application-default login

A Vertex AI API key (GOOGLE_CLOUD_API_KEY) or a credential stored with /login google-vertex works too. Searches run in that project and location, and fail with Pi's auth error when Vertex AI is not configured.

The current Gemini models are served from the global location.

Configuration

  • PI_VERTEX_SEARCH_MODEL: the google-vertex model to search with. Default: gemini-3.8-flash. It must be in Pi's model catalog (pi --list-models google-vertex).

Pi prices tokens from its model catalog. Google Search grounding is estimated at $14 per 1,000 queries.

Pricing tier

/search-pricing            # show the current preference
/search-pricing standard   # default
/search-pricing flex       # Flex PayGo, falling back to standard

Standard is the default because Flex requests can queue until they time out, and grounding dominates the cost of a search. When a Flex request fails or times out, the search is retried at standard, and later searches stay on standard until /search-pricing flex is run again. The preference does not persist across Pi sessions.

Development

bun install
bun run check

bun run check runs Biome, TypeScript 7 (tsc, the Go-based compiler), and Bun tests.

Releasing

Trusted publishing must already be configured for publish.yml. To release a new version:

bun pm version patch # or: minor / major
git push origin main --follow-tags
gh release create "$(git describe --tags --exact-match)" --generate-notes

Publishing the GitHub release runs the checks and publishes the matching package version to npm using OIDC. No long-lived NPM_TOKEN is required.

License

MIT

版本与发布记录

@bizmyth/pi-vertex-gemini-search 共发布 3 个版本,首次发布于 2026/10/09;过去 12 个月发布了 3 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.0latest2026/10/0930 天前
0.1.02026/10/0930 天前
0.0.0-stage2026/10/0930 天前

关于 @bizmyth/pi-vertex-gemini-search 的常见问题

@bizmyth/pi-vertex-gemini-search 是什么?

Vertex AI Gemini grounded web search and research tools for Pi, using Pi's google-vertex provider

如何安装 @bizmyth/pi-vertex-gemini-search?

在项目目录运行 npm install @bizmyth/pi-vertex-gemini-search,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:typebox(1.3.27)、@earendil-works/pi-ai(1.0.4)、@earendil-works/pi-tui(1.0.4)、@earendil-works/pi-coding-agent(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bizmyth/pi-vertex-gemini-search 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bizmyth__pi-vertex-gemini-search 是否存在。

@bizmyth/pi-vertex-gemini-search 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bizmyth/pi-vertex-gemini-search 可以商用吗?

@bizmyth/pi-vertex-gemini-search 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bizmyth/pi-vertex-gemini-search 的下载量有多少?

根据 npm 官方下载统计,@bizmyth/pi-vertex-gemini-search 在 2026/10/08 – 2026/11/06 这 30 天内被下载 1,966 次,日均约 66 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bizmyth/pi-vertex-gemini-search 还在维护吗?

最新版本 0.2.0 发布于 2026/10/09(30 天前);至今共发布 3 个版本,其中过去 12 个月发布了 3 个;首次发布于 2026/10/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。