langchain
langchain copied to clipboard
Pydantic output parser assumes JSON object
With a schema such as:
class JsonList(BaseModel):
__root__: List[str]
We can validate a JSON string in the form:
[ 'xxx', 'yyy', 'zzz' ]
But the Pydantic parser assumes the input is an object in its greedy search, so it fails with a validation error.