2
votes

I'm trying to create a chat bot that will help users search up motorcycles.

I'm new to API.AI and have set up my entities and their synonyms, my intent and user expressions, as well as references to the entities (@engineSize, @make, @bikeType).

My problem is when I try to add a required action and prompt, and then try to save the intent, I get the following message: "The following entities reference each other and form an infinite loop: [engineSize]."

Initially I thought I was using the references wrong in the user expressions. I deleted every reference except for one expression which uses all three entities.

I can't figure out what I'm doing wrong. Any help would be greatly appreciated, thanks! Pix below for further details.

EDIT: I fixed one of the issues of trying to pass a template expression as an example. However, I still get the same error message. I will replace and update my image links to include the edits.

Annotated User expressions

Required Actions

2

2 Answers

1
votes

Interestingly enough, the answer to this post would have been difficult to find because the problem was in defining my entities.

In the entity definitions, I included an @ref to the entity itself. ie the bikeType entity contained @bikeType as one of its definitions.

This is not to be mistaken with the User Expressions. As long as the user expression is marked as a Template (the entire line is denoted with an '@' on the far left, as opposed to a large " ), there should be no issues.

0
votes

Edited for clarity to get at root problem

In the provided user input examples you give the intent, you are supposed to provide general examples and then highlight any text belonging to an entity to map where entities appear in user's inquiries.

In your case, you have input the actual entity reference '@engineSize' as an example belonging to the engineSize entity, creating a self reference.

A proper provided user example would look like:

enter image description here

Also note though that if you are just using entities to store generic information like numbers, addresses, times, etc. it generally makes far more sense to use prebuilt system entities for those categories than create a custom entity, for example @sys.number-integer might be exactly what you need

It looks like you need to get a firmer understanding of entities, for which I would recommend the documentation: https://docs.api.ai/docs/concept-entities