Files
windmill/ai_evals/fixtures/frontend/flow/expected/test5_modify_simple.json

69 lines
3.0 KiB
JSON

{
"summary": "Simple data pipeline with validation",
"value": {
"modules": [
{
"id": "fetch_data",
"summary": "Fetch data from API",
"value": {
"type": "rawscript",
"language": "bun",
"content": "export async function main() {\n // Mock API call\n return [\n { id: 1, name: \"Item 1\", value: 100 },\n { id: 2, name: \"Item 2\", value: 200 },\n { id: 3, name: \"Item 3\", value: 300 }\n ];\n}",
"input_transforms": {}
}
},
{
"id": "process_data",
"summary": "Process the fetched data",
"value": {
"type": "rawscript",
"language": "bun",
"content": "export async function main(data: any[]) {\n // Apply some transformation\n return data.map(item => ({\n ...item,\n value: item.value * 1.1,\n processed: true\n }));\n}",
"input_transforms": {
"data": {
"type": "javascript",
"expr": "results.fetch_data"
}
}
}
},
{
"id": "validate_data",
"summary": "Validate processed data",
"value": {
"type": "rawscript",
"language": "bun",
"content": "export async function main(data: any[]) {\n if (!data || data.length === 0) {\n return { error: true, message: \"No data to save\" };\n }\n return { error: false, data: data };\n}",
"input_transforms": {
"data": {
"type": "javascript",
"expr": "results.process_data"
}
}
}
},
{
"id": "save_results",
"summary": "Save results to database",
"value": {
"type": "rawscript",
"language": "bun",
"content": "export async function main(validated: any) {\n if (validated.error) {\n return { saved: 0, status: \"skipped\", reason: validated.message };\n }\n // Mock database save\n console.log(`Saving ${validated.data.length} items to database`);\n return { saved: validated.data.length, status: \"success\" };\n}",
"input_transforms": {
"validated": {
"type": "javascript",
"expr": "results.validate_data"
}
}
}
}
]
},
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {},
"required": [],
"type": "object"
}
}