Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ezralazuardy/gem
💎 A more fun way to interact with Gemini.
https://github.com/ezralazuardy/gem
ai gemini npm vercel
Last synced: 3 months ago
JSON representation
💎 A more fun way to interact with Gemini.
- Host: GitHub
- URL: https://github.com/ezralazuardy/gem
- Owner: ezralazuardy
- License: mit
- Created: 2024-05-22T13:14:48.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-22T15:29:20.000Z (8 months ago)
- Last Synced: 2024-05-22T15:33:44.845Z (8 months ago)
- Topics: ai, gemini, npm, vercel
- Language: TypeScript
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README
## 💎 gem
A more fun way to interact with Gemini.
```typescript
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
```bash
npm install @ezralazuardy/gem
```Set the environment variables
```bash
GEMINI_API_KEY=""
```Ask the Gemini.
```typescript
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](#-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.
```bash
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](https://ai.google.dev/gemini-api/docs/models/gemini), [Gemini API Pricing](https://ai.google.dev/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](https://www.typescriptlang.org). Heavily inspired by [Vercel AI](https://sdk.vercel.ai) and [Gemini](https://gemini.google.com).