Readme

A helper to create an HTTP endpoint that conforms to the Breadboard Service Endpoint (BSE) protocol. See https://www.val.town/v/dglazkov/googlenews for sample usage.

For more information, see Breadboard service node.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
const FRONTEND_MODULE = "https://esm.town/v/dglazkov/bbaasfe";
export type NodeDescriberResult = {
title?: string;
description?: string;
metadata?: unknown;
inputSchema: {
properties: Record<string, Schema>;
required?: string[];
};
outputSchema: {
properties: Record<string, Schema>;
required?: string[];
};
};
export type InputValues = Record<string, unknown>;
export type OutputValues = Record<string, unknown>;
// Copied from https://github.com/breadboard-ai/breadboard/blob/main/packages/breadboard/src/types.ts
export type BehaviorSchema =
/**
* This port is deprecated and is only there because there might be graphs
* that still use it. Don't show it in the UI unless there are existing
* incoming wires.
*/
| "deprecated"
/**
* Indicates that this particular input port value should not be cached by
* the input bubbling machinery.
* Use this when you'd like to continually ask the user for the same input,
* rather that re-using cached answer (default behavior).
*/
| "transient"
/**
* Indicates that the output node should bubble up to the invoking runner,
* if any.
* This is useful for sending outputs to the user from inside of the nested
* graphs.
*/
| "bubble"
/**
* Indicates that the input our output port is a `BoardCapability`.
* @see [BoardCapability]
*/
| "board"
/**
* Indicates that the input or output port is a `StreamCapability`.
* @see [StreamCapability]
*/
| "stream"
/**
* Indicates that the input or output port is an `ErrorCapability`.
* @see [ErrorCapability]
*/
| "error"
/**
* Indicates that the input port is usually configured, rather than wired in.
*/
| "config"
/**
* Indicates that the input or output port represents base structured
* datatype containing multi-part content of a message, generated by an LLM.
* See [Content](https://ai.google.dev/api/rest/v1beta/Content) for details
* on the datatype.
*/
| "llm-content"
/**
* Indicates that the input or output port represents a JSON schema.
*/
| "json-schema"
/**
* Indicates that the input or output port represents a JSON schema that
* describes an input or output port.
*/
| "ports-spec"
/**
* Indicates that the input or output port represents an image. The image can
* be a URL or a base64 encoded image.
*/
| "image"
/**
* Indicates that the input or output represents some sort of code
*/
| "code";
export type Schema = {
title?: string;
description?: string;
type?: string | string[];
properties?: Record<string, Schema>;
required?: string[];
format?: string;
/**
* Can be used to provide additional hints to the UI or to other parts of
* the system about behavior of this particular input/output or input/output
* port.
*/
behavior?: BehaviorSchema[];
transient?: boolean;
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
July 8, 2024