Skip to content

Latest commit

 

History

History
227 lines (163 loc) · 1.79 KB

popAgent.md

File metadata and controls

227 lines (163 loc) · 1.79 KB

popAgent

Description

Pop Agent

Schema

inputs

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

output

{
  "type": "object",
  "properties": {
    "item": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        },
        {
          "type": "object"
        },
        {
          "type": "array"
        }
      ],
      "description": "the item popped 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"
]
[
  ":agentId",
  ":agentId.array",
  ":agentId.array.$0",
  ":agentId.array.$1",
  ":agentId.item"
]

Samples

Sample0

inputs

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

params

{}

result

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

Sample1

inputs

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

params

{}

result

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

Sample2

inputs

{
  "array": [
    1,
    2,
    3
  ],
  "array2": [
    "a",
    "b",
    "c"
  ]
}

params

{}

result

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

Author

Receptron team

Repository

https://github.com/receptron/graphai

License

MIT