gemini-ai
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

Gemini AI

Welcome to the Gemini era.

Docs | GitHub | FAQ

Installation

Install with the following command, or the command for your favorite package manager.

npm install gemini-ai

Quickstart

Make a text request:

import Gemini from "gemini-ai";

const gemini = new Gemini(API_KEY);

console.log(await gemini.ask("Hi!"));

Make a streaming text request:

import Gemini from "gemini-ai";

const gemini = new Gemini(API_KEY);

gemini.ask("Hi!", {
	stream: console.log,
});

Chat with Gemini:

import Gemini from "gemini-ai";

const gemini = new Gemini(API_KEY);
const chat = gemini.createChat();

console.log(await chat.ask("Hi!"));
console.log(await chat.ask("What's the last thing I said?"));

Read the full docs at https://github.com/EvanZhouDev/gemini-ai.

Table of Contents

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.2.0
    505
    • latest

Version History

Package Sidebar

Install

npm i gemini-ai

Weekly Downloads

1,706

Version

2.2.0

License

GPL-3.0

Unpacked Size

99.8 kB

Total Files

6

Last publish

Collaborators

  • evanzhoudev