summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/bedrock.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/bedrock.rs b/src/client/bedrock.rs
index 0dc84ca..16ea5d0 100644
--- a/src/client/bedrock.rs
+++ b/src/client/bedrock.rs
@@ -222,6 +222,9 @@ async fn chat_completions_streaming(
json_str_from_map(tool_use, "name"),
) {
if !function_name.is_empty() {
+ if function_arguments.is_empty() {
+ function_arguments = String::from("{}");
+ }
let arguments: Value =
function_arguments.parse().with_context(|| {
format!("Tool call '{function_name}' have non-JSON arguments '{function_arguments}'")
@@ -259,6 +262,9 @@ async fn chat_completions_streaming(
reasoning_state = 0;
}
if !function_name.is_empty() {
+ if function_arguments.is_empty() {
+ function_arguments = String::from("{}");
+ }
let arguments: Value = function_arguments.parse().with_context(|| {
format!("Tool call '{function_name}' have non-JSON arguments '{function_arguments}'")
})?;