pyChatGPT-intl

This Python3 module acts as a wrapper for ChatGPT API and will help you to use ChatGPT in your own language.


Keywords
bot, chatbot, chatgpt, facebook, intl, language, nlp, pychatgpt, python, python3, telegram, translate, whatsapp
License
GPL-3.0
Install
pip install pyChatGPT-intl==0.0.5

Documentation

pyChatGPT-intl

Version Package Size Upload Python Package Pylint Snyk CodeQL

Enhanced ChatGPT Wrapper for Internationalization - Python3

This NodeJS module acts as a wrapper for ChatGPT API and will help you to use ChatGPT in your own language. Logo

Installation

Install chatgpt-intl via pip : https://pypi.org/project/pyChatGPT-intl/

 pip install pyChatGPT-intl

Usage/Examples

First, you have to obtain your API key from OPENAI, then you can use it here.

from pyChatGPT-intl import PyChatGPTIntl

api_key = "sk-Z9bfKN34RT***********RtH4j0FCacAxD"
desired_lang ="si"

opts = {
                "model": "text-davinci-003",
                "temperature": 0.5,
                "max_tokens": 100,
                "top_p": 1,
                "frequency_penalty": 0,
                "presence_penalty": 0
            }

pyChatGPTIntl = PyChatGPTIntl(api_key, desired_lang, opts)
print(pyChatGPTIntl.generate_text("ශ්‍රී ලංකාව ගැන මට විස්තරයක් කියන්න"))

API

text - Type: string (The text to be translated)

api_key - Type: string (API Key obtained from OpenAI Developer Account)

opts - Type: object (OpenAI Language Model and hyperparameters)

desired_lang - Type: string ( Must be auto or one of the codes (not case-sensitive) contained in SUPPORTED_LANGUAGES.md.)

Features

  • Use ChatGPT API in your own language
  • Ability to customize the chatGPT model
  • Supports more than 50 languages

Limitations

  • Does not support for syntax and codes
  • Does not support larger text inputs

Language Support

Supported language codes contained in SUPPORTED_LANGUAGES.md

Demo

python3 chatGPT-intl.py

Sample App I created. Demo

Authors

Contributions

  • Issues and feature updates are welcome.

License

MIT