Skip to content

Commit 6c8a9d7

Browse files
authored
Updates to set up ai page (#8092)
1 parent 0e7b03f commit 6c8a9d7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/pages/[platform]/ai/set-up-ai/index.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
181182
import { Amplify } from 'aws-amplify';
182-
import outputs from '../../amplify_outputs.json';
183+
import outputs from '../amplify_outputs.json';
183184

184185
Amplify.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

320322
export 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

Comments
 (0)