Skip to content

Commit 8c3ef69

Browse files
committed
merge main
2 parents 91241f7 + b850c31 commit 8c3ef69

File tree

26 files changed

+3958
-1484
lines changed

26 files changed

+3958
-1484
lines changed

cspell.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,9 @@
16141614
"ampx",
16151615
"autodetection",
16161616
"jamba",
1617-
"webauthn"
1617+
"webauthn",
1618+
"knowledgebases",
1619+
"rehype"
16181620
],
16191621
"flagWords": ["hte", "full-stack", "Full-stack", "Full-Stack", "sudo"],
16201622
"patterns": [

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
"private": true,
1111
"dependencies": {
1212
"@aws-amplify/amplify-cli-core": "^4.3.9",
13-
"@aws-amplify/ui-react": "^6.3.1",
13+
"@aws-amplify/ui-react": "^6.7.0",
14+
"@aws-amplify/ui-react-ai": "^1.0.0",
1415
"@docsearch/react": "3",
1516
"ajv": "^8.16.0",
1617
"aws-amplify": "^6.0.9",
17-
"next": "^14.2.3",
18+
"next": "^14.2.18",
1819
"next-image-export-optimizer": "^1.8.3",
1920
"next-transpile-modules": "^9.0.0",
2021
"parse-imports": "^1.1.0",
@@ -89,6 +90,7 @@
8990
"minimatch": "3.1.2",
9091
"decode-uri-component": "0.2.1",
9192
"**/fast-xml-parser": "4.4.1",
93+
"cross-spawn": "^7.0.5",
9294
"semver": "7.5.2",
9395
"tough-cookie": "4.1.3",
9496
"aws-cdk-lib": "2.80.0",

public/images/user.jpg

39.5 KB
Loading

src/components/AI/index.tsx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { Avatar } from '@aws-amplify/ui-react';
2+
import { ConversationMessage } from '@aws-amplify/ui-react-ai';
3+
import { AmplifyLogo } from '@/components/GlobalNav/components/icons';
4+
5+
export const UserAvatar = () => {
6+
return <Avatar src="/images/user.jpg" />;
7+
};
8+
9+
export const AssistantAvatar = () => {
10+
return (
11+
<Avatar backgroundColor={'primary.20'}>
12+
<AmplifyLogo />
13+
</Avatar>
14+
);
15+
};
16+
17+
export const MESSAGES: ConversationMessage[] = [
18+
{
19+
conversationId: 'foobar',
20+
id: '1',
21+
content: [{ text: 'Hello' }],
22+
role: 'user' as const,
23+
createdAt: new Date(2023, 4, 21, 15, 23).toISOString()
24+
},
25+
{
26+
conversationId: 'foobar',
27+
id: '2',
28+
content: [
29+
{
30+
text: 'Hello! I am your virtual assistant how may I help you?'
31+
}
32+
],
33+
role: 'assistant' as const,
34+
createdAt: new Date(2023, 4, 21, 15, 24).toISOString()
35+
}
36+
];
37+
38+
export const MESSAGES_RESPONSE_COMPONENTS: ConversationMessage[] = [
39+
{
40+
conversationId: 'foobar',
41+
id: '1',
42+
content: [{ text: 'Whats the weather in San Jose?' }],
43+
role: 'user' as const,
44+
createdAt: new Date(2023, 4, 21, 15, 23).toISOString()
45+
},
46+
{
47+
conversationId: 'foobar',
48+
id: '2',
49+
content: [
50+
{
51+
text: 'Let me get the weather for San Jose for you.'
52+
},
53+
{
54+
toolUse: {
55+
name: 'AMPLIFY_UI_WeatherCard',
56+
input: { city: 'San Jose' },
57+
toolUseId: '1234'
58+
}
59+
}
60+
],
61+
role: 'assistant' as const,
62+
createdAt: new Date(2023, 4, 21, 15, 24).toISOString()
63+
}
64+
];
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import {
2+
createTheme,
3+
defaultDarkModeOverride,
4+
ThemeProvider,
5+
View
6+
} from '@aws-amplify/ui-react';
7+
import * as React from 'react';
8+
import { LayoutContext } from '../Layout';
9+
10+
const theme = createTheme({
11+
name: 'default-amplify-ui-theme',
12+
overrides: [defaultDarkModeOverride]
13+
});
14+
15+
export const UIWrapper = ({ children }: React.PropsWithChildren) => {
16+
const { colorMode } = React.useContext(LayoutContext);
17+
18+
return (
19+
<ThemeProvider theme={theme} colorMode={colorMode}>
20+
<View
21+
borderRadius="small"
22+
padding="large"
23+
boxShadow={`0 0 0 2px ${theme.tokens.colors.neutral[20]}`}
24+
>
25+
{children}
26+
</View>
27+
</ThemeProvider>
28+
);
29+
};

src/components/UIWrapper/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { UIWrapper } from './UWrapper';

src/directory/directory.mjs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,71 @@ export const directory = {
727727
}
728728
]
729729
},
730+
{
731+
path: 'src/pages/[platform]/ai/index.mdx',
732+
children: [
733+
{
734+
path: 'src/pages/[platform]/ai/set-up-ai/index.mdx'
735+
},
736+
{
737+
path: 'src/pages/[platform]/ai/concepts/index.mdx',
738+
children: [
739+
{
740+
path: 'src/pages/[platform]/ai/concepts/architecture/index.mdx'
741+
},
742+
{
743+
path: 'src/pages/[platform]/ai/concepts/models/index.mdx'
744+
},
745+
{
746+
path: 'src/pages/[platform]/ai/concepts/prompting/index.mdx'
747+
},
748+
{
749+
path: 'src/pages/[platform]/ai/concepts/inference-configuration/index.mdx'
750+
},
751+
{
752+
path: 'src/pages/[platform]/ai/concepts/streaming/index.mdx'
753+
},
754+
{
755+
path: 'src/pages/[platform]/ai/concepts/tools/index.mdx'
756+
}
757+
]
758+
},
759+
{
760+
path: 'src/pages/[platform]/ai/conversation/index.mdx',
761+
children: [
762+
{
763+
path: 'src/pages/[platform]/ai/conversation/ai-conversation/index.mdx'
764+
},
765+
{
766+
path: 'src/pages/[platform]/ai/conversation/connect-your-frontend/index.mdx'
767+
},
768+
{
769+
path: 'src/pages/[platform]/ai/conversation/history/index.mdx'
770+
},
771+
{
772+
path: 'src/pages/[platform]/ai/conversation/tools/index.mdx'
773+
},
774+
{
775+
path: 'src/pages/[platform]/ai/conversation/context/index.mdx'
776+
},
777+
{
778+
path: 'src/pages/[platform]/ai/conversation/response-components/index.mdx'
779+
},
780+
{
781+
path: 'src/pages/[platform]/ai/conversation/knowledge-base/index.mdx'
782+
}
783+
]
784+
},
785+
{
786+
path: 'src/pages/[platform]/ai/generation/index.mdx',
787+
children: [
788+
{
789+
path: 'src/pages/[platform]/ai/generation/data-extraction/index.mdx'
790+
}
791+
]
792+
}
793+
]
794+
},
730795
{
731796
path: 'src/pages/[platform]/build-ui/index.mdx',
732797
children: [

src/pages/[platform]/ai/concepts/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const meta = {
55
title: "Concepts",
66
description:
77
"Learn about what Amplify AI provisions and get an overview about generative AI concepts and terminology.",
8-
route: '/[platform]/ai-kit/overview',
8+
route: '/[platform]/ai/concepts',
99
platforms: [
1010
"javascript",
1111
"react-native",

src/pages/[platform]/ai/concepts/inference-configuration/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ All generative AI routes in Amplify accept inference configuration as optional p
5050

5151
```ts
5252
a.generation({
53-
aiModel: a.ai.model("Claude 3 Haiku"),
53+
aiModel: a.ai.model("Claude 3.5 Haiku"),
5454
systemPrompt: `You are a helpful assistant`,
5555
inferenceConfiguration: {
5656
temperature: 0.2,

0 commit comments

Comments
 (0)