ChatGPT Client
Python client for the unofficial ChatGPT API by OpenAI.
Installation
To install the ChatGPT Client, run the following command:
pip install chatgpt-client
Usage
Sign up for an OpenAI API key and store it in your environment.
import asyncio
import os
from chatgpt_client import ChatGPTClient
async def main() -> None:
api_key = os.getenv("OPENAI_API_KEY")
client = ChatGPTClient(api_key)
response = await client.get_completion("What is the meaning of life?")
print(response["choices"][0]["text"])
if __name__ == "__main__":
asyncio.run(main())
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for chatgpt-client 0.2.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 | |
|---|---|---|---|
| chatgpt_client-0.2.0.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chatgpt_client-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.5 kB
Release files / chatgpt_client-0.2.0.tar.gz
| Download URL | chatgpt_client-0.2.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d89c5664ebd07bc3778fc3ad9f77eead152dbce85fb0ef5e3f20a00d4e026e2a
|
|
BLAKE2b-256 checksum How to use checksums |
055e80ac730d80ffc64905e88d7616d3ac01b2247634aabd27d98f15362cb270
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Release files / chatgpt_client-0.2.0-py3-none-any.whl
| Download URL | chatgpt_client-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5004dfd70591083474bf074ec7533c0279d131f62968ff139748bee0c00e633e
|
|
BLAKE2b-256 checksum How to use checksums |
60436b0905727ccbdc05f18c39c6215c97e6df65ac6ade6622a29bf6cffbc4d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|