Skip to content

Commit

Permalink
[graph-playground] Use Core Kit in accumulating-context.
Browse files Browse the repository at this point in the history
  • Loading branch information
dglazkov committed Oct 19, 2023
1 parent 1b3c3ce commit 3d976d7
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion seeds/core-kit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,29 @@
* SPDX-License-Identifier: Apache-2.0
*/

console.log("code goes here");
import { KitBuilder } from "@google-labs/breadboard/kits";

import importHandler from "./nodes/import.js";
import include from "./nodes/include.js";
import invoke from "./nodes/invoke.js";
import lambda from "./nodes/lambda.js";
import passthrough from "./nodes/passthrough.js";
import reflect from "./nodes/reflect.js";
import slot from "./nodes/slot.js";

const builder = new KitBuilder({
title: "Core Kit",
description: "A Breadboard kit that enables composition and reuse of boards",
version: "0.0.1",
url: "npm:@google-labs/core-kit",
});

export const Core = builder.build({
import: importHandler,
include,
invoke,
lambda,
passthrough,
reflect,
slot,
});
3 changes: 3 additions & 0 deletions seeds/graph-playground/graphs/accumulating-context.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,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"
}
]
}
1 change: 1 addition & 0 deletions seeds/graph-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"dependencies": {
"@clack/prompts": "^0.6.3",
"@google-labs/breadboard": "*",
"@google-labs/core-kit": "*",
"@google-labs/graph-integrity": "*",
"@google-labs/llm-starter": "*",
"@google-labs/pinecone-kit": "*",
Expand Down
4 changes: 3 additions & 1 deletion seeds/graph-playground/src/boards/accumulating-context.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";

const board = new Board({
title: "Accumulating Context",
Expand All @@ -14,6 +15,7 @@ const board = new Board({
version: "0.0.1",
});
const kit = board.addKit(Starter);
const core = board.addKit(Core);

// Store input node so that we can refer back to it to create a conversation
// loop.
Expand Down Expand Up @@ -47,7 +49,7 @@ const conversationMemory = kit.append({
// Wire memory to accumulate: loop it to itself.
conversationMemory.wire("accumulator->", conversationMemory);

board.passthrough({ $id: "start" }).wire(
core.passthrough({ $id: "start" }).wire(
"->",
input
.wire(
Expand Down

0 comments on commit 3d976d7

Please sign in to comment.