Skip to content

Commit

Permalink
Updates to set up ai page (#8092)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanksdesign authored Nov 14, 2024
1 parent 0e7b03f commit 6c8a9d7
Showing 1 changed file with 7 additions and 5 deletions.
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

0 comments on commit 6c8a9d7

Please sign in to comment.