[Router] use call_id instead of id for matching function calls in Responses API for Harmony (#13056)
This commit is contained in:
@@ -603,11 +603,11 @@ impl HarmonyBuilder {
|
|||||||
.iter()
|
.iter()
|
||||||
.rev()
|
.rev()
|
||||||
.find_map(|item| match item {
|
.find_map(|item| match item {
|
||||||
ResponseInputOutputItem::FunctionToolCall { id, name, .. }
|
ResponseInputOutputItem::FunctionToolCall {
|
||||||
if id == call_id =>
|
call_id: item_call_id,
|
||||||
{
|
name,
|
||||||
Some(name.clone())
|
..
|
||||||
}
|
} if item_call_id == call_id => Some(name.clone()),
|
||||||
_ => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
.ok_or_else(|| format!("No function call found for call_id: {}", call_id))?;
|
.ok_or_else(|| format!("No function call found for call_id: {}", call_id))?;
|
||||||
|
|||||||
@@ -1353,7 +1353,7 @@ fn build_next_request_with_tools(
|
|||||||
..
|
..
|
||||||
}) = items
|
}) = items
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.find(|item| matches!(item, ResponseInputOutputItem::FunctionToolCall { id, .. } if id == &tool_result.call_id))
|
.find(|item| matches!(item, ResponseInputOutputItem::FunctionToolCall { call_id, .. } if call_id == &tool_result.call_id))
|
||||||
{
|
{
|
||||||
*output = Some(output_str);
|
*output = Some(output_str);
|
||||||
*status = if tool_result.is_error {
|
*status = if tool_result.is_error {
|
||||||
|
|||||||
Reference in New Issue
Block a user