test13_deep_nesting.json 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {
  2. "version": "3.15",
  3. "name": "Test13: Deep Nesting - Loop with Branch routing to different LLMs",
  4. "registry": {
  5. "params": [],
  6. "vars": ["$data([OBJECT])", "$results([STRING])"]
  7. },
  8. "steps": [
  9. {
  10. "id": "Set_Data",
  11. "target": "$data",
  12. "value": "[{\"type\": \"greeting\", \"lang\": \"EN\"}, {\"type\": \"farewell\", \"lang\": \"FR\"}, {\"type\": \"greeting\", \"lang\": \"JP\"}]",
  13. "next": "Loop_Process"
  14. },
  15. {
  16. "id": "Loop_Process",
  17. "mode": "serial",
  18. "source": "=$data",
  19. "children": ["Branch_Type"],
  20. "next": "Stop_End"
  21. },
  22. {
  23. "id": "Branch_Type",
  24. "cases": [
  25. ["=_item.type == \"greeting\"", "LLM_Greeting"],
  26. ["ELSE", "LLM_Farewell"]
  27. ],
  28. "next": "RETURN"
  29. },
  30. {
  31. "id": "LLM_Greeting",
  32. "in": { "messages": [{ "role": "user", "content": "=\"Say hello in \" + _item.lang + \" in exactly 3 words.\"" }] },
  33. "out": { "$results[_index]": "=_result" },
  34. "next": "RETURN"
  35. },
  36. {
  37. "id": "LLM_Farewell",
  38. "in": { "messages": [{ "role": "user", "content": "=\"Say goodbye in \" + _item.lang + \" in exactly 3 words.\"" }] },
  39. "out": { "$results[_index]": "=_result" },
  40. "next": "RETURN"
  41. },
  42. { "id": "Stop_End" }
  43. ]
  44. }