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

Add request data to useChat for React. #725

Merged
merged 6 commits into from
Nov 13, 2023
Merged

Conversation

lgrammel
Copy link
Collaborator

@lgrammel lgrammel commented Nov 8, 2023

Adds a new data option to handleSubmit for useChat that you can use to send additional data to the server.

Example output

image

@lgrammel lgrammel changed the title [WIP / RFC] Add request metadata to useChat. [RFC] Add request metadata to useChat. Nov 9, 2023
@lgrammel lgrammel requested a review from shuding November 9, 2023 08:20
@lgrammel lgrammel changed the title [RFC] Add request metadata to useChat. Add request metadata to useChat. Nov 9, 2023
@lgrammel lgrammel changed the title Add request metadata to useChat. Add request metadata to useChat for React. Nov 9, 2023
@lgrammel lgrammel self-assigned this Nov 13, 2023
@lgrammel lgrammel changed the title Add request metadata to useChat for React. [WIP] Add request metadata to useChat for React. Nov 13, 2023
@lgrammel lgrammel changed the title [WIP] Add request metadata to useChat for React. Add request data to useChat for React. Nov 13, 2023
@lgrammel lgrammel merged commit fbda5b2 into vercel:main Nov 13, 2023
8 checks passed
@lgrammel lgrammel deleted the lg/metadata branch November 17, 2023 13:59
@jadejamig
Copy link

Hi, I'm getting this error upon trying this:

Object literal may only specify known properties, and 'metadata' does not exist in type 'ChatRequestOptions'

image

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

3 participants