[AutoGen Studio] Allow multiline strings in chat input #1105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
It is useful for users to be able to input multiline strings when passing prompts to a LLM. This is mostly beneficial for the user, but it could also enhance the prompt since clear delimiters might yield better responses from the AI model: https://platform.openai.com/docs/guides/prompt-engineering/tactic-use-delimiters-to-clearly-indicate-distinct-parts-of-the-input.
This is currently rather hard to do since the entire input string is crammed up on a single line, and reviewing + editing it before submission is difficult.
Changes introduced in this PR:
input
was replaced withtextarea
Shift+Enter
key combination no longer submits the input, rather it creates a new line so the user can continue typing before pressingEnter
to submit the prompttextarea
component can be expanded to a maximum of 120px so the user can more easily tweak his prompt before submissionNote: most chat interfaces behave like this, I just wanted the same behavior here (see https://chat.openai.com/ for example)
Demo
Zight.Recording.2023-12-30.at.05.36.55.PM.mp4
Checks