Skip to content

Commit 8b3338c

Browse files
committed
fix(flow): strip fences from generated JSON values
1 parent f14ba49 commit 8b3338c

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎apps/sim/blocks/blocks/flow.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ export const FlowBlock: BlockConfig = {
710710
language: 'json',
711711
wandConfig: {
712712
enabled: true,
713+
generationType: 'json-value',
713714
prompt:
714715
'Generate valid JSON for Flow value: Field value as JSON, matching the data model: string, number, boolean, array, object, or null. Use only supplied category IDs and field keys. Return ONLY one raw JSON value, without markdown fences or prose.',
715716
placeholder: 'Describe the value to generate',

‎apps/sim/blocks/types.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export type GenerationType =
183183
| 'json-schema'
184184
| 'json-object'
185185
| 'json-array'
186+
| 'json-value'
186187
| 'table-schema'
187188
| 'system-prompt'
188189
| 'custom-tool-schema'

‎apps/sim/lib/wand/strip-code-fences.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const STRIPS_CODE_FENCES: Record<GenerationType, boolean> = {
2020
'json-schema': true,
2121
'json-object': true,
2222
'json-array': true,
23+
'json-value': true,
2324
'table-schema': true,
2425
'system-prompt': false,
2526
'custom-tool-schema': true,

0 commit comments

Comments
 (0)