Juji Python SDK
Project description
Juji Python SDK
This is a Python SDK for Juji Chatbot and Juji Design, using the Juji API.
Installation
pip install juji-python-sdk
Usage
The Chatbot and Design SDKs are in the same package.
Chatbot
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)
Design
from juji_python_sdk import JujiDesign
design = JujiDesign("<juji_api_key>", "<juji_platform_url>")
brands = design.get_brands()
browser_key = uuid.uuid4()
design.add_faq(["Where can I buy some tomatoes?"],
["We have the best tomatoes in the world!"],
"<engagement_id>",
browser_key)
Check out the design_example.py for a complete example.
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.3.tar.gz
(4.1 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.3.tar.gz.
File metadata
- Download URL: juji_python_sdk-0.2.3.tar.gz
- Upload date:
- Size: 4.1 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 |
3c2ea767c1fe5abbf0e3011422d8539f64d840d6e08d171d5fa1f6e57a4a6114
|
|
| MD5 |
f65e78e1edf5993d80c7b7adadda4b16
|
|
| BLAKE2b-256 |
658f5f8a6d28f0e5a833423c52629f305046ea47791fe87834d99d99907a4bbf
|
File details
Details for the file juji_python_sdk-0.2.3-py3-none-any.whl.
File metadata
- Download URL: juji_python_sdk-0.2.3-py3-none-any.whl
- Upload date:
- Size: 5.2 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 |
755cc6c8c1968f63c74d19748aa3a7d2fe79f2c4441a172826947c3a4fee88ea
|
|
| MD5 |
92534b2de38ce8ca294c8c8b6abc0a94
|
|
| BLAKE2b-256 |
3a2527214e2e1ac9f5e1334ab4b2c1f879f4f97cf17e54efe25ce3a274d060ba
|