From 7f8c0c69d6fcc2b6385cdbed67a3c372eb2d883a Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Tue, 10 Dec 2024 13:19:00 -0800 Subject: [PATCH] Add test --- langchain-core/src/tools/tests/tools.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/langchain-core/src/tools/tests/tools.test.ts b/langchain-core/src/tools/tests/tools.test.ts index 26f441ed6f90..9e64b8624062 100644 --- a/langchain-core/src/tools/tests/tools.test.ts +++ b/langchain-core/src/tools/tests/tools.test.ts @@ -3,6 +3,7 @@ import { z } from "zod"; import { DynamicStructuredTool, tool } from "../index.js"; import { ToolMessage } from "../../messages/tool.js"; +import { RunnableConfig } from "../../runnables/types.js"; test("Tool should error if responseFormat is content_and_artifact but the function doesn't return a tuple", async () => { const weatherSchema = z.object({ @@ -10,7 +11,9 @@ test("Tool should error if responseFormat is content_and_artifact but the functi }); const weatherTool = tool( - (_) => { + // Should be able to type this as base RunnableConfig without issue, + // though true type is more specific + (_, _config: RunnableConfig) => { return "str"; }, {