Gemini (Google) operations
This client mirrors and verifies upstream-compatible behavior. Upstream runtimes remain the canonical protocol owners.
Runtime-only provider over the Gemini Developer API (generativelanguage.googleapis.com). Auth: x-goog-api-key. The model is part of the URL path, not the body, and an explicit model is required — no default ships (GEMINI_API_VERSION is v1beta). generateContent is synchronous request/response; getRun/cancelRun return the client-remembered terminal status via SynchronousRunStore (they do not throw EndpointNotFound). The batch surface is supported over batchGenerateContent.
Capability (GEMINI_RUNTIME_SUPPORT): runs ✅ · getRun ✅ (client-local) · cancelRun ✅ (client-local) · streamRun ✅ · batch ✅.
Path notation. Gemini route helpers build paths as
/${GEMINI_API_VERSION}/${resource}— the version prefix is a constant and the model/batch resource is interpolated. The**HTTP**lines below write that resource as a leading path variable (:model=models/<id>,:batch=batches/<id>) after the/v1betaprefix; the only static path literal ingemini/paths.tsis the files-upload path.
startRun
Requires model; maps the universal body to a Gemini generateContent request and normalizes output/tokens from the response. See runtime · startRun for the full field tables.
Example
import { createGeminiProviderModule } from "@cavi-ai/api-client/providers/gemini";
// … construct the runtime client (explicit model required), then:
const run = await client.startRun({ input: "Hi", model: "gemini-2.5-pro" });streamRun
Streams streamGenerateContent SSE chunks, normalized to canonical run-stream events. See runtime · streamRun.
getRun / cancelRun
generateContent is synchronous — the run is terminal when startRun returns. getRun/cancelRun degrade to the remembered terminal result (unknown ids do not throw). Field tables per runtime · getRun / cancelRun.
submitBatch / getBatch / cancelBatch / getBatchResults
submitBatch posts to batchGenerateContent; getBatch/cancelBatch act on the returned batch resource name; getBatchResults reads the batch and returns inline or file-backed results (throwing EndpointNotFound while results are not yet available — poll getBatch first). Field tables per runtime · batch operations.