Skip to content

Commit

Permalink
[lambdas] introduce retry lambda + examples
Browse files Browse the repository at this point in the history
  • Loading branch information
seefeldb committed Oct 19, 2023
1 parent bcb95ee commit 58e6df7
Show file tree
Hide file tree
Showing 8 changed files with 937 additions and 0 deletions.
47 changes: 47 additions & 0 deletions seeds/graph-playground/docs/graphs/relationship-json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# relationship-json
- Original: [`relationship-json.ts`](../../src/boards/relationship-json.ts)
- Graph: [`relationship-json.json`](../../graphs/relationship-json.json)

```mermaid
%%{init: 'themeVariables': { 'fontFamily': 'Fira Code, monospace' }}%%
graph TD;
lambda1["lambda <br> id='lambda-1'"] -- "board->lambda" --> invoke3["invoke <br> id='invoke-3'"]
subgraph sg_lambda1 [lambda-1]
lambda1_secrets3("secrets <br> id='secrets-3'"):::secrets -- "PALM_KEY->PALM_KEY" --o lambda1_generateText4["generateText <br> id='generateText-4'"]
lambda1_input1[/"input <br> id='input-1'"/]:::input -- "text->text" --> lambda1_generateText4["generateText <br> id='generateText-4'"]
lambda1_generateText4["generateText <br> id='generateText-4'"] -- "completion->json" --> lambda1_validateJson5["validateJson <br> id='validateJson-5'"]
lambda1_runJavascript6["runJavascript <br> id='runJavascript-6'"] -- "json->completion" --> lambda1_output2{{"output <br> id='output-2'"}}:::output
lambda1_validateJson5["validateJson <br> id='validateJson-5'"] -- "json->json" --> lambda1_runJavascript6["runJavascript <br> id='runJavascript-6'"]
lambda1_input1[/"input <br> id='input-1'"/]:::input -- "text->text" --> lambda1_runJavascript6["runJavascript <br> id='runJavascript-6'"]
lambda1_generateText4["generateText <br> id='generateText-4'"] -- "completion->completion" --> lambda1_jsonata7["jsonata <br> id='jsonata-7'"]
lambda1_input1[/"input <br> id='input-1'"/]:::input -- "schema->schema" --> lambda1_validateJson5["validateJson <br> id='validateJson-5'"]
lambda1_validateJson5["validateJson <br> id='validateJson-5'"] -- "error->error" --> lambda1_jsonata7["jsonata <br> id='jsonata-7'"]
lambda1_runJavascript6["runJavascript <br> id='runJavascript-6'"] -- "error->error" --> lambda1_jsonata7["jsonata <br> id='jsonata-7'"]
end
sg_lambda1:::slotted -- "lamdba->lamdba" --o lambda1
invoke3["invoke <br> id='invoke-3'"] -- "completion->text" --> analysis{{"output <br> id='analysis'"}}:::output
promptTemplate2["promptTemplate <br> id='promptTemplate-2'"] -- "prompt->text" --> invoke3["invoke <br> id='invoke-3'"]
scene[/"input <br> id='scene'"/]:::input -- "text->scene" --> promptTemplate2["promptTemplate <br> id='promptTemplate-2'"]
schemascene[schema]:::config -- "schema->schema" --o scene
templatepromptTemplate2[template]:::config -- "template->template" --o promptTemplate2
schemapromptTemplate2[schema]:::config -- "schema->schema" --o promptTemplate2
pathinvoke3[path]:::config -- "path->path" --o invoke3
schemaanalysis[schema]:::config -- "schema->schema" --o analysis
classDef default stroke:#ffab40,fill:#fff2ccff,color:#000
classDef input stroke:#3c78d8,fill:#c9daf8ff,color:#000
classDef output stroke:#38761d,fill:#b6d7a8ff,color:#000
classDef passthrough stroke:#a64d79,fill:#ead1dcff,color:#000
classDef slot stroke:#a64d79,fill:#ead1dcff,color:#000
classDef config stroke:#a64d79,fill:#ead1dcff,color:#000
classDef secrets stroke:#db4437,fill:#f4cccc,color:#000
classDef slotted stroke:#a64d79
```
38 changes: 38 additions & 0 deletions seeds/graph-playground/docs/graphs/retry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# retry
- Original: [`retry.ts`](../../src/boards/retry.ts)
- Graph: [`retry.json`](../../graphs/retry.json)

```mermaid
%%{init: 'themeVariables': { 'fontFamily': 'Fira Code, monospace' }}%%
graph TD;
input1[/"input <br> id='input-1'"/]:::input -- "tries->tries" --> jsonata4["jsonata <br> id='jsonata-4'"]
jsonata4["jsonata <br> id='jsonata-4'"] -- "tries->tries" --> jsonata4["jsonata <br> id='jsonata-4'"]
input1[/"input <br> id='input-1'"/]:::input -- "text->text" --> promptTemplate6["promptTemplate <br> id='promptTemplate-6'"]
promptTemplate6["promptTemplate <br> id='promptTemplate-6'"] -- "prompt->text" --> promptTemplate6["promptTemplate <br> id='promptTemplate-6'"]
input1[/"input <br> id='input-1'"/]:::input -- "text->text" --> lambda completion["invoke <br> id='lambda completion'"]
input1[/"input <br> id='input-1'"/]:::input -- "lambda->board" --o lambda completion["invoke <br> id='lambda completion'"]
lambda completion["invoke <br> id='lambda completion'"] -- "completion->completion" --> output2{{"output <br> id='output-2'"}}:::output
lambda completion["invoke <br> id='lambda completion'"] -- "$error->data" --> jsonata4["jsonata <br> id='jsonata-4'"]
jsonata4["jsonata <br> id='jsonata-4'"] -- "done->$error" --> output3{{"output <br> id='output-3'"}}:::output
jsonata4["jsonata <br> id='jsonata-4'"] -- "data->json" --> jsonata5["jsonata <br> id='jsonata-5'"]
jsonata5["jsonata <br> id='jsonata-5'"] -- "error->error" --> promptTemplate6["promptTemplate <br> id='promptTemplate-6'"]
jsonata5["jsonata <br> id='jsonata-5'"] -- "completion->completion" --> promptTemplate6["promptTemplate <br> id='promptTemplate-6'"]
promptTemplate6["promptTemplate <br> id='promptTemplate-6'"] -- "prompt->text" --> lambda completion["invoke <br> id='lambda completion'"]
schemainput1[schema]:::config -- "schema->schema" --o input1
schemaoutput2[schema]:::config -- "schema->schema" --o output2
schemaoutput3[schema]:::config -- "schema->schema" --o output3
expressionjsonata4[expression]:::config -- "expression->expression" --o jsonata4
triesjsonata4[tries]:::config -- "tries->tries" --o jsonata4
rawjsonata4[raw]:::config -- "raw->raw" --o jsonata4
expressionjsonata5[expression]:::config -- "expression->expression" --o jsonata5
rawjsonata5[raw]:::config -- "raw->raw" --o jsonata5
templatepromptTemplate6[template]:::config -- "template->template" --o promptTemplate6
classDef default stroke:#ffab40,fill:#fff2ccff,color:#000
classDef input stroke:#3c78d8,fill:#c9daf8ff,color:#000
classDef output stroke:#38761d,fill:#b6d7a8ff,color:#000
classDef passthrough stroke:#a64d79,fill:#ead1dcff,color:#000
classDef slot stroke:#a64d79,fill:#ead1dcff,color:#000
classDef config stroke:#a64d79,fill:#ead1dcff,color:#000
classDef secrets stroke:#db4437,fill:#f4cccc,color:#000
classDef slotted stroke:#a64d79
```
25 changes: 25 additions & 0 deletions seeds/graph-playground/docs/graphs/schemish-validator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# schemish-validator
- Original: [`schemish-validator.ts`](../../src/boards/schemish-validator.ts)
- Graph: [`schemish-validator.json`](../../graphs/schemish-validator.json)

```mermaid
%%{init: 'themeVariables': { 'fontFamily': 'Fira Code, monospace' }}%%
graph TD;
secrets1("secrets <br> id='secrets-1'"):::secrets -- "PALM_KEY->PALM_KEY" --o generateText2["generateText <br> id='generateText-2'"]
generateText2["generateText <br> id='generateText-2'"] -- "completion->text" --> analysis{{"output <br> id='analysis'"}}:::output
promptTemplate3["promptTemplate <br> id='promptTemplate-3'"] -- "prompt->text" --> generateText2["generateText <br> id='generateText-2'"]
scene[/"input <br> id='scene'"/]:::input -- "text->scene" --> promptTemplate3["promptTemplate <br> id='promptTemplate-3'"]
keyssecrets1[keys]:::config -- "keys->keys" --o secrets1
schemascene[schema]:::config -- "schema->schema" --o scene
templatepromptTemplate3[template]:::config -- "template->template" --o promptTemplate3
schemishpromptTemplate3[schemish]:::config -- "schemish->schemish" --o promptTemplate3
textanalysis[text]:::config -- "text->text" --o analysis
classDef default stroke:#ffab40,fill:#fff2ccff,color:#000
classDef input stroke:#3c78d8,fill:#c9daf8ff,color:#000
classDef output stroke:#38761d,fill:#b6d7a8ff,color:#000
classDef passthrough stroke:#a64d79,fill:#ead1dcff,color:#000
classDef slot stroke:#a64d79,fill:#ead1dcff,color:#000
classDef config stroke:#a64d79,fill:#ead1dcff,color:#000
classDef secrets stroke:#db4437,fill:#f4cccc,color:#000
classDef slotted stroke:#a64d79
```
Loading

0 comments on commit 58e6df7

Please sign in to comment.