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

Update: Correct server action to be called and implemented 02-stream… #1646

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MrMaina100
Copy link
Contributor

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.

…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 MrMaina100 closed this May 19, 2024
@MrMaina100 MrMaina100 reopened this May 19, 2024
@lgrammel
Copy link
Collaborator

@MrMaina100 Please run pnpm prettier-fix in the project root to fix the quality error.

@MrMaina100
Copy link
Contributor Author

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';
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes

@lgrammel
Copy link
Collaborator

No problem, I can fix this later.

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

2 participants