@@ -82,7 +82,8 @@ const schema = a.schema({
82
82
chat: a .conversation ({
83
83
aiModel: a .ai .model (' Claude 3 Haiku' ),
84
84
systemPrompt: ' You are a helpful assistant' ,
85
- }),
85
+ })
86
+ .authorization ((allow ) => allow .owner ()),
86
87
// highlight-end
87
88
88
89
// 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
179
180
180
181
``` tsx title="src/main.tsx"
181
182
import { Amplify } from ' aws-amplify' ;
182
- import outputs from ' ../../ amplify_outputs.json' ;
183
+ import outputs from ' ../amplify_outputs.json' ;
183
184
184
185
Amplify .configure (outputs );
185
186
```
@@ -314,12 +315,13 @@ export const { useAIConversation, useAIGeneration } = createAIHooks(client);
314
315
<InlineFilter filters = { [" react" ]} >
315
316
316
317
``` 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" ;
319
321
320
322
export default function App() {
321
323
const [description, setDescription] = React .useState (" " );
322
- const [{ data, isLoading, hasError }, generateRecipe] =
324
+ const [{ data, isLoading }, generateRecipe] =
323
325
useAIGeneration (" generateRecipe" );
324
326
325
327
const handleClick = async () => {
0 commit comments