|
@@ -3,13 +3,17 @@ import { IonHeader, IonToolbar, IonTitle, IonContent, IonButton,IonIcon, ModalCo
|
|
|
import { AgentTaskStep } from 'src/agent/agent.task';
|
|
|
import { addIcons } from 'ionicons';
|
|
|
import { radioButtonOffOutline, reloadOutline, checkmarkCircleOutline, closeCircleOutline } from 'ionicons/icons';
|
|
|
-import { startTask } from 'src/agent/agent.start';
|
|
|
+import { TaskExecutor } from 'src/agent/agent.start';
|
|
|
import { AgentUserInputComponent } from 'src/agent/agent-user-input/agent-user-input.component';
|
|
|
import { getUserInput } from 'src/agent/agent.input';
|
|
|
import { FmodeChatCompletion, ImagineWork, DalleOptions } from "fmode-ng";
|
|
|
import { TaskPoemPictureDesc } from 'src/agent/tasks/poem/poem-desc';
|
|
|
import { TaskPoemPictureCreate } from 'src/agent/tasks/poem/poem-picture';
|
|
|
import { DecimalPipe } from '@angular/common';
|
|
|
+import { TaskInqueryUserStory } from 'src/agent/tasks/inquiry/1.inquiry-user-story';
|
|
|
+import { extactAndParseJsonFromString } from 'src/agent/agent.json';
|
|
|
+import { TaskInqueryDoctorQuestion } from 'src/agent/tasks/inquiry/2.inquiry-doctor-question';
|
|
|
+import { TaskInqueryUserAnswer } from 'src/agent/tasks/inquiry/3.inquiry-user-answer';
|
|
|
addIcons({radioButtonOffOutline,reloadOutline,checkmarkCircleOutline,closeCircleOutline})
|
|
|
@Component({
|
|
|
selector: 'app-tab1',
|
|
@@ -52,46 +56,46 @@ export class Tab1Page {
|
|
|
// 传递给显示组件
|
|
|
this.taskList = PoemTaskList
|
|
|
// 开始执行任务
|
|
|
- startTask(PoemTaskList)
|
|
|
+ TaskExecutor(PoemTaskList)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ testJSON(){
|
|
|
+ let string = `
|
|
|
+ ''''json
|
|
|
+ {
|
|
|
+ "keshi": "神经内科",
|
|
|
+ "sympList": [
|
|
|
+ {
|
|
|
+ "title": "偏头痛",
|
|
|
+ "desc": "持续了2天的偏头疼",
|
|
|
+ "duration": "2天"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "title": "发冷",
|
|
|
+ "desc": "感觉发冷,已经有一天",
|
|
|
+ "duration": "1天"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ''''
|
|
|
+ `
|
|
|
+ console.log(extactAndParseJsonFromString(string))
|
|
|
+ }
|
|
|
+ // 任务集:医疗问诊任务集 完成一次完整的门诊服务
|
|
|
doInqueryTask(){
|
|
|
- let task1 = new AgentTaskStep({title:"导诊",shareData:this.shareData})
|
|
|
- task1.handle = async ()=>{
|
|
|
- await this.wait(1000)
|
|
|
- console.log("导诊:执行过程")
|
|
|
- task1.progress = 1
|
|
|
- }
|
|
|
- let task2 = new AgentTaskStep({title:"问诊",shareData:this.shareData})
|
|
|
- task2.handle = async ()=>{
|
|
|
- await this.wait(1000)
|
|
|
- console.log("问诊:执行过程")
|
|
|
- task2.progress = 1
|
|
|
- }
|
|
|
- let task3 = new AgentTaskStep({title:"初诊",shareData:this.shareData})
|
|
|
- task3.handle = async ()=>{
|
|
|
- await this.wait(1000)
|
|
|
- console.log("初诊:执行过程")
|
|
|
- task3.progress = 1
|
|
|
- }
|
|
|
- let task4 = new AgentTaskStep({title:"检验",shareData:this.shareData})
|
|
|
- task4.handle = async ()=>{
|
|
|
- await this.wait(1000)
|
|
|
- console.log("检验:执行过程")
|
|
|
- task4.progress = 1
|
|
|
- }
|
|
|
- let task5 = new AgentTaskStep({title:"处方",shareData:this.shareData})
|
|
|
- task5.handle = async ()=>{
|
|
|
- console.log("处方:执行过程")
|
|
|
- task5.progress = 1
|
|
|
- }
|
|
|
+ let task1 = TaskInqueryUserStory({shareData:this.shareData,modalCtrl:this.modalCtrl});
|
|
|
+ let task2 = TaskInqueryDoctorQuestion({shareData:this.shareData,modalCtrl:this.modalCtrl});
|
|
|
+ let task3 = TaskInqueryUserAnswer({shareData:this.shareData,modalCtrl:this.modalCtrl});
|
|
|
|
|
|
// 定义任务集
|
|
|
- let InquireServiceTaskList = [task1,task2,task3,task4,task5]
|
|
|
+ let InquireServiceTaskList = [
|
|
|
+ task1,task2,task3
|
|
|
+ ]
|
|
|
// 传递给显示组件
|
|
|
this.taskList = InquireServiceTaskList
|
|
|
// 开始执行任务
|
|
|
- startTask(InquireServiceTaskList)
|
|
|
+ TaskExecutor(InquireServiceTaskList)
|
|
|
}
|
|
|
|
|
|
|