-
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.
[proxy] added base kit, accumlator demo
- Loading branch information
Showing
20 changed files
with
325 additions
and
107 deletions.
There are no files selected for viewing
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 @@ | ||
## accumulator.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" --> conversationMemory["append <br> id='conversationMemory'"] | ||
start(("passthrough <br> id='start'")):::passthrough -- all --> userRequest[/"input <br> id='userRequest'"/]:::input | ||
output2{{"output <br> id='output-2'"}}:::output -- all --> userRequest[/"input <br> id='userRequest'"/]:::input | ||
assistant["promptTemplate <br> id='assistant'"] -- "prompt->text" --> generateText1["generateText <br> id='generateText-1'"] | ||
conversationMemory["append <br> id='conversationMemory'"] -- "accumulator->accumulator" --> conversationMemory["append <br> id='conversationMemory'"] | ||
conversationMemory["append <br> id='conversationMemory'"] -- "accumulator->context" --> assistant["promptTemplate <br> id='assistant'"] | ||
generateText1["generateText <br> id='generateText-1'"] -- "completion->accumulator" --> conversationMemory["append <br> id='conversationMemory'"] | ||
generateText1["generateText <br> id='generateText-1'"] -- "completion->text" --> output2{{"output <br> id='output-2'"}}:::output | ||
secrets0("secrets <br> id='secrets-0'"):::secrets -- "PALM_KEY->PALM_KEY" --> generateText1["generateText <br> id='generateText-1'"] | ||
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
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
126 changes: 126 additions & 0 deletions
126
seeds/breadboard-web/public/graphs/new/accumulator.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,126 @@ | ||
{ | ||
"title": "New: Accumulating context", | ||
"edges": [ | ||
{ | ||
"from": "userRequest", | ||
"to": "assistant", | ||
"out": "text", | ||
"in": "question" | ||
}, | ||
{ | ||
"from": "userRequest", | ||
"to": "conversationMemory", | ||
"out": "text", | ||
"in": "user" | ||
}, | ||
{ | ||
"from": "start", | ||
"to": "userRequest", | ||
"out": "*", | ||
"in": "*" | ||
}, | ||
{ | ||
"from": "output-2", | ||
"to": "userRequest", | ||
"out": "*", | ||
"in": "*" | ||
}, | ||
{ | ||
"from": "assistant", | ||
"to": "generateText-1", | ||
"out": "prompt", | ||
"in": "text" | ||
}, | ||
{ | ||
"from": "conversationMemory", | ||
"to": "conversationMemory", | ||
"out": "accumulator", | ||
"in": "accumulator" | ||
}, | ||
{ | ||
"from": "conversationMemory", | ||
"to": "assistant", | ||
"out": "accumulator", | ||
"in": "context" | ||
}, | ||
{ | ||
"from": "generateText-1", | ||
"to": "conversationMemory", | ||
"out": "completion", | ||
"in": "accumulator" | ||
}, | ||
{ | ||
"from": "generateText-1", | ||
"to": "output-2", | ||
"out": "completion", | ||
"in": "text" | ||
}, | ||
{ | ||
"from": "secrets-0", | ||
"to": "generateText-1", | ||
"out": "PALM_KEY", | ||
"in": "PALM_KEY" | ||
} | ||
], | ||
"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-2", | ||
"type": "output", | ||
"configuration": {} | ||
}, | ||
{ | ||
"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": "conversationMemory", | ||
"type": "append", | ||
"configuration": { | ||
"accumulator": "\n== Conversation History" | ||
} | ||
}, | ||
{ | ||
"id": "generateText-1", | ||
"type": "generateText", | ||
"configuration": {} | ||
}, | ||
{ | ||
"id": "secrets-0", | ||
"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.