Make prompt available as form element

Created on 19 July 2024, 5 months ago

Problem/Motivation

Form elements are most basic building blocks, which can be integrated anywhere by developers.

Proposed resolution

  1. Prompt engineering would need to be ajaxified and/or modal based.
  2. Data state would be stored temporary under $form_state, and dumped to array (json) on form submit
  3. To utilize prompt, prompt service would be introduced to set stored configuration, pass arguments and return the result.

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇱🇹Lithuania mindaugasd

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mindaugasd
  • 🇱🇹Lithuania mindaugasd

    This idea would be quite challenging, because routes are tied to entities:

    /admin/config/aiprompt/{aiprompt_config}/segment/add/{plugin_id}
    /admin/config/aiprompt/{aiprompt_config}/segment/{segment_id}/edit
    /admin/config/aiprompt/{aiprompt_config}/segment/{segment_id}/delete
    
    /admin/config/aiprompt/{aiprompt_config}/argument/add/{plugin_id}
    /admin/config/aiprompt/{aiprompt_config}/argument/{argument_name}/edit
    /admin/config/aiprompt/{aiprompt_config}/argument/{argument_name}/delete
    
    /aiprompt/{aiprompt}/edit/segment/add/{plugin_id}
    /aiprompt/{aiprompt}/edit/segment/{segment_id}/edit
    /aiprompt/{aiprompt}/edit/segment/{segment_id}/delete
    
    /aiprompt/{aiprompt}/edit/argument/add/{plugin_id}
    /aiprompt/{aiprompt}/edit/argument/{argument_name}/edit
    /aiprompt/{aiprompt}/edit/argument/{argument_name}/delete
    

    Never seen this before, but maybe is possible to tie the route to ID of $form_state, so ensuring all this is saved under particular $form_state.

Production build 0.71.5 2024