Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.
/ PyGPT Public archive

Python implementation of Unofficial ChatGPT Client

License

Notifications You must be signed in to change notification settings

PawanOsman/PyGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ 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]

PyGPT - Unofficial API client for ChatGPT [Discord]

Other versions [NodeJS Version][C# Version]

PyPi Version PyPi Downloads GitHub issues GitHub forks GitHub stars GitHub license Discord server

Get Started

Install dependencies first

pip install --upgrade PyGPT

Example

import asyncio
from pygpt import PyGPT

async 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

import asyncio
from pygpt import PyGPT

async 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())

About

Python implementation of Unofficial ChatGPT Client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages