Skip to main content

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

juji_python_sdk-0.2.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for juji_python_sdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7e48e72658005b2b7f0809937deb0e21bda0615e8959bc8a5919eac1bdcb1147
MD5 6ad4b53ba4aa564505cd3f2d52ac86a6
BLAKE2b-256 269653e61cffc2f79c3a166e2cdf551cd590246bc95d3a2d963157acdfae98a7

See more details on using hashes here.

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

Hashes for juji_python_sdk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12c35d099dfc14c995e4c40b2b517c759679bc5330cdf67762510682c423549a
MD5 dcf73b40cd855f02c6a432dd84b1fdf8
BLAKE2b-256 557f94e6466e274bf3327d4bac0af357d5ad50839e84091ac2c899ab70c869c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page