langchainjs icon indicating copy to clipboard operation
langchainjs copied to clipboard

Fix ChatConversationalAgentOutputParser cannot handle markdown in the JSON

Open micahriggan opened this issue 2 years ago • 6 comments

The output parser doesn't handle when the AI's action_input contains markdown, or ``` backticks really, as it's matching on the first set of backticks it finds rather than the last.

Tested with yarn test:single langchain/src/agents/tests/chat_output_parser.test.ts

micahriggan avatar Apr 23 '23 19:04 micahriggan

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Apr 28, 2023 2:01pm

vercel[bot] avatar Apr 23 '23 19:04 vercel[bot]

For the lint, how should I resolve the no-unused-expressions on the tests calling expect?

micahriggan avatar Apr 23 '23 19:04 micahriggan

@micahriggan I've fixed it, it was missing the () for doing the function call

nfcampos avatar Apr 24 '23 08:04 nfcampos

FWIW, I think StructuredOutputParser has the same problem

NJordan72 avatar Apr 24 '23 09:04 NJordan72

@NJordan72 agreed, just took a look at that file and it has the same issue.

micahriggan avatar Apr 25 '23 01:04 micahriggan

Anything else I need to do on this one? @nfcampos

micahriggan avatar Apr 28 '23 13:04 micahriggan

Thanks, merging this now. The same issue in StructuredOutputParser is resolved in another PR

nfcampos avatar May 01 '23 12:05 nfcampos