abhagsain
03/31/2024, 11:43 PMjs examples.
I'm using StructuredOutputParser using zod in langchain and getting JSON from LLMs.
Now I get a response in a JSON format, but it's wrapped in a code block (3 backticks), so before running any assertions, I first want to parse it using Zod. Parsing via zod would validate the structure of the response but I want to format the response in text format for llm-rubric. It would save me token cost, and the llm would only need to focus on the content, not the structure.abhagsain
03/31/2024, 11:46 PMlodash etcian
04/01/2024, 12:13 AMyaml
# ...
tests:
- vars:
language: French
body: Hello world
options:
transform: file://path/to/transform.js
# ...
js
module.exports = (output, context) => {
// Use context.vars, context.prompt ...
return output.toUpperCase();
}
Will be included in tonight's releaseabhagsain
04/01/2024, 12:20 AM