- Issue created by @wouters_f
- Status changed to Needs review
16 days ago 11:47am 10 June 2024 - π§πͺBelgium wouters_f Leuven
I have added the hooks to make this configurable in the code in the BRANCH.
Please review.
I want to override/change
1. the predefined tones of voice (could be with a form alter, but a openai_alter would be nice too).
2. the prompts used in some of these features.
Example of this: openai_content_entity_suggest_taxonomy lets openai randomy generate terms.
If I have a existing tree, I want openai to suggest from my existing tags, to reduce the risk of duplicates.
I dont want to remake these features, I just want to plug into this module.
Allow hooking like funcionality
Just before passing the text into the ajaxcommand.
\Drupal::moduleHandler()->invokeAll('openai_alter_tov_options', [&$tov_options]);
// hook openai_alter_tov_options for altering the provided options for tone of voice
\Drupal::moduleHandler()->invokeAll('openai_prompt_alter_tone', [&$tone_instruction]);
// hook openai_prompt_alter_tone for changing the tone of voice prompt.
\Drupal::moduleHandler()->invokeAll('openai_prompt_alter_summary', [&$summary_instruction]);
// hook openai_prompt_alter_summary for changing the summary sugggestion prompt.
\Drupal::moduleHandler()->invokeAll('openai_prompt_alter_title', [&$title_instruction]);
// hook openai_prompt_alter_title for changing the title suggestion prompt.
\Drupal::moduleHandler()->invokeAll('openai_prompt_alter_terms', [&$terms_instruction]);
// hook openai_prompt_alter_terms for changing the terms suggestion prompt.
so that
-> tones of voices can be fetched from multiple modules
-> prompts can be appended or changed by modules.
No user interface changes required.
It would add the possibility to extend the module a bit.
No data model changes needed for this change.
Needs review
1.0
Code
I have added the hooks to make this configurable in the code in the BRANCH.
Please review.