Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/pages/[platform]/ai/set-up-ai/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ const schema = a.schema({
chat: a.conversation({
aiModel: a.ai.model('Claude 3 Haiku'),
systemPrompt: 'You are a helpful assistant',
}),
})
.authorization((allow) => allow.owner()),
// highlight-end

// This adds a new generation route to your Amplify Data backend.
Expand Down Expand Up @@ -179,7 +180,7 @@ Call `Amplify.configure()` with the **amplify_outputs.json** file where the Reac

```tsx title="src/main.tsx"
import { Amplify } from 'aws-amplify';
import outputs from '../../amplify_outputs.json';
import outputs from '../amplify_outputs.json';

Amplify.configure(outputs);
```
Expand Down Expand Up @@ -314,12 +315,13 @@ export const { useAIConversation, useAIGeneration } = createAIHooks(client);
<InlineFilter filters={["react"]}>

```tsx title="src/App.tsx"
import { Flex, TextAreaField, Loader, Text, View } from "@aws-amplify/ui-react"
import { useAIGeneration } from "@/client";
import * as React from 'react';
import { Flex, TextAreaField, Loader, Text, View, Button } from "@aws-amplify/ui-react"
import { useAIGeneration } from "./client";

export default function App() {
const [description, setDescription] = React.useState("");
const [{ data, isLoading, hasError }, generateRecipe] =
const [{ data, isLoading }, generateRecipe] =
useAIGeneration("generateRecipe");

const handleClick = async () => {
Expand Down