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.

open_ai: Fix issues with optional arguments when model calls a tool (#64920)

Bennet Bo Fennerc32938c34c56
diff --git a/crates/open_ai/src/completion.rs b/crates/open_ai/src/completion.rs
index 9dbd0bd27d4..c9d27385ea3 100644
--- a/crates/open_ai/src/completion.rs
+++ b/crates/open_ai/src/completion.rs
@@ -339,7 +339,7 @@ pub fn into_open_ai_response(
name: tool.name,
description: Some(tool.description),
parameters: Some(input_schema),
- strict: None,
+ strict: Some(false),
}
}
LanguageModelRequestToolInput::Custom { format } => {
@@ -1959,7 +1959,8 @@ mod tests {
"type": "function",
"name": "get_weather",
"description": "Fetches the weather",
- "parameters": { "type": "object" }
+ "parameters": { "type": "object" },
+ "strict": false
}
],
"prompt_cache_key": "thread-123",