Skip to content

Commit 3185eb2

Browse files
committed
fix: rm langchain dependency
1 parent d933232 commit 3185eb2

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

bun.lockb

-14.3 KB
Binary file not shown.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
"@ai-sdk/openai": "^1.0.15",
109109
"@upstash/qstash": "^2.7.20",
110110
"ai": "^4.0.30",
111-
"langchain": "^0.3.11",
112111
"zod": "^3.24.1"
113112
},
114113
"directories": {

src/agents/adapters.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export const convertLangchainTool = (langchainTool: LangchainTool): AISDKTool =>
9999
return tool({
100100
description: langchainTool.description,
101101
parameters: langchainTool.schema,
102-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
103-
execute: async (param: any) => langchainTool.invoke(param),
102+
execute: async (...param: unknown[]) => langchainTool.invoke(...param),
104103
});
105104
};

src/agents/types.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import type { CoreTool, generateText } from "ai";
2-
import type { Tool } from "langchain/tools";
32
import { Agent } from "./agent";
43

54
export type AISDKTool = CoreTool;
6-
export type LangchainTool = Tool;
5+
export type LangchainTool = {
6+
description: string;
7+
schema: AISDKTool["parameters"];
8+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
9+
invoke: (...params: any[]) => any;
10+
};
711

812
type GenerateTextParams = Parameters<typeof generateText>[0];
913

0 commit comments

Comments
 (0)