Skip to content

Commit

Permalink
[graph-playground] Use Core Kit in react-with-include.
Browse files Browse the repository at this point in the history
  • Loading branch information
dglazkov committed Oct 19, 2023
1 parent 97fabfe commit a1c5b3a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions seeds/graph-playground/docs/graphs/react-with-include.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ keyssecrets1[keys]:::config -- "keys->keys" --o secrets1
templatepromptTemplate2[template]:::config -- "template->template" --o promptTemplate2
schemainput5[schema]:::config -- "schema->schema" --o input5
stopSequencesreactcompletion[stopSequences]:::config -- "stopSequences->stopSequences" --o reactcompletion
$refinclude6[$ref]:::config -- "$ref->$ref" --o include6
$refinclude7[$ref]:::config -- "$ref->$ref" --o include7
pathinclude6[path]:::config -- "path->path" --o include6
pathinclude7[path]:::config -- "path->path" --o include7
classDef default stroke:#ffab40,fill:#fff2ccff,color:#000
classDef input stroke:#3c78d8,fill:#c9daf8ff,color:#000
classDef output stroke:#38761d,fill:#b6d7a8ff,color:#000
Expand Down
7 changes: 5 additions & 2 deletions seeds/graph-playground/graphs/react-with-include.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@
"id": "include-6",
"type": "include",
"configuration": {
"$ref": "https://raw.githubusercontent.com/google/labs-prototypes/main/seeds/graph-playground/graphs/math.json"
"path": "https://raw.githubusercontent.com/google/labs-prototypes/main/seeds/graph-playground/graphs/math.json"
}
},
{
"id": "include-7",
"type": "include",
"configuration": {
"$ref": "https://raw.githubusercontent.com/google/labs-prototypes/main/seeds/graph-playground/graphs/search-summarize.json"
"path": "https://raw.githubusercontent.com/google/labs-prototypes/main/seeds/graph-playground/graphs/search-summarize.json"
}
},
{
Expand All @@ -196,6 +196,9 @@
}
],
"kits": [
{
"url": "npm:@google-labs/core-kit"
},
{
"title": "LLM Starter Kit",
"description": "A kit that provides a few necessary components for wiring boards that use PaLM API.",
Expand Down
10 changes: 6 additions & 4 deletions seeds/graph-playground/src/boards/react-with-include.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import { Board } from "@google-labs/breadboard";
import { Starter } from "@google-labs/llm-starter";
import { ReActHelper } from "../react.js";
import { Core } from "@google-labs/core-kit";

const board = new Board();
const core = board.addKit(Core);
const kit = board.addKit(Starter);
const reAct = board.addKit(ReActHelper);

Expand Down Expand Up @@ -115,13 +117,13 @@ const reActCompletion = kit
.wire("<-PALM_KEY.", secrets);

// Wire up the math tool by including the `math.json` graph.
const math = board
.include(`${REPO_URL}/math.json`)
const math = core
.include({ path: `${REPO_URL}/math.json` })
.wire("text->Observation", rememberObservation);

// Wire up the search tool by including the `search-summarize.ts` graph.
const search = board
.include(`${REPO_URL}/search-summarize.json`)
const search = core
.include({ path: `${REPO_URL}/search-summarize.json` })
.wire("text->Observation", rememberObservation);

reActTemplate.wire(
Expand Down

0 comments on commit a1c5b3a

Please sign in to comment.