open-index/open-npm huggingface dataset:
npm package: @paulkinlan/breadboard-utils-kit
Description: A Kit with useful nodes for Breadboard.
Author: Paul Kinlan
Latest version: 1.1.0

# "Google Labs Breadboard" Useful nodes by Paul Kinlan Kit 

This is a collection of [Breadboard](https://github.com/google/labs-prototypes/tree/main/seeds/breadboard) nodes that are helpful for building LLM-based (Generative AI) applications.

## Installing

This Kit requires Node version >=v19.0.0. To install:

```sh
npm install @paulkinlan/breadboard-utils-kit
```

## Node Types

Here are all node handlers that are included in the OpenAI Breadboard Kit

### The `undefinedGuard` node

Takes an `input` and if the value is `defined` (!undefined) then outputs the `input` on the false. If the value is `undefined` outputs `true` on "true" 

#### Inputs:

- `input` optional. The value to be checked if undefined.

#### Outputs:

- `true` - "true" if the input is `undefined`.
- `false` - value of the input if the input is not `undefined`.

### The `headTail` node

Takes a list as `input` and returns the first item as the head, and the rest of the list as tail.

#### Inputs:

- `input` optional. The array to split in to 1 head and the remaining nodes.

#### Outputs:

- `head` - the first item in the list
- `tail` - the rest of the input list (`slice(1)`)

## Example graph

```mermaid
%%{init: 'themeVariables': { 'fontFamily': 'Fira Code, monospace' }}%%
graph TD;
inputprompt[/"input
id='input-prompt'"/]:::input -- "input->input" --> headTail1["headTail
id='headTail-1'"]
headTail1["headTail
id='headTail-1'"] -- "tail->input" --> undefinedGuard1["undefinedGuard
id='undefinedGuard-1'"]
headTail1["headTail
id='headTail-1'"] -- "head->text" --> output{{"output
id='output'"}}:::output
undefinedGuard1["undefinedGuard
id='undefinedGuard-1'"] -- "false->input" --> headTail1["headTail
id='headTail-1'"]
messageinputprompt[message]:::config -- "message->message" --o inputprompt
classDef default stroke:#ffab40,fill:#fff2ccff,color:#000
classDef input stroke:#3c78d8,fill:#c9daf8ff,color:#000
classDef output stroke:#38761d,fill:#b6d7a8ff,color:#000
classDef passthrough stroke:#a64d79,fill:#ead1dcff,color:#000
classDef slot stroke:#a64d79,fill:#ead1dcff,color:#000
classDef config stroke:#a64d79,fill:#ead1dcff,color:#000
classDef secrets stroke:#db4437,fill:#f4cccc,color:#000
classDef slotted stroke:#a64d79
```

Which will output `[ { text: 1 }, { text: 2 }, { text: 3 }, { text: 4 } ]`

### The `take` node

Takes a list as `input` and returns the first `count` items.

#### Inputs:

- `input` required, the array to have `count` items taken from it.
- `count` required, the number of items to take from the input array.

#### Outputs:

- `output` - the first `count` items in the list


### The `take` node

Takes a list as `input` and removes the first `count` items.

#### Inputs:

- `input` required, the array to have `count` items taken from it.
- `count` required, the number of items to take from the input array.

#### Outputs:

- `output` -  `length` - `count` items in the list, starting at `count`
npm package: @paulkinlan/claude-breadboard-kit
Description: A Kit that allows you to build Breadboard graphs for Claude.
Author: Paul Kinlan
Latest version: 3.1.0

# "Google Labs Breadboard" Kit for the Claude API

The Claude Breadboard Kit is a collection of [Breadboard](https://github.com/google/labs-prototypes/tree/main/seeds/breadboard) nodes that are helpful for building LLM-based (Generative AI) applications using the Claude API.

## Installing

Claude Breadboard Kit requires Node version >=v19.0.0. To install:

```sh
npm install @paulkinlan/claude-breadboard-kit
```

## Node Types

Here are all node handlers that are included in the Claude Breadboard Kit

### The `generateCompletion` node

This is an [Claude API](https://docs.anthropic.com/) text completion node. To produce useful output, the node needs an `CLAUDE_API_KEY` input and the `text` input and the `model` to run it against (although it defaults to `claude-2`).

#### Example:

Given this input:

```json
{
  "CLAUDE_API_KEY": "<your API key>",
  "text": "How much wood can a woodchuck chuck?"
}
```

The node will produce this output:

```json
{
  "completion": " The exact amount a woodchuck can chuck is unknown, but it is believed that they can chuck about 700 pounds of wood in a day."
}
```

#### Inputs:

- `CLAUDE_API_KEY` required, must contain the Claude API key.
- `text` required, sent as the prompt for the completion.
- `model` the name of the model Claude that you want to use.

#### Outputs:

- `completion` - result of the Claude API text completion.
npm package: @paulkinlan/f
Description: Natural Language to runnable functions.
Author: Paul Kinlan
Latest version: 0.1.1

# f

Natural Language to runnable functions.

```JavaScript
import { create } from "@paulkinlan/f";
import { prompt, ChromePromptConfiguration } from "@paulkinlan/reactive-prompt/chrome"

// Create the builder - we have to tell it which reactive prompt we want to use.
const config = new ChromePromptConfiguration();
const f = create(
  prompt, config
);

// Create a function that sums two numbers
const sum = await f`Sum two numbers`;

console.log(sum(22,44)) // Run the code.
```

## Using Claude (or other LLMs)

[reactive-prompts](https://github.com/paulkinlan/reactive-prompts) offers the developer to use the following LLMs:

- Gemini - `import { prompt, GeminiPromptConfiguration } from "@paulkinlan/reactive-prompt/gemini`
- Gemini Nano in Chrome - `import { prompt, ChromePromptConfiguration } from "@paulkinlan/reactive-prompt/chrome`
- Claude - `import { prompt, ClaudePromptConfiguration } from "@paulkinlan/reactive-prompt/claude`
- OpenAI - `import { prompt, OpenAIPromptConfiguration } from "@paulkinlan/reactive-prompt/openai`
- Ollama - `import { prompt, OllamaPromptConfiguration } from "@paulkinlan/reactive-prompt/ollama`

You can pass in the exported `prompt` and configuration objects in to `create` and `f` will use these libraries as the LLM exectution engine.

## Recompiling the function

Because the prompting library is based on [reactive-prompts](https://github.com/paulkinlan/reactive-prompts) it is possible to recompile the function when the prompt uses a signal to change the prompt.

```JavaScript
import { create } from "@paulkinlan/f";
import { prompt, ChromePromptConfiguration } from "@paulkinlan/reactive-prompt/chrome";
import { signal, effect } from "@preact/signals";

const f = create(
  prompt, new ChromePromptConfiguration()
);

const numbers = signal(2);

// Prompts can take a signal as an argument which means the prompt can re-run.
const sum = await f`Sum ${numbers} numbers`;

// The first generated function is the direct invocation of the code generated by the prompt. While it can update, you won't know if it did.
console.log("Direct invocation", sum(22,44));

// Update the signal which will re-generate the function.
setTimeout(() => {
  numbers.value = 3;
}, 2000);

// Watch for changes.
effect(()=>{
  // Each function has a signal that you can watch.
  const func = sum.signal.value;
  // You can either call sum directly, or you can do it via the signal.
  if (func) {
    if (func.length === 2) {
      console.log(func(22, 44));
    } else if (func.length === 3) {
      console.log(func(1,2, 3));
    }
  }
})
```

## Installation

```bash
npm install @paulkinlan/f
```
npm package: @paulkinlan/openai-breadboard-kit
Description: A Kit that allows you to build Breadboard graphs for OpenAI.
Author: Paul Kinlan
Latest version: 1.2.0

# "Google Labs Breadboard" Kit for the OpenAI API

The OpenAI Breadboard Kit is a collection of [Breadboard](https://github.com/google/labs-prototypes/tree/main/seeds/breadboard) nodes that are helpful for building LLM-based (Generative AI) applications using the OpenAI API.

## Installing

OpenAI Breadboard Kit requires Node version >=v19.0.0. To install:

```sh
npm install @paulkinlan/openai-breadboard-kit
```

## Node Types

Here are all node handlers that are included in the OpenAI Breadboard Kit

### The `generateCompletion` node

This is an [OpenAI API](https://platform.openai.com/docs) text completion node. To produce useful output, the node needs an `OPENAI_API_KEY` input and the `text` input and the `model` to run it against.

#### Example:

Given this input:

```json
{
  "OPENAI_API_KEY": "<your API key>",
  "text": "How much wood can a woodchuck chuck?"
}
```

The node will produce this output:

```json
{
  "completion": "The exact amount a woodchuck can chuck is unknown, but it is believed that they can chuck about 700 pounds of wood in a day."
}
```

#### Inputs:

- `OPENAI_API_KEY` required, must contain the OpenAI API key.
- `text` required, sent as the prompt for the completion.
- `model` the name of the model OpenAI that you want to use.

#### Outputs:

- `completion` - result of the OpenAI API text completion.
npm package: @paulkinlan/transformerjs-breadboard-kit
Description: A Kit with useful nodes for use with TransformerJS.
Author: Paul Kinlan
Latest version: 1.3.2

# "Google Labs Breadboard" TransformerJS Nodes Kit

This is a collection of [Breadboard](https://github.com/google/labs-prototypes/tree/main/seeds/breadboard) nodes that let you integrate `transformerjs` in to your apps built with Breadboard.

## Installing

This Kit requires Node version >=v19.0.0. To install:

```sh
npm install @paulkinlan/transformerjs-breadboard-kit
```

## Node Types

Here are all node handlers that are included in the OpenAI Breadboard Kit

### The `pipeline` node

Takes an `input` 

#### Inputs:

- `input` required. The value to be checked if undefined.
- `task` required. The transformerjs task to be used (tested: `sentiment-analysis`, `summarize`)
- `model` optional.

#### Outputs:

- `modelResult` - likely an array of results returned by the `transfomerjs` logic as defined by `task` and `model`

### The `summarize` node

- `input` required. The text to be summarized.
- `model` optional. The model to use. This will be loaded by transformjs. The default is `Xenova/distilbart-cnn-6-6`.

#### Outputs:

- `modelResult` - an array of `{ "summary_text": "[some text]" }`

### The `sentiment-analysis` node

- `input` required. The text to be analysed for sentiment.
- `model` optional. The model to use. This will be loaded by transformjs. The default is `Xenova/distilbert-base-uncased-finetuned-sst-2-english`.

#### Outputs:

- `modelResult` - an array of objects of the form: `{ "label":  "POSITIVE", "confidence": 0.9995 }`