Skip to content

Commit 7b877ab

Browse files
authored
[Router] use call_id instead of id for matching function calls in Responses API for Harmony (#13056)
1 parent 0d4a418 commit 7b877ab

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sgl-router/src/routers/grpc/harmony/builder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -603,11 +603,11 @@ impl HarmonyBuilder {
603603
.iter()
604604
.rev()
605605
.find_map(|item| match item {
606-
ResponseInputOutputItem::FunctionToolCall { id, name, .. }
607-
if id == call_id =>
608-
{
609-
Some(name.clone())
610-
}
606+
ResponseInputOutputItem::FunctionToolCall {
607+
call_id: item_call_id,
608+
name,
609+
..
610+
} if item_call_id == call_id => Some(name.clone()),
611611
_ => None,
612612
})
613613
.ok_or_else(|| format!("No function call found for call_id: {}", call_id))?;

sgl-router/src/routers/grpc/harmony/responses.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ fn build_next_request_with_tools(
13531353
..
13541354
}) = items
13551355
.iter_mut()
1356-
.find(|item| matches!(item, ResponseInputOutputItem::FunctionToolCall { id, .. } if id == &tool_result.call_id))
1356+
.find(|item| matches!(item, ResponseInputOutputItem::FunctionToolCall { call_id, .. } if call_id == &tool_result.call_id))
13571357
{
13581358
*output = Some(output_str);
13591359
*status = if tool_result.is_error {

0 commit comments

Comments
 (0)