If the entity-reference field in the content type allows references to more than one other content type, the prompt sent to AI with have "Array" instead of the actual entity name.
In GetAISuggestions, there is this code:
$possible_results = $this->getFieldAllowedValues($node, $field_name);
$imploded_possible_results = implode('|', $possible_results);
When the field allows multiple content types, the $possible_results is a nested array rather that a simple array. For example:
$possible_results = [
"article" = [
1 = "article 1",
2 = "article 2",
].
"event" = [
1 = "event 1",
2 = "event 2",
]
]
which ends up with $imploded_possible_results being "Array|Array"
Comments
Comment #5
scott_euser commentedThanks for spotting and for finding the root cause!