File tree 3 files changed +7
-8
lines changed
3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import {Task} from "@/type.ts";
6
6
// import axios from "@/api";
7
7
8
8
export const useJobStore = defineStore ( "job" , ( ) => {
9
- let _job ;
9
+ let _job : Task ;
10
10
11
11
async function fetchData ( task : string ) {
12
12
const res = ( ( await mockFetchJob ( task ) ) as { data : any } ) . data ;
@@ -33,7 +33,7 @@ export const useJobStore = defineStore("job", () => {
33
33
34
34
const job = computed ( ( ) => {
35
35
if ( ! _job ) {
36
- return new Task ( ) ;
36
+ return null ;
37
37
} else {
38
38
return _job ;
39
39
}
Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ export const useSessionStore = defineStore("session", () => {
19
19
} ) ;
20
20
const graphShow = ref ( false ) ;
21
21
22
+ // TODO chatted?
22
23
async function chatted ( ) {
23
- if ( ! dataStore . job . name ) {
24
+ if ( ! dataStore . job ) {
24
25
await dataStore . fetchData ( session . question ) ;
25
26
}
26
27
// session.question = "";
Original file line number Diff line number Diff line change @@ -5,12 +5,8 @@ export class Task {
5
5
6
6
constructor ( task : string , toolId : string , toolName : string ) {
7
7
this . name = task ;
8
- this . initTool ( toolId , toolName ) ;
9
- this . children = [ ] as Task [ ] ;
10
- }
11
-
12
- initTool ( toolId : string , toolName : string ) {
13
8
this . tool = new Tool ( toolId , toolName ) ;
9
+ this . children = [ ] as Task [ ] ;
14
10
}
15
11
16
12
addChild ( task : Task ) {
@@ -31,6 +27,8 @@ export class Tool {
31
27
constructor ( id : string , name : string ) {
32
28
this . id = id ;
33
29
this . name = name ;
30
+ this . description = "" ;
31
+ this . args = [ ] ;
34
32
}
35
33
}
36
34
You can’t perform that action at this time.
0 commit comments