-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
feat(component): enhance chat input component #5131
base: main
Are you sure you want to change the base?
feat(component): enhance chat input component #5131
Conversation
- Replace MultilineInput with StrInput for better text handling - Remove input handle for cleaner playground integration - Maintain image support through FileInput - Keep essential styling and session management options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the advantages of using a StrInput over a MultilineInput for this case?
The main reason for using Additionally, as the Chat Input is a primary component, having a handle is unnecessary. |
@@ -13,7 +13,7 @@ class ChatInput(ChatComponent): | |||
name = "ChatInput" | |||
|
|||
inputs = [ | |||
MultilineInput( | |||
StrInput( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raphaelchristi Could we do this instead:
- Keep it as a MultilineInput as before
- But, pass
input_types=[]
so that the handle should disappear
Multiline has some nice properties when composing the text, so i think if we do this, we get the advantage of your PR (the handle being hidden for UI cleanliness) but also the multiline advantage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @erichare for this suggestion! I agree this is a much better approach.
Keep MultilineInput for text composition advantage but hide the handle for UI cleanliness by setting input_types=[]. This preserves the multiline functionality while improving the visual interface by removing the unnecessary connection handle.
Description
This PR enhances the Chat Input component by simplifying the input structure and improving text handling.
Changes
Improved Text Handling:
MultilineInput
withStrInput
for more efficient text management.Playground Integration:
Image and File Support:
FileInput
usingTEXT_FILE_TYPES + IMG_FILE_TYPES
.Styling and Session Management:
Code Comparison
Before
After
Benefits