Metadata-Version: 2.1
Name: uagents-twilio
Version: 1.0.7
Summary: Use uagents to automate SMS/Whatsapp by twilio
Home-page: https://github.com/harshpatel199259/uagents_twilio
Author: Harsh
Author-email: harsh.patel@fetch.ai
Requires-Python: >=3.8.1,<3.12
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: fastapi (>=0.100.0,<0.101.0)
Requires-Dist: flake8 (==6.0.0)
Requires-Dist: pre-commit (==3.3.3)
Requires-Dist: python-decouple (==3.8)
Requires-Dist: uagents (==0.5.0)
Project-URL: Repository, https://github.com/harshpatel199259/uagents_twilio
Description-Content-Type: text/x-rst

==============
uagents-twilio
==============

.. image:: https://img.shields.io/pypi/v/uagents-twilio.svg
    :target: https://pypi.org/project/uagents-twilio
    :alt: PyPI version


----

This `uagents <https://github.com/fetchai/uAgents>`_ utlity was generated with `Cookiecutter <https://github.com/cookiecutter/cookiecutter>`_.


Features
--------

* uagents protocols to send SMS or Whatsapp messages using twilio
* supports on_message and on_query methods to receive and send messages


Installation
------------

You can install "uagents-twilio" via `pip <https://pypi.org/project/pip/>`_ from `PyPI <https://pypi.org/project>`_::

    $ pip install uagents-twilio

You can install "uagents_twilio" via poetry::

    $ poetry add uagents-twilio

Usage
-----

* Create .env file in root folder of project::

    AGENT_ADDRESS=""
    ACCOUNT_SID=""
    AUTH_TOKEN=""
    FROM_NUMBER=""
    WP_FROM_NUMBER=""
    TO_NUMBER=""

* Create a uagents in your project

* Import uagents_twilio protocol::

    $ from uagents_twilio.protocols.messages import service_protocol

* Include protocol in uagent::

    $ service_agent.include(service_protocol)

* Use functions::

    from uagents_twilio.models import Message, MessageType

    @service_agent.on_interval(period=2.0)
    async def send_message(ctx: Context):
        await ctx.send(
            AGENT_ADDRESS,
            Message(receiver="<replace_your_number>", msg="hello there bob", type=MessageType.sms),
        )

