mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-19 13:52:07 +00:00
fix: update test for tool_call_id in Message
This commit is contained in:
parent
042a6bc365
commit
e721574729
@ -1181,6 +1181,7 @@ TOOL CALL ID: 0
|
||||
"I'd like to show off how chat templating works!".to_string(),
|
||||
),
|
||||
},
|
||||
tool_call_id: None,
|
||||
},
|
||||
Message {
|
||||
name: None,
|
||||
@ -1190,6 +1191,7 @@ TOOL CALL ID: 0
|
||||
"Great! How can I help you today?".to_string(),
|
||||
),
|
||||
},
|
||||
tool_call_id: None,
|
||||
},
|
||||
Message {
|
||||
name: None,
|
||||
@ -1197,6 +1199,7 @@ TOOL CALL ID: 0
|
||||
body: MessageBody::Content {
|
||||
content: MessageContent::SingleText("Just testing".to_string()),
|
||||
},
|
||||
tool_call_id: None,
|
||||
},
|
||||
];
|
||||
let tools_string = r#"[{"type": "function","function": {"name": "get_current_weather","description": "Get the current weather","parameters": {"type": "object","properties": {"location": {"type": "string","description": "The city and state, e.g. San Francisco, CA"},"format": {"type": "string","enum": ["celsius", "fahrenheit"],"description": "The temperature unit to use. Infer this from the users location."}},"required": ["location", "format"]}}}]"#.to_string();
|
||||
@ -1226,6 +1229,7 @@ TOOL CALL ID: 0
|
||||
.to_string(),
|
||||
),
|
||||
},
|
||||
tool_call_id: None,
|
||||
},
|
||||
Message {
|
||||
name: None,
|
||||
@ -1235,6 +1239,7 @@ TOOL CALL ID: 0
|
||||
"What is the weather like in Brooklyn, New York?".to_string(),
|
||||
),
|
||||
},
|
||||
tool_call_id: None,
|
||||
},
|
||||
];
|
||||
let tools_string = r#"[{"type": "function","function": {"name": "get_current_weather","description": "Get the current weather","parameters": {"type": "object","properties": {"location": {"type": "string","description": "The city and state, e.g. San Francisco, CA"},"format": {"type": "string","enum": ["celsius", "fahrenheit"],"description": "The temperature unit to use. Infer this from the users location."}},"required": ["location", "format"]}}}]"#.to_string();
|
||||
@ -1305,6 +1310,7 @@ TOOL CALL ID: 0
|
||||
text: "You are a helpful assistant.".to_string(),
|
||||
}]),
|
||||
},
|
||||
tool_call_id: None,
|
||||
},
|
||||
Message {
|
||||
name: None,
|
||||
@ -1332,6 +1338,7 @@ TOOL CALL ID: 0
|
||||
},
|
||||
]),
|
||||
},
|
||||
tool_call_id: None,
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -1644,6 +1644,7 @@ mod tests {
|
||||
body: MessageBody::Content {
|
||||
content: MessageContent::SingleText("What is Deep Learning?".to_string())
|
||||
},
|
||||
tool_call_id: None,
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1703,6 +1704,7 @@ mod tests {
|
||||
MessageChunk::ImageUrl { image_url: Url { url: "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rabbit.png".to_string() }},
|
||||
]),
|
||||
},
|
||||
tool_call_id: None,
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -1717,7 +1719,8 @@ mod tests {
|
||||
MessageChunk::Text { text: "Whats in this image?".to_string() },
|
||||
MessageChunk::ImageUrl { image_url: Url { url: "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rabbit.png".to_string() } }
|
||||
]),
|
||||
}
|
||||
},
|
||||
tool_call_id: None
|
||||
};
|
||||
let textmsg: TextMessage = message.into();
|
||||
assert_eq!(textmsg.content, "Whats in this image?");
|
||||
|
@ -175,6 +175,7 @@ mod tests {
|
||||
"What's Deep Learning?".to_string()
|
||||
)
|
||||
},
|
||||
tool_call_id: None,
|
||||
},],
|
||||
max_tokens: Some(128),
|
||||
top_p: Some(0.95),
|
||||
|
Loading…
Reference in New Issue
Block a user