Skip to content

Commit

Permalink
[graph-playground] Use Core Kit in call-react-with-lambdas.
Browse files Browse the repository at this point in the history
  • Loading branch information
dglazkov committed Oct 19, 2023
1 parent 3d976d7 commit 184ae9b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions seeds/graph-playground/docs/graphs/call-react-with-lambdas.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jsonata1["jsonata <br> id='jsonata-1'"] -- "result->tools" --> invoke4["invoke <
invoke4["invoke <br> id='invoke-4'"] -- "text->text" --> reactResponse{{"output <br> id='reactResponse'"}}:::output
userRequest[/"input <br> id='userRequest'"/]:::input -- "text->text" --> invoke4["invoke <br> id='invoke-4'"]
expressionjsonata1[expression]:::config -- "expression->expression" --o jsonata1
$refimport2[$ref]:::config -- "$ref->$ref" --o import2
$refimport3[$ref]:::config -- "$ref->$ref" --o import3
pathimport2[path]:::config -- "path->path" --o import2
pathimport3[path]:::config -- "path->path" --o import3
schemauserRequest[schema]:::config -- "schema->schema" --o userRequest
pathinvoke4[path]:::config -- "path->path" --o invoke4
schemareactResponse[schema]:::config -- "schema->schema" --o reactResponse
Expand Down
7 changes: 5 additions & 2 deletions seeds/graph-playground/graphs/call-react-with-lambdas.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
"id": "import-2",
"type": "import",
"configuration": {
"$ref": "search-summarize.json"
"path": "search-summarize.json"
}
},
{
"id": "import-3",
"type": "import",
"configuration": {
"$ref": "math.json"
"path": "math.json"
}
},
{
Expand Down Expand Up @@ -108,6 +108,9 @@
"description": "A kit that provides a few necessary components for wiring boards that use PaLM API.",
"version": "0.0.1",
"url": "npm:@google-labs/llm-starter"
},
{
"url": "npm:@google-labs/core-kit"
}
]
}
8 changes: 5 additions & 3 deletions seeds/graph-playground/src/boards/call-react-with-lambdas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import { Board } from "@google-labs/breadboard";
import { Starter } from "@google-labs/llm-starter";
import { Core } from "@google-labs/core-kit";

/**
* An example of a board that uses the `react-witih-lambdas.ts` board.
Expand All @@ -20,6 +21,7 @@ const board = new Board({
version: "0.0.1",
});
const kit = board.addKit(Starter);
const core = board.addKit(Core);

const tools = kit
.jsonata(
Expand All @@ -39,8 +41,8 @@ const tools = kit
}
]`
)
.wire("search<-board", board.import("search-summarize.json"))
.wire("math<-board", board.import("math.json"));
.wire("search<-board", core.import({ path: "search-summarize.json" }))
.wire("math<-board", core.import({ path: "math.json" }));

// Include the `react-with-slot` board from a URL, wiring input to it.
// Slot the `tools` board into the `tools` slot.
Expand All @@ -63,7 +65,7 @@ board
})
.wire(
"text",
board
core
.invoke({ path: `react-with-lambdas.json` })
.wire("tools<-result", tools)
.wire(
Expand Down

0 comments on commit 184ae9b

Please sign in to comment.