langchain/tests/unit_tests/output_parsers
Joshua Snyder 59d054308c
Add type inference for output parsers (#2769)
Currently, the output type of a number of OutputParser's `parse` methods
is `Any` when it can in fact be inferred.

This PR makes BaseOutputParser use a generic type and fixes the output
types of the following parsers:
- `PydanticOutputParser`
- `OutputFixingParser`
- `RetryOutputParser`
- `RetryWithErrorOutputParser`

The output of the `StructuredOutputParser` is corrected from `BaseModel`
to `Any` since there are no type guarantees provided by the parser.

Fixes issue #2715
2023-04-12 09:12:20 -07:00
..
__init__.py Add regex dict: (#1616) 2023-03-13 23:05:39 -07:00
test_pydantic_parser.py Add type inference for output parsers (#2769) 2023-04-12 09:12:20 -07:00
test_regex_dict.py Add regex dict: (#1616) 2023-03-13 23:05:39 -07:00