Skip to content

Latest commit

 

History

History
459 lines (325 loc) · 2.91 KB

arrayJoinAgent.md

File metadata and controls

459 lines (325 loc) · 2.91 KB

arrayJoinAgent

Description

Array Join Agent

Schema

inputs

{
  "type": "object",
  "properties": {
    "array": {
      "type": "array",
      "description": "array join"
    }
  },
  "required": [
    "array"
  ]
}

output

{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "description": "joined text"
    }
  }
}

Input example of the next node

[
  ":agentId",
  ":agentId.text"
]
[
  ":agentId",
  ":agentId.text"
]
[
  ":agentId",
  ":agentId.text"
]
[
  ":agentId",
  ":agentId.text"
]
[
  ":agentId",
  ":agentId.text"
]
[
  ":agentId",
  ":agentId.text"
]
[
  ":agentId",
  ":agentId.text"
]
[
  ":agentId",
  ":agentId.text"
]

Samples

Sample0

inputs

{
  "array": [
    [
      1
    ],
    [
      2
    ],
    [
      3
    ]
  ]
}

params

{}

result

{
  "text": "123"
}

Sample1

inputs

{
  "array": [
    [
      1
    ],
    [
      2
    ],
    [
      [
        3
      ]
    ]
  ]
}

params

{}

result

{
  "text": "123"
}

Sample2

inputs

{
  "array": [
    [
      "a"
    ],
    [
      "b"
    ],
    [
      "c"
    ]
  ]
}

params

{}

result

{
  "text": "abc"
}

Sample3

inputs

{
  "array": [
    [
      1
    ],
    [
      2
    ],
    [
      3
    ]
  ]
}

params

{"separator":"|"}

result

{
  "text": "1|2|3"
}

Sample4

inputs

{
  "array": [
    [
      [
        1
      ]
    ],
    [
      [
        2
      ],
      [
        3
      ]
    ]
  ]
}

params

{"separator":"|"}

result

{
  "text": "1|2,3"
}

Sample5

inputs

{
  "array": [
    [
      [
        1
      ]
    ],
    [
      [
        2
      ],
      [
        3
      ]
    ]
  ]
}

params

{"separator":"|","flat":1}

result

{
  "text": "1|2|3"
}

Sample6

inputs

{
  "array": [
    [
      [
        [
          1
        ]
      ],
      [
        [
          2
        ],
        [
          3
        ]
      ]
    ]
  ]
}

params

{"separator":"|","flat":1}

result

{
  "text": "1|2,3"
}

Sample7

inputs

{
  "array": [
    [
      [
        [
          1
        ]
      ],
      [
        [
          2
        ],
        [
          3
        ]
      ]
    ]
  ]
}

params

{"separator":"|","flat":2}

result

{
  "text": "1|2|3"
}

Author

Receptron team

Repository

https://github.com/receptron/graphai

License

MIT