@@ -4,7 +4,6 @@ import { AbstractController } from "../../../../abstract/controller";
4
4
import { Controller } from "../../../../decorator/Controller" ;
5
5
import { AI_SERVER_URL_CN , AI_SERVER_URL_EN } from "./const" ;
6
6
import { Status } from "../../../../constants/Project" ;
7
-
8
7
@Controller < RequestType , any > ( {
9
8
method : "post" ,
10
9
path : "agora/ai/start" ,
@@ -14,7 +13,7 @@ export class AgoraAIStart extends AbstractController<RequestType, any> {
14
13
public static readonly schema : FastifySchema < RequestType > = {
15
14
body : {
16
15
type : "object" ,
17
- required : [ "request_id" , "channel_name" , "user_uid" , "language" , "scene" , " role"] ,
16
+ required : [ "request_id" , "channel_name" , "user_uid" , "language" , "role" ] ,
18
17
properties : {
19
18
request_id : {
20
19
type : "string" ,
@@ -23,14 +22,11 @@ export class AgoraAIStart extends AbstractController<RequestType, any> {
23
22
type : "string" ,
24
23
} ,
25
24
user_uid : {
26
- type : "string " ,
25
+ type : "number " ,
27
26
} ,
28
27
language : {
29
28
type : "string" ,
30
29
} ,
31
- scene : {
32
- type : "string" ,
33
- } ,
34
30
role : {
35
31
type : "string" ,
36
32
} ,
@@ -40,7 +36,7 @@ export class AgoraAIStart extends AbstractController<RequestType, any> {
40
36
41
37
public async execute ( ) : Promise < Response < any > > {
42
38
const { request_id, channel_name, user_uid, language, role } = this . body ;
43
- const api = language === "cn " ? AI_SERVER_URL_CN : AI_SERVER_URL_EN ;
39
+ const api = language === "zh " ? AI_SERVER_URL_CN : AI_SERVER_URL_EN ;
44
40
const res = await ax . post < any > ( `${ api } /start` , {
45
41
request_id,
46
42
channel_name,
@@ -56,7 +52,7 @@ export class AgoraAIStart extends AbstractController<RequestType, any> {
56
52
57
53
return {
58
54
status : Status . Success ,
59
- data : res ,
55
+ data : res . data ,
60
56
}
61
57
}
62
58
@@ -69,9 +65,8 @@ interface RequestType {
69
65
body : {
70
66
request_id : string ;
71
67
channel_name : string ;
72
- user_uid : string ;
68
+ user_uid : number ;
73
69
language : string ;
74
- scene : string ;
75
70
role : string ;
76
71
} ;
77
72
}
0 commit comments