Next.js Discord

Discord Forum

ai/react

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
I am trying to generate a meal plan from openai api - I am passing values to an edge function then constructing a prompt using chatCompletion from openai sdk. I was getting timeout errors on my pro account in 15s? I added vercel.json and upped it to 300 which is the max for edge functions on pro account. Still timing out though??

I then started looking into the ai/react sdk. I see the useChat hook and it has the handleSubmit and then the route takes in messages from the body - but if I need to construct my prompt from the submit of a form that is not a text area how would I pass the messages to it?

Its not a conversation either - they fill out a form and I prompt and return json object - unsure of best ways to do this - I have been reading through some streaming docs as well

Thank you in advance

0 Replies