Anvia
Providers

Gemini

Use Gemini and Vertex AI models through the Anvia provider layer.

Use GeminiClient when you want Gemini completion and embedding models through Anvia's normalized runtime.

Gemini API

import { AgentBuilder } from "@anvia/core";
import { GeminiClient } from "@anvia/gemini";

const client = new GeminiClient({ apiKey });
const model = client.completionModel("gemini-2.5-flash");

const agent = new AgentBuilder("support", model)
  .instructions("Answer support questions clearly.")
  .build();

Vertex AI

const client = new GeminiClient({
  vertexai: true,
  project,
  location,
});

Anvia does not read Google environment variables. Pass values from your application configuration.

Embedding Model

const embeddings = client.embeddingModel("gemini-embedding-001", {
  taskType: "RETRIEVAL_DOCUMENT",
  dimensions: 768,
});

Use embedding models for document preprocessing and retrieval.

Provider Notes

Gemini v1 support covers text completions, tools, structured output, streaming, Gemini embeddings, and Vertex AI client construction. Image and document attachments are intentionally rejected until Anvia adds full multimodal mapping for Gemini.