# @graphai/vanilla 中文文档

规范地址：https://npmcn.com/package/%40graphai/vanilla/

版本：2\.0\.12
npm 元数据更新时间：2025-08-18T02:39:39.436Z
中文译文更新时间：2026-11-17T00:08:04.203Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40graphai/vanilla
原文对照：https://npmcn.com/package/%40graphai/vanilla/?lang=original
项目主页：https://github.com/receptron/graphai/blob/main/agents/vanilla_agents/README.md
源码仓库：https://github.com/receptron/graphai

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：241 kB，96 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- 运行依赖：1 个
- 首次发布：2024-05-25T00:01:36.131Z
- 最新版本发布：2025-08-18T02:39:39.201Z
- 近 30 天下载量：16599（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：75（近 12 个月 0 个）

## 中文简介

GraphAI的香草剂.

## 安装

```sh
npm install @graphai/vanilla
```

也可以使用：`pnpm add @graphai/vanilla`、`yarn add @graphai/vanilla`、`bun add @graphai/vanilla`

## README

# @graphai/ vanilla for GraphAI 页面存档备份,存于互联网档案馆

GraphAI的香草剂.

### 安装

```sh
yarn add @graphai/vanilla
```

### 使用量

```typescript
import { GraphAI } from "graphai";
import { 
  arrayFindFirstExistsAgent,
  arrayFlatAgent,
  arrayJoinAgent,
  arrayToObjectAgent,
  compareAgent,
  consoleAgent,
  copy2ArrayAgent,
  copyAgent,
  copyMessageAgent,
  countingAgent,
  dataSumTemplateAgent,
  dotProductAgent,
  echoAgent,
  images2messageAgent,
  jsonParserAgent,
  lookupDictionaryAgent,
  mapAgent,
  mergeNodeIdAgent,
  mergeObjectAgent,
  nestedAgent,
  popAgent,
  propertyFilterAgent,
  pushAgent,
  shiftAgent,
  sleeperAgent,
  sortByValuesAgent,
  streamMockAgent,
  stringCaseVariantsAgent,
  stringEmbeddingsAgent,
  stringSplitterAgent,
  stringTemplateAgent,
  stringUpdateTextAgent,
  totalAgent,
  vanillaFetchAgent
 } from "@graphai/vanilla";

const agents = { 
  arrayFindFirstExistsAgent,
  arrayFlatAgent,
  arrayJoinAgent,
  arrayToObjectAgent,
  compareAgent,
  consoleAgent,
  copy2ArrayAgent,
  copyAgent,
  copyMessageAgent,
  countingAgent,
  dataSumTemplateAgent,
  dotProductAgent,
  echoAgent,
  images2messageAgent,
  jsonParserAgent,
  lookupDictionaryAgent,
  mapAgent,
  mergeNodeIdAgent,
  mergeObjectAgent,
  nestedAgent,
  popAgent,
  propertyFilterAgent,
  pushAgent,
  shiftAgent,
  sleeperAgent,
  sortByValuesAgent,
  streamMockAgent,
  stringCaseVariantsAgent,
  stringEmbeddingsAgent,
  stringSplitterAgent,
  stringTemplateAgent,
  stringUpdateTextAgent,
  totalAgent,
  vanillaFetchAgent
 };

const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
```

### 代理人说明

-   查找第一Exists 代理 - 矩阵平面代理
-   阵列FlatAgent - 阵列平面代理
-   阵列Join代理 - 组合代理
-   矩阵到对象代理 - 矩阵到对象代理
-   比较代理 - 比较
-   控制台代理 - 只给控制台发短信。 info
-   复制2 箭头代理 - 复制2 矩阵代理
-   复制代理 - 返回已命名的输入
-   复制信代理 - 复制信代理
-   计数代理 - 计数代理
-   数据SumTemplate 代理 - 返回输入值的总和
-   点生产剂 - 点生产剂
-   回声代理 - Echo代理
-   图像2message Agent - 返回 llm 的信息数据包含图像
-   jsonParser 代理 - 模板代理
-   查找词典代理 - 选择带有参数的元素
-   地图代理 - 地图代理
-   合并节点ID代理 - 合并节点ID代理
-   合并对象代理 - 返回的输入
-   嵌入代理 - 嵌入代理
-   流行代理 - 流行代理
-   propertyFilter Agent - 基于属性名称的过滤器属性, 包括“ 包含 ” 、 “ 排除 ” 、 “ 修改 ” 、 “ 擦拭 ” 、 “ 插入 ” 、 “ 检查 ”
-   推动代理 - 推动代理
-   换行代理 - 换行代理
-   卧底 - 卧底 测试和调试代理
-   排序 ByValues 代理 - 排序 ByValues 代理
-   streamMock Agent - 流模拟代理
-   字符串变量代理 - 格式字符串代理
-   字符串Embeddings 代理 - 嵌入代理
-   字符串分配器代理 - 使用以下参数将一个长字符串剥入块
-   字符串模板代理 - 模板代理
-   字符串更新文本代理 -
-   代理 - 返回输入值之和
-   香草FetchAgent - 从指定的 URL 获取 JSON 数据

### 输入/输出/图像Schema和样本

-   [查找第一个存在代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/array/arrayFindFirstExistsAgent.md)
-   [阵列FlatAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/array/arrayFlatAgent.md)
-   [数组](https://github.com/receptron/graphai/blob/main/docs/agentDocs/array/arrayJoinAgent.md)
-   [数组到对象代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/array/arrayToObjectAgent.md)
-   [比较代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/compare/compareAgent.md)
-   [控制台代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/string/consoleAgent.md)
-   [复制2 箭头代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/test/copy2ArrayAgent.md)
-   [复制代理人](https://github.com/receptron/graphai/blob/main/docs/agentDocs/data/copyAgent.md)
-   [复制对象](https://github.com/receptron/graphai/blob/main/docs/agentDocs/test/copyMessageAgent.md)
-   [计数 探员](https://github.com/receptron/graphai/blob/main/docs/agentDocs/test/countingAgent.md)
-   [数据SumTemplate 代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/data/dataSumTemplateAgent.md)
-   [点生产代理商](https://github.com/receptron/graphai/blob/main/docs/agentDocs/matrix/dotProductAgent.md)
-   [回声代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/test/echoAgent.md)
-   [图像2消息代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/image/images2messageAgent.md)
-   [jsonParser 代理服务器](https://github.com/receptron/graphai/blob/main/docs/agentDocs/string/jsonParserAgent.md)
-   [搜索词典代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/data/lookupDictionaryAgent.md)
-   [地图代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/graph/mapAgent.md)
-   [合并节点ID代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/test/mergeNodeIdAgent.md)
-   [合并对象代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/data/mergeObjectAgent.md)
-   [嵌入剂](https://github.com/receptron/graphai/blob/main/docs/agentDocs/graph/nestedAgent.md)
-   [弹出代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/array/popAgent.md)
-   [客户端](https://github.com/receptron/graphai/blob/main/docs/agentDocs/data/propertyFilterAgent.md)
-   [推动代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/array/pushAgent.md)
-   [换行代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/array/shiftAgent.md)
-   [卧底代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/sleeper/sleeperAgent.md)
-   [类型](https://github.com/receptron/graphai/blob/main/docs/agentDocs/matrix/sortByValuesAgent.md)
-   [流媒体代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/test/streamMockAgent.md)
-   [字符串变量](https://github.com/receptron/graphai/blob/main/docs/agentDocs/string/stringCaseVariantsAgent.md)
-   [字符串编辑器](https://github.com/receptron/graphai/blob/main/docs/agentDocs/embedding/stringEmbeddingsAgent.md)
-   [字符串分配器代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/string/stringSplitterAgent.md)
-   [字符串模板代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/string/stringTemplateAgent.md)
-   [字符串更新文本代理](https://github.com/receptron/graphai/blob/main/docs/agentDocs/undefined/stringUpdateTextAgent.md)
-   [共计](https://github.com/receptron/graphai/blob/main/docs/agentDocs/data/totalAgent.md)
-   [香草剂](https://github.com/receptron/graphai/blob/main/docs/agentDocs/service/vanillaFetchAgent.md)

### 输入/图像示例

-   查找第一个存在代理
    -   投入
        -   数组( 阵列)
            -   要找到的数组
    -   段落

```typescript
{
  "inputs": {
    "array": [
      null,
      2
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      null,
      null,
      3
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      null,
      null,
      0
    ]
  },
  "params": {}
}
```

-   阵列FlatAgent
    -   投入
        -   数组( 阵列)
            -   要平整的阵列
    -   段落
        -   深度( 数量)
            -   平缓深度

```typescript
{
  "inputs": {
    "array": [
      [
        1
      ],
      [
        2
      ],
      [
        3
      ]
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        1
      ],
      [
        2
      ],
      [
        [
          3
        ]
      ]
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        1
      ],
      [
        2
      ],
      [
        [
          3
        ]
      ]
    ]
  },
  "params": {
    "depth": 2
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        "a"
      ],
      [
        "b"
      ],
      [
        "c"
      ]
    ]
  },
  "params": {}
}
```

-   数组
    -   投入
        -   数组( 阵列)
            -   数组加入
    -   段落
        -   分隔符( 字符串)
            -   数组加入分隔符
        -   平面( 数字)
            -   数组平平深度

```typescript
{
  "inputs": {
    "array": [
      [
        1
      ],
      [
        2
      ],
      [
        3
      ]
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        1
      ],
      [
        2
      ],
      [
        [
          3
        ]
      ]
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        "a"
      ],
      [
        "b"
      ],
      [
        "c"
      ]
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        1
      ],
      [
        2
      ],
      [
        3
      ]
    ]
  },
  "params": {
    "separator": "|"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        [
          1
        ]
      ],
      [
        [
          2
        ],
        [
          3
        ]
      ]
    ]
  },
  "params": {
    "separator": "|"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        [
          1
        ]
      ],
      [
        [
          2
        ],
        [
          3
        ]
      ]
    ]
  },
  "params": {
    "separator": "|",
    "flat": 1
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        [
          [
            1
          ]
        ],
        [
          [
            2
          ],
          [
            3
          ]
        ]
      ]
    ]
  },
  "params": {
    "separator": "|",
    "flat": 1
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        [
          [
            1
          ]
        ],
        [
          [
            2
          ],
          [
            3
          ]
        ]
      ]
    ]
  },
  "params": {
    "separator": "|",
    "flat": 2
  }
}
```

-   数组到对象代理
    -   投入
        -   项(阵列)
            -   从中弹出一个项的阵列

```typescript
{
  "inputs": {
    "items": [
      {
        "id": 1,
        "data": "a"
      },
      {
        "id": 2,
        "data": "b"
      }
    ]
  },
  "params": {
    "key": "id"
  }
}
```

-   比较代理
    -   投入
        -   数组( 阵列)
            -   3-元素阵列在窗体中\[左Operand,操作员,右Operand\]. 用于直接比较逻辑.
        -   左边的Value( 字符串、 数字、 布尔)
            -   不提供“ 阵列” 时使用的左手操作 。 用"右派"和"params.operator"来表示.
        -   右等值( 字符串、 数字、 布尔)
            -   不提供“ 阵列” 时使用的右手操作 。 与"左侧Value"和"params.
    -   段落
        -   运算符(字符串)
            -   应用的比较运算符,例如"==","!=",">","<","<=","||","||","&&","&&","&&"或"X"等. 如果“ 阵列” 不包括操作员, 则需要 .
        -   值(对象)
            -   比较结果的可选映射. 如果提供, 它必须包含“ truth” 和/ 或“ false” 键, 以返回自定义值, 而不是布尔值 .

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "==",
      "abc"
    ]
  },
  "params": {
    "value": {
      "true": "a",
      "false": "b"
    }
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "==",
      "abca"
    ]
  },
  "params": {
    "value": {
      "true": "a",
      "false": "b"
    }
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "==",
      "abc"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "==",
      "abcd"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "!=",
      "abc"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "!=",
      "abcd"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      ">",
      "5"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      ">",
      "15"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      ">",
      5
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      ">",
      15
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      ">=",
      "5"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      ">=",
      "10"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      ">=",
      "19"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      ">=",
      5
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      ">=",
      10
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      ">=",
      19
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "<",
      "5"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "<",
      "15"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      "<",
      5
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      "<",
      15
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "<=",
      "5"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "<=",
      "10"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "<=",
      "19"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      "<=",
      5
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      "<=",
      10
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      "<=",
      19
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      "||",
      false
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      false,
      "||",
      false
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      "&&",
      false
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      "&&",
      true
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      "XOR",
      false
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      false,
      "XOR",
      true
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      false,
      "XOR",
      false
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      "XOR",
      true
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        "aaa",
        "==",
        "aaa"
      ],
      "||",
      [
        "aaa",
        "==",
        "bbb"
      ]
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        "aaa",
        "==",
        "aaa"
      ],
      "&&",
      [
        "aaa",
        "==",
        "bbb"
      ]
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        [
          "aaa",
          "==",
          "aaa"
        ],
        "&&",
        [
          "bbb",
          "==",
          "bbb"
        ]
      ],
      "||",
      [
        "aaa",
        "&&",
        "bbb"
      ]
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "abc"
    ]
  },
  "params": {
    "value": {
      "true": "a",
      "false": "b"
    },
    "operator": "=="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "abca"
    ]
  },
  "params": {
    "value": {
      "true": "a",
      "false": "b"
    },
    "operator": "=="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "abc"
    ]
  },
  "params": {
    "operator": "=="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "abcd"
    ]
  },
  "params": {
    "operator": "=="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "abc"
    ]
  },
  "params": {
    "operator": "!="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "abc",
      "abcd"
    ]
  },
  "params": {
    "operator": "!="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "5"
    ]
  },
  "params": {
    "operator": ">"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "15"
    ]
  },
  "params": {
    "operator": ">"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      5
    ]
  },
  "params": {
    "operator": ">"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      15
    ]
  },
  "params": {
    "operator": ">"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "5"
    ]
  },
  "params": {
    "operator": ">="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "10"
    ]
  },
  "params": {
    "operator": ">="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "19"
    ]
  },
  "params": {
    "operator": ">="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      5
    ]
  },
  "params": {
    "operator": ">="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      10
    ]
  },
  "params": {
    "operator": ">="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      19
    ]
  },
  "params": {
    "operator": ">="
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "5"
    ]
  },
  "params": {
    "operator": "<"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "10",
      "15"
    ]
  },
  "params": {
    "operator": "<"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      5
    ]
  },
  "params": {
    "operator": "<"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      10,
      15
    ]
  },
  "params": {
    "operator": "<"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      false
    ]
  },
  "params": {
    "operator": "||"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      false,
      false
    ]
  },
  "params": {
    "operator": "||"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      false
    ]
  },
  "params": {
    "operator": "&&"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      true
    ]
  },
  "params": {
    "operator": "&&"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      false
    ]
  },
  "params": {
    "operator": "XOR"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      false,
      true
    ]
  },
  "params": {
    "operator": "XOR"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      false,
      false
    ]
  },
  "params": {
    "operator": "XOR"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      true
    ]
  },
  "params": {
    "operator": "XOR"
  }
}
```

```typescript
{
  "inputs": {
    "leftValue": "abc",
    "rightValue": "abc"
  },
  "params": {
    "value": {
      "true": "a",
      "false": "b"
    },
    "operator": "=="
  }
}
```

```typescript
{
  "inputs": {
    "leftValue": "abc",
    "rightValue": "abca"
  },
  "params": {
    "value": {
      "true": "a",
      "false": "b"
    },
    "operator": "=="
  }
}
```

-   控制台代理
    -   投入
        -   文本(字符串)
            -   文本

```typescript
{
  "inputs": {
    "text": "hello"
  },
  "params": {}
}
```

-   复制2 箭头代理
    -   投入
        -   项( 未定义)
            -   复制到生成数组的每个元素的项目 .
    -   段落
        -   计数(整数)
            -   将输入项目复制到输出阵列的次数 .

```typescript
{
  "inputs": {
    "item": {
      "message": "hello"
    }
  },
  "params": {
    "count": 10
  }
}
```

```typescript
{
  "inputs": {
    "message": "hello"
  },
  "params": {
    "count": 10
  }
}
```

```typescript
{
  "inputs": {
    "item": "hello"
  },
  "params": {
    "count": 10
  }
}
```

-   复制代理人
    -   投入
        
    -   段落
        
        -   命名为 Key( 字符串)
            -   如果指定, 代理将只从命名的输入返回与此密钥相关的值 .

```typescript
{
  "inputs": {
    "color": "red",
    "model": "Model 3"
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "Hello World",
      "Discarded"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "color": "red",
    "model": "Model 3"
  },
  "params": {
    "namedKey": "color"
  }
}
```

-   复制对象
    -   投入
        
    -   段落
        
        -   计数(整数)
            -   数组中信件的重复次数 .
        -   信件(字符串)
            -   要重复的信件字符串 .

```typescript
{
  "inputs": {},
  "params": {
    "count": 4,
    "message": "hello"
  }
}
```

-   计数 探员
    -   投入
        
    -   段落
        
        -   计数(整数)
            -   要生成的整数, 从 0 到 数 - 1.

```typescript
{
  "inputs": {},
  "params": {
    "count": 4
  }
}
```

-   数据SumTemplate 代理
    -   投入
        -   数组( 阵列)
            -   计算总和的数组

```typescript
{
  "inputs": {
    "array": [
      1
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      1,
      2
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      1,
      2,
      3
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      1
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      1,
      2
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      1,
      2,
      3
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

-   点生产代理商
    -   投入
        -   矩阵( 阵列)
            -   二维数相. 每个内数组代表一个要比较的向量.
        -   向量( 阵列)
            -   一个数字的单一矢量,以计算矩阵中每个矢量的点出产物.
    -   段落

```typescript
{
  "inputs": {
    "matrix": [
      [
        1,
        2
      ],
      [
        3,
        4
      ],
      [
        5,
        6
      ]
    ],
    "vector": [
      3,
      2
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "matrix": [
      [
        1,
        2
      ],
      [
        2,
        3
      ]
    ],
    "vector": [
      1,
      2
    ]
  },
  "params": {}
}
```

-   回声代理
    -   投入
        
    -   段落
        
        -   滤波器( 布尔)
            -   如果为真, 返回“ filterParams” 而不是完整的“ params ” .

```typescript
{
  "inputs": {},
  "params": {
    "text": "this is test"
  }
}
```

```typescript
{
  "inputs": {},
  "params": {
    "text": "If you add filterParams option, it will respond to filterParams",
    "filterParams": true
  }
}
```

-   图像2消息代理
    -   投入
        -   数组( 阵列)
            -   一组基数64-编码的图像数据字符串或图像 URL. 这些将被转换为OpenAI Vision-兼容图像消息格式.
        -   提示( 字符串)
            -   可选的快速文本将包含在图像之前的第一个消息内容 .
    -   段落
        -   图像类型( 字符串)
            -   图像输入类型: Base64的"png","jpg"等,或图像URL的"http".
        -   细节( 字符串)
            -   模型所要求的图像细节级别(如"自发","低","高"等). 可选的.

```typescript
{
  "inputs": {
    "array": [
      "abcabc",
      "122123"
    ]
  },
  "params": {
    "imageType": "png"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "abcabc",
      "122123"
    ],
    "prompt": "hello"
  },
  "params": {
    "imageType": "jpg",
    "detail": "high"
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      "http://example.com/1.jpg",
      "http://example.com/2.jpg"
    ]
  },
  "params": {
    "imageType": "http"
  }
}
```

-   jsonParser 代理服务器
    -   投入
        -   文本(字符串)
            -   一个JSON字符串,可能嵌入了Markdown代码块. 如果提供,将解析为数据对象.
        -   数据( 未定义)
            -   在“ text” 输出中将原始数据转换为格式化的 JSON 字符串 .
    -   段落

```typescript
{
  "inputs": {
    "data": {
      "apple": "red",
      "lemon": "yellow"
    }
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "text": "{\n  \"apple\": \"red\",\n  \"lemon\": \"yellow\"\n}"
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "text": "```\n{\"apple\":\"red\",\"lemon\":\"yellow\"}\n```"
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "text": "```json\n{\"apple\":\"red\",\"lemon\":\"yellow\"}\n```"
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "text": "```JSON\n{\"apple\":\"red\",\"lemon\":\"yellow\"}\n```"
  },
  "params": {}
}
```

-   搜索词典代理
    -   投入
        -   命名为 Key( 字符串)
            -   在“ params” 提供的词典中查找的密钥 .
        -   supress Error( 布尔)
            -   如果为真, 则在“ params” 中缺少密钥时, 防止代理机出错 。 可选的.
    -   段落

```typescript
{
  "inputs": {
    "namedKey": "openai"
  },
  "params": {
    "openai": {
      "model": "gpt4-o",
      "temperature": 0.7
    },
    "groq": {
      "model": "llama3-8b-8192",
      "temperature": 0.6
    },
    "gemini": {
      "model": "gemini-2.0-pro-exp-02-05",
      "temperature": 0.7
    }
  }
}
```

```typescript
{
  "inputs": {
    "namedKey": "gemini"
  },
  "params": {
    "openai": {
      "model": "gpt4-o",
      "temperature": 0.7
    },
    "groq": {
      "model": "llama3-8b-8192",
      "temperature": 0.6
    },
    "gemini": {
      "model": "gemini-2.0-pro-exp-02-05",
      "temperature": 0.7
    }
  }
}
```

-   地图代理

```typescript
{
  "inputs": {
    "rows": [
      "apple",
      "orange",
      "banana",
      "lemon"
    ],
    "color": [
      "red",
      "orange",
      "yellow",
      "yellow"
    ]
  },
  "params": {
    "compositeResult": true,
    "expandKeys": [
      "color"
    ]
  }
}
```

```typescript
{
  "inputs": {
    "rows": [
      1,
      2
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "rows": [
      1,
      2
    ]
  },
  "params": {
    "rowKey": "myKey"
  }
}
```

```typescript
{
  "inputs": {
    "rows": [
      "apple",
      "orange",
      "banana",
      "lemon",
      "melon",
      "pineapple",
      "tomato"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "rows": [
      {
        "fruit": "apple"
      },
      {
        "fruit": "orange"
      }
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "rows": [
      {
        "fruit": "apple"
      },
      {
        "fruit": "orange"
      }
    ],
    "name": "You",
    "verb": "like"
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "rows": [
      1,
      2
    ]
  },
  "params": {
    "resultAll": true
  }
}
```

```typescript
{
  "inputs": {
    "rows": [
      1,
      2
    ]
  },
  "params": {
    "resultAll": true
  }
}
```

```typescript
{
  "inputs": {
    "rows": [
      1,
      2
    ]
  },
  "params": {
    "compositeResult": true
  }
}
```

```typescript
{
  "inputs": {
    "rows": [
      "apple",
      "orange",
      "banana",
      "lemon",
      "melon",
      "pineapple",
      "tomato"
    ]
  },
  "params": {
    "compositeResult": true
  }
}
```

```typescript
{
  "inputs": {
    "rows": [
      "apple",
      "orange",
      "banana",
      "lemon",
      "melon",
      "pineapple",
      "tomato"
    ]
  },
  "params": {
    "compositeResult": true,
    "compositeResultKey": "node2"
  }
}
```

```typescript
{
  "inputs": {
    "rows": [
      1,
      2
    ]
  },
  "params": {
    "resultAll": true,
    "compositeResult": true
  }
}
```

```typescript
{
  "inputs": {
    "rows": [
      1,
      2
    ]
  },
  "params": {
    "resultAll": true,
    "compositeResult": true
  }
}
```

-   合并节点ID代理
    -   投入
        -   数组( 阵列)
            -   要合并成单个对象的一组对象。 每个对象代表部分结果或状态.
    -   段落

```typescript
{
  "inputs": {
    "array": [
      {
        "message": "hello"
      }
    ]
  },
  "params": {}
}
```

-   合并对象代理
    -   投入
        -   项(阵列)
            -   一组对象的密钥值对将合并为一个单一对象。 后期对象在密钥冲突上覆盖了更早的对象 .
    -   段落

```typescript
{
  "inputs": {
    "items": [
      {
        "color": "red"
      },
      {
        "model": "Model 3"
      }
    ]
  },
  "params": {}
}
```

-   嵌入剂

```typescript
{
  "inputs": {
    "message": "hello"
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "message": "hello"
  },
  "params": {
    "resultNodeId": "test"
  }
}
```

```typescript
{
  "inputs": {
    "loopCount": 5
  },
  "params": {
    "resultNodeId": "test"
  }
}
```

-   弹出代理
    -   投入
        -   数组( 阵列)
            -   从中弹出一个项的阵列

```typescript
{
  "inputs": {
    "array": [
      1,
      2,
      3
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "a",
      "b",
      "c"
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      1,
      2,
      3
    ],
    "array2": [
      "a",
      "b",
      "c"
    ]
  },
  "params": {}
}
```

-   客户端
    -   投入

```typescript
{
  "inputs": {
    "array": [
      {
        "color": "red",
        "model": "Model 3",
        "type": "EV",
        "maker": "Tesla",
        "range": 300
      }
    ]
  },
  "params": {
    "include": [
      "color",
      "model"
    ]
  }
}
```

```typescript
{
  "inputs": {
    "item": {
      "color": "red",
      "model": "Model 3",
      "type": "EV",
      "maker": "Tesla",
      "range": 300
    }
  },
  "params": {
    "include": [
      "color",
      "model"
    ]
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        {
          "color": "red",
          "model": "Model 3",
          "type": "EV",
          "maker": "Tesla",
          "range": 300
        },
        {
          "color": "blue",
          "model": "Model Y",
          "type": "EV",
          "maker": "Tesla",
          "range": 400
        }
      ],
      "Tesla Motors"
    ]
  },
  "params": {
    "include": [
      "color",
      "model"
    ]
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        {
          "color": "red",
          "model": "Model 3",
          "type": "EV",
          "maker": "Tesla",
          "range": 300
        },
        {
          "color": "blue",
          "model": "Model Y",
          "type": "EV",
          "maker": "Tesla",
          "range": 400
        }
      ],
      "Tesla Motors"
    ]
  },
  "params": {
    "exclude": [
      "color",
      "model"
    ]
  }
}
```

```typescript
{
  "inputs": {
    "item": {
      "color": "red",
      "model": "Model 3",
      "type": "EV",
      "maker": "Tesla",
      "range": 300
    }
  },
  "params": {
    "exclude": [
      "color",
      "model"
    ]
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        {
          "color": "red",
          "model": "Model 3",
          "type": "EV",
          "maker": "Tesla",
          "range": 300
        },
        {
          "color": "blue",
          "model": "Model Y",
          "type": "EV",
          "maker": "Tesla",
          "range": 400
        }
      ],
      "Tesla Motors"
    ]
  },
  "params": {
    "alter": {
      "color": {
        "red": "blue",
        "blue": "red"
      }
    }
  }
}
```

```typescript
{
  "inputs": {
    "item": {
      "color": "red",
      "model": "Model 3",
      "type": "EV",
      "maker": "Tesla",
      "range": 300
    }
  },
  "params": {
    "alter": {
      "color": {
        "red": "blue",
        "blue": "red"
      }
    }
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        {
          "color": "red",
          "model": "Model 3",
          "type": "EV",
          "maker": "Tesla",
          "range": 300
        },
        {
          "color": "blue",
          "model": "Model Y",
          "type": "EV",
          "maker": "Tesla",
          "range": 400
        }
      ],
      "Tesla Motors"
    ]
  },
  "params": {
    "swap": {
      "maker": "model"
    }
  }
}
```

```typescript
{
  "inputs": {
    "item": {
      "color": "red",
      "model": "Model 3",
      "type": "EV",
      "maker": "Tesla",
      "range": 300
    }
  },
  "params": {
    "swap": {
      "maker": "model"
    }
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        {
          "color": "red",
          "model": "Model 3",
          "type": "EV",
          "maker": "Tesla",
          "range": 300
        },
        {
          "color": "blue",
          "model": "Model Y",
          "type": "EV",
          "maker": "Tesla",
          "range": 400
        }
      ],
      "Tesla Motors"
    ]
  },
  "params": {
    "inject": [
      {
        "propId": "maker",
        "from": 1
      }
    ]
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        {
          "color": "red",
          "model": "Model 3",
          "type": "EV",
          "maker": "Tesla",
          "range": 300
        },
        {
          "color": "blue",
          "model": "Model Y",
          "type": "EV",
          "maker": "Tesla",
          "range": 400
        }
      ],
      "Tesla Motors"
    ]
  },
  "params": {
    "inject": [
      {
        "propId": "maker",
        "from": 1,
        "index": 0
      }
    ]
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        {
          "color": "red",
          "model": "Model 3",
          "type": "EV",
          "maker": "Tesla",
          "range": 300
        },
        {
          "color": "blue",
          "model": "Model Y",
          "type": "EV",
          "maker": "Tesla",
          "range": 400
        }
      ],
      "Tesla Motors"
    ]
  },
  "params": {
    "inspect": [
      {
        "propId": "isTesla",
        "equal": "Tesla Motors"
      },
      {
        "propId": "isGM",
        "notEqual": "Tesla Motors",
        "from": 1
      }
    ]
  }
}
```

-   推动代理
    -   投入
        -   数组( 阵列)
            -   将项目推向的阵列
        -   项( 未定义)
            -   将项目推入数组
        -   项(阵列)
            -   将项目推入阵列

```typescript
{
  "inputs": {
    "array": [
      1,
      2
    ],
    "item": 3
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      true,
      false
    ],
    "item": false
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      1,
      2
    ],
    "item": 3,
    "data": {
      "example": "hello"
    }
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "apple": 1
      }
    ],
    "item": {
      "lemon": 2
    }
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "apple": 1
      }
    ],
    "items": [
      {
        "lemon": 2
      },
      {
        "banana": 3
      }
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      1,
      2
    ],
    "item": 3
  },
  "params": {
    "arrayKey": "test"
  }
}
```

-   换行代理
    -   投入
        -   数组( 阵列)
            -   将项目从

```typescript
{
  "inputs": {
    "array": [
      1,
      2,
      3
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "a",
      "b",
      "c"
    ]
  },
  "params": {}
}
```

-   卧底代理
    -   投入
        
    -   段落
        
        -   期限(数目)
            -   可选持续时间以毫秒计, 在返回输入前暂停执行 。 默认为10ms.

```typescript
{
  "inputs": {},
  "params": {
    "duration": 1
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      },
      {
        "b": 2
      }
    ]
  },
  "params": {
    "duration": 1
  }
}
```

-   类型
    -   投入
        -   数组( 阵列)
            -   要排序的项目数组 。 每个项目都将从“ 值” 阵列中以相应的数值对齐 .
        -   值( 阵列)
            -   用于确定“ 阵列” 项目排序的数组数值 。 一定和"阵列"一样长.
    -   段落
        -   缓存( 布尔)
            -   若为真,则按升序排序;否则,按降序排序(默认).

```typescript
{
  "inputs": {
    "array": [
      "banana",
      "orange",
      "lemon",
      "apple"
    ],
    "values": [
      2,
      5,
      6,
      4
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      "banana",
      "orange",
      "lemon",
      "apple"
    ],
    "values": [
      2,
      5,
      6,
      4
    ]
  },
  "params": {
    "assendant": true
  }
}
```

-   流媒体代理
    -   投入

```typescript
{
  "inputs": {},
  "params": {
    "message": "this is params test"
  }
}
```

```typescript
{
  "inputs": {
    "message": "this is named inputs test"
  },
  "params": {}
}
```

-   字符串变量
    -   投入
        -   文本(字符串)
            -   要被转换成各种外壳样式的输入字符串.
    -   段落
        -   后缀( 字符串)
            -   在转换大小写前附加到输入字符串的可选后缀 .

```typescript
{
  "inputs": {
    "text": "this is a pen"
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "text": "string case variants"
  },
  "params": {
    "suffix": "agent"
  }
}
```

-   字符串分配器代理
    -   投入
        -   文本(字符串)
            -   要剪切的文本

```typescript
{
  "inputs": {
    "text": "Here's to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes ... the ones who see things differently -- they're not fond of rules, and they have no respect for the status quo. ... You can quote them, disagree with them, glorify or vilify them, but the only thing you can't do is ignore them because they change things. ... They push the human race forward, and while some may see them as the crazy ones, we see genius, because the people who are crazy enough to think that they can change the world, are the ones who do."
  },
  "params": {
    "chunkSize": 64
  }
}
```

-   字符串模板代理
    -   投入
        
    -   段落
        
        -   模板( 未定义)
            -   ${ key} 这样的占位符将替换为“ 输入” 值的模板结构 .

```typescript
{
  "inputs": {
    "message1": "hello",
    "message2": "test"
  },
  "params": {
    "template": "${message1}: ${message2}"
  }
}
```

```typescript
{
  "inputs": {
    "message1": "hello",
    "message2": "test"
  },
  "params": {
    "template": [
      "${message1}: ${message2}",
      "${message2}: ${message1}"
    ]
  }
}
```

```typescript
{
  "inputs": {
    "message1": "hello",
    "message2": "test"
  },
  "params": {
    "template": {
      "apple": "${message1}",
      "lemon": "${message2}"
    }
  }
}
```

```typescript
{
  "inputs": {
    "message1": "hello",
    "message2": "test"
  },
  "params": {
    "template": [
      {
        "apple": "${message1}",
        "lemon": "${message2}"
      }
    ]
  }
}
```

```typescript
{
  "inputs": {
    "message1": "hello",
    "message2": "test"
  },
  "params": {
    "template": {
      "apple": "${message1}",
      "lemon": [
        "${message2}"
      ]
    }
  }
}
```

```typescript
{
  "inputs": {
    "agent": "openAiAgent",
    "row": "hello world",
    "params": {
      "text": "message"
    }
  },
  "params": {
    "template": {
      "version": 0.5,
      "nodes": {
        "ai": {
          "agent": "${agent}",
          "isResult": true,
          "params": "${params}",
          "inputs": {
            "prompt": "${row}"
          }
        }
      }
    }
  }
}
```

-   字符串更新文本代理
    -   投入
        -   新Text( 字符串)
            -   如果提供而非空的要使用的新文本 .
        -   旧文本( 字符串)
            -   如果“ newText” 是空的或未提供, 则使用倒置文本 .
    -   段落

```typescript
{
  "inputs": {
    "newText": "new",
    "oldText": "old"
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "newText": "",
    "oldText": "old"
  },
  "params": {}
}
```

```typescript
{
  "inputs": {},
  "params": {}
}
```

```typescript
{
  "inputs": {
    "oldText": "old"
  },
  "params": {}
}
```

-   共计
    -   投入
        -   数组( 阵列)
            -   一系列对象或一系列对象。 每个内对象必须具有按键相加的数值.
    -   段落
        -   平方响应( 布尔)
            -   如果为真,则结果将作为普通对象(如{a: 6})返回; 否则, 包裹在{数据: {...}} 中.

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      },
      {
        "a": 2
      },
      {
        "a": 3
      }
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        {
          "a": 1,
          "b": -1
        },
        {
          "c": 10
        }
      ],
      [
        {
          "a": 2,
          "b": -1
        }
      ],
      [
        {
          "a": 3,
          "b": -2
        },
        {
          "d": -10
        }
      ]
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      }
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      },
      {
        "a": 2
      }
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      },
      {
        "a": 2
      },
      {
        "a": 3
      }
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1,
        "b": 1
      },
      {
        "a": 2,
        "b": 2
      },
      {
        "a": 3,
        "b": 0
      }
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      },
      {
        "a": 2,
        "b": 2
      },
      {
        "a": 3,
        "b": 0
      }
    ]
  },
  "params": {}
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      },
      {
        "a": 2
      },
      {
        "a": 3
      }
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      [
        {
          "a": 1,
          "b": -1
        },
        {
          "c": 10
        }
      ],
      [
        {
          "a": 2,
          "b": -1
        }
      ],
      [
        {
          "a": 3,
          "b": -2
        },
        {
          "d": -10
        }
      ]
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      }
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      },
      {
        "a": 2
      }
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      },
      {
        "a": 2
      },
      {
        "a": 3
      }
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1,
        "b": 1
      },
      {
        "a": 2,
        "b": 2
      },
      {
        "a": 3,
        "b": 0
      }
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

```typescript
{
  "inputs": {
    "array": [
      {
        "a": 1
      },
      {
        "a": 2,
        "b": 2
      },
      {
        "a": 3,
        "b": 0
      }
    ]
  },
  "params": {
    "flatResponse": true
  }
}
```

-   香草剂
    -   投入
        -   url( 字符串)
            -   请求 URL 。 可以在“输入”或“参数”中提供.
        -   方法(字符串)
            -   要使用的HTTP方法(GET, POST, PUT等). 未指定且未提供尸体的默认获取; 否则为 POST .
        -   页眉( 对象)
            -   可选的 HTTP 信头包含在请求中 。 输入值和参数值合并.
        -   查询Params( 对象)
            -   附加到 URL 的可选查询参数 .
        -   正文( 未定义)
            -   可选请求机构以 POST, PUT, 或 PATCH 方法发送.
    -   段落
        -   url( 字符串)
            -   请求 URL( 如果输入中也指定, 覆盖) .
        -   方法(字符串)
            -   HTTP 方法( 如果输入中也指定的话, 覆盖) .
        -   页眉( 对象)
            -   外加头相. 和输入物合并 头部.
        -   查询Params( 对象)
            -   要附加到 URL 的查询参数 .
        -   正文( 未定义)
            -   请求发送正文,与POST/PUT/PATCH使用.
        -   调试( 布尔)
            -   如果为真, 请返回已准备的请求细节, 而不是执行实际获取 .
        -   supress Error( 布尔)
            -   如果为真,则按下抛出的错误并返回错误响应.
        -   平方响应( 布尔)
            -   如果真实, 则返回原始响应 。 如果错误,则用“data”键将响应包入对象中。 默认是虚假的.
        -   类型(字符串)
            -   解析的反应类型 。 要么是"json" 要么是"text". 默认为"json" .

```typescript
{
  "inputs": {
    "url": "https://example.com",
    "queryParams": {
      "foo": "bar"
    },
    "headers": {
      "x-myHeader": "secret"
    }
  },
  "params": {
    "debug": true
  }
}
```

```typescript
{
  "inputs": {
    "url": "https://example.com",
    "body": {
      "foo": "bar"
    }
  },
  "params": {
    "debug": true
  }
}
```

```typescript
{
  "inputs": {
    "url": "https://example.com",
    "body": {
      "foo": "bar"
    },
    "method": "PUT"
  },
  "params": {
    "debug": true
  }
}
```

```typescript
{
  "inputs": {
    "url": "https://example.com",
    "method": "options"
  },
  "params": {
    "debug": true
  }
}
```

```typescript
{
  "inputs": {},
  "params": {
    "url": "https://example.com",
    "body": {
      "foo": "bar"
    },
    "method": "PUT",
    "debug": true
  }
}
```

```typescript
{
  "inputs": {
    "method": "DELETE",
    "headers": {
      "authentication": "bearer XXX"
    }
  },
  "params": {
    "url": "https://example.com",
    "body": {
      "foo": "bar"
    },
    "method": "PUT",
    "headers": {
      "Content-Type": "application/json"
    },
    "debug": true
  }
}
```

### 图表数据示例

#### 动态图形数据

```json
{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": {
        "version": 0.5,
        "loop": {
          "count": 5
        },
        "nodes": {
          "array": {
            "value": [],
            "update": ":reducer.array"
          },
          "item": {
            "agent": "sleepAndMergeAgent",
            "params": {
              "duration": 10,
              "value": "hello"
            }
          },
          "reducer": {
            "isResult": true,
            "agent": "pushAgent",
            "inputs": {
              "array": ":array",
              "item": ":item"
            }
          }
        }
      }
    },
    "nested": {
      "agent": "nestedAgent",
      "graph": ":source",
      "isResult": true
    }
  }
}
```

#### 动态 GraphData2

```json
{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": "{\"version\":0.5,\"loop\":{\"count\":5},\"nodes\":{\"array\":{\"value\":[],\"update\":\":reducer.array\"},\"item\":{\"agent\":\"sleepAndMergeAgent\",\"params\":{\"duration\":10,\"value\":\"hello\"}},\"reducer\":{\"isResult\":true,\"agent\":\"pushAgent\",\"inputs\":{\"array\":\":array\",\"item\":\":item\"}}}}"
    },
    "parser": {
      "agent": "jsonParserAgent",
      "inputs": {
        "text": ":source"
      }
    },
    "nested": {
      "agent": "nestedAgent",
      "graph": ":parser.data",
      "isResult": true
    }
  }
}
```

#### 动态 GraphData3

```json
{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": "```json\n{\"version\":0.5,\"loop\":{\"count\":5},\"nodes\":{\"array\":{\"value\":[],\"update\":\":reducer.array\"},\"item\":{\"agent\":\"sleepAndMergeAgent\",\"params\":{\"duration\":10,\"value\":\"hello\"}},\"reducer\":{\"isResult\":true,\"agent\":\"pushAgent\",\"inputs\":{\"array\":\":array\",\"item\":\":item\"}}}}\n```\n"
    },
    "parser": {
      "agent": "jsonParserAgent",
      "inputs": {
        "text": ":source"
      }
    },
    "nested": {
      "agent": "nestedAgent",
      "graph": ":parser.data",
      "isResult": true
    }
  }
}
```

#### 嵌入式GraphData 数据

```json
{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": "Hello World"
    },
    "nestedNode": {
      "agent": "nestedAgent",
      "inputs": {
        "inner0": ":source"
      },
      "isResult": true,
      "graph": {
        "nodes": {
          "resultInner": {
            "agent": "copyAgent",
            "inputs": {
              "text": ":inner0"
            },
            "isResult": true
          }
        }
      }
    }
  }
}
```

#### 被嵌入的 GraphData2

```json
{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": "Hello World"
    },
    "nestedNode": {
      "agent": "nestedAgent",
      "inputs": {
        "source": ":source"
      },
      "isResult": true,
      "graph": {
        "nodes": {
          "result": {
            "agent": "copyAgent",
            "inputs": {
              "text": ":source"
            },
            "isResult": true
          }
        }
      }
    }
  }
}
```

#### 图表数据映射1

```json
{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": {
        "fruits": [
          "apple",
          "orange",
          "banana",
          "lemon",
          "melon",
          "pineapple",
          "tomato"
        ]
      }
    },
    "nestedNode": {
      "agent": "mapAgent",
      "inputs": {
        "rows": ":source.fruits"
      },
      "graph": {
        "version": 0.5,
        "nodes": {
          "node2": {
            "agent": "stringTemplateAgent",
            "params": {
              "template": "I love ${m}."
            },
            "inputs": {
              "m": ":row"
            },
            "isResult": true
          }
        }
      },
      "params": {
        "compositeResult": true
      }
    },
    "result": {
      "agent": "sleepAndMergeAgent",
      "inputs": {
        "array": [
          ":nestedNode.node2"
        ]
      },
      "isResult": true
    }
  }
}
```

#### 图表数据映射3

```json
{
  "version": 0.5,
  "nodes": {
    "source1": {
      "value": [
        "hello",
        "hello2"
      ]
    },
    "nestedNode": {
      "agent": "mapAgent",
      "inputs": {
        "rows": ":source1"
      },
      "graph": {
        "version": 0.5,
        "nodes": {
          "node1": {
            "agent": "copyAgent",
            "params": {
              "namedKey": "row"
            },
            "inputs": {
              "row": ":row"
            },
            "isResult": true
          }
        }
      },
      "params": {
        "compositeResult": true
      }
    },
    "result": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "result"
      },
      "inputs": {
        "result": [
          ":nestedNode.node1"
        ]
      },
      "isResult": true
    }
  }
}
```

#### 图表数据映射4

```json
{
  "version": 0.5,
  "nodes": {
    "source1": {
      "value": [
        "hello",
        "hello2"
      ]
    },
    "nestedNode": {
      "agent": "mapAgent",
      "inputs": {
        "rows": ":source1"
      },
      "graph": {
        "version": 0.5,
        "nodes": {
          "node1": {
            "agent": "copyAgent",
            "params": {
              "namedKey": "row"
            },
            "inputs": {
              "row": ":row"
            },
            "isResult": true
          }
        }
      },
      "params": {
        "compositeResult": true
      }
    },
    "result": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "result"
      },
      "inputs": {
        "result": ":nestedNode.node1"
      }
    }
  }
}
```

#### 图表数据映射5

```json
{
  "version": 0.5,
  "nodes": {
    "source1": {
      "value": [
        "hello",
        "hello2"
      ]
    },
    "nestedNode": {
      "agent": "mapAgent",
      "inputs": {
        "rows": ":source1"
      },
      "graph": {
        "version": 0.5,
        "nodes": {
          "node1": {
            "agent": "copyAgent",
            "params": {
              "namedKey": "row"
            },
            "inputs": {
              "row": ":row"
            },
            "isResult": true
          }
        }
      },
      "params": {
        "compositeResult": true
      }
    },
    "result": {
      "agent": "copyAgent",
      "params": {
        "flat": 2,
        "namedKey": "res"
      },
      "inputs": {
        "res": ":nestedNode.node1"
      }
    }
  }
}
```

#### 图表数据推

```json
{
  "version": 0.5,
  "loop": {
    "count": 10
  },
  "nodes": {
    "array": {
      "value": [],
      "update": ":reducer.array"
    },
    "item": {
      "agent": "sleepAndMergeAgent",
      "params": {
        "duration": 10,
        "value": "hello"
      }
    },
    "reducer": {
      "isResult": true,
      "agent": "pushAgent",
      "inputs": {
        "array": ":array",
        "item": ":item"
      }
    }
  }
}
```

#### 图表数据Pop

```json
{
  "version": 0.5,
  "loop": {
    "while": ":source"
  },
  "nodes": {
    "source": {
      "value": [
        "orange",
        "banana",
        "lemon"
      ],
      "update": ":popper.array"
    },
    "result": {
      "value": [],
      "update": ":reducer.array"
    },
    "popper": {
      "inputs": {
        "array": ":source"
      },
      "agent": "popAgent"
    },
    "reducer": {
      "agent": "pushAgent",
      "inputs": {
        "array": ":result",
        "item": ":popper.item"
      }
    }
  }
}
```

#### 图解

```json
{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": "hello"
    },
    "parent": {
      "agent": "nestedAgent",
      "inputs": {
        "source": ":source"
      },
      "isResult": true,
      "graph": {
        "loop": {
          "count": 10
        },
        "nodes": {
          "array": {
            "value": [],
            "update": ":reducer.array"
          },
          "item": {
            "agent": "copyAgent",
            "inputs": {
              "value": ":source"
            }
          },
          "reducer": {
            "agent": "pushAgent",
            "inputs": {
              "array": ":array",
              "item": ":item.value"
            },
            "isResult": true
          }
        }
      }
    }
  }
}
```

#### 图表数据NestedPop

```json
{
  "version": 0.5,
  "nodes": {
    "fruits": {
      "value": [
        "orange",
        "banana",
        "lemon"
      ]
    },
    "parent": {
      "agent": "nestedAgent",
      "isResult": true,
      "inputs": {
        "fruits": ":fruits"
      },
      "graph": {
        "loop": {
          "while": ":fruits"
        },
        "nodes": {
          "fruits": {
            "value": [],
            "update": ":popper.array"
          },
          "result": {
            "value": [],
            "update": ":reducer.array",
            "isResult": true
          },
          "popper": {
            "inputs": {
              "array": ":fruits"
            },
            "agent": "popAgent"
          },
          "reducer": {
            "agent": "pushAgent",
            "inputs": {
              "array": ":result",
              "item": ":popper.item"
            }
          }
        }
      }
    }
  }
}
```

#### 图Data上注

```json
{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": "hello"
    },
    "parent": {
      "agent": "nestedAgent",
      "inputs": {
        "inner_source": ":source"
      },
      "isResult": true,
      "graph": {
        "loop": {
          "count": 10
        },
        "nodes": {
          "array": {
            "value": [],
            "update": ":reducer.array"
          },
          "item": {
            "agent": "copyAgent",
            "inputs": {
              "value": ":inner_source"
            }
          },
          "reducer": {
            "agent": "pushAgent",
            "inputs": {
              "array": ":array",
              "item": ":item.value"
            },
            "isResult": true
          }
        }
      }
    }
  }
}
```

#### 叉纹

```json
{
  "version": 0.5,
  "nodes": {
    "source": {
      "value": {
        "content": [
          {
            "level1": {
              "level2": "hello1"
            }
          },
          {
            "level1": {
              "level2": "hello2"
            }
          }
        ]
      }
    },
    "mapNode": {
      "agent": "mapAgent",
      "inputs": {
        "rows": ":source.content"
      },
      "graph": {
        "version": 0.5,
        "nodes": {
          "workingMemory": {
            "value": {}
          },
          "forked": {
            "agent": "sleepAndMergeAgent",
            "inputs": {
              "array": [
                ":row.level1"
              ]
            }
          },
          "forked2": {
            "agent": "sleepAndMergeAgent",
            "inputs": {
              "array": [
                ":forked"
              ]
            },
            "isResult": true
          }
        }
      },
      "params": {
        "compositeResult": true
      }
    },
    "copyAgent": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "result"
      },
      "inputs": {
        "result": [
          ":mapNode"
        ]
      }
    }
  }
}
```

#### 图表数据Bypass

```json
{
  "version": 0.5,
  "nodes": {
    "echo": {
      "agent": "echoAgent",
      "params": {
        "message": "hello"
      }
    },
    "copyAgent": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "text"
      },
      "inputs": {
        "text": [
          ":echo"
        ]
      }
    },
    "copyAgent2": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "text"
      },
      "inputs": {
        "text": [
          ":copyAgent.$0"
        ]
      }
    }
  }
}
```

#### 图表数据Bypass2

```json
{
  "version": 0.5,
  "nodes": {
    "echo": {
      "agent": "echoAgent",
      "params": {
        "message": [
          "hello",
          "hello"
        ]
      }
    },
    "mapNode": {
      "agent": "mapAgent",
      "inputs": {
        "rows": ":echo.message"
      },
      "graph": {
        "version": 0.5,
        "nodes": {
          "copyAgent": {
            "agent": "copyAgent",
            "params": {
              "namedKey": "row"
            },
            "inputs": {
              "row": ":row"
            },
            "isResult": true
          }
        }
      },
      "params": {
        "compositeResult": true
      }
    },
    "copyAgent2": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "array"
      },
      "inputs": {
        "array": [
          ":mapNode.copyAgent"
        ]
      }
    }
  }
}
```

#### 图表数据Bypass3

```json
{
  "version": 0.5,
  "nodes": {
    "echo": {
      "agent": "echoAgent",
      "params": {
        "message": [
          "hello",
          "hello"
        ]
      }
    },
    "mapNode": {
      "agent": "mapAgent",
      "inputs": {
        "rows": ":echo.message"
      },
      "graph": {
        "version": 0.5,
        "nodes": {
          "copyAgent": {
            "agent": "copyAgent",
            "params": {
              "namedKey": "row"
            },
            "inputs": {
              "row": [
                ":row"
              ]
            }
          },
          "copyAgent2": {
            "agent": "copyAgent",
            "params": {
              "namedKey": "text"
            },
            "inputs": {
              "text": ":copyAgent"
            }
          },
          "copyAgent3": {
            "agent": "copyAgent",
            "params": {
              "namedKey": "text"
            },
            "inputs": {
              "text": ":copyAgent2.$0"
            },
            "isResult": true
          }
        }
      },
      "params": {
        "compositeResult": true
      }
    },
    "copyAgent4": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "text"
      },
      "inputs": {
        "text": ":mapNode.copyAgent3"
      }
    }
  }
}
```

#### 图表数据Bypass4

```json
{
  "version": 0.5,
  "nodes": {
    "echo": {
      "agent": "echoAgent",
      "params": {
        "message": [
          "hello",
          "hello"
        ]
      }
    },
    "mapNode": {
      "agent": "mapAgent",
      "inputs": {
        "rows": ":echo.message"
      },
      "graph": {
        "version": 0.5,
        "nodes": {
          "copyAgent": {
            "agent": "copyAgent",
            "params": {
              "namedKey": "row"
            },
            "inputs": {
              "row": ":row"
            }
          },
          "copyAgent2": {
            "agent": "copyAgent",
            "params": {
              "namedKey": "array"
            },
            "inputs": {
              "array": [
                ":copyAgent",
                ":row"
              ]
            },
            "isResult": true
          }
        }
      },
      "params": {
        "compositeResult": true
      }
    },
    "copyAgent3": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "text"
      },
      "inputs": {
        "text": ":mapNode.copyAgent2"
      }
    }
  }
}
```

#### 图表数据Bypass5

```json
{
  "version": 0.5,
  "nodes": {
    "echo": {
      "agent": "echoAgent",
      "params": {
        "message": "hello"
      }
    },
    "copyAgent": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "array"
      },
      "inputs": {
        "array": [
          ":echo",
          ":echo",
          ":echo"
        ]
      }
    },
    "copyAgent2": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "array"
      },
      "inputs": {
        "array": [
          ":copyAgent",
          ":copyAgent"
        ]
      }
    },
    "copyAgent3": {
      "agent": "copyAgent",
      "params": {
        "namedKey": "array"
      },
      "inputs": {
        "array": [
          ":copyAgent2",
          ":copyAgent2"
        ]
      }
    }
  }
}
```

## 常见问题

### @graphai/vanilla 是什么？

GraphAI的香草剂\.

### 如何安装 @graphai/vanilla？

在项目目录运行 npm install @graphai/vanilla，或使用 pnpm add / yarn add / bun add。

### @graphai/vanilla 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @graphai/vanilla 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @graphai/vanilla 可以商用吗？

@graphai/vanilla 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @graphai/vanilla 的下载量有多少？

根据 npm 官方下载统计，@graphai/vanilla 在 2026/10/17 – 2026/11/15 这 30 天内被下载 16,599 次，日均约 553 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @graphai/vanilla 还在维护吗？

最新版本 2\.0\.12 发布于 2025/08/18（1\.2 年前）；至今共发布 75 个版本，其中过去 12 个月发布了 0 个；首次发布于 2024/05/25。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

