Skip to main content

Receiving Actions

Remember that Canopy parses the LLM output and POSTs to the baseAgentUrl the following format. Make sure that you have passed the baseAgentUrl and initialSystemMessage in the CanopyConfig object, from the frontend, like here:
Now let’s set up code to listen for these actions and respond accordingly. We are going to continue using the example from the previous section
1

Install Required Packages

2

Starting Listening For Post Requests

Now let’s set up our server to listen for actions - here are a couple of examples in different languages.
3

Writing the handleAction function

We will now handle the action that we received from the LLM. We will just use a dummy response, but you should use this function to do what you want.

If its unclear what the actionType and actionData are, please refer to the previous section