From a1c5b3a1b021cc3e25e0faaed2e1a60ceb050c5b Mon Sep 17 00:00:00 2001 From: Dimitri Glazkov Date: Thu, 19 Oct 2023 14:02:34 -0700 Subject: [PATCH] [graph-playground] Use Core Kit in `react-with-include`. --- .../graph-playground/docs/graphs/react-with-include.md | 4 ++-- seeds/graph-playground/graphs/react-with-include.json | 7 +++++-- .../graph-playground/src/boards/react-with-include.ts | 10 ++++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/seeds/graph-playground/docs/graphs/react-with-include.md b/seeds/graph-playground/docs/graphs/react-with-include.md index 99de546e..2a0bcb80 100644 --- a/seeds/graph-playground/docs/graphs/react-with-include.md +++ b/seeds/graph-playground/docs/graphs/react-with-include.md @@ -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 diff --git a/seeds/graph-playground/graphs/react-with-include.json b/seeds/graph-playground/graphs/react-with-include.json index b2fe6b62..cff594b5 100644 --- a/seeds/graph-playground/graphs/react-with-include.json +++ b/seeds/graph-playground/graphs/react-with-include.json @@ -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" } }, { @@ -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.", diff --git a/seeds/graph-playground/src/boards/react-with-include.ts b/seeds/graph-playground/src/boards/react-with-include.ts index 6f02d30e..49d322de 100644 --- a/seeds/graph-playground/src/boards/react-with-include.ts +++ b/seeds/graph-playground/src/boards/react-with-include.ts @@ -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); @@ -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(