Skip to content

Commit 4d2f17e

Browse files
committed
LLM generated graphs
1 parent 26e5663 commit 4d2f17e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+3747
-18
lines changed
File renamed without changes.
File renamed without changes.

static/frp-graph-06/graph.js renamed to static/frp-graph-06-no-static-ui-code/graph.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { connect, ground } from "./connect.js";
1717
import { SerializedGeneratedUI } from "./nodes/SerializedGeneratedUI.js";
1818
import { SerializedLLMNode } from "./nodes/SerializedLLMNode.js";
1919

20-
const schemaConfigUI = SerializedGeneratedUI("dimensions", {
20+
const tableDimensionsUI = SerializedGeneratedUI("dimensions", {
2121
inputs: {
2222
prompt: {
2323
shape: {
@@ -32,11 +32,10 @@ const schemaConfigUI = SerializedGeneratedUI("dimensions", {
3232
rows: { shape: { kind: "number", default: 2 } },
3333
cols: { shape: { kind: "number", default: 2 } },
3434
},
35-
contentType: "generated_ui",
36-
body: ``,
35+
contentType: "GeneratedUI",
3736
});
3837

39-
const dataUI = SerializedGeneratedUI("table", {
38+
const dataTableUI = SerializedGeneratedUI("table", {
4039
inputs: {
4140
prompt: {
4241
shape: {
@@ -51,11 +50,10 @@ const dataUI = SerializedGeneratedUI("table", {
5150
fields: { shape: { kind: "array", default: [] } },
5251
data: { shape: { kind: "array", default: [] } },
5352
},
54-
contentType: "generated_ui",
55-
body: ``,
53+
contentType: "GeneratedUI",
5654
});
5755

58-
const fields$ = SerializedLLMNode({
56+
const generatedFieldNames$ = SerializedLLMNode({
5957
inputs: {
6058
fields: {
6159
shape: {
@@ -79,17 +77,18 @@ const fields$ = SerializedLLMNode({
7977
outputs: {
8078
result: { shape: { kind: "array", default: [] } },
8179
},
80+
contentType: "LLMResult",
8281
});
8382

84-
const dataTablePrompt$ = fields$.out.result.pipe(
83+
const dataTablePrompt$ = generatedFieldNames$.out.result.pipe(
8584
map((d) => {
8685
return `A datatable that displays records from a database schema. Data will be in \`data\` as a list of JSON records. The columns of the table will be in \`fields\` as a list of strings.
8786
8887
Here are the fields: ${JSON.stringify(d, null, 2)};`;
8988
}),
9089
);
9190

92-
const data$ = SerializedLLMNode({
91+
const generatedData$ = SerializedLLMNode({
9392
inputs: {
9493
fields: {
9594
shape: {
@@ -118,17 +117,18 @@ const data$ = SerializedLLMNode({
118117
outputs: {
119118
result: { shape: { kind: "array", default: [] } },
120119
},
120+
contentType: "LLMResult",
121121
});
122122

123-
ground(schemaConfigUI.out.ui);
124-
ground(dataUI.out.ui);
123+
ground(tableDimensionsUI.out.ui);
124+
ground(dataTableUI.out.ui);
125125

126-
connect(schemaConfigUI.out.cols, fields$.in.fields);
127-
connect(fields$.out.result, data$.in.fields);
128-
connect(schemaConfigUI.out.rows, data$.in.rows);
129-
connect(fields$.out.result, dataUI.out.fields);
130-
connect(data$.out.result, dataUI.out.data);
126+
connect(tableDimensionsUI.out.cols, generatedFieldNames$.in.fields);
127+
connect(generatedFieldNames$.out.result, generatedData$.in.fields);
128+
connect(tableDimensionsUI.out.rows, generatedData$.in.rows);
129+
connect(generatedFieldNames$.out.result, dataTableUI.out.fields);
130+
connect(generatedData$.out.result, dataTableUI.out.data);
131131

132-
connect(data$.out.result, dataUI.in.render);
132+
connect(generatedData$.out.result, dataTableUI.in.render);
133133

134-
connect(dataTablePrompt$, dataUI.in.prompt);
134+
connect(dataTablePrompt$.out.result, dataTableUI.in.prompt);
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)