Tina's Friction Log #1524
TinaNikou
started this conversation in
Friction Log
Replies: 1 comment
-
I get the import { base, board } from "@google-labs/breadboard";
export default await board(() => {
const input = base.input({});
const output = base.output({});
input.say.to(output.hear);
return output;
}).serialize(); Here's my code recreating and running it: import { asRuntimeKit, base, board, BoardRunner } from "@google-labs/breadboard";
import Core from "@google-labs/core-kit";
const myBoard = await board(() => {
const input = base.input({});
const output = base.output({});
input.say.to(output.hear);
return output;
}).serialize();
const runner = await BoardRunner.fromGraphDescriptor(myBoard);
console.log(await runner.runOnce({ say: "Hello Breadboard!" }, { kits: [asRuntimeKit(Core)] })); I can adjust it slightly to get it work other ways, like below: board(() => {
const input = base.input({});
const output = base.output({});
input.say.as("hear").to(output);
return output;
}).serialize(); Or: board(() => {
const input = base.input({});
const output = base.output({});
input.say.to(output);
return { hear: output };
}).serialize(); I tried a few other variations as well. const myBoard = await board<{ say: string; }, OutputValues>(({ say }, { output }) => {
const outputNode = output();
say.to(outputNode.hear);
return outputNode;
}).serialize(); And without serializing - which doesn't error but returns an empty object: const myBoard = board(() => {
const input = base.input();
const output = base.output();
input.say.to(output.hear);
return output;
});
console.log(await myBoard({ say: "Hello Breadboard!" })); I'm not too sure if there is a way to make it work which maintains the same structure. I do hope so, especially because I really liked this diagram from the guide!
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My friction log 💥 📖
Beta Was this translation helpful? Give feedback.
All reactions