Problem/Motivation
Sometimes, when calling AiReferenceGenerator->getAiSuggestions directly, it may be useful to override the content retrieved from the node.
This can be helpful when a new node instance has not been saved yet, or when the content used for AI relation generation needs to be replaced with custom content.
Proposed resolution
Add optional arguments $override_content in AiReferenceGenerator->getAiSuggestions
Issue fork ai_auto_reference-3579500
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
scott_euser commentedHi Vitalii, can you check the test failure please + ensure phpcs coding standards? Thanks!
E.g.:
Fatal error: Declaration of Drupal\ai_auto_reference_test\MockAiReferenceGenerator::getAiSuggestions(Drupal\node\NodeInterface $node, string $field_name, string $view_mode, string $prompt_id): array must be compatible with Drupal\ai_auto_reference\AiReferenceGenerator::getAiSuggestions(Drupal\node\NodeInterface $node, string $field_name, string $view_mode, string $prompt_id, string $override_content = '') in /var/www/html/modules/contrib/ai_auto_reference/tests/modules/ai_auto_reference_test/src/MockAiReferenceGenerator.php on line 47Comment #4
scott_euser commentedSorted out the test coverage + phpcs, will get to reviewing asap
Comment #6
scott_euser commentedThanks!