# 任务：大模型生成JSON结果 TaskCompletionJson

# 使用示例
``` ts
const triageTask = new TaskCompletionJson({
  title: '智能分诊',
  promptTemplate: `您是一名专业的分诊护士，根据患者描述推荐最合适的科室。严格按照以下JSON格式返回：
  {
    "department": "科室名称",
    "reason": "分诊理由(50字以内)"
  }
  患者主诉：{{userDesc}}`,
  input: [
    { name: 'userDesc', type: 'string', required: true }
  ],
  output: [
    { name: 'department', type: 'string', required: true },
    { name: 'reason', type: 'string' }
  ]
});

// Set input data
triageTask.updateData('userDesc', '患者描述的症状...');

// Execute the task
await triageTask.execute();

// Get results
console.log(triageTask.output); // { department: '内科', reason: '根据症状描述判断...' }
```