Return message

When working with Custom Actions, it is often necessary for the action to return data to the AI Assistant so that it can generate a response for the user.

For example, a user might ask, “At what speed is the robot moving?” In this case, the action should retrieve the relevant information and pass it back to the AI Assistant.

To do this, you can call the following function within your action:

ai_return(message)

This function sends the data back to the AI Assistant, which then uses the real-time information provided by the robot to compose a natural-language response, such as: “The robot is moving at a speed of 250 mm/s.”

circle-info

The ai_return function can only be called once within a custom action, as it signals to the AI Assistant that the action has finished executing. If you need to return multiple data you can compose the message into a string.

Last updated