mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-08 19:04:52 +00:00
fix: lint and format
This commit is contained in:
parent
71fbe88a30
commit
b6540cea50
@ -46,6 +46,12 @@ async def test_flash_gemma3_defs(flash_gemma3, response_snapshot):
|
||||
seed=42,
|
||||
)
|
||||
|
||||
assert response.choices[0].message.tool_calls[0]["function"]["name"] == "classify_weather"
|
||||
assert response.choices[0].message.tool_calls[0]["function"]["arguments"] == '{"weather":"sunny"}'
|
||||
assert (
|
||||
response.choices[0].message.tool_calls[0]["function"]["name"]
|
||||
== "classify_weather"
|
||||
)
|
||||
assert (
|
||||
response.choices[0].message.tool_calls[0]["function"]["arguments"]
|
||||
== '{"weather":"sunny"}'
|
||||
)
|
||||
assert response == response_snapshot
|
||||
|
@ -96,9 +96,13 @@ impl ToolGrammar {
|
||||
if ref_str.starts_with("#/$defs/") {
|
||||
// Replace $defs with $functions/{func.name}/$defs to handle
|
||||
// function-specific definitions
|
||||
new_obj.insert("$ref".to_string(), Value::String(
|
||||
ref_str.replace("#/$defs/", &format!("#/$functions/{}/$defs/", func.name))
|
||||
));
|
||||
new_obj.insert(
|
||||
"$ref".to_string(),
|
||||
Value::String(ref_str.replace(
|
||||
"#/$defs/",
|
||||
&format!("#/$functions/{}/$defs/", func.name),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
Value::Object(new_obj)
|
||||
|
Loading…
Reference in New Issue
Block a user