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

Command icon 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

vitaliyb98 created an issue. See original summary.

scott_euser’s picture

Version: 1.0.0-rc3 » 1.0.x-dev
Status: Active » Needs work

Hi 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 47

scott_euser’s picture

Status: Needs work » Needs review

Sorted out the test coverage + phpcs, will get to reviewing asap

scott_euser’s picture

Status: Needs review » Fixed

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.