New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@breadboard-ai/build

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@breadboard-ai/build

JavaScript library for building boards and defining new node types for the Breadboard AI prototyping library

0.12.1
latest
Source
npm
Version published
Weekly downloads
492
209.43%
Maintainers
0
Weekly downloads
 
Created
Source

Breadboard Build

Published on npm

The Breadboard Build API allows you to design and compose boards with TypeScript.

It is an alternative to the Visual Editor, designed for users who prefer a code-first approach to working with Breadboard.

Boards that you create with the Build API can be serialized to BGL (Breadboard Graph Language), which can then be executed directly, or imported into the Visual Editor.

Install

npm i @breadboard-ai/build

Documentation

Please refer to the Build API section of the Breadboard Documentation site for full documentation.

Example

import { board, input, output } from "@breadboard-ai/build";
import { prompt } from "@google-labs/template-kit";
import { geminiText } from "@google-labs/gemini-kit";

const topic = input({
  description: "What should the poem be about?",
  examples: ["Coffee in the morning", "The mind of a cat"],
});

const stanzas = input({
  type: "number",
  description: "How many stanzas should the poem have?",
  default: 4,
});

const poemPrompt = prompt`
  Write a poem about ${topic} with ${stanzas} stanzas.`;

const poemWriter = geminiText({
  text: poemPrompt,
  model: "gemini-1.5-flash-latest",
});

const poem = output(poemWriter.outputs.text, {
  title: "Poem",
  description: "The poem that Gemini generated.",
});

export default board({
  id: "poem-writer",
  title: "Poem Writer",
  description: "Write a poem with Gemini.",
  inputs: { topic, stanzas },
  outputs: { poem },
});

FAQs

Package last updated on 06 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts