Skip to content

Commit

Permalink
refactor(client): support the function call response with content in …
Browse files Browse the repository at this point in the history
…same time
  • Loading branch information
wwsheng009 committed Feb 18, 2025
1 parent d72ce9c commit 465c6c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ pub async fn openai_chat_completions_streaming(
reason_state = 1;
}
handler.text(text)?;
} else if let (Some(function), index, id) = (
}
if let (Some(function), index, id) = (
data["choices"][0]["delta"]["tool_calls"][0]["function"].as_object(),
data["choices"][0]["delta"]["tool_calls"][0]["index"].as_u64(),
data["choices"][0]["delta"]["tool_calls"][0]["id"]
Expand Down

0 comments on commit 465c6c1

Please sign in to comment.