Skip to content

Commit e721574

Browse files
committed
fix: update test for tool_call_id in Message
1 parent 042a6bc commit e721574

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

router/src/infer/chat_template.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,7 @@ TOOL CALL ID: 0
11811181
"I'd like to show off how chat templating works!".to_string(),
11821182
),
11831183
},
1184+
tool_call_id: None,
11841185
},
11851186
Message {
11861187
name: None,
@@ -1190,13 +1191,15 @@ TOOL CALL ID: 0
11901191
"Great! How can I help you today?".to_string(),
11911192
),
11921193
},
1194+
tool_call_id: None,
11931195
},
11941196
Message {
11951197
name: None,
11961198
role: "user".to_string(),
11971199
body: MessageBody::Content {
11981200
content: MessageContent::SingleText("Just testing".to_string()),
11991201
},
1202+
tool_call_id: None,
12001203
},
12011204
];
12021205
let tools_string = r#"[{"type": "function","function": {"name": "get_current_weather","description": "Get the current weather","parameters": {"type": "object","properties": {"location": {"type": "string","description": "The city and state, e.g. San Francisco, CA"},"format": {"type": "string","enum": ["celsius", "fahrenheit"],"description": "The temperature unit to use. Infer this from the users location."}},"required": ["location", "format"]}}}]"#.to_string();
@@ -1226,6 +1229,7 @@ TOOL CALL ID: 0
12261229
.to_string(),
12271230
),
12281231
},
1232+
tool_call_id: None,
12291233
},
12301234
Message {
12311235
name: None,
@@ -1235,6 +1239,7 @@ TOOL CALL ID: 0
12351239
"What is the weather like in Brooklyn, New York?".to_string(),
12361240
),
12371241
},
1242+
tool_call_id: None,
12381243
},
12391244
];
12401245
let tools_string = r#"[{"type": "function","function": {"name": "get_current_weather","description": "Get the current weather","parameters": {"type": "object","properties": {"location": {"type": "string","description": "The city and state, e.g. San Francisco, CA"},"format": {"type": "string","enum": ["celsius", "fahrenheit"],"description": "The temperature unit to use. Infer this from the users location."}},"required": ["location", "format"]}}}]"#.to_string();
@@ -1305,6 +1310,7 @@ TOOL CALL ID: 0
13051310
text: "You are a helpful assistant.".to_string(),
13061311
}]),
13071312
},
1313+
tool_call_id: None,
13081314
},
13091315
Message {
13101316
name: None,
@@ -1332,6 +1338,7 @@ TOOL CALL ID: 0
13321338
},
13331339
]),
13341340
},
1341+
tool_call_id: None,
13351342
},
13361343
];
13371344

router/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,7 @@ mod tests {
16441644
body: MessageBody::Content {
16451645
content: MessageContent::SingleText("What is Deep Learning?".to_string())
16461646
},
1647+
tool_call_id: None,
16471648
}
16481649
);
16491650
}
@@ -1703,6 +1704,7 @@ mod tests {
17031704
MessageChunk::ImageUrl { image_url: Url { url: "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rabbit.png".to_string() }},
17041705
]),
17051706
},
1707+
tool_call_id: None,
17061708
}
17071709
);
17081710
}
@@ -1717,7 +1719,8 @@ mod tests {
17171719
MessageChunk::Text { text: "Whats in this image?".to_string() },
17181720
MessageChunk::ImageUrl { image_url: Url { url: "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rabbit.png".to_string() } }
17191721
]),
1720-
}
1722+
},
1723+
tool_call_id: None
17211724
};
17221725
let textmsg: TextMessage = message.into();
17231726
assert_eq!(textmsg.content, "Whats in this image?![](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rabbit.png)");

router/src/vertex.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ mod tests {
175175
"What's Deep Learning?".to_string()
176176
)
177177
},
178+
tool_call_id: None,
178179
},],
179180
max_tokens: Some(128),
180181
top_p: Some(0.95),

0 commit comments

Comments
 (0)