@@ -4,7 +4,6 @@ import { AbstractController } from "../../../../abstract/controller";
44import { Controller } from "../../../../decorator/Controller" ;
55import { AI_SERVER_URL_CN , AI_SERVER_URL_EN } from "./const" ;
66import { Status } from "../../../../constants/Project" ;
7-
87@Controller < RequestType , any > ( {
98 method : "post" ,
109 path : "agora/ai/start" ,
@@ -14,7 +13,7 @@ export class AgoraAIStart extends AbstractController<RequestType, any> {
1413 public static readonly schema : FastifySchema < RequestType > = {
1514 body : {
1615 type : "object" ,
17- required : [ "request_id" , "channel_name" , "user_uid" , "language" , "scene" , " role"] ,
16+ required : [ "request_id" , "channel_name" , "user_uid" , "language" , "role" ] ,
1817 properties : {
1918 request_id : {
2019 type : "string" ,
@@ -23,14 +22,11 @@ export class AgoraAIStart extends AbstractController<RequestType, any> {
2322 type : "string" ,
2423 } ,
2524 user_uid : {
26- type : "string " ,
25+ type : "number " ,
2726 } ,
2827 language : {
2928 type : "string" ,
3029 } ,
31- scene : {
32- type : "string" ,
33- } ,
3430 role : {
3531 type : "string" ,
3632 } ,
@@ -40,7 +36,7 @@ export class AgoraAIStart extends AbstractController<RequestType, any> {
4036
4137 public async execute ( ) : Promise < Response < any > > {
4238 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 ;
4440 const res = await ax . post < any > ( `${ api } /start` , {
4541 request_id,
4642 channel_name,
@@ -56,7 +52,7 @@ export class AgoraAIStart extends AbstractController<RequestType, any> {
5652
5753 return {
5854 status : Status . Success ,
59- data : res ,
55+ data : res . data ,
6056 }
6157 }
6258
@@ -69,9 +65,8 @@ interface RequestType {
6965 body : {
7066 request_id : string ;
7167 channel_name : string ;
72- user_uid : string ;
68+ user_uid : number ;
7369 language : string ;
74- scene : string ;
7570 role : string ;
7671 } ;
7772}
0 commit comments