Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

anthropic: Use an empty object if no tool input is provided (#26144)

Marshall Bowersd0c2bef8c397
diff --git a/crates/language_models/src/provider/anthropic.rs b/crates/language_models/src/provider/anthropic.rs
index 011224cf1a4..ec9fcfeb8fc 100644
--- a/crates/language_models/src/provider/anthropic.rs
+++ b/crates/language_models/src/provider/anthropic.rs
@@ -639,7 +639,9 @@ pub fn map_to_language_model_completion_events(
id: tool_use.id.into(),
name: tool_use.name.into(),
input: if tool_use.input_json.is_empty() {
- serde_json::Value::Null
+ serde_json::Value::Object(
+ serde_json::Map::default(),
+ )
} else {
serde_json::Value::from_str(
&tool_use.input_json,