Skip to content

Commit dc30e25

Browse files
committed
fix: make tool test more reliable with toolChoice required
1 parent 476e9f0 commit dc30e25

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/e2e/callModel.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ describe("callModel E2E Tests", () => {
9696
input: [
9797
{
9898
role: "user",
99-
content: "What's the weather in Paris? Use the get_weather tool.",
99+
content: "Call the get_weather function with location set to Paris.",
100100
},
101101
],
102102
tools: [
103103
{
104104
type: "function" as const,
105105
function: {
106106
name: "get_weather",
107-
description: "Get weather for a location",
107+
description: "Get weather for a location. Always call this when asked about weather.",
108108
parameters: {
109109
type: "object",
110110
properties: {
@@ -118,6 +118,7 @@ describe("callModel E2E Tests", () => {
118118
},
119119
},
120120
],
121+
toolChoice: "required",
121122
});
122123

123124
const toolCalls = await response.getToolCalls();

0 commit comments

Comments
 (0)