Skip to content

Allow book owner to add customised AI writing prompts

victor mutai requested to merge 942-ai-prompts into master

Description

This PR introduces changes to Allow book owner to add customised AI writing prompts

Relates to ketty/ketty#942

Changes Made

  1. AskAIOverlay.js 
    1. Update UI and styling with customised AI prompts
    2. Add logic to Query OpenAI when a customised prompt is clicked
  2. config.js 
    1. Add props passed from ketty

Testing

  1. Change props in config.js 
  2. Switch FreeTextPromptsOn true/false.
    • Expected behaviour: The input field to type in the prompt should be hidden
  3. 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

  1. ketty/server!166
  2. ketty/ketty!387
Edited by victor mutai

Merge request reports