Skip to content

Commit f8294fa

Browse files
committed
重複コードを整理
1 parent 7a1cefb commit f8294fa

43 files changed

Lines changed: 5775 additions & 9452 deletions

File tree

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ updates:
1414
- package-ecosystem: npm
1515
directories:
1616
- '/'
17+
- '/common/core/'
18+
- '/common/backend/'
1719
- '/agents/agent-mastra/'
1820
- '/agents/agent-voltagent/'
1921
- '/basic/cdk/'

agents/agent-voltagent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"zod": "3.24.2"
2424
},
2525
"devDependencies": {
26-
"@types/node": "^22.17.1",
26+
"@types/node": "^22.17.2",
2727
"tsx": "^4.20.4",
2828
"typescript": "^5.9.2"
2929
}

basic/app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
"@eslint/compat": "^1.3.2",
2121
"@eslint/eslintrc": "^3.3.1",
2222
"@eslint/js": "^9.33.0",
23+
"@llm-ts-example/common-core": "workspace:*",
2324
"@solidjs/router": "^0.15.3",
2425
"@stylistic/eslint-plugin": "^5.2.3",
2526
"@types/crypto-js": "^4.2.2",
26-
"@types/node": "^22.17.1",
27+
"@types/node": "^22.17.2",
2728
"@types/uuid": "^10.0.0",
2829
"crypto-js": "^4.2.0",
2930
"eslint": "^9.33.0",

basic/app/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import './App.css';
22
import { v7 as uuidv7 } from 'uuid';
33
import { Chat } from './features/chat/components/Chat';
4-
import { models } from './constants';
4+
import { models } from '@llm-ts-example/common-core';
55

66
function App() {
77
const sessionId = uuidv7();

basic/cdk/lambda/handler.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
'use strict';
2-
31
import { ChatPromptTemplate } from '@langchain/core/prompts';
42
import { StringOutputParser } from '@langchain/core/output_parsers';
53
import { CallbackHandler } from 'langfuse-langchain';
6-
import { selectLlm } from './llm';
7-
import { logger } from './logger';
4+
import { selectLlm, logger } from '@llm-ts-example/common-backend';
85

96
export async function handle(
107
sessionId: string,

basic/cdk/lambda/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
'use strict';
2-
31
import { APIGatewayProxyEvent } from 'aws-lambda';
42
import { handle } from './handler';
53
import { v7 as uuidv7 } from 'uuid';
6-
import { logger } from './logger';
4+
import { logger } from '@llm-ts-example/common-backend';
75

86
export const handler = awslambda.streamifyResponse(
97
async (

basic/cdk/lambda/llm.ts

Lines changed: 0 additions & 239 deletions
This file was deleted.

basic/cdk/lambda/logger.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

basic/cdk/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@eslint/js": "^9.33.0",
1818
"@stylistic/eslint-plugin": "^5.2.3",
1919
"@types/aws-lambda": "^8.10.152",
20-
"@types/node": "^22.17.1",
20+
"@types/node": "^22.17.2",
2121
"@types/uuid": "^10.0.0",
2222
"@vitest/eslint-plugin": "^1.3.4",
2323
"aws-cdk": "^2.1025.0",
@@ -26,7 +26,6 @@
2626
"eslint-import-resolver-typescript": "^4.4.4",
2727
"eslint-plugin-import": "^2.32.0",
2828
"eslint-plugin-promise": "^7.2.1",
29-
"ts-node": "^10.9.2",
3029
"tsx": "^4.20.4",
3130
"typescript": "^5.9.2",
3231
"typescript-eslint": "^8.39.1",
@@ -39,9 +38,10 @@
3938
"@aws-sdk/credential-provider-node": "^3.864.0",
4039
"@langchain/anthropic": "^0.3.26",
4140
"@langchain/aws": "^0.1.13",
42-
"@langchain/core": "^0.3.70",
41+
"@langchain/core": "^0.3.71",
4342
"@langchain/langgraph": "^0.2.74",
4443
"@langchain/openai": "^0.5.18",
44+
"@llm-ts-example/common-backend": "workspace:*",
4545
"@smithy/eventstream-codec": "^4.0.5",
4646
"aws-cdk-lib": "^2.211.0",
4747
"constructs": "^10.4.2",

basic/cdk/tsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"ts-node": {
3-
"esm": true,
4-
"experimentalSpecifierResolution": "node"
5-
},
62
"compilerOptions": {
73
"target": "esnext",
84
"module": "esnext",

0 commit comments

Comments
 (0)