This is a 2-Part tutorial. The first part is a quick guide to writing a good system message to teach your agent its instructions. The second part is how to set up your server, to deal with these actions and send the necessary data back. In this tutorial, we will be using the example of a clothing store, where users can search for items of clothing, subscribe to a newsletter, cancel their subscription, and purchase clothes.
1
Identify all POST Endpoints
First you need to figure out all the
POST endpoints that are used by the agent. We recommend you use up to 10, but the fewer the better.
We also recommend you dynamically add system dialogues using the AppendDialogue endpoint depending on how the conversation is going.Let’s say I have the following endpoints:| Action | Required JSON |
|---|---|
UNSUBSCRIBE | {"uid":"<6 digit string>", "reason":"<string> for why the user wants to unsubscribe"} |
QUERY | {"reason":"<string> query string for clothing item you want to search for (i.e. small woolen red jumper)"} |
SUBSCRIBE | {"uid":"<6 digit code>", "subscription":"<string> 'weekly' or 'monthly'"} |
PURCHASE | {"uid":"<6 digit code>", "itemId":"<string 6 digits starting>", "color":"<string> 'blue' or 'black', 'red', 'green', 'auburn'"} |
2
Construct as Follows
Now create a system message of the following structure: