Allow book owner to add customised AI writing prompts
Description
This PR introduces changes to Allow book owner to add customised AI writing prompts
Relates to ketty/ketty#942
Changes Made
-
AskAIOverlay.js
- Update UI and styling with customised AI prompts
- Add logic to Query OpenAI when a customised prompt is clicked
-
config.js
- Add props passed from ketty
Testing
- Change props in config.js
- Switch
FreeTextPromptsOn
true/false.- Expected behaviour: The input field to type in the prompt should be hidden
- Add custom prompts to
CustomPrompts
-
Example:
CustomPrompts: ['Translate to Spanish', 'Summarize this text']
-
Expected behaviour: You should see the custom prompts in the drop down. Clicking on submit should fire the query
-
Caveats
Setting FreeTextPromptsOn
to false
and CustomPrompts
to Empty Array will not show anything. It would be as if AI has been turned off. This edge case has been handled on Ketty. On Ketty we have a restriction if FreeTextPromptsOn
is false the CustomPrompts
have to be provided.
Related MRs
Edited by victor mutai