So I am using the example project that they have in one of the trainings just to try to prove to myself that I can do what is needed, in my project with the genAI node.
The first screenshot is the genAI node settings that has been successfully inquiring for all of the entities.
The second screenshot shows the flow from RegisterPatientInformation to Read Back Entities message node that I am attempting to reference the entities collected in the genAI node (I got the structure of context.AI_ASSISTED….etc from a service node in the example).
The third screenshot shows the RegisterPatientInformation Node Request Response details, which clearly match my inputs in the fourth screenshot to the corresponding entity. However, the values are all blank when I attempt to read back the entities, and I am not sure what I am doing wrong or how to fix it.
Hey Conor, I might have a solution to your dilemma. You did not provide a screenshot of the of the GenAI node output so this suggestion is just a guess (based on experience). Try changing your Read Back Entities variable names to include the array value like in this example: {{context.AI_Assisted_Dialogs.RegisterPatientInformation.entities[0].DoctorsName}}
FYI…the GenAI node entity JSON output format will not be consistent unless you provide formatting instructions in your prompt. Sometimes the output will be an array, sometimes multiple arrays, sometimes no array…and your bot will work great 100 times and then fail the next 100 times. Be sure to put an example or description of the expected output format in your prompt to avoid issues. It looks like there are already some JSON instructions in the prompt, but it never hurts to be more specific. Let me know if you need assistance with the prompt.
Good Luck!
Hey Robert, thanks for the reply! That last screenshot is actually the request and response from the genAI node “RegisterPatientInformation”. In terms of providing response format instructions, should that go in the context or in the rules section of the node?
This image shows how the platform formatted the LLM response into context variables. To use the context of this response in a message node, you would need to use the format {{context.AI_Assisted_Dialogs.GenChangeAddress.entities[0].streetAddress}}
I usually put the format instructions in as a rule, but I’ve seen it work when entered in the context window. The instructions can be simple like “format the output as a single JSON array” or “format the output as a single JSON array with the collected entities as objects in the array”. You may need to play with prompt wording to get what you want.
I hope this helps. Let me know if you get it working…