test04_loop_serial.json 893 B

12345678910111213141516171819202122232425262728293031323334
  1. {
  2. "version": "3.15",
  3. "name": "Test04: Serial Loop",
  4. "registry": {
  5. "params": [],
  6. "vars": ["$items([OBJECT])", "$results([STRING])"]
  7. },
  8. "steps": [
  9. {
  10. "id": "Set_Items",
  11. "target": "$items",
  12. "value": "[{\"name\": \"apple\", \"color\": \"red\"}, {\"name\": \"banana\", \"color\": \"yellow\"}, {\"name\": \"grape\", \"color\": \"purple\"}]",
  13. "next": "Loop_Describe"
  14. },
  15. {
  16. "id": "Loop_Describe",
  17. "mode": "serial",
  18. "source": "=$items",
  19. "children": ["LLM_Describe"],
  20. "next": "Stop_End"
  21. },
  22. {
  23. "id": "LLM_Describe",
  24. "in": {
  25. "messages": [
  26. { "role": "user", "content": "=\"In exactly one sentence, describe a \" + _item.color + \" \" + _item.name + \".\"" }
  27. ]
  28. },
  29. "out": { "$results[_index]": "=_result" },
  30. "next": "RETURN"
  31. },
  32. { "id": "Stop_End" }
  33. ]
  34. }