mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 20:34:54 +00:00
fix: adjust default when json tool choice is
This commit is contained in:
parent
905d503971
commit
c1eab6cbb3
@ -1066,7 +1066,7 @@ pub enum ToolChoice {
|
|||||||
///
|
///
|
||||||
/// `none` is the default when no tools are present. `auto` is the default if tools are present."
|
/// `none` is the default when no tools are present. `auto` is the default if tools are present."
|
||||||
enum ToolTypeDeserializer {
|
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,
|
Null,
|
||||||
|
|
||||||
/// `auto` means the model can pick between generating a message or calling one or more tools.
|
/// `auto` means the model can pick between generating a message or calling one or more tools.
|
||||||
@ -1081,7 +1081,7 @@ enum ToolTypeDeserializer {
|
|||||||
impl From<ToolTypeDeserializer> for ToolChoice {
|
impl From<ToolTypeDeserializer> for ToolChoice {
|
||||||
fn from(value: ToolTypeDeserializer) -> Self {
|
fn from(value: ToolTypeDeserializer) -> Self {
|
||||||
match value {
|
match value {
|
||||||
ToolTypeDeserializer::Null => ToolChoice::NoTool,
|
ToolTypeDeserializer::Null => ToolChoice::Auto,
|
||||||
ToolTypeDeserializer::String(s) => match s.as_str() {
|
ToolTypeDeserializer::String(s) => match s.as_str() {
|
||||||
"none" => ToolChoice::NoTool,
|
"none" => ToolChoice::NoTool,
|
||||||
"auto" => ToolChoice::Auto,
|
"auto" => ToolChoice::Auto,
|
||||||
|
Loading…
Reference in New Issue
Block a user