Replace enumerate with zip. (#5527)

# Replace enumerate with zip.

It's more idiomatic and slightly more readable.
pull/4521/head
Taras Tsugrii 1 year ago committed by GitHub
parent 226a7521ed
commit af41cdfc8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -46,6 +46,6 @@ class CombiningOutputParser(BaseOutputParser):
"""Parse the output of an LLM call."""
texts = text.split("\n\n")
output = dict()
for i, parser in enumerate(self.parsers):
output.update(parser.parse(texts[i].strip()))
for txt, parser in zip(texts, self.parsers):
output.update(parser.parse(txt.strip()))
return output

Loading…
Cancel
Save