langchain/docs/modules/prompts/output_parsers/examples
mwinterde 9c0cb90997
Resolve error in StructuredOutputParser docs (#5240)
# Resolve error in StructuredOutputParser docs

Documentation for `StructuredOutputParser` currently not reproducible,
that is, `output_parser.parse(output)` raises an error because the LLM
returns a response with an invalid format

```python
_input = prompt.format_prompt(question="what's the capital of france")
output = model(_input.to_string())

output

# ?
#
# ```json
# {
# 	"answer": "Paris",
# 	"source": "https://www.worldatlas.com/articles/what-is-the-capital-of-france.html"
# }
# ```
```

Was fixed by adding a question mark to the prompt
2023-05-25 07:47:25 -07:00
..
comma_separated.ipynb big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
output_fixing_parser.ipynb Update output_fixing_parser.ipynb (#3978) 2023-05-02 09:33:46 -07:00
pydantic.ipynb big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
retry.ipynb big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
structured.ipynb Resolve error in StructuredOutputParser docs (#5240) 2023-05-25 07:47:25 -07:00