This commit is contained in:
ishaan-jaff 2023-07-29 07:12:19 -07:00
parent 2cf949990e
commit a168cf8b9c
832 changed files with 161273 additions and 0 deletions

View file

@ -0,0 +1,14 @@
```python
from langchain.schema import BaseOutputParser
class CommaSeparatedListOutputParser(BaseOutputParser):
"""Parse the output of an LLM call to a comma-separated list."""
def parse(self, text: str):
"""Parse the output of an LLM call."""
return text.strip().split(", ")
CommaSeparatedListOutputParser().parse("hi, bye")
# >> ['hi', 'bye']
```