Tina's Friction Log #1524
Replies: 2 comments
-
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.
-
Issues using kits, and boards as kits, with the Build APIStarted discussion #2542 due to difficulties figuring out how to use the gemini-kit using the Build API. Managed to do it through invoking the gemini-generator board. However I wasn't able to get the ideal, simpler solution of importing the board directly from the kit working by specifying the path to it, due to getting an error that the module can't be found. Due to similar errors I've also had issues with getting the json-kit's jsonata node working with the Build API when using it from the kit, but I also get the same error that the module can't be found when trying to import the node from the json-kit by specifying the path. |
Beta Was this translation helpful? Give feedback.
-
My friction log 💥 📖
Beta Was this translation helpful? Give feedback.
All reactions