Skip to content

Merge Request for AI Functionality into ai-service

paulwababu requested to merge replace-text-draft into ai-service

Merge Request for AI Functionality.

Background

  1. This MR integrates a basic AI functionality into the AskAiEditor

  2. Although future iterations will allow admins to define a list of prompts for users, this MVP version allows users to ask AI anything.

Objective

The goal is to offer users a way to interact with AI to generate text, while giving them full control over whether the text is inserted into the document, replaced, or discarded.


User Flow Implemented

  1. User selects text: Highlight text within the editor.
  2. AI Window: An AI window pops up with a prompt field.
  3. Enter Prompt: User inputs their query or statement.
  4. Send Query: User sends the query by pressing enter or clicking a send button.
  5. AI Response: The AI-generated text replaces the prompt field in the AI window.
  6. User Options: Below the AI response, the user is presented with four actions:
    • Replace current selection
    • Insert below
    • Try again
    • Discard

Actions Explained

  • Replace current selection: Deletes the selected text and replaces it with the AI's response.
  • Insert below: Retains the selected text and adds a new paragraph below with the AI's response.
  • Try again: Removes the prior AI response and triggers a new AI query, repeating the process.
  • Discard: Closes the AI tooltip "modal".

Additional Notes

Merge request reports