npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ank1015/agents-provider-gemini-spec

v0.1.1

Published

Gemini provider static spec (config + per-call option types) for @ank1015/agents.

Readme

@ank1015/agents-provider-gemini-spec

Static Gemini provider metadata for the @ank1015/agents packages.

This package contains no live Gemini client. It provides provider identity, config types, an opinionated Gemini Interactions API option surface, provider-specific type augmentation, tool support helpers, native message typing, and a static model catalog.

Install

pnpm add @ank1015/agents-provider-gemini-spec

What This Package Provides

  • GEMINI_PROVIDER provider id.
  • geminiProviderConfigSchema for provider config validation.
  • GeminiProviderOptions for Gemini Interactions API request options not owned by the generic LLM layer.
  • GeminiNativeMessage for stateless Interactions responses with replayable steps.
  • GEMINI_MODELS, GeminiModelId, getGeminiModel, and isGeminiModelId.
  • geminiToolDefinitionSchema and assertGeminiToolsSupported.
  • Contract augmentation for @ank1015/agents-contracts.

Provider Config

Gemini provider config uses a secret reference for the API key:

import {
  GEMINI_PROVIDER,
  geminiProviderConfigSchema,
} from '@ank1015/agents-provider-gemini-spec';

const config = geminiProviderConfigSchema.parse({
  provider: GEMINI_PROVIDER,
  apiKey: {
    type: 'env',
    name: 'GEMINI_API_KEY',
  },
});

Callers that already have a key from another secret source can pass a direct value reference:

const config = geminiProviderConfigSchema.parse({
  provider: GEMINI_PROVIDER,
  apiKey: {
    type: 'value',
    value: geminiKey,
  },
});

Provider Options

GeminiProviderOptions intentionally exposes a small Interactions API subset. The generic LLM layer owns model, input, stream, system_instruction, tools, store, and previous_interaction_id.

The option surface currently includes:

  • generation_config.thinking_level
  • generation_config.thinking_summaries
  • generation_config.max_output_tokens
  • generation_config.tool_choice
  • generation_config.stop_sequences
  • generation_config.seed
  • generation_config.temperature
  • generation_config.top_p
  • generation_config.top_k
  • response_format for text output and JSON-schema structured output.
  • built_in_tools for Gemini-managed tools: Google Search, Google Maps, Code Execution, URL Context, and File Search.

Generic request.tools remains function-tool only in v1. assertGeminiToolsSupported rejects generic custom grammar tools; use providerOptions.response_format with mime_type: "application/json" for structured output.

built_in_tools is intentionally separate from request.tools:

const providerOptions = {
  built_in_tools: [
    { type: 'google_search' },
    { type: 'code_execution' },
  ],
};

The Gemini runtime adapter will combine these Gemini-managed tools with converted generic function tools when building the Interactions API tools array.

Model Catalog

Runtime support is catalog-only:

| Model | Model id | Input | Context | Max output | Input / Cached Input / Output | | --- | --- | --- | --- | --- | --- | | Gemini 3.5 Flash | gemini-3.5-flash | Text, image | 1,048,576 tokens | 65,536 tokens | $1.50 / $0.15 / $9.00 | | Gemini 3.1 Pro Preview | gemini-3.1-pro-preview | Text, image | 1,048,576 tokens | 65,536 tokens | $2.00 / $0.20 / $12.00 up to 200k prompt tokens | | Gemini 3.1 Flash-Lite | gemini-3.1-flash-lite | Text, image | 1,048,576 tokens | 65,536 tokens | $0.25 / $0.025 / $1.50 |

Gemini 3.1 Pro Preview also includes pricingTiers metadata for prompts over 200k tokens: $4.00 input, $0.40 cached input, and $18.00 output per 1M tokens.

All models use 0 as the cache write cost because the shared usage model does not represent hourly cache storage costs.

Type Augmentation

Importing this package augments @ank1015/agents-contracts so Gemini requests can narrow provider-specific fields:

import type { LLMRequest } from '@ank1015/agents-contracts';
import type { GeminiProvider } from '@ank1015/agents-provider-gemini-spec';

const request: LLMRequest<GeminiProvider> = {
  provider: 'gemini',
  modelId: 'gemini-3.5-flash',
  messages: [],
};

Versioning

This package is currently 0.1.1. Until 1.0.0, model metadata and provider option types may evolve as the surrounding agent runtime settles.