* fix: support special flow modules in evals Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: extract shared flow helper logic Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: make special flow tools openai-compatible Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: improve flow eval prompts and validation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test: relax flow benchmark overfits Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test: record updated flow benchmark history Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: address flow review findings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: source flow chat special module prompt Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: narrow rawscript helper return type Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: dedupe flow chat prompt guidance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: relax flow test10 validation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
Special Modules
- Use
set_preprocessor_moduleto add, replace, or remove the top-levelvalue.preprocessor_module - Use
set_failure_moduleto add, replace, or remove the top-levelvalue.failure_module - Use
set_flow_jsononly when you are replacing the whole flow, including normal modules and optional special modules
Example - Update only the special modules:
set_preprocessor_module({
module: JSON.stringify({
id: "preprocessor",
value: {
type: "rawscript",
language: "bun",
content: "export async function preprocessor(payload: string) { const trimmed = payload.trim(); if (!trimmed) { throw new Error('payload must not be empty'); } return { payload: trimmed }; }",
input_transforms: {
payload: { type: "javascript", expr: "flow_input.payload" }
}
}
})
})
set_failure_module({
module: JSON.stringify({
id: "failure",
value: {
type: "rawscript",
language: "bun",
content: "export async function main(message: string, name: string, step_id: string) { return { message, name, step_id }; }",
input_transforms: {
message: { type: "javascript", expr: "error.message" },
name: { type: "javascript", expr: "error.name" },
step_id: { type: "javascript", expr: "error.step_id" }
}
}
})
})