A module for using GPT-3/4 for free (Needs Chrome or Chromium browser for GPT-3)
Project description
libgpt
libgpt is a Python module that provides functions to interact with GPT3 and GPT4 models using different backends.
Cookie files:
- This module only accepts cookie files in JSON format.
GPT3 Backends:
- This module supports two GPT3 backends: freegpt and thebai.
GPT4 Backend:
- This module supports only one GPT4 backend: Bing Chat.
Dependencies:
- This module requires selenium and undetected_chromedriver libraries.
How to Extract a Cookie File? (Required for GPT4)
To extract a cookie file, please follow these instructions:
- Install the cookie editor extension for Chrome or Firefox.
- Go to bing.com.
- Open the extension.
- Click "Export" on the bottom right, then "Export as JSON" (This saves your cookies to clipboard).
- Paste your cookies into a file called cookies.json.
Usage:
GPT3
To use the GPT3 backend, you can call the function GPT3() with the prompt you want to provide as the only argument.
from libgpt import GPT3
response = GPT3("I need a prompt for my essay about quantum mechanics.")
print(response)
This will return a string with the response generated by the GPT3 model using the freegpt backend.
You can also specify the backend you want to use by passing the backend parameter.
from libgpt import GPT3
response = GPT3("I need a prompt for my essay about quantum mechanics.", backend="thebai")
print(response)
This will return a string with the response generated by the GPT3 model using the thebai backend, which may produce different results.
GPT4
To use the GPT4 backend, you can call the function GPT4() with the prompt you want to provide and the path to the cookie file you extracted as parameters.
from libgpt import GPT4
response = GPT4("I need a prompt for my essay about quantum mechanics.", "cookies.json")
print(response)
This will return a string with the response generated by the GPT4 model using the Bing Chat backend and the Creative conversation style by default.
You can also specify the conversation style you want to use by passing the style parameter.
from libgpt import GPT4
response = GPT4("I need a prompt for my essay about quantum mechanics.", "cookies.json", style="Precise")
print(response)
This will return a string with the response generated by the GPT4 model using the Bing Chat backend and the Precise conversation style.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file libgpt-1.0.1.tar.gz.
File metadata
- Download URL: libgpt-1.0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bb59a26b014195baf37b8be8eaa20bc70cabd6e09aafc9e4cbdbbc6e71204c3
|
|
| MD5 |
44d4f46222480b4969ca82cafd903342
|
|
| BLAKE2b-256 |
f2ccb2cc7320b448bb3928c76c4b57a5022d8b59279a9a21c9a2f63e73a28ee1
|