Skip to content

πŸ’Ž A more fun way to interact with Gemini.

License

Notifications You must be signed in to change notification settings

ezralazuardy/gem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Build CodeQL Analysis NPM License NPM Unpacked Size NPM Unpacked Size NPM Type Definitions

πŸ’Ž gem

A more fun way to interact with Gemini.

await ask("am i deserve better?");

Gem is a simple package that allows you to interact with the Gemini API in a more human-friendly way.

It's like talking to a friend, but in a more professional way. It's simplify the process of sending requests to the Gemini API, so you can focus more on the conversation itself. It's even more simpler than other API wrappers.

🚧 This package is still under heavy development. Beware of breaking changes.


πŸš€ Getting Started

It's only require 3 simple steps to get started.

Install the package

npm install @ezralazuardy/gem

Set the environment variables

GEMINI_API_KEY="<YOUR_GEMINI_API_KEY>"

Ask the Gemini.

import { ask } from "@ezralazuardy/gem";

const response = await ask("what is the weather today?");

console.log(response);

Yup, just like that! Simple, right?

For advanced usage, please read the documentation below.


βš™οΈ Using Specific Model

By default, the model used is gemini-pro. You can change it by setting the GEMINI_MODEL_ID environment variable.

GEMINI_MODEL_ID="gemini-pro"

Please beware of the pricing and capabilities of each model.

As of v0.0.1, the following models are available:

  • gemini-pro (default)
  • gemini-1.5-pro-latest

Plase refer to these references: Gemini API Models, Gemini API Pricing.


πŸš₯ Roadmap

The following features are planned to be implemented in the future.

Supported Method Version Usage
🟒 ask v0.0.1+ Generates text for a given prompt.
πŸ”΄ askByStream - Streams a text generations.
πŸ”΄ object - Generates a typed, structured object for a given prompt.
πŸ”΄ objectByStream - Streams a typed, structured object for a given prompt.

πŸ“– Documentation

A proper documentation is still in progress πŸ₯²

Written in Typescript. Heavily inspired by Vercel AI and Gemini.