From c1eab6cbb3516921deae53a013e902a51b8cb194 Mon Sep 17 00:00:00 2001 From: David Holtz Date: Sun, 20 Oct 2024 21:57:47 +0000 Subject: [PATCH] fix: adjust default when json tool choice is --- router/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/router/src/lib.rs b/router/src/lib.rs index d8762206834..18d1b1b3de0 100644 --- a/router/src/lib.rs +++ b/router/src/lib.rs @@ -1066,7 +1066,7 @@ pub enum ToolChoice { /// /// `none` is the default when no tools are present. `auto` is the default if tools are present." enum ToolTypeDeserializer { - /// `none` means the model will not call any tool and instead generates a message. + /// None means `null` was passed in the JSON, and the default choice is applied based on the presence of tools. Null, /// `auto` means the model can pick between generating a message or calling one or more tools. @@ -1081,7 +1081,7 @@ enum ToolTypeDeserializer { impl From for ToolChoice { fn from(value: ToolTypeDeserializer) -> Self { match value { - ToolTypeDeserializer::Null => ToolChoice::NoTool, + ToolTypeDeserializer::Null => ToolChoice::Auto, ToolTypeDeserializer::String(s) => match s.as_str() { "none" => ToolChoice::NoTool, "auto" => ToolChoice::Auto,