Skip to main content

Update 30-DEC-2022

We have introduced a new method that utilizes a socket for faster performance without the need for a browser anymore. [NodeJS Version][C# Version]

For support join [Discord]

PyGPT - Unofficial API client for ChatGPT [Discord]

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

Metadata

Release files for PyGPT 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyGPT 1.0.5
File Size Uploaded Provenance Actions
PyGPT-1.0.5.tar.gz 10.1 kB Without provenance Details for PyGPT-1.0.5.tar.gz

Release files / PyGPT-1.0.5.tar.gz

Download URL PyGPT-1.0.5.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b5622c108f3310e3dee3f1a9a0e5f12cf9bfb1320d8667b0e74d2d6c47a28695
BLAKE2b-256 checksum
How to use checksums
88d9a10361c1b6ff011607834f5faffee324397f2b3c997c9015d167e96c79ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for PyGPT 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.5 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page