Python client for the unofficial ChatGPT API.
Project description
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
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.
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
chatgpt_client-0.1.0.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for chatgpt_client-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ec14569510928bd262eaa610ccf1a62aa3c625105d0d40eae38556ba400cdae |
|
MD5 | bf00e4ba52aeaf67c4870644ae60276d |
|
BLAKE2b-256 | 2dd94e2158105f78c01dbd59a8b3006f2e897f438391c6eba88b010f7699d68b |