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.0.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.0.tar.gz.
File metadata
- Download URL: juji_python_sdk-0.2.0.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 |
7ae57a53c02b10b63c658e04fe30ae28ee1cd16310005af308c566ba99e1c708
|
|
| MD5 |
f7554e9fb5cdcb9ae8f54a69ed2110e8
|
|
| BLAKE2b-256 |
abcb5b1f70e2ff24e4675799ac6e1e857d9d433dc7d9c1930efe1ded33545ece
|
File details
Details for the file juji_python_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: juji_python_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.9 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 |
f382a8de5e790f49b17f0aa5b698760e92a7aefb864ab4eb522d731e1d301df1
|
|
| MD5 |
84f9c62a95dbf19586f64c451133170c
|
|
| BLAKE2b-256 |
896a3a03b16b4878b7c0ff7b70944eebdf41ab14f3da671d55c0a85d4fa95467
|