Inheriting segments of parent prompt in user interface

Created on 12 July 2024, 4 months ago
Updated 12 August 2024, 3 months ago

Problem/Motivation

It would be interesting feature to extend existing prompts (within user interface), because different prompts may share similar elements.

User can already add a different prompt as segment, but that does not allow to change individual segments or override anything.

New approach could be to inherit parent prompt segments individually, enabling to edit anything within it.

Proposed resolution

Extend ContentPrompt.php and ConfigPrompt.php prompt segments with a new feature to choose how to relate the prompt:

  • (existing) Include rendered prompt
  • (new) Include all parent segments individually and allow to edit them

If user choose to inherit, then prompt segments from the parent will be cloned and added to the list of segments.

Each inherited segment at AIPromptSegmentBase.php level will have parent segment relationship, which will also allow to track changes.

Remaining tasks

Do related issues first as those are subset of the feature:

User interface changes

Each segment which inherits the parent can be labeled "Inheriting @link parent segment".
Status:

  • default;
  • overridden;
  • orphan.

In addition to "Save", there will be a new button and operation to "Restore to default" - which would clear local changes.
And new button "Save as default" - which would make local changes as default by updating the parent prompt segment.

API changes

Data model changes

Feature request
Status

Active

Version

1.0

Component

Prompt inheritance

Created by

🇱🇹Lithuania mindaugasd

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

Comments & Activities

Production build 0.71.5 2024