Skip to main content

asynchronous wrapper over the chatsonic api for the python programming language

Project description

achat

achat is an asynchronous wrapper over the chatsonic api for the python programming language.

Features

  • asynchronous support
  • message history support
  • convenient customization of all query parameters

Installation

To install the latest stable version, use

pip install achat

Examples

Using chat instance

import asyncio

from achat import SonicChat


async def main():
    chat = SonicChat(token="your api token here")
    try:
        await chat.start()
        
        response = await chat.ask("Who is Elon Musk?")
        print(response.message)

        response = await chat.ask("When was he born?")
        print(response.message)
    finally:
        await chat.close()


asyncio.run(main())

Using async context manager

import asyncio

from achat import SonicChat


async def main():
    async with SonicChat(token="your api token here") as chat:
        response = await chat.ask("Who is Elon Musk?")
        print(response.message)

        response = await chat.ask("When was he born?")
        print(response.message)


asyncio.run(main())

Documentation

Coming soon

Dependencies

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

achat-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

achat-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file achat-0.1.0.tar.gz.

File metadata

  • Download URL: achat-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.2 Windows/10

File hashes

Hashes for achat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1316103416bcd726d2279008690d189f2c56697deef3de2a02abbee3bf04736a
MD5 06eefdfed193280e3a71173430f68936
BLAKE2b-256 b76e9e7bd63d7571e6a811e1ff7cca62fc4a960776256505f253ef36934d6090

See more details on using hashes here.

File details

Details for the file achat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: achat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.2 Windows/10

File hashes

Hashes for achat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee048de129cb0c6beced8ea23d86abe8e404a45950659a59c3d469087f9b5cf4
MD5 a5412ff64e89c6669f50c65cdb410ff4
BLAKE2b-256 47f374cee33313155188e1c41a3fdcbeeb32562373e419aea88dbc689e7ebcf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page