mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
updated formatting changes
This commit is contained in:
parent
b1f649bca5
commit
8a4670e127
@ -121,7 +121,9 @@ class BaseQAWithSourcesChain(Chain, ABC):
|
|||||||
def _split_sources(self, answer: str) -> Tuple[str, str]:
|
def _split_sources(self, answer: str) -> Tuple[str, str]:
|
||||||
"""Split sources from answer."""
|
"""Split sources from answer."""
|
||||||
if re.search(r"SOURCES?[:\s]", answer, re.IGNORECASE):
|
if re.search(r"SOURCES?[:\s]", answer, re.IGNORECASE):
|
||||||
answer, sources = re.split(r"SOURCES?[:\s]|QUESTION:\s", answer, flags=re.IGNORECASE)[:2]
|
answer, sources = re.split(
|
||||||
|
r"SOURCES?[:\s]|QUESTION:\s", answer, flags=re.IGNORECASE
|
||||||
|
)[:2]
|
||||||
sources = re.split(r"\n", sources)[0].strip()
|
sources = re.split(r"\n", sources)[0].strip()
|
||||||
else:
|
else:
|
||||||
sources = ""
|
sources = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user