From the course: Learning Next.js
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
Writing blog posts with AI-generated content
From the course: Learning Next.js
Writing blog posts with AI-generated content
So this is where we left off. So we have a function now that allows to generate content by using generative AI. So we are using the chat completion API to send a request. And based on the inputs, we're going to generates an output. And this is where we update the content. So we're going to use this content information to update the text area here. Because when we complete when we fill out the text area field we can then use this generated text to save and insert a new blog posts by using the generative AI. So let's go back to the text area. You see that here, we update the value with the form data contents. So that's not it. What we want is to also update if we have a content that we defined up here. And once this is updated here. So once we receive the response from the chat completion API, we also update the content. So let's use another hook which is Use Memo. And I'm gonna name this one post content. This is going to be a new computed variable. And we're going to use Use Memo to…