Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/evanzhoudev/gemini-ai

The easiest way to use the powerful Google Gemini model.
https://github.com/evanzhoudev/gemini-ai

ai gemini google

Last synced: 7 days ago
JSON representation

The easiest way to use the powerful Google Gemini model.

Awesome Lists containing this project

README

        

Gemini AI


Welcome to the Gemini era.














Docs | GitHub | FAQ

## Installation

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

```bash
npm install gemini-ai
```

## Quickstart

Make a text request:

```javascript
import Gemini from "gemini-ai";

const gemini = new Gemini(API_KEY);

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

Make a streaming text request:

```javascript
import Gemini from "gemini-ai";

const gemini = new Gemini(API_KEY);

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

Chat with Gemini:

```javascript
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

- [**Installation**](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#installation)
- [**Getting an API Key**](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#getting-an-api-key)
- [**Quickstart**](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#quickstart)
- [**Special Features**](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#special-features)
- [**Documentation**](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#documentation)
- [Initialization](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#inititalization)
- [Method Patterns](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#method-patterns)
- [`Gemini.ask()` Method](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#geminiask)
- [`Gemini.count()` Method](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#geminicount)
- [`Gemini.embed()` Method](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#geminiembed)
- [`Gemini.createChat()` Method](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#geminicreatechat)
- [**FAQ**](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#faq)
- [**Contributors**](https://github.com/EvanZhouDev/gemini-ai?tab=readme-ov-file#contributors)