-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b91a144
commit 29c1848
Showing
13 changed files
with
1,936 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"loader": "ts-node/esm", | ||
"require": ["ts-node/register", "chai/register-expect.js"], | ||
"extensions": ["ts", "tsx"], | ||
"spec": ["tests/**/*.test.*"], | ||
"watch-files": ["src"], | ||
"allowImportingTsExtensions": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,68 @@ | ||
<div> | ||
<img alt="Build" src="https://github.com/ezralazuardy/gem/actions/workflows/build.yml/badge.svg" /> | ||
<img alt="CodeQL Analysis" src="https://github.com/ezralazuardy/gem/actions/workflows/github-code-scanning/codeql/badge.svg" /> | ||
<img alt="NPM License" src="https://img.shields.io/npm/l/%40ezralazuardy%2Fgem" /> | ||
<img alt="NPM Unpacked Size" src="https://img.shields.io/npm/v/%40ezralazuardy%2Fgem" /> | ||
<img alt="NPM Unpacked Size" src="https://img.shields.io/npm/unpacked-size/%40ezralazuardy%2Fgem" /> | ||
<img alt="NPM Type Definitions" src="https://img.shields.io/npm/types/%40ezralazuardy%2Fgem" /> | ||
<img alt="Build" src="https://github.com/ezralazuardy/aksara/actions/workflows/build.yml/badge.svg" /> | ||
<img alt="CodeQL Analysis" src="https://github.com/ezralazuardy/aksara/actions/workflows/github-code-scanning/codeql/badge.svg" /> | ||
<img alt="NPM License" src="https://img.shields.io/npm/l/%40ezralazuardy%2Faksara" /> | ||
<img alt="NPM Unpacked Size" src="https://img.shields.io/npm/v/%40ezralazuardy%2Faksara" /> | ||
<img alt="NPM Unpacked Size" src="https://img.shields.io/npm/unpacked-size/%40ezralazuardy%2Faksara" /> | ||
<img alt="NPM Type Definitions" src="https://img.shields.io/npm/types/%40ezralazuardy%2Faksara" /> | ||
</div> | ||
|
||
## 💎 gem | ||
## ꦲ aksara | ||
|
||
A more fun way to interact with Gemini. | ||
Translate a text into Javanese Script in one line of code. | ||
|
||
```typescript | ||
await ask("am i deserve better?"); | ||
translate("aksara jawa"); // ꦲꦏ꧀ꦱꦫꦗꦮ | ||
``` | ||
|
||
Gem is a simple package that allows you to interact with the Gemini API in a more human-friendly way. | ||
Aksara is a simple package that helps you to translate your text into Javanese Script or also known as _Aksara Jawa_, which is one of the most beautiful scripts in the world. | ||
|
||
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. | ||
The translated text will be formatted as [Unicode](https://home.unicode.org) string of Javanese Script characters that can be used in any text editor or web browser, without any specific font requirement. | ||
|
||
> 🚧 This package is still under heavy development. Beware of breaking changes. | ||
It's also typescript compatible, so you can use it in any javascript or typescript project. | ||
|
||
> Reference: [Wikipedia](https://en.wikipedia.org/wiki/Javanese_script) | ||
<br/> | ||
|
||
### 🚀 Getting Started | ||
|
||
It's only require 3 simple steps to get started. | ||
It's only require 2 simple steps to get started. | ||
|
||
Install the package | ||
|
||
```bash | ||
npm install @ezralazuardy/gem | ||
``` | ||
|
||
Set the environment variables | ||
|
||
```bash | ||
GEMINI_API_KEY="<YOUR_GEMINI_API_KEY>" | ||
npm install @ezralazuardy/aksara | ||
``` | ||
|
||
Ask the Gemini. | ||
And use it! | ||
|
||
```typescript | ||
import { ask } from "@ezralazuardy/gem"; | ||
import { translate } from "@ezralazuardy/aksara"; | ||
|
||
const response = await ask("what is the weather today?"); | ||
|
||
console.log(response); | ||
console.log(translate("aksara jawa")); // ꦲꦏ꧀ꦱꦫꦗꦮ | ||
``` | ||
|
||
Yup, just like that! Simple, right? | ||
|
||
For advanced usage, please read the [documentation](#-documentation) below. | ||
|
||
<br/> | ||
|
||
### ⚙️ 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` | ||
### 🔄 Revert Translation | ||
|
||
> 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). | ||
If you want to revert the translation, you can just use the `translate` function again. | ||
|
||
<br/> | ||
|
||
### 🚥 Roadmap | ||
```typescript | ||
import { translate } from "@ezralazuardy/aksara"; | ||
|
||
The following features are planned to be implemented in the future. | ||
console.log(translate("ꦲꦏ꧀ꦱꦫꦗꦮ")); // aksara jawa | ||
``` | ||
|
||
| 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. | | ||
No need to use other function. Simple, right? | ||
|
||
<br/> | ||
|
||
### 📖 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). | ||
> Written in [Typescript](https://www.typescriptlang.org). Heavily inspired by [@bennylin](https://github.com/bennylin). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,10 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js"; | ||
import { fixupConfigRules } from "@eslint/compat"; | ||
|
||
|
||
export default [ | ||
{ | ||
languageOptions: { globals: globals.node }, | ||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
}, | ||
}, | ||
{languageOptions: { globals: {...globals.browser, ...globals.node} }}, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
...fixupConfigRules(pluginReactConfig), | ||
]; | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
{ | ||
"name": "@ezralazuardy/gem", | ||
"version": "0.0.8", | ||
"description": "💎 A more fun way to interact with Gemini.", | ||
"name": "@ezralazuardy/aksara", | ||
"version": "0.0.1", | ||
"description": "ꦲ Headless javanese script translator.", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"/dist" | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"lint": "eslint src/ --cache", | ||
"prepare": "npm run build && npm run lint" | ||
"test": "mocha" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ezralazuardy/gem.git" | ||
"url": "git+https://github.com/ezralazuardy/aksara.git" | ||
}, | ||
"keywords": [ | ||
"gem", | ||
"gemini", | ||
"google", | ||
"ai", | ||
"aksara", | ||
"javanese", | ||
"jawa", | ||
"translate", | ||
"npm", | ||
"pnpm", | ||
"yarn", | ||
|
@@ -31,36 +30,32 @@ | |
"author": "Ezra Lazuardy <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ezralazuardy/gem/issues" | ||
"url": "https://github.com/ezralazuardy/aksara/issues" | ||
}, | ||
"homepage": "https://github.com/ezralazuardy/gem#readme", | ||
"homepage": "https://github.com/ezralazuardy/aksara#readme", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@ai-sdk/google": "^0.0.14", | ||
"ai": "^3.1.12", | ||
"dotenv": "^16.4.5", | ||
"openai": "^4.47.1", | ||
"react": "^18.3.1", | ||
"typescript": "^5.4.5", | ||
"zod": "^3.23.8" | ||
"typescript": "^5.4.5" | ||
}, | ||
"devDependencies": { | ||
"@eslint-community/eslint-utils": "^4.4.0", | ||
"@eslint/compat": "^1.0.1", | ||
"@eslint/js": "^9.3.0", | ||
"@types/json-schema": "^7.0.15", | ||
"@eslint/js": "^9.4.0", | ||
"@types/chai": "^4.3.16", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "^20.12.12", | ||
"@types/react": "^18.3.2", | ||
"@types/react-dom": "^18.3.0", | ||
"@typescript-eslint/eslint-plugin": "^7.10.0", | ||
"@typescript-eslint/parser": "^7.10.0", | ||
"@typescript-eslint/type-utils": "^7.10.0", | ||
"@typescript-eslint/utils": "^7.10.0", | ||
"eslint": "^8.56.0", | ||
"chai": "^4.4.1", | ||
"eslint": "9.x", | ||
"eslint-plugin-react": "^7.34.1", | ||
"globals": "^15.3.0", | ||
"typescript-eslint": "^7.10.0" | ||
"mocha": "^10.4.0", | ||
"ts-node": "^10.9.2", | ||
"typescript-eslint": "^7.12.0" | ||
} | ||
} |
Oops, something went wrong.