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.2.tar.gz
(3.9 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.2.tar.gz.
File metadata
- Download URL: juji_python_sdk-0.2.2.tar.gz
- Upload date:
- Size: 3.9 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 |
04995137a8cd5841f6ff2c904f8098df66e4e5e7b6c94122b959439247b8f588
|
|
| MD5 |
ff4eb8782514bf6c4b587cb199710408
|
|
| BLAKE2b-256 |
66ecdd2020642cdc5244fa56d9031d1f68a5c354df4656b0084843fff2723e16
|
File details
Details for the file juji_python_sdk-0.2.2-py3-none-any.whl.
File metadata
- Download URL: juji_python_sdk-0.2.2-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 |
48872c9d406b75348129ee9cc3d146d71a03522218e32b32bb3d8d830d674b50
|
|
| MD5 |
97e3e23d95c04f9fb467d343a2a99d68
|
|
| BLAKE2b-256 |
f964430c485932244ebd55647498b37e531a6f51dd0a66c717d56b9e7290bc6d
|