-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[syntax] added support for memoized (nee constant) wires
- Loading branch information
Showing
8 changed files
with
298 additions
and
73 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
seeds/breadboard-web/docs/graphs/new/accumulating-context.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## accumulating-context.ts | ||
|
||
```mermaid | ||
%%{init: 'themeVariables': { 'fontFamily': 'Fira Code, monospace' }}%% | ||
graph TD; | ||
userRequest[/"input <br> id='userRequest'"/]:::input -- "text->question" --> assistant["promptTemplate <br> id='assistant'"] | ||
userRequest[/"input <br> id='userRequest'"/]:::input -- "text->user" --> append0["append <br> id='append-0'"] | ||
start(("passthrough <br> id='start'")):::passthrough --> userRequest[/"input <br> id='userRequest'"/]:::input | ||
output3{{"output <br> id='output-3'"}}:::output --> userRequest[/"input <br> id='userRequest'"/]:::input | ||
assistant["promptTemplate <br> id='assistant'"] -- "prompt->text" --> generateText2["generateText <br> id='generateText-2'"] | ||
append0["append <br> id='append-0'"] -- "accumulator->accumulator" --> append0["append <br> id='append-0'"] | ||
append0["append <br> id='append-0'"] -- "accumulator->context" --> assistant["promptTemplate <br> id='assistant'"] | ||
generateText2["generateText <br> id='generateText-2'"] -- "completion->accumulator" --> append0["append <br> id='append-0'"] | ||
generateText2["generateText <br> id='generateText-2'"] -- "completion->text" --> output3{{"output <br> id='output-3'"}}:::output | ||
secrets1("secrets <br> id='secrets-1'"):::secrets -- "PALM_KEY->PALM_KEY" --o generateText2["generateText <br> id='generateText-2'"] | ||
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
141 changes: 141 additions & 0 deletions
141
seeds/breadboard-web/public/graphs/new/accumulating-context.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
{ | ||
"title": "New: Accumulating context", | ||
"edges": [ | ||
{ | ||
"from": "userRequest", | ||
"to": "assistant", | ||
"out": "text", | ||
"in": "question" | ||
}, | ||
{ | ||
"from": "userRequest", | ||
"to": "append-0", | ||
"out": "text", | ||
"in": "user" | ||
}, | ||
{ | ||
"from": "start", | ||
"to": "userRequest", | ||
"out": "", | ||
"in": "" | ||
}, | ||
{ | ||
"from": "output-3", | ||
"to": "userRequest", | ||
"out": "", | ||
"in": "" | ||
}, | ||
{ | ||
"from": "assistant", | ||
"to": "generateText-2", | ||
"out": "prompt", | ||
"in": "text" | ||
}, | ||
{ | ||
"from": "append-0", | ||
"to": "append-0", | ||
"out": "accumulator", | ||
"in": "accumulator" | ||
}, | ||
{ | ||
"from": "append-0", | ||
"to": "assistant", | ||
"out": "accumulator", | ||
"in": "context" | ||
}, | ||
{ | ||
"from": "generateText-2", | ||
"to": "append-0", | ||
"out": "completion", | ||
"in": "accumulator" | ||
}, | ||
{ | ||
"from": "generateText-2", | ||
"to": "output-3", | ||
"out": "completion", | ||
"in": "text" | ||
}, | ||
{ | ||
"from": "secrets-1", | ||
"to": "generateText-2", | ||
"out": "PALM_KEY", | ||
"in": "PALM_KEY", | ||
"constant": true | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"id": "userRequest", | ||
"type": "input", | ||
"configuration": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"text": { | ||
"type": "string", | ||
"title": "User", | ||
"description": "Type here to chat with the assistant" | ||
} | ||
}, | ||
"required": [ | ||
"text" | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "start", | ||
"type": "passthrough", | ||
"configuration": {} | ||
}, | ||
{ | ||
"id": "output-3", | ||
"type": "output", | ||
"configuration": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"text": { | ||
"type": "string", | ||
"title": "Assistant", | ||
"description": "Assistant's response in the conversation with the user" | ||
} | ||
}, | ||
"required": [ | ||
"text" | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"id": "assistant", | ||
"type": "promptTemplate", | ||
"configuration": { | ||
"template": "This is a conversation between a friendly assistant and their user. You are the assistant and your job is to try to be helpful, empathetic, and fun.\n{{context}}\n\n== Current Conversation\nuser: {{question}}\nassistant:", | ||
"context": "" | ||
} | ||
}, | ||
{ | ||
"id": "append-0", | ||
"type": "append", | ||
"configuration": { | ||
"accumulator": "\n== Conversation History" | ||
} | ||
}, | ||
{ | ||
"id": "generateText-2", | ||
"type": "generateText", | ||
"configuration": {} | ||
}, | ||
{ | ||
"id": "secrets-1", | ||
"type": "secrets", | ||
"configuration": { | ||
"keys": [ | ||
"PALM_KEY" | ||
] | ||
} | ||
} | ||
], | ||
"graphs": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.