improvement(subblock-defaults): custom defaults for subblocks if needed (#1298)

This commit is contained in:
Vikhyath Mondreti
2025-09-09 17:12:10 -07:00
committed by GitHub
parent 8f7b11f089
commit c48039f97f
3 changed files with 5 additions and 1 deletions

View File

@@ -175,6 +175,7 @@ Create a system prompt appropriately detailed for the request, using clear langu
layout: 'half',
min: 0,
max: 1,
defaultValue: 0.5,
condition: () => ({
field: 'model',
value: (() => {
@@ -192,6 +193,7 @@ Create a system prompt appropriately detailed for the request, using clear langu
layout: 'half',
min: 0,
max: 2,
defaultValue: 1,
condition: () => ({
field: 'model',
value: (() => {
@@ -289,6 +291,7 @@ Create a system prompt appropriately detailed for the request, using clear langu
title: 'Tools',
type: 'tool-input',
layout: 'full',
defaultValue: [],
},
{
id: 'responseFormat',

View File

@@ -103,6 +103,7 @@ export interface SubBlockConfig {
mode?: 'basic' | 'advanced' | 'both' // Default is 'both' if not specified
canonicalParamId?: string
required?: boolean
defaultValue?: string | number | boolean | Record<string, unknown> | Array<unknown>
options?:
| { label: string; id: string; icon?: React.ComponentType<{ className?: string }> }[]
| (() => { label: string; id: string; icon?: React.ComponentType<{ className?: string }> }[])

View File

@@ -634,7 +634,7 @@ export function useCollaborativeWorkflow() {
subBlocks[subBlock.id] = {
id: subBlock.id,
type: subBlock.type,
value: null,
value: subBlock.defaultValue ?? null,
}
})
}