Skip to content

Commit

Permalink
Merge pull request #892 from isamu/nestedAgentGeneratorOption
Browse files Browse the repository at this point in the history
Nested agent generator option
  • Loading branch information
isamu authored Jan 16, 2025
2 parents 916c9a8 + 5e3fe42 commit 0fbe413
Show file tree
Hide file tree
Showing 24 changed files with 691 additions and 314 deletions.
109 changes: 92 additions & 17 deletions agents/vanilla_agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ import {
sleeperAgent,
sortByValuesAgent,
streamMockAgent,
stringCaseVariantsAgent,
stringEmbeddingsAgent,
stringSplitterAgent,
stringTemplateAgent,
totalAgent,
updateTextAgent,
vanillaFetchAgent
} from "@graphai/vanilla";

Expand All @@ -67,10 +69,12 @@ const agents = {
sleeperAgent,
sortByValuesAgent,
streamMockAgent,
stringCaseVariantsAgent,
stringEmbeddingsAgent,
stringSplitterAgent,
stringTemplateAgent,
totalAgent,
updateTextAgent,
vanillaFetchAgent
};

Expand Down Expand Up @@ -101,10 +105,12 @@ const result = await graph.run();
- sleeperAgent - sleeper Agent
- sortByValuesAgent - sortByValues Agent
- streamMockAgent - Stream mock agent
- stringCaseVariantsAgent - Format String Cases agent
- stringEmbeddingsAgent - Embeddings Agent
- stringSplitterAgent - This agent strip one long string into chunks using following parameters
- stringTemplateAgent - Template agent
- totalAgent - Returns the sum of input values
- updateTextAgent -
- vanillaFetchAgent - Retrieves JSON data from the specified URL

### Input/Output/Params Schema & samples
Expand All @@ -130,10 +136,12 @@ const result = await graph.run();
- [sleeperAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/sleeper/sleeperAgent.md)
- [sortByValuesAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/matrix/sortByValuesAgent.md)
- [streamMockAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/test/streamMockAgent.md)
- [stringCaseVariantsAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/string/stringCaseVariantsAgent.md)
- [stringEmbeddingsAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/embedding/stringEmbeddingsAgent.md)
- [stringSplitterAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/string/stringSplitterAgent.md)
- [stringTemplateAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/string/stringTemplateAgent.md)
- [totalAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/data/totalAgent.md)
- [updateTextAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/undefined/updateTextAgent.md)
- [vanillaFetchAgent](https://github.com/receptron/graphai/blob/main/docs/agentDocs/service/vanillaFetchAgent.md)

### Input/Params example
Expand Down Expand Up @@ -422,6 +430,44 @@ const result = await graph.run();

- compareAgent

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


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


```typescript
{
"inputs": {
Expand Down Expand Up @@ -1945,23 +1991,6 @@ const result = await graph.run();
```


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


```typescript
{
"inputs": {
Expand Down Expand Up @@ -2044,6 +2073,29 @@ const result = await graph.run();
},
"params": {}
}
```

- stringCaseVariantsAgent

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


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

- stringSplitterAgent
Expand Down Expand Up @@ -2319,6 +2371,29 @@ const result = await graph.run();
},
"params": {}
}
```

- updateTextAgent

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


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

- vanillaFetchAgent
Expand Down
4 changes: 1 addition & 3 deletions agents/vanilla_agents/docs/GraphDataYAML.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ nodes:
version: 0.5
nodes:
source:
value: >
value: |
```json
{"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
Expand Down
Loading

0 comments on commit 0fbe413

Please sign in to comment.