Juji Python SDK
Project description
Juji Python SDK
This is a Python SDK for Juji Chatbot, using the Juji API.
Installation
pip install juji-python-sdk
Usage
from juji_python_sdk import Chatbot
chatbot = Chatbot("<chatbot_url>")
participation = chatbot.start_chat()
Asynchronous message handling
def handle_message(message: dict):
if message["type"] == "normal":
print(f"Juji: {message['text']}")
elif message["type"] == "flowinfo":
print(f"Juji is waiting for your response...")
participation.add_message_callback(handle_message)
time.sleep(10)
print("You: Hello, how are you?")
participation.send_chat_msg("Hello, how are you?")
time.sleep(10)
print("You: Bye!")
participation.end()
Synchronous message handling
messages = participation.get_messages()
print(messages)
print("You: Hello, how are you?")
messages = participation.send_chat_msg("Hello, how are you?")
print(messages)
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
juji_python_sdk-0.2.1.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file juji_python_sdk-0.2.1.tar.gz.
File metadata
- Download URL: juji_python_sdk-0.2.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.13.0 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e48e72658005b2b7f0809937deb0e21bda0615e8959bc8a5919eac1bdcb1147
|
|
| MD5 |
6ad4b53ba4aa564505cd3f2d52ac86a6
|
|
| BLAKE2b-256 |
269653e61cffc2f79c3a166e2cdf551cd590246bc95d3a2d963157acdfae98a7
|
File details
Details for the file juji_python_sdk-0.2.1-py3-none-any.whl.
File metadata
- Download URL: juji_python_sdk-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.0.0 CPython/3.13.0 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12c35d099dfc14c995e4c40b2b517c759679bc5330cdf67762510682c423549a
|
|
| MD5 |
dcf73b40cd855f02c6a432dd84b1fdf8
|
|
| BLAKE2b-256 |
557f94e6466e274bf3327d4bac0af357d5ad50839e84091ac2c899ab70c869c5
|