Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Dec 10, 2024
1 parent 9f8cf91 commit 7f8c0c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion langchain-core/src/tools/tests/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ 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({
location: z.string(),
});

const weatherTool = tool(
(_) => {
// Should be able to type this as base RunnableConfig without issue,
// though true type is more specific
(_, _config: RunnableConfig) => {
return "str";
},
{
Expand Down

0 comments on commit 7f8c0c6

Please sign in to comment.