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

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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