fix: map tool_choice 'none' in OpenAI shim
The Anthropic-to-OpenAI tool_choice mapping handled 'auto', 'any', and 'tool' but not 'none'. When 'none' was passed, the request was sent without tool_choice, defaulting to 'auto' — the opposite of the intended behavior (disable tool use). Relates to #30 Co-Authored-By: Juan Camilo <juancamilo.auriti@gmail.com>
This commit is contained in:
@@ -630,6 +630,8 @@ class OpenAIShimMessages {
|
|||||||
}
|
}
|
||||||
} else if (tc.type === 'any') {
|
} else if (tc.type === 'any') {
|
||||||
body.tool_choice = 'required'
|
body.tool_choice = 'required'
|
||||||
|
} else if (tc.type === 'none') {
|
||||||
|
body.tool_choice = 'none'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user