Skip to main content

A module for using the ChatGPT Free (Needs Chrome or Chromium browser)

Project description

libgpt

The libgpt module is designed to facilitate interaction with the free text generation platform FreeGPT.One. It provides a ChatGPT function that leverages the selenium and undetected_chromedriver libraries to submit a prompt and retrieve a generated text response from the free GPT-3 alternative.

Installation

libgpt can be installed via pip using the following command:

pip install libgpt

Usage

The ChatGPT function is the main functionality of the module and takes in three parameters: request, chromedriver, chromepath.

import libgpt
prompt = "I'm feeling bored today. Can you suggest some interesting activities?"
response = libgpt.ChatGPT(request=prompt)
print(response)

The request parameter is a string that prompts the FreeGPT.One model to generate a text response. The optional chromedriver and chromepath parameters allow the user to specify a custom path to the Chrome Driver executable and Chrome browser installation, respectively.

Functionality

Once the ChatGPT function is invoked, it automatically navigates to the FreeGPT.One website and enters the prompt. It then waits for the generated text response by parsing the HTML of the website and checking for the :::::end:::::: flag, indicating the end of the generated response. The generated text is then returned as a string.

Dependencies

libgpt needs Chrome or Chromium. libgpt relies on the selenium and undetected_chromedriver libraries. These can be installed via pip by executing the following commands:

pip install selenium
pip install undetected-chromedriver

Disclaimer

This module is not endorsed by or affiliated with the FreeGPT.One platform in any way. The module is intended for educational purposes only, and any misuse or abuse of the FreeGPT.One platform is not the responsibility of the module's author or maintainers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libgpt-1.0.0a4.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file libgpt-1.0.0a4.tar.gz.

File metadata

  • Download URL: libgpt-1.0.0a4.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for libgpt-1.0.0a4.tar.gz
Algorithm Hash digest
SHA256 6e5c7bcd3f6cbee777d8e60c63f4b0c260543e54eae451e6047c01a05c0bb08c
MD5 4417de3cb9ea696daeda161b341000d6
BLAKE2b-256 1f1b3a55d0247ae4103543cfc35f95d1e1edaf56a64739da7c4ae7af0d909679

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page