Allow new lines during JSON generation (#1277)
This commit is contained in:
committed by
GitHub
parent
0836055324
commit
32a4141d5a
@@ -79,7 +79,7 @@ class FSMCache(BaseToolCache):
|
|||||||
|
|
||||||
def init_value(self, value):
|
def init_value(self, value):
|
||||||
if self.json_schema_mode:
|
if self.json_schema_mode:
|
||||||
regex = build_regex_from_schema(value)
|
regex = build_regex_from_schema(value, whitespace_pattern=r"[\n\t ]*")
|
||||||
return RegexGuide(regex, self.outlines_tokenizer), regex
|
return RegexGuide(regex, self.outlines_tokenizer), regex
|
||||||
else:
|
else:
|
||||||
return RegexGuide(value, self.outlines_tokenizer)
|
return RegexGuide(value, self.outlines_tokenizer)
|
||||||
|
|||||||
Reference in New Issue
Block a user