mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-21 14:18:52 +00:00
community[minor]: Fix regular expression in visualize and outlines modules. (#30002)
Fix invalid escape characteres
This commit is contained in:
parent
577c0d0715
commit
4710c1fa8c
@ -20,7 +20,7 @@ _EDGE_DIRECTION = {
|
||||
"bidir": "both",
|
||||
}
|
||||
|
||||
_WORD_RE = re.compile("\s*\S+")
|
||||
_WORD_RE = re.compile(r"\s*\S+")
|
||||
|
||||
|
||||
def _split_prefix(s: str, max_chars: int = 50) -> str:
|
||||
|
@ -59,7 +59,7 @@ class Outlines(LLM):
|
||||
"""Whether to stream the results, token by token."""
|
||||
|
||||
regex: Optional[str] = None
|
||||
"""Regular expression for structured generation.
|
||||
r"""Regular expression for structured generation.
|
||||
|
||||
If provided, Outlines will guarantee that the generated text matches this regex.
|
||||
This can be useful for generating structured outputs like IP addresses, dates, etc.
|
||||
|
Loading…
Reference in New Issue
Block a user