Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoGen Studio] Allow multiline strings in chat input #1105

Merged

Conversation

dragosMC91
Copy link
Collaborator

@dragosMC91 dragosMC91 commented Dec 30, 2023

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:

  1. the input was replaced with textarea
  2. Shift+Enter key combination no longer submits the input, rather it creates a new line so the user can continue typing before pressing Enter to submit the prompt
  3. the textarea component can be expanded to a maximum of 120px so the user can more easily tweak his prompt before submission

Note: 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

@codecov-commenter
Copy link

codecov-commenter commented Dec 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d20bc09) 30.74% compared to head (43aaca9) 30.74%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1105   +/-   ##
=======================================
  Coverage   30.74%   30.74%           
=======================================
  Files          30       30           
  Lines        4033     4033           
  Branches      913      913           
=======================================
  Hits         1240     1240           
  Misses       2714     2714           
  Partials       79       79           
Flag Coverage Δ
unittests 30.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dragosMC91
Copy link
Collaborator Author

@microsoft-github-policy-service agree

@sonichi sonichi added this pull request to the merge queue Jan 3, 2024
Merged via the queue into microsoft:main with commit 98d1480 Jan 3, 2024
16 checks passed
whiskyboy pushed a commit to whiskyboy/autogen that referenced this pull request Apr 17, 2024
* [AutoGen Studio] Allow multiline strings in chat input

* make cogicon spin/animate during loading. minor fix to header issue.

---------

Co-authored-by: Victor Dibia <victordibia@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants