/npc/respond
This one is the main endpoint on the app. Has 4 main requirements:
groupId
latestMessage
userId
npcId
customContext (optional)
const response = await backend.post('/npc/respond', {
latestMessage: "Nice, how do I cook pasta?",
groupId: '<GROUP ID>',
userId: '<USER ID>',
npcId: '<NPC ID>',
customContext: 'Focus on Macaroni when answering'
}).then(res => res?.data).catch(err => {});
This method is generally called after recording the latest message with /user/recordMessage endpoint. The latest message is required to make the response generation instant as you do not have to wait for the DB to store the message before asking the NPC to respond.
The implementation allows for the NPC to not respond to every message recorded in the group, allowing for more customizability.
Last updated