Skip to content

Commit

Permalink
Add a remove-item-number and reimplement remove-numbers in terms …
Browse files Browse the repository at this point in the history
…of it.

Part of #55. Part of #52.
  • Loading branch information
jkomoros committed Jul 23, 2023
1 parent bece7f5 commit 5541408
Showing 1 changed file with 41 additions and 14 deletions.
55 changes: 41 additions & 14 deletions seeds/example-utility.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@
}
},
"remove-numbers": {
"description": "Useful when you get a list of items back from an LLM and it might have numbers at the front",
"type": "array",
"return": "last",
"items": [
{
"type": "let",
"name": "arg:args",
"value": [
"arg:items"
"arg:input"
],
"block": {
"seed": "expect"
Expand All @@ -50,29 +49,57 @@
"items": {
"type": "map",
"items": {
"type": "property",
"object": {
"type": "extract",
"template": "{{ @loop:lines }}{{index|int|optional}}{{separator|choice:'.'|choice:')'|optional}} {{content}}\n{{ @end }}",
"input": {
"type": "var",
"name": "arg:items"
}
"type": "split",
"input": {
"type": "var",
"name": "arg:input"
},
"property": "lines"
"delimiter": "\n"
},
"block": {
"type": "property",
"property": "content",
"object": {
"type": "let",
"name": "arg:input",
"value": {
"type": "var",
"name": "value"
},
"block": {
"seed": "remove-item-number"
}
}
}
}
]
},
"remove-item-number": {
"description": "Removes a possible 1) or 1. from the front of a line",
"type": "array",
"return": "last",
"items": [
{
"type": "let",
"name": "arg:args",
"value": [
"arg:input"
],
"block": {
"seed": "expect"
}
},
{
"type": "property",
"object": {
"type": "extract",
"template": "{{index|int|optional}}{{separator|choice:'. '|choice:') '|optional}}{{content}}",
"input": {
"type": "var",
"name": "arg:input"
}
},
"property": "content"
}
]
},
"memorize-items": {
"type": "array",
"return": "last",
Expand Down

0 comments on commit 5541408

Please sign in to comment.