No project description provided
Project description
BAIChat API Python
Installation
You can install it from PyPi
pip install baichat_py
Usage
Async
import asyncio
loop = asyncio.get_event_loop()
hello = loop.run_until_complete(chat.async_ask("Hi"))
print(hello.text)
# => Hello! How can I assist you today?
Context manager
with BAIChat() as (loop, chat):
hello = chat.ask("Hi")
print(hello.text)
# => Hello! How can I assist you today?
Delta
with BAIChat() as (loop, chat):
hello = chat.ask("Hi")
for delta in hello:
print(delta.text)
# => Hello
# => Hello!
# => Hello! How
# => Hello! How may
# => Hello! How may I
# => Hello! How may I assist
# => Hello! How may I assist you
# => Hello! How may I assist you today
# => Hello! How may I assist you today?
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
baichat_py-0.1.0.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for baichat_py-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a1e327cc0d0553160585a5dbcad3dc758526458b04bd24fa19b5c55c884fd6b |
|
MD5 | d22dfb15858a88afaec8976d39de7b58 |
|
BLAKE2b-256 | 4d35304e344972576a927c4f014561b2c399dc6b255b27c784768ef22b16f529 |