mirror of https://github.com/hwchase17/langchain
Fix issue#1712: Update `BaseQAWithSourcesChain` to handle space & newline after `SOURCES:` (#2118)
Fix the issue outlined in #1712 to ensure the `BaseQAWithSourcesChain` can properly separate the sources from an agent response even when they are delineated by a newline. This will ensure the `BaseQAWithSourcesChain` can reliably handle both of these agent outputs: * `"This Agreement is governed by English law.\nSOURCES: 28-pl"` -> `"This Agreement is governed by English law.\n`, `"28-pl"` * `"This Agreement is governed by English law.\nSOURCES:\n28-pl"` -> `"This Agreement is governed by English law.\n`, `"28-pl"` I couldn't find any unit tests for this but please let me know if you'd like me to add any test coverage.pull/2124/head
parent
c33e055f17
commit
859502b16c
Loading…
Reference in New Issue