mirror of
https://github.com/langchain-ai/create-agent-chat-app.git
synced 2026-07-01 21:24:02 -04:00
fix issues
This commit is contained in:
@@ -2,5 +2,4 @@ node_modules
|
||||
dist
|
||||
.env
|
||||
coverage
|
||||
templates/**
|
||||
index.js
|
||||
@@ -70,7 +70,7 @@ This will contain all of the required secrets the agent(s) need in order to run.
|
||||
Finally, start the development servers. This command will start both the web, and LangGraph servers:
|
||||
|
||||
```bash
|
||||
npm dev
|
||||
npm run dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
@@ -106,7 +106,7 @@ Web:
|
||||
```bash
|
||||
cd apps/web
|
||||
|
||||
npm dev
|
||||
npm run dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
@@ -118,7 +118,7 @@ LangGraph:
|
||||
```bash
|
||||
cd apps/agents
|
||||
|
||||
npm dev
|
||||
npm run dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"extends": "@tsconfig/recommended",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"baseUrl": ".",
|
||||
"target": "ES2021",
|
||||
"lib": ["ES2021", "ES2022.Object", "DOM", "es2023"],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"declaration": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"useDefineForClassFields": true,
|
||||
"strictPropertyInitialization": false,
|
||||
"allowJs": true,
|
||||
"strict": true
|
||||
},
|
||||
"include": ["src/"],
|
||||
"exclude": ["node_modules/", "dist"]
|
||||
}
|
||||
@@ -21,6 +21,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
||||
"@eslint/eslintrc": "^3.1.0",
|
||||
"@typescript-eslint/parser": "^5.59.8",
|
||||
"@tsconfig/recommended": "^1.0.8",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-no-instanceof": "^1.0.1",
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
"dotenv": "^16.4.7",
|
||||
"turbo": "latest",
|
||||
"eslint": "^9.19.0",
|
||||
"eslint-config-next": "14.2.10",
|
||||
"eslint-config-next": "15.2.2",
|
||||
"eslint-plugin-react-hooks": "^5.0.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.18",
|
||||
"globals": "^15.14.0",
|
||||
|
||||
@@ -131,7 +131,6 @@ async function respond(
|
||||
): Promise<typeof AgentStateAnnotation.Update> {
|
||||
const configuration = ensureAgentConfiguration(config);
|
||||
const model = await loadChatModel(configuration.responseModel);
|
||||
// @ts-ignore
|
||||
const context = formatDocs(state.documents);
|
||||
const prompt = configuration.responseSystemPrompt.replace(
|
||||
"{context}",
|
||||
|
||||
@@ -70,7 +70,6 @@ export const AgentStateAnnotation = Annotation.Root({
|
||||
Document[] | { [key: string]: any }[] | string[] | string | "delete"
|
||||
>({
|
||||
default: () => [],
|
||||
// @ts-ignore
|
||||
reducer: reduceDocs,
|
||||
}),
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export function reduceDocs(
|
||||
existingIds.add(itemId);
|
||||
} else if (typeof item === "object") {
|
||||
const metadata = (item as Document).metadata ?? {};
|
||||
let itemId = metadata.uuid ?? uuidv4();
|
||||
const itemId = metadata.uuid ?? uuidv4();
|
||||
|
||||
if (!existingIds.has(itemId)) {
|
||||
if ("pageContent" in item) {
|
||||
|
||||
Reference in New Issue
Block a user