@@ -82,7 +82,8 @@ const schema = a.schema({
8282 chat: a .conversation ({
8383 aiModel: a .ai .model (' Claude 3 Haiku' ),
8484 systemPrompt: ' You are a helpful assistant' ,
85- }),
85+ })
86+ .authorization ((allow ) => allow .owner ()),,
8687 // highlight-end
8788
8889 // This adds a new generation route to your Amplify Data backend.
@@ -179,7 +180,7 @@ Call `Amplify.configure()` with the **amplify_outputs.json** file where the Reac
179180
180181``` tsx title="src/main.tsx"
181182import { Amplify } from ' aws-amplify' ;
182- import outputs from ' ../../ amplify_outputs.json' ;
183+ import outputs from ' ../amplify_outputs.json' ;
183184
184185Amplify .configure (outputs );
185186```
@@ -314,12 +315,13 @@ export const { useAIConversation, useAIGeneration } = createAIHooks(client);
314315<InlineFilter filters = { [" react" ]} >
315316
316317``` tsx title="src/App.tsx"
317- import { Flex , TextAreaField , Loader , Text , View } from " @aws-amplify/ui-react"
318- import { useAIGeneration } from " @/client" ;
318+ import * as React from ' react' ;
319+ import { Flex , TextAreaField , Loader , Text , View , Button } from " @aws-amplify/ui-react"
320+ import { useAIGeneration } from " ./client" ;
319321
320322export default function App() {
321323 const [description, setDescription] = React .useState (" " );
322- const [{ data, isLoading, hasError }, generateRecipe] =
324+ const [{ data, isLoading }, generateRecipe] =
323325 useAIGeneration (" generateRecipe" );
324326
325327 const handleClick = async () => {
0 commit comments