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

ai-sdk/ui: Provide a way to customise the user message in useChat #2987

Open
sahas-si opened this issue Sep 12, 2024 · 0 comments
Open

ai-sdk/ui: Provide a way to customise the user message in useChat #2987

sahas-si opened this issue Sep 12, 2024 · 0 comments
Labels
ai/ui enhancement New feature or request

Comments

@sahas-si
Copy link

Feature Description

Creating this enhancement issue as suggested by @lgrammel in this thread -> #2820

Current Scenario: In a conversation, user asks a query & assistant provides an answer. Both the query and response are represented as messages. By default, useChat's handleSubmit method generates the user's message & appends it to messages. There can be no customisation & its fixed.

Requirement: Many a times, user message can have more than a query/text, there could be an extra filters that user has selected. (Check the usecaseProvide a way for the user to add more attributes to the user's message either through a callback or via any other mechanism

Current code:
image

Use Case

Here's our usecase. We have a stock market based chat assistant. While asking a query, users can select the year/quarter/filing type from the filters & send these filters to the API. The user can update these filters for every new query.

Right now, its not possible to render these filters as part of user's message in the UI as the handleSubmit already generates the message on its own with just the text.

Additional context

No response

@sahas-si sahas-si changed the title Provide a way to customise the user message in useChat ai-sdk/ui: Provide a way to customise the user message in useChat Sep 12, 2024
@lgrammel lgrammel added enhancement New feature or request ai/ui labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/ui enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants