[Frontend] Support strict mode for tool calling (#45003)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com> Co-authored-by: cjackal <44624812+cjackal@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
cjackal
mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent
bd59c913bc
commit
2043258dec
@@ -46,6 +46,7 @@ class Llama3JsonToolParser(ToolParser):
|
||||
"""
|
||||
|
||||
bot_token: str = "<|python_tag|>"
|
||||
structural_tag_model = "llama"
|
||||
# Simple regex to find opening braces - we'll use JSON decoder for parsing
|
||||
# This handles arbitrary nesting depth correctly
|
||||
tool_call_start_regex: re.Pattern = re.compile(r"\{")
|
||||
|
||||
Reference in New Issue
Block a user