diff --git a/src/v1/controller/agora/ai/ping.ts b/src/v1/controller/agora/ai/ping.ts index 25bce8b5..62bed14c 100644 --- a/src/v1/controller/agora/ai/ping.ts +++ b/src/v1/controller/agora/ai/ping.ts @@ -31,7 +31,7 @@ export class AgoraAIPing extends AbstractController { public async execute(): Promise> { const { request_id, channel_name, language } = this.body; - const api = language === "cn" ? AI_SERVER_URL_CN : AI_SERVER_URL_EN; + const api = language === "zh" ? AI_SERVER_URL_CN : AI_SERVER_URL_EN; const res = await ax.post(`${api}/ping`, { request_id, channel_name @@ -44,7 +44,7 @@ export class AgoraAIPing extends AbstractController { ) return { status: Status.Success, - data: res, + data: res.data, } } diff --git a/src/v1/controller/agora/ai/start.ts b/src/v1/controller/agora/ai/start.ts index 0a2da322..fd527924 100644 --- a/src/v1/controller/agora/ai/start.ts +++ b/src/v1/controller/agora/ai/start.ts @@ -4,7 +4,6 @@ import { AbstractController } from "../../../../abstract/controller"; import { Controller } from "../../../../decorator/Controller"; import { AI_SERVER_URL_CN, AI_SERVER_URL_EN } from "./const"; import { Status } from "../../../../constants/Project"; - @Controller({ method: "post", path: "agora/ai/start", @@ -14,7 +13,7 @@ export class AgoraAIStart extends AbstractController { public static readonly schema: FastifySchema = { body: { type: "object", - required: ["request_id", "channel_name", "user_uid", "language", "scene", "role"], + required: ["request_id", "channel_name", "user_uid", "language", "role"], properties: { request_id: { type: "string", @@ -23,14 +22,11 @@ export class AgoraAIStart extends AbstractController { type: "string", }, user_uid: { - type: "string", + type: "number", }, language: { type: "string", }, - scene: { - type: "string", - }, role: { type: "string", }, @@ -40,7 +36,7 @@ export class AgoraAIStart extends AbstractController { public async execute(): Promise> { const { request_id, channel_name, user_uid, language, role } = this.body; - const api = language === "cn" ? AI_SERVER_URL_CN : AI_SERVER_URL_EN; + const api = language === "zh" ? AI_SERVER_URL_CN : AI_SERVER_URL_EN; const res = await ax.post(`${api}/start`, { request_id, channel_name, @@ -56,7 +52,7 @@ export class AgoraAIStart extends AbstractController { return { status: Status.Success, - data: res, + data: res.data, } } @@ -69,9 +65,8 @@ interface RequestType { body: { request_id: string; channel_name: string; - user_uid: string; + user_uid: number; language: string; - scene: string; role: string; }; } diff --git a/src/v1/controller/agora/ai/stop.ts b/src/v1/controller/agora/ai/stop.ts index fed0aa67..26d5c248 100644 --- a/src/v1/controller/agora/ai/stop.ts +++ b/src/v1/controller/agora/ai/stop.ts @@ -31,7 +31,7 @@ export class AgoraAIStop extends AbstractController { public async execute(): Promise> { const { request_id, channel_name, language } = this.body; - const api = language === "cn" ? AI_SERVER_URL_CN : AI_SERVER_URL_EN; + const api = language === "zh" ? AI_SERVER_URL_CN : AI_SERVER_URL_EN; const res = await ax.post(`${api}/start`, { request_id, channel_name, @@ -44,7 +44,7 @@ export class AgoraAIStop extends AbstractController { ) return { status: Status.Success, - data: res, + data: res.data, } }