https://github.com/PawanOsman/PyGPT
Python implementation of Unofficial ChatGPT Client
https://github.com/PawanOsman/PyGPT
Last synced: 1 day ago
JSON representation
Python implementation of Unofficial ChatGPT Client
- Host: GitHub
- URL: https://github.com/PawanOsman/PyGPT
- Owner: PawanOsman
- License: mit
- Archived: true
- Created: 2022-12-23T19:21:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-01T10:06:52.000Z (about 2 years ago)
- Last Synced: 2025-03-18T06:55:11.132Z (28 days ago)
- Language: Python
- Size: 81.1 KB
- Stars: 46
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-ChatGPT - PyGPT
- awesome-chatgpt - PyGPT
README
# ***:warning: __This repository is deprecated and no longer maintained!__***
if you have a question about it you can join our Discord server.### For support join [[Discord](https://discord.pawan.krd)]
# PyGPT - Unofficial API client for ChatGPT [[Discord](https://discord.pawan.krd)]
### Other versions [[NodeJS Version](https://github.com/PawanOsman/chatgpt-io)][[C# Version](https://github.com/PawanOsman/ChatGPT.Net)]
[](https://pypi.org/project/PyGPT)
[](https://pypi.org/project/PyGPT)
[](https://github.com/PawanOsman/PyGPT/issues)
[](https://github.com/PawanOsman/PyGPT/network)
[](https://github.com/PawanOsman/PyGPT/stargazers)
[](https://github.com/PawanOsman/PyGPT)
[](https://discord.pawan.krd)## [Check the new Google Bard Chatbot!](https://github.com/PawanOsman/GoogleBard)
## Get Started
# Install dependencies first
```bash
pip install --upgrade PyGPT
```## Example
```python
import asyncio
from pygpt import PyGPTasync def main():
chat_gpt = PyGPT('eyJhbGciOiJkaXIiLCJlbmMiOiJBMR0NN....')
await chat_gpt.connect()
await chat_gpt.wait_for_ready()
answer = await chat_gpt.ask('What is the capital of France?')
print(answer)
await chat_gpt.disconnect()if __name__ == '__main__':
asyncio.run(main())
```### For multiple queries
```python
import asyncio
from pygpt import PyGPTasync def main():
chat_gpt = PyGPT('eyJhbGciOiJkaXIiLCJlbmMiOiJBMR0NN....')
await chat_gpt.connect()
await chat_gpt.wait_for_ready()
questions = ["how are you", "where do you live", "what do you do"]
for question in questions:
answer = await chat_gpt.ask(question)
print(answer)
await chat_gpt.disconnect()if name == 'main':
asyncio.run(main())
```