-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update: Correct server action to be called and implemented 02-stream… #1646
base: main
Are you sure you want to change the base?
Conversation
…ng-text-generation.mdx For stream text generation we are calling the generate function from the actions file in instead of getAnswer function. Also removed the extra 'use server' in the generate function since we are already declaring it at the top of the file.
@MrMaina100 Please run |
hey @lgrammel uumh yea the repo is not on my local machine . I did the changes directly here on Github. |
@@ -58,8 +58,7 @@ import { streamText } from 'ai'; | |||
import { openai } from '@ai-sdk/openai'; | |||
import { createStreamableValue } from 'ai/rsc'; | |||
|
|||
export async function generate(input: string) { | |||
'use server'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was use server
removed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we had use server
at the top of the file there was no need for it ..or am i wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes
No problem, I can fix this later. |
For stream text generation we are calling the generate function from the actions file in instead of getAnswer function. Also removed the extra 'use server' in the generate function since we are already declaring it at the top of the file.