Closed zachtball closed 3 months ago
try setting sendExtraMessageFields
to true
. works for us with v2.2.35
const { messages, input, handleInputChange, append, isLoading, setMessages } = useChat({
api: process.env.NEXT_PUBLIC_CHAT_LAMBDA_URL,
sendExtraMessageFields: true,
body: {
functions,
idToken,
...settings,
},
});
try setting
sendExtraMessageFields
totrue
. works for us withv2.2.35
Hey thanks for the reply, sadly that did not work for me.
This is an issue for me in 3.0.23
. Any resolution? body
is not dynamic.
This is an issue for me in 3.0.23
. Any resolution? body
is not dynamic.
You can send in the body in handleSubmit
if it's dynamic: https://sdk.vercel.ai/docs/ai-sdk-ui/chatbot#setting-custom-body-fields-per-request
Description
Install version >2.2.25 Use useChat hook and point the
api
at a lambda url (haven't tested another backend service) Try to log the request body, it is undefined Install version 2.2.25 Works fineCode example
in my backend (lambda) I do
Change version to "ai": "2.2.25", and it works fine
Additional context
No response