|
| 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 | +]; |
0 commit comments