Skip to main content

A unified Python library for connecting to various chatbot APIs (RASA, MillionBot, Taskyto)

Project description

Chatbot Connectors

CI PyPI License

A Python library for connecting to various chatbot APIs with a unified interface.

Installation

pip install chatbot-connectors

Custom YAML Connector

If there is no connector for your chatbot and you are not willing to code one, you can use the Custom Connector. What this one does is read a YAML file with the info and try to work that way.

To see how to build these YAML files and use them see CUSTOM CONNECTOR GUIDE, there are also examples in the yaml-examples directory.

If you want to directly try one, execute this in a Python shell:

from chatbot_connectors.implementations.custom import CustomChatbot

bot = CustomChatbot("yaml-examples/ada-uam.yml")
success, response = bot.execute_with_input("Hola, necesito ayuda con Moodle")
print(response)

Built-in Connectors

The library ships with several ready-to-use connectors. Each connector exposes the parameters listed via --list-connector-params in the CLI or get_chatbot_parameters() in code.

Botslovers

  • Only required parameter: base_url.
  • Base URL examples: https://arthur.botslovers.com/, https://alcampo.botslovers.com/
  • Minimal Python usage:
    from chatbot_connectors.implementations.botslovers import BotsloversChatbot
    
    bot = BotsloversChatbot(base_url="https://arthur.botslovers.com/")
    success, reply = bot.execute_with_input("Hi Arthur!")
    print(reply)
    

Metro de Madrid

  • Uses Metro Madrid's public website widget API and auto-creates a session.
  • Requires a handshake that sends the first message, selects the language, and accepts the privacy policy; the connector performs this sequence automatically using the language parameter ("es" by default, accepts "en").
  • Example:
    from chatbot_connectors.implementations.metro_madrid import MetroMadridChatbot
    
    bot = MetroMadridChatbot(language="es")
    success, reply = bot.execute_with_input("¿A qué hora cierra hoy el metro?")
    print(reply)
    

MillionBot

  • Requires a bot_id. Known deployments:
    • ADA UAM: 60a3be81f9a6b98f7659a6f9
    • SAIC Malaga: 64e5d1af081211d24e2cfec8
    • Madrid te cuida: 612cc0d871562c07747d3f0a
    • Genion: 65157185ba7cc62753c7d3e2
    • Gallo de Morón de la Frontera: 65ca19e7dbbb4e26cbeadf24
    • Ayto. de Arucas: 660d8b37876b1f546abde807
    • Gestri Diputación Valencia: 6141bc1e161c3d4e06ced69c
  • Quick example:
    from chatbot_connectors.implementations.millionbot import MillionBot
    
    bot = MillionBot(bot_id="60a3be81f9a6b98f7659a6f9")
    success, reply = bot.execute_with_input("Hola, ¿puedes ayudarme?")
    print(reply)
    

RASA

  • Use the public REST webhook, e.g. base_url="http://localhost:5005".
  • Optional sender_id controls conversation tracking.

Taskyto

  • Requires the Taskyto server base URL and optional port (defaults to 5000).
  • Example: ChatbotTaskyto(base_url="http://localhost", port=8080)

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

chatbot_connectors-0.7.2.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

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

chatbot_connectors-0.7.2-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

Details for the file chatbot_connectors-0.7.2.tar.gz.

File metadata

  • Download URL: chatbot_connectors-0.7.2.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for chatbot_connectors-0.7.2.tar.gz
Algorithm Hash digest
SHA256 01194b16867af06b52761af01824209ff772de8bccf5f570b92ba6e7c1427b5b
MD5 2220273096e42d1d14f1011da41fd75e
BLAKE2b-256 d42913e85c56813fd9c935dc0bf7d375239119d5371f04f3c114f626b02deb53

See more details on using hashes here.

File details

Details for the file chatbot_connectors-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: chatbot_connectors-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 29.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for chatbot_connectors-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f17a4cc5f42e674b7c8fae9f87b6c1affaa149e49247dfea1cc47dfdeb43d0c8
MD5 ba10f841868914621cf088ff1c0ccd0d
BLAKE2b-256 6ac55076183858a4c3ae42f05eaf2d4f75464f9a674aad2fa35822357b0abfe3

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