Skip to content

Repository files navigation

ChatGptBotAPI Flask Application

This is a Flask application that provides an API for interacting with the ChatGptBotAPI, allowing you to create, read, update, and delete prompts, and get responses from the OpenAI GPT-3 model.

Features

  • Create a new prompt
  • Read prompts by index or get responses from prompts
  • Update prompts
  • Delete prompts

Installation

  1. Clone the repository:
          git clone https://github.com/mab3321/openAiBot.git
          cd openAiBot```
  2. Install dependencies using pip: pip install -r requirements.txt
  3. Set up your .env File: Rename the .env.example file to .env and replace OPENAI_API_KEY with your actual OpenAI API key. Run the Flask application: python app.py

Access the endpoints using HTTP requests. You can use tools like curl or software like Postman for testing. For Getting The Collections You can Use Following Link :(https://grey-robot-983360.postman.co/workspace/New-Team-Workspace~5ccf99c2-888d-498b-8b6d-afcc04e9ec57/collection/24157295-0dae2534-ded7-4e59-aa82-f5d6a502d92b?action=share&creator=24157295)

Endpoints

  • POST /create: Create a new prompt.
  • GET /read?index=: Read a prompt by index.
  • GET /get_response?index=: Get a response from a prompt.
  • PUT /update: Update a prompt.
  • DELETE /delete: Delete a prompt

Testing

To run the unit tests, you can use the following command: python test.py

Using Docker

You can also run the application using Docker for easy containerization:

Build the Docker image:

docker build -t chatgptbotapi-flask-app .

Run the Docker container:

docker run -p 5000:5000 chatgptbotapi-flask-app

Access the endpoints as usual.

.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages