Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
f93a7cad
Unverified
Commit
f93a7cad
authored
Sep 08, 2025
by
Ayush Agarwal
Committed by
GitHub
Sep 08, 2025
Browse files
fix: fix hermes tool call config (#2915)
Signed-off-by:
ayushag
<
ayushag@nvidia.com
>
parent
1477f6ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
lib/parsers/src/tool_calling/config.rs
lib/parsers/src/tool_calling/config.rs
+1
-1
lib/parsers/src/tool_calling/parsers.rs
lib/parsers/src/tool_calling/parsers.rs
+13
-0
No files found.
lib/parsers/src/tool_calling/config.rs
View file @
f93a7cad
...
...
@@ -81,7 +81,7 @@ impl ToolCallConfig {
format
:
ToolCallParserType
::
Json
,
json
:
JsonParserConfig
{
tool_call_start_tokens
:
vec!
[
"<tool_call>"
.to_string
()],
tool_call_end_tokens
:
vec!
[
"
\n
</tool_call>"
.to_string
()],
tool_call_end_tokens
:
vec!
[
"</tool_call>"
.to_string
()],
..
Default
::
default
()
},
}
...
...
lib/parsers/src/tool_calling/parsers.rs
View file @
f93a7cad
...
...
@@ -1186,4 +1186,17 @@ Remember, San Francisco weather can be quite unpredictable, particularly with it
assert_eq!
(
name
,
"get_current_weather"
);
assert_eq!
(
args
[
"location"
],
"Paris"
);
}
#[test]
fn
test_hermes_parser_without_new_line
()
{
let
input
=
r#"<tool_call>{"name": "get_weather", "arguments": {"location": "San Francisco, CA", "unit": "celsius"}}</tool_call>"
"#
;
let
(
result
,
content
)
=
detect_and_parse_tool_call
(
input
,
Some
(
"hermes"
))
.unwrap
();
assert_eq!
(
content
,
Some
(
""
.to_string
()));
assert_eq!
(
result
.len
(),
1
);
let
(
name
,
args
)
=
extract_name_and_args
(
result
[
0
]
.clone
());
assert_eq!
(
name
,
"get_weather"
);
assert_eq!
(
args
[
"location"
],
"San Francisco, CA"
);
assert_eq!
(
args
[
"unit"
],
"celsius"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment