Skip to content

Latest commit

 

History

History
174 lines (124 loc) · 1.45 KB

shiftAgent.md

File metadata and controls

174 lines (124 loc) · 1.45 KB

shiftAgent

Description

shift Agent

Schema

inputs

{
  "type": "object",
  "properties": {
    "array": {
      "type": "array",
      "description": "the array to shift an item from"
    }
  },
  "required": [
    "array"
  ]
}

output

{
  "type": "object",
  "properties": {
    "item": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        },
        {
          "type": "object"
        },
        {
          "type": "array"
        }
      ],
      "description": "the item shifted from the array"
    },
    "array": {
      "type": "array",
      "description": "the remaining array"
    }
  }
}

Input example of the next node

[
  ":agentId",
  ":agentId.array",
  ":agentId.array.$0",
  ":agentId.array.$1",
  ":agentId.item"
]
[
  ":agentId",
  ":agentId.array",
  ":agentId.array.$0",
  ":agentId.array.$1",
  ":agentId.item"
]

Samples

Sample0

inputs

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

params

{}

result

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

Sample1

inputs

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

params

{}

result

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

Author

Receptron team

Repository

https://github.com/receptron/graphai

License

MIT