3 ms·
I've had good luck with Langchain's output parsers[0], but in addition to the format instructions I also append something like "Do not provide any explanations,
by SparkyMcUnicorn 3y ago
I've had good luck with Langchain's output parsers[0], but in addition to the format instructions I also append something like "Do not provide any explanations, just the JSON output.", which helps eliminate content being generated outside of the JSON block.
[0] https://js.langchain.com/docs/modules/prompts/output_parsers/#structured-output-parser-with-zod-schema https://js.langchain.com/docs/modules/prompts/output_parsers...