|
@@ -1,9 +1,14 @@
|
|
|
import { Component,OnInit } from '@angular/core';
|
|
|
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonButton,IonIcon } from '@ionic/angular/standalone';
|
|
|
+import { IonHeader, IonToolbar, IonTitle, IonContent, IonButton,IonIcon, ModalController } from '@ionic/angular/standalone';
|
|
|
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 { 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';
|
|
|
addIcons({radioButtonOffOutline,reloadOutline,checkmarkCircleOutline,closeCircleOutline})
|
|
|
@Component({
|
|
|
selector: 'app-tab1',
|
|
@@ -17,7 +22,7 @@ addIcons({radioButtonOffOutline,reloadOutline,checkmarkCircleOutline,closeCircle
|
|
|
export class Tab1Page {
|
|
|
|
|
|
|
|
|
- constructor() {
|
|
|
+ constructor(private modalCtrl:ModalController) {
|
|
|
|
|
|
|
|
|
}
|
|
@@ -34,19 +39,12 @@ export class Tab1Page {
|
|
|
|
|
|
shareData:any = {}
|
|
|
|
|
|
+ // 任务:完成故事意境描述及图像绘制
|
|
|
doPoemTask(){
|
|
|
- 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
|
|
|
- }
|
|
|
+ // 产生: shareData.PictureDescResult 生成后描述
|
|
|
+ let task1 = TaskPoemPictureDesc({shareData:this.shareData,modalCtrl:this.modalCtrl});
|
|
|
+ // 产生: shareData.images 渲染后图片
|
|
|
+ let task2 = TaskPoemPictureCreate({shareData:this.shareData,modalCtrl:this.modalCtrl});
|
|
|
|
|
|
// 定义任务集
|
|
|
let PoemTaskList = [task1,task2]
|