Skip to content

Commit edd5738

Browse files
committed
Add the AI Element
1 parent 6a5c21a commit edd5738

82 files changed

Lines changed: 17132 additions & 594 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ updates:
3939
- '/rag/app/'
4040
- '/rag/batch/'
4141
- '/rag/cdk/'
42+
- '/chat-app/'
4243
schedule:
4344
interval: daily
4445
timezone: Asia/Tokyo

agents/agent-langchain/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@
5858
"langchain": "^1.2.3",
5959
"source-map-support": "^0.5.21",
6060
"uuid": "^13.0.0",
61-
"zod": "^4.3.2"
61+
"zod": "^4.3.4"
6262
}
6363
}

agents/agent-mastra/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@mastra/mcp": "^0.14.5",
2323
"@mastra/memory": "^0.15.13",
2424
"langfuse-vercel": "^3.38.6",
25-
"zod": "^4.3.2"
25+
"zod": "^4.3.4"
2626
},
2727
"devDependencies": {
2828
"@eslint/compat": "^2.0.0",

agents/agent-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
"@anthropic-ai/claude-agent-sdk": "^0.1.76",
3838
"source-map-support": "^0.5.21",
3939
"uuid": "^13.0.0",
40-
"zod": "^4.3.2"
40+
"zod": "^4.3.4"
4141
}
4242
}

agents/agent-voltagent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"ai": "^5.0.117",
2626
"dotenv": "^16.6.1",
2727
"hono": "^4.11.3",
28-
"zod": "^4.3.2"
28+
"zod": "^4.3.4"
2929
},
3030
"devDependencies": {
3131
"@types/node": "^24.10.4",

chat-app/.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts

chat-app/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.

chat-app/app/api/chat/route.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { streamText, UIMessage, convertToModelMessages } from 'ai';
2+
import { bedrock } from "@ai-sdk/amazon-bedrock";
3+
4+
// Allow streaming responses up to 30 seconds
5+
export const maxDuration = 30;
6+
export async function POST(req: Request) {
7+
const {
8+
messages,
9+
model,
10+
webSearch,
11+
}: {
12+
messages: UIMessage[];
13+
model: string;
14+
webSearch: boolean;
15+
} = await req.json();
16+
const result = streamText({
17+
model: webSearch ? 'perplexity/sonar' : bedrock(model),
18+
messages: convertToModelMessages(messages),
19+
system:
20+
'You are a helpful assistant that can answer questions and help with tasks',
21+
});
22+
// send sources and reasoning back to the client
23+
return result.toUIMessageStreamResponse({
24+
sendSources: true,
25+
sendReasoning: true,
26+
});
27+
}

chat-app/app/favicon.ico

25.3 KB
Binary file not shown.

chat-app/app/globals.css

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
@import "tailwindcss";
2+
@import "tw-animate-css";
3+
4+
@custom-variant dark (&:is(.dark *));
5+
6+
@theme inline {
7+
--color-background: var(--background);
8+
--color-foreground: var(--foreground);
9+
--font-sans: var(--font-geist-sans);
10+
--font-mono: var(--font-geist-mono);
11+
--color-sidebar-ring: var(--sidebar-ring);
12+
--color-sidebar-border: var(--sidebar-border);
13+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
14+
--color-sidebar-accent: var(--sidebar-accent);
15+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
16+
--color-sidebar-primary: var(--sidebar-primary);
17+
--color-sidebar-foreground: var(--sidebar-foreground);
18+
--color-sidebar: var(--sidebar);
19+
--color-chart-5: var(--chart-5);
20+
--color-chart-4: var(--chart-4);
21+
--color-chart-3: var(--chart-3);
22+
--color-chart-2: var(--chart-2);
23+
--color-chart-1: var(--chart-1);
24+
--color-ring: var(--ring);
25+
--color-input: var(--input);
26+
--color-border: var(--border);
27+
--color-destructive: var(--destructive);
28+
--color-accent-foreground: var(--accent-foreground);
29+
--color-accent: var(--accent);
30+
--color-muted-foreground: var(--muted-foreground);
31+
--color-muted: var(--muted);
32+
--color-secondary-foreground: var(--secondary-foreground);
33+
--color-secondary: var(--secondary);
34+
--color-primary-foreground: var(--primary-foreground);
35+
--color-primary: var(--primary);
36+
--color-popover-foreground: var(--popover-foreground);
37+
--color-popover: var(--popover);
38+
--color-card-foreground: var(--card-foreground);
39+
--color-card: var(--card);
40+
--radius-sm: calc(var(--radius) - 4px);
41+
--radius-md: calc(var(--radius) - 2px);
42+
--radius-lg: var(--radius);
43+
--radius-xl: calc(var(--radius) + 4px);
44+
--radius-2xl: calc(var(--radius) + 8px);
45+
--radius-3xl: calc(var(--radius) + 12px);
46+
--radius-4xl: calc(var(--radius) + 16px);
47+
}
48+
49+
:root {
50+
--radius: 0.625rem;
51+
--background: oklch(1 0 0);
52+
--foreground: oklch(0.145 0 0);
53+
--card: oklch(1 0 0);
54+
--card-foreground: oklch(0.145 0 0);
55+
--popover: oklch(1 0 0);
56+
--popover-foreground: oklch(0.145 0 0);
57+
--primary: oklch(0.205 0 0);
58+
--primary-foreground: oklch(0.985 0 0);
59+
--secondary: oklch(0.97 0 0);
60+
--secondary-foreground: oklch(0.205 0 0);
61+
--muted: oklch(0.97 0 0);
62+
--muted-foreground: oklch(0.556 0 0);
63+
--accent: oklch(0.97 0 0);
64+
--accent-foreground: oklch(0.205 0 0);
65+
--destructive: oklch(0.577 0.245 27.325);
66+
--border: oklch(0.922 0 0);
67+
--input: oklch(0.922 0 0);
68+
--ring: oklch(0.708 0 0);
69+
--chart-1: oklch(0.646 0.222 41.116);
70+
--chart-2: oklch(0.6 0.118 184.704);
71+
--chart-3: oklch(0.398 0.07 227.392);
72+
--chart-4: oklch(0.828 0.189 84.429);
73+
--chart-5: oklch(0.769 0.188 70.08);
74+
--sidebar: oklch(0.985 0 0);
75+
--sidebar-foreground: oklch(0.145 0 0);
76+
--sidebar-primary: oklch(0.205 0 0);
77+
--sidebar-primary-foreground: oklch(0.985 0 0);
78+
--sidebar-accent: oklch(0.97 0 0);
79+
--sidebar-accent-foreground: oklch(0.205 0 0);
80+
--sidebar-border: oklch(0.922 0 0);
81+
--sidebar-ring: oklch(0.708 0 0);
82+
}
83+
84+
.dark {
85+
--background: oklch(0.145 0 0);
86+
--foreground: oklch(0.985 0 0);
87+
--card: oklch(0.205 0 0);
88+
--card-foreground: oklch(0.985 0 0);
89+
--popover: oklch(0.205 0 0);
90+
--popover-foreground: oklch(0.985 0 0);
91+
--primary: oklch(0.922 0 0);
92+
--primary-foreground: oklch(0.205 0 0);
93+
--secondary: oklch(0.269 0 0);
94+
--secondary-foreground: oklch(0.985 0 0);
95+
--muted: oklch(0.269 0 0);
96+
--muted-foreground: oklch(0.708 0 0);
97+
--accent: oklch(0.269 0 0);
98+
--accent-foreground: oklch(0.985 0 0);
99+
--destructive: oklch(0.704 0.191 22.216);
100+
--border: oklch(1 0 0 / 10%);
101+
--input: oklch(1 0 0 / 15%);
102+
--ring: oklch(0.556 0 0);
103+
--chart-1: oklch(0.488 0.243 264.376);
104+
--chart-2: oklch(0.696 0.17 162.48);
105+
--chart-3: oklch(0.769 0.188 70.08);
106+
--chart-4: oklch(0.627 0.265 303.9);
107+
--chart-5: oklch(0.645 0.246 16.439);
108+
--sidebar: oklch(0.205 0 0);
109+
--sidebar-foreground: oklch(0.985 0 0);
110+
--sidebar-primary: oklch(0.488 0.243 264.376);
111+
--sidebar-primary-foreground: oklch(0.985 0 0);
112+
--sidebar-accent: oklch(0.269 0 0);
113+
--sidebar-accent-foreground: oklch(0.985 0 0);
114+
--sidebar-border: oklch(1 0 0 / 10%);
115+
--sidebar-ring: oklch(0.556 0 0);
116+
}
117+
118+
@layer base {
119+
* {
120+
@apply border-border outline-ring/50;
121+
}
122+
body {
123+
@apply bg-background text-foreground;
124+
}
125+
}

0 commit comments

Comments
 (0)