@graphai/vanilla_node_agents
v0.2.7
Published
Vanilla node agents for GraphAI.
Downloads
349
Readme
@graphai/vanilla_node_agents for GraphAI
Vanilla node agents for GraphAI.
Install
yarn add @graphai/vanilla_node_agents
Usage
import { GraphAI } from "graphai";
import { fileReadAgent, fileWriteAgent, pathUtilsAgent } from "@graphai/vanilla_node_agents";
const agents = { fileReadAgent, fileWriteAgent, pathUtilsAgent };
const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
Agents description
- fileReadAgent - Read data from file system and returns data
- fileWriteAgent - Write data to file system
- pathUtilsAgent - Path utils
Input/Output/Params Schema & samples
Input/Params example
- fileReadAgent
{
"inputs": {
"array": [
"test.txt"
]
},
"params": {
"baseDir": "/Users/isamu/ss/llm/graphai/agents/vanilla_node_agents/lib/node_file_agents/../../tests/files/"
}
}
{
"inputs": {
"array": [
"test.txt"
]
},
"params": {
"baseDir": "/Users/isamu/ss/llm/graphai/agents/vanilla_node_agents/lib/node_file_agents/../../tests/files/",
"outputType": "base64"
}
}
{
"inputs": {
"array": [
"test.txt"
]
},
"params": {
"baseDir": "/Users/isamu/ss/llm/graphai/agents/vanilla_node_agents/lib/node_file_agents/../../tests/files/",
"outputType": "text"
}
}
{
"inputs": {
"file": "test.txt"
},
"params": {
"baseDir": "/Users/isamu/ss/llm/graphai/agents/vanilla_node_agents/lib/node_file_agents/../../tests/files/",
"outputType": "text"
}
}
- fileWriteAgent
{
"inputs": {
"file": "write.txt",
"text": "hello"
},
"params": {
"baseDir": "/Users/isamu/ss/llm/graphai/agents/vanilla_node_agents/lib/node_file_agents/../../tests/files/"
}
}
- pathUtilsAgent
{
"inputs": {
"dirs": [
"/base/",
"tmp/",
"test.txt"
]
},
"params": {
"method": "resolve"
}
}
{
"inputs": {
"dirs": [
"base/",
"tmp/",
"test.txt"
]
},
"params": {
"method": "join"
}
}
{
"inputs": {
"path": "base///tmp//test.txt"
},
"params": {
"method": "normalize"
}
}