Skip to content

About

A client for the Google Gemini API: generate content with tools, structured output and thinking, embeddings, files, context caching

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

@deckyard/gemini

test Documentation release

A client for the Google™ Gemini™ API as Google AI Studio serves it, for Jennifer programs: generate content from text and media with a system instruction, function calling and a tool loop that keeps thought signatures, structured output, thinking and safety settings; count tokens; embeddings; model listing; the Files API for large media; context caching. Requests and replies are Google's own JSON, every request has a deadline and a reply cap, and rate limits are retried with backoff.

Documentation

Install

jvc add @deckyard/gemini

This vendors the deck to vendor/@deckyard/gemini/. Without jvc, unpack the src/ subtree of a release archive (deckyard-gemini-<version>.tar.gz) there.

Usage

import "@deckyard/gemini/" as gemini;
use io;
use json;
use os;

def c as gemini.Client init gemini.client(os.getEnv("GEMINI_API_KEY"));
def req as json.Value init gemini.newRequest("gemini-3.8-flash");
$req = gemini.withSystem($req, "Answer in one sentence.");
$req = gemini.addUserText($req, "Why is the sky blue?");
io.printf("%s\n", gemini.text(gemini.chat($c, $req)));

A key comes from Google AI Studio; the free tier needs no billing account. The examples in examples/ (a conversation, a tool loop, a file upload) read it from GEMINI_API_KEY.

Requirements

Jennifer 0.28.0 or newer, the default binary: the deck opens network connections (capability net), so it does not load on jennifer-tiny. No streaming yet (it waits for streaming http); no Vertex AI™ yet.

Development

tools/check-all.sh                   # the full gate, as CI runs it
jennifer test src/gemini_test.j      # the test overlay, against a loopback fake
tools/check-docs.sh                  # docs against the code
tools/pack.sh dist                   # build the release archive

Trademarks

Google™, Gemini™ and Vertex AI™ are trademarks of Google LLC. Other product and company names may be trademarks of their respective owners. They are used only to identify the products this deck works with. This deck is an independent project, not affiliated with, sponsored or endorsed by Google LLC.

Licence

LGPL-3.0-only, see LICENSE. Copyright (C) 2026 mplx <mplx@jennifer-lang.dev>.

About

A client for the Google Gemini API: generate content with tools, structured output and thinking, embeddings, files, context caching

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors