GithubHelp home page GithubHelp logo

dransvasta / free-chatgptapi Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 37.26 MB

A Flask web application providing an educational API to interact with the OpenAI GPT chat interface. Launch ChatGPT chat sessions, send prompts, and retrieve responses.

Python 99.66% CSS 0.03% HTML 0.01% C 0.15% JavaScript 0.06% Shell 0.02% Batchfile 0.01% PowerShell 0.08%
flask python seleniumbase

free-chatgptapi's Introduction

free-chatgptapi

free-chatgptapi is a simple Flask web application that provides an API for interacting with the OpenAI GPT chat interface. It allows users to launch GPT chat sessions, send prompts, and retrieve responses.

Table of Contents

Getting Started

Prerequisites

Make sure you have the following installed:

  • Python (version 3.6 or higher)
  • pip (Python package installer)

Installation

  1. Clone the repository to your local machine:

    git clone https://github.com/your-username/free-chatgptapi.git
    cd free-chatgptapi

2.Install the required dependencies:

```bash
pip install -r requirements.txt

Aditional

Exposing Localhost with ngrok

For testing purposes, you can use ngrok to expose your local Flask application to the internet. Follow these steps:

  1. Download and Install ngrok:

    Download and install ngrok from ngrok.com.

  2. Start your Flask application:

    python app.py
    
  3. Running ngrok:

In a new terminal, navigate to the directory where ngrok is installed and run the following command:

```
ngrok http 5000

Usage

Launch GPT Session

1.To launch a new GPT chat session, make a GET request to the /launch endpoint:

'''
curl -X GET "http://localhost:5000/launch?username=your_username&pass=your_password"

This will return a JSON response with the status and the generated driverid for the session. The Json contains the driver id(['driverid']) which you will need to pass on later two requests to connect to your driver.

2.Send Prompts To send a prompt to an existing GPT chat session, make a GET request to the /promt/int:driverid endpoint:

'''
curl -X GET "http://localhost:5000/promt/your_driverid?prompt=your_prompt_text"
This will return a JSON response with the prompt and the GPT-generated response.

3.Stop GPT Session To stop an existing GPT chat session, make a GET request to the /stop/int:driverid endpoint:

'''
curl -X GET "http://localhost:5000/stop/your_driverid"

API Endpoints

1./launch: Launches a new GPT chat session. 2./promt/int:driverid: Sends a prompt to an existing GPT chat session. 3./stop/int:driverid: Stops an existing GPT chat session.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

License

This project is for educational purposes only.This project is licensed under the MIT License.

'''
Remember to replace placeholders like `your_username`, `your_password`, and `your_driverid` with the appropriate values. Also, ensure that you have accurate information about the API endpoints and functionality based on your actual code implementation.

free-chatgptapi's People

Contributors

dransvasta avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.