I'm using a helper called StructuredOutputParser from langchain/core/output_parsers, which you can u
I'm using a helper called StructuredOutputParser from langchain/core/output_parsers, which you can use a zod schema in order to enforce the result type.
i'm using this parser with the input:
this basically adds a descriptive text to the prompt which explains what is the JSON structure and how you(LLM) should apply this to the result. In the end, it outputs a JSON with the correct fields. Maybe you can try this. I'm sure you can just reverse engineer the process and write your own helper.
I'll try to post the result of the
i'm using this parser with the input:
this basically adds a descriptive text to the prompt which explains what is the JSON structure and how you(LLM) should apply this to the result. In the end, it outputs a JSON with the correct fields. Maybe you can try this. I'm sure you can just reverse engineer the process and write your own helper.
I'll try to post the result of the
getFormatInstructions when i'm home.



