mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-14 17:07:25 +00:00
Replace enumerate with zip. (#5527)
# Replace enumerate with zip. It's more idiomatic and slightly more readable.
This commit is contained in:
parent
226a7521ed
commit
af41cdfc8b
@ -46,6 +46,6 @@ class CombiningOutputParser(BaseOutputParser):
|
|||||||
"""Parse the output of an LLM call."""
|
"""Parse the output of an LLM call."""
|
||||||
texts = text.split("\n\n")
|
texts = text.split("\n\n")
|
||||||
output = dict()
|
output = dict()
|
||||||
for i, parser in enumerate(self.parsers):
|
for txt, parser in zip(texts, self.parsers):
|
||||||
output.update(parser.parse(texts[i].strip()))
|
output.update(parser.parse(txt.strip()))
|
||||||
return output
|
return output
|
||||||
|
Loading…
Reference in New Issue
Block a user