-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into CourseCrafter
- Loading branch information
Showing
42 changed files
with
1,152 additions
and
260 deletions.
There are no files selected for viewing
Binary file renamed
BIN
+5.82 MB
...-kits-npm-0.9.0-97ea563a9b-1f577b7364.zip → ...-kits-npm-0.9.1-a61b87c9a2-23cf4794fd.zip
Binary file not shown.
Binary file added
BIN
+11.8 MB
.yarn/cache/@xenova-transformers-npm-2.11.0-3f962b83d2-d95d513f52.zip
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,50 @@ | ||
{ | ||
"dependencies": { | ||
"@exadev/breadboard-kits": "^0.8.3", | ||
"@google-labs/breadboard": "^0.5.1" | ||
"@exadev/breadboard-kits": "^0.9.1", | ||
"@google-labs/breadboard": "^0.6.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.9.3", | ||
"@types/node": "^20.10.4", | ||
"npm-run-all": "^4.1.5", | ||
"tsx": "^4.2.0", | ||
"typescript": "^5.3.2" | ||
"tsx": "^4.6.2", | ||
"typescript": "^5.3.3" | ||
}, | ||
"engines": { | ||
"node": ">=19" | ||
}, | ||
"engineStrict": true, | ||
"name": "breadboard-walkthrough", | ||
"scripts": { | ||
"run-adding-slot-to-a-board": "tsx src/adding-slot-to-a-board/index.ts", | ||
"run-adding-slot-to-a-board-with-url": "tsx src/adding-slot-to-a-board-with-url/index.ts", | ||
"run-arrow-directions": "tsx src/arrow-directions/index.ts", | ||
"run-custom-kit-node-values-and-handlers": "tsx src/custom-kit-node-values-and-handlers/index.ts", | ||
"run-hello-world": "tsx src/hello-world/index.ts", | ||
"run-include-board-as-a-node": "tsx src/include-board-as-a-node/index.ts", | ||
"run-include-board-as-a-node-with-url": "tsx src/include-board-as-a-node-with-url/index.ts", | ||
"run-multiple-inputs": "tsx src/multiple-inputs/index.ts", | ||
"run-multiple-inputs-one-output": "tsx src/multiple-inputs-one-output/index.ts", | ||
"run-multiple-outputs": "tsx src/multiple-outputs/index.ts", | ||
"run-naming-wiring-parameters": "tsx src/naming-wiring-parameters/index.ts", | ||
"run-nodes-by-id": "tsx src/nodes-by-id/index.ts", | ||
"run-one-input-multiple-outputs": "tsx src/one-input-multiple-outputs/index.ts", | ||
"run-specific-outputs": "tsx src/specific-outputs/index.ts", | ||
"start": "npm-run-all --print-name --serial 'run-*'", | ||
"watch": "npm-run-all --print-name --parallel 'watch-*'", | ||
"run-arrow-directions": "tsx src/arrow-directions/index.ts", | ||
"watch-adding-slot-to-a-board": "tsx watch src/adding-slot-to-a-board/index.ts", | ||
"watch-adding-slot-to-a-board-with-url": "tsx watch src/adding-slot-to-a-board-with-url/index.ts", | ||
"watch-arrow-directions": "tsx watch src/arrow-directions/index.ts", | ||
"run-hello-world": "tsx src/hello-world/index.ts", | ||
"watch-custom-kit-node-values-and-handlers": "tsx watch src/custom-kit-node-values-and-handlers/index.ts", | ||
"watch-hello-world": "tsx watch src/hello-world/index.ts", | ||
"run-multiple-inputs": "tsx src/multiple-inputs/index.ts", | ||
"watch-include-board-as-a-node": "tsx watch src/include-board-as-a-node/index.ts", | ||
"watch-include-board-as-a-node-with-url": "tsx watch src/include-board-as-a-node-with-url/index.ts", | ||
"watch-multiple-inputs": "tsx watch src/multiple-inputs/index.ts", | ||
"run-multiple-outputs": "tsx src/multiple-outputs/index.ts", | ||
"watch-multiple-inputs-one-output": "tsx watch src/multiple-inputs-one-output/index.ts", | ||
"watch-multiple-outputs": "tsx watch src/multiple-outputs/index.ts", | ||
"run-specific-outputs": "tsx src/specific-outputs/index.ts", | ||
"watch-specific-outputs": "tsx watch src/specific-outputs/index.ts", | ||
"run-nodes-by-id": "tsx src/nodes-by-id/index.ts", | ||
"watch-naming-wiring-parameters": "tsx watch src/naming-wiring-parameters/index.ts", | ||
"watch-nodes-by-id": "tsx watch src/nodes-by-id/index.ts", | ||
"run-one-input-multiple-outputs": "tsx src/one-input-multiple-outputs/index.ts", | ||
"watch-one-input-multiple-outputs": "tsx watch src/one-input-multiple-outputs/index.ts", | ||
"run-multiple-inputs-one-output": "tsx src/multiple-inputs-one-output/index.ts", | ||
"watch-multiple-inputs-one-output": "tsx watch src/multiple-inputs-one-output/index.ts" | ||
"watch-specific-outputs": "tsx watch src/specific-outputs/index.ts" | ||
}, | ||
"type": "module" | ||
} |
69 changes: 0 additions & 69 deletions
69
samples/Breadboard Walkthrough/src/adding-slot-to-a-board-with-json/index.ts
This file was deleted.
Oops, something went wrong.
File renamed without changes.
36 changes: 36 additions & 0 deletions
36
samples/Breadboard Walkthrough/src/adding-slot-to-a-board-with-url/board.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,36 @@ | ||
{ | ||
"url": "https://raw.githubusercontent.com/ExaDev-io/breadboard-samples/develop/samples/Breadboard%20Walkthrough/src/adding-slot-to-a-board-with-url/mainboard.json", | ||
"title": "Adding Slot to a Board with URL", | ||
"edges": [ | ||
{ | ||
"from": "slot-1", | ||
"to": "mainOutputNode", | ||
"out": "nestedOutput", | ||
"in": "nestedOutput" | ||
}, | ||
{ | ||
"from": "mainInputNode", | ||
"to": "slot-1", | ||
"out": "mainInput", | ||
"in": "nestedInput" | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"id": "mainInputNode", | ||
"type": "input" | ||
}, | ||
{ | ||
"id": "slot-1", | ||
"type": "slot", | ||
"configuration": { | ||
"slot": "nested" | ||
} | ||
}, | ||
{ | ||
"id": "mainOutputNode", | ||
"type": "output" | ||
} | ||
], | ||
"kits": [] | ||
} |
67 changes: 67 additions & 0 deletions
67
samples/Breadboard Walkthrough/src/adding-slot-to-a-board-with-url/index.ts
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,67 @@ | ||
#!/usr/bin/env npx -y tsx | ||
|
||
import writeMarkdown from "@exadev/breadboard-kits/util/files/writeMarkdown"; | ||
import { asRuntimeKit, Board } from "@google-labs/breadboard"; | ||
import { Core } from "@google-labs/core-kit"; | ||
import * as url from "url"; | ||
import fs from "fs"; | ||
|
||
/* | ||
Slot has now been deprecated. | ||
*/ | ||
(async () => { | ||
const BASE = "https://raw.githubusercontent.com"; | ||
const OWNER = "ExaDev-io"; | ||
const REPO = "breadboard-samples"; | ||
const BRANCH = "develop"; | ||
const PATH = | ||
"samples/Breadboard%20Walkthrough/src/adding-slot-to-a-board-with-url"; | ||
|
||
const MAIN_BOARD_URL = [ | ||
BASE, | ||
OWNER, | ||
REPO, | ||
BRANCH, | ||
PATH, | ||
"mainboard.json", | ||
].join("/"); | ||
|
||
const NESTED_BOARD_URL = [ | ||
BASE, | ||
OWNER, | ||
REPO, | ||
BRANCH, | ||
PATH, | ||
"nestedboard.json", | ||
].join("/"); | ||
|
||
const nested = await Board.load(NESTED_BOARD_URL); | ||
|
||
const board = await Board.load(MAIN_BOARD_URL, { | ||
slotted: { nested }, | ||
}); | ||
|
||
writeMarkdown({ | ||
filename: "README", | ||
markdown: ["```mermaid", `${board.mermaid()}`, "```"].join("\n"), | ||
dir: url.fileURLToPath(new URL(".", import.meta.url)), | ||
}); | ||
|
||
for await (const run of board.run({ | ||
slots: {}, | ||
kits: [asRuntimeKit(Core)], // The kit needs to be passed because the JSON only contains an identifier of the kit and not the logic | ||
})) { | ||
if (run.type === "input") { | ||
run.inputs = { | ||
mainInput: "Hello World!", | ||
}; | ||
} else if (run.type === "output") { | ||
console.log(run.node.id, run.outputs); | ||
} | ||
} | ||
|
||
fs.writeFileSync( | ||
url.fileURLToPath(new URL("board.json", import.meta.url)), | ||
JSON.stringify(board, null, "\t") | ||
); | ||
})(); |
39 changes: 39 additions & 0 deletions
39
samples/Breadboard Walkthrough/src/adding-slot-to-a-board-with-url/mainboard.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,39 @@ | ||
{ | ||
"title":"Adding Slot to a Board with URL", | ||
"edges":[ | ||
{ | ||
"from":"slot-1", | ||
"to":"mainOutputNode", | ||
"out":"nestedOutput", | ||
"in":"nestedOutput" | ||
}, | ||
{ | ||
"from":"mainInputNode", | ||
"to":"slot-1", | ||
"out":"mainInput", | ||
"in":"nestedInput" | ||
} | ||
], | ||
"nodes":[ | ||
{ | ||
"id":"mainInputNode", | ||
"type":"input" | ||
}, | ||
{ | ||
"id":"slot-1", | ||
"type":"slot", | ||
"configuration":{ | ||
"slot":"nested" | ||
} | ||
}, | ||
{ | ||
"id":"mainOutputNode", | ||
"type":"output" | ||
} | ||
], | ||
"kits":[ | ||
{ | ||
"url":"npm:@google-labs/core-kit" | ||
} | ||
] | ||
} |
22 changes: 22 additions & 0 deletions
22
samples/Breadboard Walkthrough/src/adding-slot-to-a-board-with-url/nestedboard.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,22 @@ | ||
{ | ||
"title": "Nested Board", | ||
"edges": [ | ||
{ | ||
"from": "nestedInputNode", | ||
"to": "nestedOutputNode", | ||
"out": "nestedInput", | ||
"in": "nestedOutput" | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"id": "nestedInputNode", | ||
"type": "input" | ||
}, | ||
{ | ||
"id": "nestedOutputNode", | ||
"type": "output" | ||
} | ||
], | ||
"kits": [] | ||
} |
39 changes: 39 additions & 0 deletions
39
samples/Breadboard Walkthrough/src/adding-slot-to-a-board/board.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,39 @@ | ||
{ | ||
"title": "Adding Slot to a Board", | ||
"edges": [ | ||
{ | ||
"from": "slot-1", | ||
"to": "mainOutputNode", | ||
"out": "nestedOutput", | ||
"in": "nestedOutput" | ||
}, | ||
{ | ||
"from": "mainInputNode", | ||
"to": "slot-1", | ||
"out": "mainInput", | ||
"in": "nestedInput" | ||
} | ||
], | ||
"nodes": [ | ||
{ | ||
"id": "mainInputNode", | ||
"type": "input" | ||
}, | ||
{ | ||
"id": "slot-1", | ||
"type": "slot", | ||
"configuration": { | ||
"slot": "nested" | ||
} | ||
}, | ||
{ | ||
"id": "mainOutputNode", | ||
"type": "output" | ||
} | ||
], | ||
"kits": [ | ||
{ | ||
"url": "npm:@google-labs/core-kit" | ||
} | ||
] | ||
} |
Oops, something went wrong.