[PMS] Self repair prompt

Self-repair prompt

The motives of this feature is that sometimes the output of LLM is not desired, instead of setting a static output validator, we can run a self-repair prompt to fix the result.

In /prompt page, we allow user to tick a box turn on self repair prompt feature.

Can refer to Microsoft Typechat on how the implementation is being done https://github.com/microsoft/TypeChat

Code: https://github.com/microsoft/TypeChat/blob/main/src/program.ts

Refer to createRepairPrompt

`The JSON program object is invalid for the following reason:\\n` +
`"""\\n${validationError}\\n"""\\n` +
`The following is a revised JSON program object:\\n`;

Example: Use in Following code

Some other readings:

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board

💡 Request a feature

Date

Over 2 years ago

Author

Mei Wei Lim

Subscribe to post

Get notified by email when there are changes.