Skip to content

Documentation / @agentick/google

@agentick/google ​

Google AI / Vertex AI adapter for Agentick.

Installation ​

bash
pnpm add @agentick/google

Usage ​

tsx
import { google } from "@agentick/google";
import { createApp } from "@agentick/core";

// Google AI Studio
const model = google({
  apiKey: process.env.GOOGLE_API_KEY,
  model: "gemini-2.0-flash",
});

// Use with createApp
const app = createApp(MyAgent, { model });
const session = await app.session();
await session.run({ messages: [{ role: "user", content: [{ type: "text", text: "Hello!" }] }] });

// Or use as JSX component
function MyAgent() {
  return (
    <model temperature={0.7}>
      <System>You are helpful.</System>
      <Timeline />
    </model>
  );
}

// Or call directly
const result = await model.generate({
  messages: [{ role: "user", content: "Hello!" }],
});

Vertex AI ​

tsx
const model = google({
  vertexai: true,
  project: process.env.GCP_PROJECT_ID,
  location: "us-central1",
  model: "gemini-2.0-flash",
  googleAuthOptions: {
    credentials: JSON.parse(process.env.GCP_CREDENTIALS),
  },
});

JSX Component Pattern ​

tsx
import { GoogleModel } from "@agentick/google";

function MyAgent() {
  return (
    <GoogleModel apiKey={process.env.GOOGLE_API_KEY} model="gemini-2.0-flash" temperature={0.7}>
      <System>You are helpful.</System>
      <Timeline />
    </GoogleModel>
  );
}

Configuration ​

OptionTypeDescription
modelstringModel name (e.g., gemini-2.0-flash)
apiKeystring?Google AI Studio API key
vertexaiboolean?Use Vertex AI instead
projectstring?GCP project ID (Vertex)
locationstring?GCP region (Vertex)
googleAuthOptionsobject?Auth options (Vertex)
temperaturenumber?Sampling temperature
maxTokensnumber?Maximum tokens to generate

Exports ​

  • google(config) - Factory function returning ModelClass
  • createGoogleModel(config) - Same as google()
  • GoogleModel - JSX component for declarative usage

Agentick Google AI Adapter ​

Native Google AI (Gemini) adapter for Agentick. Provides direct integration with Google's Gemini models without requiring the Vercel AI SDK.

Features ​

  • Native API - Direct Google AI API integration
  • Streaming - Full streaming support
  • Tool Calling - Native function calling support
  • Multimodal - Image and document understanding
  • All Models - Gemini Pro, Gemini Flash, and more

Quick Start ​

typescript
import { google } from '@agentick/google';

const model = google('gemini-1.5-pro');

// Use with app
const app = createApp(<MyAgent />);
const result = await app.run({ messages });

Interfaces ​

Functions ​

Released under the ISC License.