| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- /**
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
- * SPDX-License-Identifier: MIT
- */
- import { FlowDocumentJSON } from './typings';
- export const initialData: FlowDocumentJSON = {
- nodes: [
- {
- id: 'start_0',
- type: 'start',
- blocks: [],
- data: {
- title: 'Start',
- outputs: {
- type: 'object',
- properties: {
- query: {
- type: 'string',
- default: 'Hello Flow.',
- },
- enable: {
- type: 'boolean',
- default: true,
- },
- array_obj: {
- type: 'array',
- items: {
- type: 'object',
- properties: {
- int: {
- type: 'number',
- },
- str: {
- type: 'string',
- },
- },
- },
- },
- },
- },
- },
- },
- {
- id: 'llm_0',
- type: 'llm',
- blocks: [],
- data: {
- title: 'LLM',
- inputsValues: {
- modelType: {
- type: 'constant',
- content: 'gpt-3.5-turbo',
- },
- temperature: {
- type: 'constant',
- content: 0.5,
- },
- systemPrompt: {
- type: 'constant',
- content: '# Role\nYou are an AI assistant.\n',
- },
- prompt: {
- type: 'constant',
- content: '',
- },
- },
- inputs: {
- type: 'object',
- required: ['modelType', 'temperature', 'prompt'],
- properties: {
- modelType: {
- type: 'string',
- },
- temperature: {
- type: 'number',
- },
- systemPrompt: {
- type: 'string',
- extra: { formComponent: 'prompt-editor' },
- },
- prompt: {
- type: 'string',
- extra: { formComponent: 'prompt-editor' },
- },
- },
- },
- outputs: {
- type: 'object',
- properties: {
- result: { type: 'string' },
- },
- },
- },
- },
- {
- id: 'switch_0',
- type: 'switch',
- data: {
- title: 'Switch',
- },
- blocks: [
- {
- id: 'case_0',
- type: 'case',
- data: {
- title: 'Case_0',
- inputsValues: {
- condition: { type: 'constant', content: true },
- },
- inputs: {
- type: 'object',
- required: ['condition'],
- properties: {
- condition: {
- type: 'boolean',
- },
- },
- },
- },
- blocks: [],
- },
- {
- id: 'case_1',
- type: 'case',
- data: {
- title: 'Case_1',
- inputsValues: {
- condition: { type: 'constant', content: true },
- },
- inputs: {
- type: 'object',
- required: ['condition'],
- properties: {
- condition: {
- type: 'boolean',
- },
- },
- },
- },
- },
- {
- id: 'case_default_1',
- type: 'caseDefault',
- data: {
- title: 'Default',
- },
- blocks: [],
- },
- ],
- },
- {
- id: 'loop_0',
- type: 'loop',
- data: {
- title: 'Loop',
- batchFor: {
- type: 'ref',
- content: ['start_0', 'array_obj'],
- },
- },
- blocks: [
- {
- id: 'if_0',
- type: 'if',
- data: {
- title: 'If',
- inputsValues: {
- condition: { type: 'constant', content: true },
- },
- inputs: {
- type: 'object',
- required: ['condition'],
- properties: {
- condition: {
- type: 'boolean',
- },
- },
- },
- },
- blocks: [
- {
- id: 'if_true',
- type: 'ifBlock',
- data: {
- title: 'true',
- },
- blocks: [],
- },
- {
- id: 'if_false',
- type: 'ifBlock',
- data: {
- title: 'false',
- },
- blocks: [
- {
- id: 'break_0',
- type: 'breakLoop',
- data: {
- title: 'BreakLoop',
- },
- },
- ],
- },
- ],
- },
- ],
- },
- {
- id: 'tryCatch_0',
- type: 'tryCatch',
- data: {
- title: 'TryCatch',
- },
- blocks: [
- {
- id: 'tryBlock_0',
- type: 'tryBlock',
- blocks: [],
- },
- {
- id: 'catchBlock_0',
- type: 'catchBlock',
- data: {
- title: 'Catch Block 1',
- inputsValues: {
- condition: { type: 'constant', content: true },
- },
- inputs: {
- type: 'object',
- required: ['condition'],
- properties: {
- condition: {
- type: 'boolean',
- },
- },
- },
- },
- blocks: [],
- },
- {
- id: 'catchBlock_1',
- type: 'catchBlock',
- data: {
- title: 'Catch Block 2',
- inputsValues: {
- condition: { type: 'constant', content: true },
- },
- inputs: {
- type: 'object',
- required: ['condition'],
- properties: {
- condition: {
- type: 'boolean',
- },
- },
- },
- },
- blocks: [],
- },
- ],
- },
- {
- id: 'end_0',
- type: 'end',
- blocks: [],
- data: {
- title: 'End',
- outputs: {
- type: 'object',
- properties: {
- result: {
- type: 'string',
- },
- },
- },
- },
- },
- ],
- };
|