# 工作流 - 大模型 - Mock 数据

export const initialData: FlowDocumentJSON = {
  nodes: [
    {
      id: '100001',
      type: 'start',
      data: {
        title: '开始',
        outputs: {
          type: 'object',
          properties: {
            prompt: {
              type: 'string',
              default: '生成一段关于工作流的介绍文字。',
            },
          },
        },
      },
    },
    {
      id: '112898',
      type: 'llm',
      data: {
        title: 'LLM_1',
        inputsValues: {
          model_name: {
            type: 'constant',
            content: 'gemini-3-pro-preview',
          },
          input_params: {
            prompt: {
              type: 'ref',
              content: ['100001', 'prompt']
            }
          },
          message: [                   // 消息列表
            {
              role: {
                type: 'constant',
                content: 'system',
              },
              text: {
                type: 'freemarker',
                content: '${params.prompt}',
              },
            },
          ],                 
          temperature: {               // 温度
            type: 'constant',
            content: 0.7,
          },
          top_p: {                     // 采样策略
            type: 'constant',
            content: 1,
          },
          frequency_penalty: {         // 频率惩罚
            type: 'constant',
            content: 0,
          },
          presence_penalty: {          // 存在惩罚
            type: 'constant',
            content: 0,
          },
          max_tokens: {                // 最大标记
            type: 'constant',
            content: 4096,
          },
          max_retries: {               // 最大重试次数
            type: 'constant',
            content: 3,
          },
          retry_interval: {            // 重试间隔
            type: 'constant',
            content: 1000,
          },
        },
        inputs: {
          type: 'object',
          required: [],
          properties: {
            model_name: { type: 'string' };
            input_params: { 
              type: 'object'
              properties: {
                prompt: { type: 'string' },
              }
            };
            message: {
              type: 'array',
              items: {
                type: 'object',
                properties: {
                  role: { type: 'string' },
                  text: { type: 'string' },
                },
              },
            };
            temperature: { type: 'number' };
            top_p: { type: 'number' };
            frequency_penalty: { type: 'number' };
            presence_penalty: { type: 'number' };
            max_tokens: { type: 'number' };
            max_retries: { type: 'number' };
            retry_interval: { type: 'number' };
          }
        },
        outputs: {
          type: 'object',
          properties: {
            result: {
              type: 'string',
            },
          },
        },
      },
    }
    {
      id: '900001',
      type: 'end',
      data: {
        title: '结束',
        inputs: {
          type: 'object',
          properties: {
            result: {
              type: 'string',
            },
          },
        },
        inputsValues: {
          result: {
            type: 'constant',
            content: '',
          },
        },
      },
    },
  ],
  edges: [
    {
      sourceNodeID: '100001',
      targetNodeID: '112898',
    },{
      sourceNodeID: '112898',
      targetNodeID: '900001',
    }
  ],
};