mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
fixed regex to match sources for all cases, also includes source
This commit is contained in:
parent
e80834d783
commit
6d3485e798
@ -124,7 +124,7 @@ class BaseQAWithSourcesChain(Chain, ABC):
|
||||
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]
|
||||
else:
|
||||
sources = ""
|
||||
return answer, sources
|
||||
|
Loading…
Reference in New Issue
Block a user