v.0.16
2023.02.14
Last updated
Was this helpful?
2023.02.14
Last updated
Was this helpful?
This version has been deprecated. If used with the current API version it can produce unexpected behaviour or errors.
The package shimoku-api-python is no longer maintained
To get the new version 🤖
This is a small but very important version, as it includes the tools necessary for handling generic AI and complex tasks!
The SDK has been adapted to python 3.9, there was an async feature that was only available on python 3.10 >=, but now it has been resolved, so there are no compatibility issues with version 3.9.
The Shimoku module now includes an exciting new feature - activities and runs! This addition allows users to trigger webhooks through Shimoku's API, making it easier than ever to create complex AI and data workflows. For example, you can now create a complete lead scoring prediction page, with your data, with just a single line of code.
The process of linking a webhook to an activity will be handled internally for the time being, but if you have a specific task in mind, don't hesitate to reach out to us!
With this new feature, you can create multiple runs for each activity, each run being a single execution with unique settings. You can also keep track of everything with run logs. The Shimoku module provides several methods to make the most of activities and runs, including:
Get the activities available in your business using get_business_activities
Interact with a specific business using set_business
Create a new activity using create_activity
Update an existing activity using update_activity
Delete an activity using delete_activity
Create a new run from an activity and execute it using execute_activity
Retrieve an activity from your business using get_activity
Get all activities from the app using get_activities
Create a new run for an activity using create_run
Execute a run for an activity using execute_run
Create a new run log to keep track of everything using create_run_log
In the next example it will be shown how to use these methods to create and manipulate runs and activities:
In order to execute an activity it has to be linked to a webhook, the next example expects that the activity in use has a webhook attached:
When a run gets executed the API will automatically add a log indicating that the webhook has been called
The webhook will no longer be attached after deleting an activity, we do not recommend deleting activities.
A run can only be executed once.
It has also been added the option to create a button in the dashboard to dinamically execute the activity. To use it call s.activity.button_execute_activity
passing it with the traditional information of the s.plt.*
methods. Like the other execute methods settings can be provided. It has a parameter named align
which can be set with one of the follow options:
start, center, right, stretch
By default it will use stretch
.
The next example shows how to call this method in various ways:
The result in the dashboard is: