Skip to content

Commit 193ad66

Browse files
committed
fix: adjust default when json tool choice is
1 parent 16e4c38 commit 193ad66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

router/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ pub enum ToolChoice {
10231023
///
10241024
/// `none` is the default when no tools are present. `auto` is the default if tools are present."
10251025
enum ToolTypeDeserializer {
1026-
/// `none` means the model will not call any tool and instead generates a message.
1026+
/// None means `null` was passed in the JSON, and the default choice is applied based on the presence of tools.
10271027
Null,
10281028

10291029
/// `auto` means the model can pick between generating a message or calling one or more tools.
@@ -1038,7 +1038,7 @@ enum ToolTypeDeserializer {
10381038
impl From<ToolTypeDeserializer> for ToolChoice {
10391039
fn from(value: ToolTypeDeserializer) -> Self {
10401040
match value {
1041-
ToolTypeDeserializer::Null => ToolChoice::NoTool,
1041+
ToolTypeDeserializer::Null => ToolChoice::Auto,
10421042
ToolTypeDeserializer::String(s) => match s.as_str() {
10431043
"none" => ToolChoice::NoTool,
10441044
"auto" => ToolChoice::Auto,

0 commit comments

Comments
 (0)