Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

params subgraphs #4872

Merged
merged 8 commits into from
Mar 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/shy-loops-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@google-labs/breadboard": minor
"@breadboard-ai/shared-ui": minor
"@breadboard-ai/a2": minor
---

Teach parameters to work in subgraphs.
40 changes: 31 additions & 9 deletions packages/a2/bgl/a2.bgl.json

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion packages/a2/bgl/go-over-list.bgl.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,29 @@
}
}
],
"visual": {},
"visual": {
"presentation": {
"themes": {
"5f3ca599-8fee-46fb-951f-0d47b16a6d56": {
"themeColors": {
"primaryColor": "#246db5",
"secondaryColor": "#5cadff",
"backgroundColor": "#ffffff",
"textColor": "#1a1a1a",
"primaryTextColor": "#ffffff"
},
"template": "basic",
"splashScreen": {
"storedData": {
"handle": "/images/app/generic-flow.jpg",
"mimeType": "image/jpeg"
}
}
}
},
"theme": "5f3ca599-8fee-46fb-951f-0d47b16a6d56"
}
},
"tags": [
"published",
"tool",
Expand Down
123 changes: 123 additions & 0 deletions packages/a2/bgl/goal-subgraph-params-workbench.bgl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"title": "GOAL Subgraph Workbench",
"description": "",
"version": "0.0.1",
"nodes": [
{
"id": "go-over-list-bed6bec0",
"type": "file://bgl/go-over-list.bgl.json#module:main",
"metadata": {
"visual": {
"x": 320,
"y": -100.00000000000011,
"collapsed": "expanded",
"outputHeight": 88
},
"logLevel": "info",
"userModified": true,
"title": "Planner"
},
"configuration": {
"plan": {
"role": "user",
"parts": [
{
"text": "Use {{\"type\":\"tool\",\"path\":\"#01b21b56-9299-49fe-9602-f32359fc8926\",\"title\":\"Poem Writer\"}} to write a poem about each city:\n\n {{\"type\":\"param\",\"path\":\"list-of-cities\",\"title\":\"List of Cities\"}}\n\nThe poem must be in one of these styles: Ballad, Limerick, Elegy, Haiku. Pick a different one for each city."
}
]
},
"strategy": "All at once"
}
}
],
"edges": [],
"metadata": {
"tags": [],
"visual": {
"presentation": {
"themes": {
"6a9ed960-ab30-4d64-bb12-af3e52204ecf": {
"themeColors": {
"primaryColor": "#246db5",
"secondaryColor": "#5cadff",
"backgroundColor": "#ffffff",
"textColor": "#1a1a1a",
"primaryTextColor": "#ffffff"
},
"template": "basic",
"splashScreen": {
"storedData": {
"handle": "/images/app/generic-flow.jpg",
"mimeType": "image/jpeg"
}
}
}
},
"theme": "6a9ed960-ab30-4d64-bb12-af3e52204ecf"
}
},
"parameters": {
"list-of-cities": {
"title": "List of Cities",
"usedIn": [
"go-over-list-bed6bec0"
]
}
}
},
"assets": {
"@@thumbnail": {
"metadata": {
"title": "Thumbnail",
"type": "file"
},
"data": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjUwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDI1MCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8cmVjdCB4PSIxMC4wMCIKICAgICAgICAgICAgICAgICAgICB5PSI2Mi43NSIKICAgICAgICAgICAgICAgICAgICB3aWR0aD0iOTQuNjciCiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0PSI2OC40NSIKICAgICAgICAgICAgICAgICAgICByeD0iMy41IgogICAgICAgICAgICAgICAgICAgIGZpbGw9IndoaXRlIgogICAgICAgICAgICAgICAgICAgIHN0cm9rZT0iIzJlOGJlOCIgLz4KICAgICAgPHJlY3QgeD0iMTQ1LjMzIgogICAgICAgICAgICAgICAgICAgIHk9IjY4Ljc5IgogICAgICAgICAgICAgICAgICAgIHdpZHRoPSI5NC42NyIKICAgICAgICAgICAgICAgICAgICBoZWlnaHQ9IjY4LjQ1IgogICAgICAgICAgICAgICAgICAgIHJ4PSIzLjUiCiAgICAgICAgICAgICAgICAgICAgZmlsbD0id2hpdGUiCiAgICAgICAgICAgICAgICAgICAgc3Ryb2tlPSIjNzc1N2Q5IiAvPgogICAgPC9zdmc+"
}
},
"graphs": {
"01b21b56-9299-49fe-9602-f32359fc8926": {
"title": "Poem Writer",
"description": "Writes a poem, generates an image for it and returns both",
"version": "0.0.1",
"nodes": [
{
"id": "a2-f1165e94",
"type": "file://bgl/a2.bgl.json#daf082ca-c1aa-4aff-b2c8-abeb984ab66c",
"metadata": {
"visual": {
"x": 691.6621530059132,
"y": -83.41041290243129,
"collapsed": "expanded",
"outputHeight": 88
},
"logLevel": "info",
"title": "Generate Poem",
"userModified": false,
"description": "Generates a poem based on a given topic and style, incorporating current weather information."
},
"configuration": {
"description": {
"parts": [
{
"text": "Write a poem based on this topic:\n {{\"type\":\"param\",\"path\":\"topic\",\"title\":\"Topic\"}}\n\nIn this style:\n{{\"type\":\"param\",\"path\":\"style\",\"title\":\"Style\"}}\n\nUse {{\"type\":\"tool\",\"path\":\"file://bgl/tools.bgl.json#module:get-weather\",\"title\":\"Get Weather\"}} to get current weather info and use it to write a poem.\n\nEach poem must have a title as a level 2 markdown heading."
}
],
"role": "user"
}
}
}
],
"edges": [],
"metadata": {
"visual": {
"minimized": false
},
"tags": [],
"userModified": true
}
}
},
"exports": [
"#01b21b56-9299-49fe-9602-f32359fc8926"
]
}
44 changes: 36 additions & 8 deletions packages/a2/bgl/goal-subgraph-workbench.bgl.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,29 @@
"edges": [],
"metadata": {
"tags": [],
"visual": {}
"visual": {
"presentation": {
"themes": {
"6a9ed960-ab30-4d64-bb12-af3e52204ecf": {
"themeColors": {
"primaryColor": "#246db5",
"secondaryColor": "#5cadff",
"backgroundColor": "#ffffff",
"textColor": "#1a1a1a",
"primaryTextColor": "#ffffff"
},
"template": "basic",
"splashScreen": {
"storedData": {
"handle": "/images/app/generic-flow.jpg",
"mimeType": "image/jpeg"
}
}
}
},
"theme": "6a9ed960-ab30-4d64-bb12-af3e52204ecf"
}
}
},
"assets": {
"@@thumbnail": {
Expand All @@ -44,8 +66,8 @@
},
"graphs": {
"01b21b56-9299-49fe-9602-f32359fc8926": {
"title": "",
"description": "",
"title": "Poem Writer",
"description": "Writes a poem, generates an image for it and returns both",
"version": "0.0.1",
"nodes": [
{
Expand All @@ -59,13 +81,15 @@
"outputHeight": 88
},
"logLevel": "info",
"title": "Write a Poem"
"title": "Write Poem",
"userModified": false,
"description": "Writes a poem based on the provided topic. Uses web search to gather facts and incorporates them into the poem. The poem includes a title as a markdown heading."
},
"configuration": {
"description": {
"parts": [
{
"text": "Write a poem based on the topic. Use {{\"type\":\"tool\",\"path\":\"file://bgl/tools.bgl.json#module:search-web\",\"title\":\"Search Web\"}} to gather interesting facts about the topic and incorporate them into the poem.\n\nEach poem must have a title as a markdown heading."
"text": "Write a poem based on this topic:\n {{\"type\":\"param\",\"path\":\"topic\",\"title\":\"Topic\"}}\n\nUse {{\"type\":\"tool\",\"path\":\"file://bgl/tools.bgl.json#module:search-web\",\"title\":\"Search Web\"}} to gather interesting facts about the topic and incorporate them into the poem.\n\nEach poem must have a title as a markdown heading."
}
],
"role": "user"
Expand Down Expand Up @@ -145,8 +169,12 @@
"visual": {
"minimized": false
},
"tags": []
"tags": [],
"userModified": true
}
}
}
}
},
"exports": [
"#01b21b56-9299-49fe-9602-f32359fc8926"
]
}
24 changes: 23 additions & 1 deletion packages/a2/bgl/parameters-workbench.bgl.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,29 @@
}
],
"metadata": {
"visual": {},
"visual": {
"presentation": {
"themes": {
"6c30a931-5de7-43e3-b5b8-905219dd943c": {
"themeColors": {
"primaryColor": "#246db5",
"secondaryColor": "#5cadff",
"backgroundColor": "#ffffff",
"textColor": "#1a1a1a",
"primaryTextColor": "#ffffff"
},
"template": "basic",
"splashScreen": {
"storedData": {
"handle": "/images/app/generic-flow.jpg",
"mimeType": "image/jpeg"
}
}
}
},
"theme": "6c30a931-5de7-43e3-b5b8-905219dd943c"
}
},
"userModified": true,
"tags": [],
"parameters": {
Expand Down
Loading
Loading