Documentation / @agentick/google
@agentick/google ​
Google AI / Vertex AI adapter for Agentick.
Installation ​
bash
pnpm add @agentick/googleUsage ​
Factory Pattern (Recommended) ​
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 ​
| Option | Type | Description |
|---|---|---|
model | string | Model name (e.g., gemini-2.0-flash) |
apiKey | string? | Google AI Studio API key |
vertexai | boolean? | Use Vertex AI instead |
project | string? | GCP project ID (Vertex) |
location | string? | GCP region (Vertex) |
googleAuthOptions | object? | Auth options (Vertex) |
temperature | number? | Sampling temperature |
maxTokens | number? | Maximum tokens to generate |
Exports ​
google(config)- Factory function returningModelClasscreateGoogleModel(config)- Same asgoogle()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 });