pygptwrapper - A Python Wrapper for the ChatGPT API
pygptwrapper is a Python library that provides a simple way to interact with the ChatGPT API, which is a powerful language model trained by OpenAI that can generate human-like text based on input prompts.
This library makes it easy to integrate the ChatGPT API into your Python applications, allowing you to generate text in real-time, create chatbots, or automate text generation tasks. It provides context-based model using newly introduced model gpt-3.5-turbo.
Installation
To install pygptwrapper, you can use pip:
pip install pygptwrapper
Usage
Here's a basic example of how to use pygptwrapper:
from pygptwrapper import ContextualGPT
# Instantiate the ContextualGPT object with a task and api_key
gpt = ContextualGPT(
task="You are a chatbot assistant. You will give recommendations for restaurants."
api_key=api_key
)
Initiate a conversation with instanciated bot
text = gpt.ask(question="What is the meaning of life?")
print(text)
This will generate a response from the ChatGPT API based on the input prompt. Notice that contextual conversation is stored in gpt.conversation.
Metadata
Release files for pygptwrapper 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pygptwrapper-0.4.0.tar.gz | 2.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pygptwrapper-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.8 kB
Release files / pygptwrapper-0.4.0.tar.gz
| Download URL | pygptwrapper-0.4.0.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61b74fd596af31a37700acfb7ce99675e820c3ed12617d094638a8edcb603fea
|
|
BLAKE2b-256 checksum How to use checksums |
cb6ee437ce51dad10d5d70eb422303ab5571a20ffdb26e4540b4c22a3bc2accf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.1 CPython/3.8.5 Darwin/21.5.0
|
Release files / pygptwrapper-0.4.0-py3-none-any.whl
| Download URL | pygptwrapper-0.4.0-py3-none-any.whl |
|---|---|
| Size | 2.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4c25711ae74348360ca3e7630e7f9102fdac73f3f03695816ebae458b3a14ca
|
|
BLAKE2b-256 checksum How to use checksums |
62c685ef9161aedb8837ba8a227da6a86d067193fb2ff8208279a6347cd080d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.1 CPython/3.8.5 Darwin/21.5.0
|