This NodeJS module acts as a wrapper for ChatGPT API and will help you to use ChatGPT in your own language.
Install chatgpt-intl via npm : https://www.npmjs.com/package/chatgpt-intl
npm i chatgpt-intl
First, you have to obtain your API key from OPENAI, then you can use it here.
import ChatGPTIntl from 'chatgpt-intl';
import dotenv from "dotenv";
dotenv.config();
const text = "ChatGPT ගැන කියන්න"
const openAiKey = process.env.openAiKey
const lang = 'si';
const opts = {
model: "text-davinci-003",
temperature: 0.9,
max_tokens: 150,
top_p: 1,
frequency_penalty: 0.0,
presence_penalty: 0.6
};
ChatGPTIntl(text, openAiKey, opts, lang).then((res) => {
console.log(res);
}).catch((er)=> {
console.log(er);
});
text - Type: string (The text to be translated)
openAiKey - Type: string (API Key obtained from OpenAI Developer Account)
opts - Type: object (OpenAI Language Model and hyperparameters)
lang - Type: string ( Must be auto
or one of the codes (not case sensitive) contained in SUPPORTED_LANGUAGES.md.)
- Use ChatGPT API in your own language
- Ability to customize the chatGPT model
- Supports more than 50 languages
- Does not support for syntax and codes
- Does not support larger text inputs
Supported language codes contained in SUPPORTED_LANGUAGES.md
npm run demo
- Issues and feature updates are welcome.