test05_loop_parallel.json 866 B

12345678910111213141516171819202122232425262728293031323334
  1. {
  2. "version": "3.15",
  3. "name": "Test05: Parallel Loop",
  4. "registry": {
  5. "params": [],
  6. "vars": ["$tasks([OBJECT])", "$outputs([STRING])"]
  7. },
  8. "steps": [
  9. {
  10. "id": "Set_Tasks",
  11. "target": "$tasks",
  12. "value": "[{\"lang\": \"Python\"}, {\"lang\": \"JavaScript\"}, {\"lang\": \"Go\"}, {\"lang\": \"Rust\"}]",
  13. "next": "Loop_GenCode"
  14. },
  15. {
  16. "id": "Loop_GenCode",
  17. "mode": "parallel",
  18. "source": "=$tasks",
  19. "children": ["LLM_GenHello"],
  20. "next": "Stop_End"
  21. },
  22. {
  23. "id": "LLM_GenHello",
  24. "in": {
  25. "messages": [
  26. { "role": "user", "content": "=\"Write a hello world one-liner in \" + _item.lang + \". Only output the code, no explanation.\"" }
  27. ]
  28. },
  29. "out": { "$outputs[_index]": "=_result" },
  30. "next": "RETURN"
  31. },
  32. { "id": "Stop_End" }
  33. ]
  34. }