From 149524b0e414bd8d1b125a7a8d6177cc549f4729 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 24 Jul 2024 14:38:33 -0700 Subject: [PATCH] cr --- .../src/tests/chat_models.int.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/langchain-google-vertexai/src/tests/chat_models.int.test.ts b/libs/langchain-google-vertexai/src/tests/chat_models.int.test.ts index b27dc3b98caa..3692ebd9560d 100644 --- a/libs/langchain-google-vertexai/src/tests/chat_models.int.test.ts +++ b/libs/langchain-google-vertexai/src/tests/chat_models.int.test.ts @@ -325,7 +325,7 @@ test("Streaming true constructor param will stream", async () => { expect(totalTokenCount).toBeGreaterThan(1); }); -test("tool_choice works", async () => { +test.only("tool_choice works", async () => { const model = new ChatVertexAI({ model: "gemini-1.5-pro", }); @@ -358,9 +358,10 @@ test("tool_choice works", async () => { }); const result = await modelWithTools.invoke( - "Whats the weather like in paris today?" + "What's 1836 plus 7262? Whats the weather like in paris today?" ); + expect(result.tool_calls).toHaveLength(1); expect(result.tool_calls?.[0]).toBeDefined(); if (!result.tool_calls?.[0]) return; expect(result.tool_calls?.[0].name).toBe("get_weather");