Skip to content

TelegramGPT is a Telegram chatbot powered by OpenAI's GPT-3.5 Turbo model created using Python. It reads messages from a specified chat file and responds to user messages in Telegram using the GPT-3.5 Turbo model.

License

Notifications You must be signed in to change notification settings

RanitManik/TelegamGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TelegramGPT Chatbot

Welcome to the comprehensive setup guide for the ChatGPT Text Generation Service, a powerful tool that utilizes the state-of-the-art GPT-3.5 Turbo model to generate natural language text. Follow this step-by-step guide to set up the Text Generation Service and unlock the capabilities of ChatGPT.

Table of Contents

Overview

TelegramGPT is a Telegram chatbot powered by OpenAI's GPT-3.5 Turbo model created using Python. It reads messages from a specified chat file and responds to user messages in Telegram using the GPT-3.5 Turbo model.

Features

  • Seamless integration with Telegram
  • Configurable chat file selection
  • Utilizes OpenAI GPT-3.5 Turbo for natural language understanding
  • Easy-to-use and extendable

Installation

1. Clone the Repository

git clone https://github.com/YourUsername/ChatGPT-Text-Generation

2. Install Required Packages

pip install -r requirements.txt

Usage

1. Set up Telegram Bot

  1. Create a Telegram bot on the Telegram BotFather.

  2. Copy the bot token.

  3. Replace Your Telegram Bot Token Goes here in the .env file with the actual bot token.

2. Create an OpenAI Account

  1. Visit the OpenAI website: https://beta.openai.com/

  2. Sign up for an account if you don't have one. Follow the registration process.

3. Access the OpenAI API Section

  1. Once you're logged in, navigate to the OpenAI API section.

    • On the OpenAI dashboard, click on your account name in the top right corner.
    • Select "API" from the dropdown menu.

4. Create a New API Key

  1. In the API section, you'll find the option to create a new API key.

  2. Click on the "Create API Key" button.

  3. Give your API key a meaningful name related to your project (e.g., "TelegramGPT").

  4. Copy the generated API key. It will look something like this: sk-xxxxxx-xxxxxxxxxxxxxx.

  5. Open the .env file in your TelegramGPT project directory.

  6. Replace the placeholder Your openAI API key goes here with the actual API key you obtained from OpenAI:

    TELEGRAM_TOKEN=your_telegram_bot_token
    OPENAI_API_KEY=sk-xxxxxx-xxxxxxxxxxxxxx
    

5. Save and Run

  1. Save the changes to the .env file.

  2. Now, when you run your TelegramGPT bot, it will use the OpenAI GPT-3.5 Turbo model with the specified API key.

6. Verify Functionality

  1. Start a chat with your Telegram bot.

  2. Use the /setfile command to set the chat file (e.g., /setfile 1).

  3. Send messages to the bot and confirm that it generates responses using the GPT-3.5 Turbo model.

By following these steps, you've successfully created an OpenAI GPT-3.5 Turbo API key and integrated it into your TelegramGPT project. This key allows your bot to communicate with the OpenAI API and generate natural language responses.

Configuration

You can configure the bot by modifying the following variables in main.py:

  • fileNumber: Change the chat file by setting this variable to 1, 2, or 3 before /setfile flag and send it to bot.
  • model: Specify the GPT model to be used (default is "gpt-3.5-turbo").
  • Adjust other parameters like temperature, max_tokens, top_p, frequency_penalty, and presence_penalty as needed.

Chat Files

Text Generation

Experiment with the service by sending text prompts and receiving generated responses. Adjust configuration parameters for different text generation styles.

Contributing

  1. Clone the repository:

    git clone https://github.com/RanitManik/TelegamGPT.git
  2. Add This repo as Remote:

    git remote add origin https://github.com/RanitManik/TelegamGPT.git
  3. Create a New Branch for your feature or bugfix:

    git checkout -b feature/{your_feature} or bugfix/{issue_number}
  4. Commit your changes:

    git commit -m "Your meaningful commit message here"
  5. Push your changes to the repository:

    git push origin feature/{your_feature} or bugfix/{issue_number}

Feel free to contribute to the project by opening issues or pull requests. Any feedback or improvements are appreciated.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

Social Media Username Link
Email ranitmanik.dev@gmail.com Email
LinkedIn Ranit Manik LinkedIn
Instagram ranit_manik_ Instagram
Facebook RanitKumarManik Facebook
Twitter RANIT_MANIK Twitter

Acknowledgment

I want to express my gratitude to CodeWithHarry for his insightful tutorial on creating the myGPT Discord Chatbot using OpenAI's GPT-3.5 Turbo model, which served as a crucial guide. Special thanks to contributors and the open-source community for enhancing the project. The inspiration behind TelegramGPT arose from the need for an advanced Telegram chatbot leveraging OpenAI's GPT-3.5 Turbo.

Best regards, Ranit Manik

About

TelegramGPT is a Telegram chatbot powered by OpenAI's GPT-3.5 Turbo model created using Python. It reads messages from a specified chat file and responds to user messages in Telegram using the GPT-3.5 Turbo model.

Topics

Resources

License

Stars

Watchers

Forks

Languages