Author: Alisson Pelizaro
This repository contains an example client that demonstrates the usage of the assistant-fulfillment-helper
library. The assistant-fulfillment-helper
library simplifies the creation of webhooks for intent nodes in the TOTVS Assistant platform. With just a few lines of code, you can create custom business rules within your own server infrastructure.
- Python 3.7 or higher.
-
Clone this repository to your local machine.
-
Install the required dependencies using the following command:
pip install -r requirements.txt
-
Run the example client using the command:
python my_app.py
The purpose of this client example is to demonstrate how to integrate and utilize the assistant-fulfillment-helper
library to create a custom webhook server for intent nodes in the TOTVS Assistant platform. By following the example code in main.py
, you can understand how to:
- Set up a FulfillmentHelper instance.
- Define intent callbacks using the
@fh.intent()
decorator. - Handle intent-specific logic and return responses using
FulfillmentHelperResponse
. - Start a local server to handle webhook requests from the Assistant.
-
Install the required packages by following the prerequisites above.
-
Import the
FulfillmentHelper
class from theassistant_fulfillment_helper
module. -
Instantiate the
FulfillmentHelper
class and define intent callbacks using the@fh.intent()
decorator. -
Implement your custom business logic within the callback functions.
-
Run the example client and access the local server's endpoint to test the webhook locally.
For more information on the assistant-fulfillment-helper
library and its usage, please refer to the official documentation.
This example client is provided under the MIT License.