Closed reveurguy closed 3 weeks ago
Maybe this helps https://vercel.com/guides/streaming-from-llm
export const maxDuration = 60; should be placed in the page.tsx file
@ElectricCodeGuy is right, the server actions inherit maxDuration
set in the page it's called from, so I would move it into page.tsx
I was able to reproduce the error and setting the max duration in page.tsx
fixed it!
I created a small example project on how you could implement the new ai/rsc :) https://github.com/ElectricCodeGuy/SupabaseAuthWithSSR
Description
While using the
Stream Text generation
from ai-sdk, the function call is getting timed out. The generation starts and runs for a bit, after that i receive this error and the generation stops.This is the log from vercel.
This is the error console log in production.
Code example
This is the code in
/layout.tsx
file:export const dynamic = 'force-dynamic';
export const maxDuration = 60;
This is the code in
/page.tsx
file:This is the code for the
generate
,generate4
,generate4o
functions in the/action.ts
file:The
handleRun()
function is called on click of submit button.Additional context
No response