mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 16:02:19 +00:00
d3cb0c6220
* 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>
39 lines
1.3 KiB
Markdown
39 lines
1.3 KiB
Markdown
## Special Modules
|
|
|
|
- Use `set_preprocessor_module` to add, replace, or remove the top-level `value.preprocessor_module`
|
|
- Use `set_failure_module` to add, replace, or remove the top-level `value.failure_module`
|
|
- Use `set_flow_json` only when you are replacing the whole flow, including normal modules and optional special modules
|
|
|
|
**Example - Update only the special modules:**
|
|
```javascript
|
|
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" }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
```
|