Spaces:
Build error
Build error
File size: 380 Bytes
d660b02 |
1 2 3 4 5 6 7 8 9 10 |
from langchain.output_parsers import PydanticOutputParser
class ListPydanticOutputParser(PydanticOutputParser):
def _parse_obj(self, obj: dict | list):
if isinstance(obj, list):
return [super(ListPydanticOutputParser, self)._parse_obj(obj_) for obj_ in obj]
else:
return super(ListPydanticOutputParser, self)._parse_obj(obj)
|