diff --git a/playground/src/common/request.ts b/playground/src/common/request.ts index 0100cd99..38eb3358 100644 --- a/playground/src/common/request.ts +++ b/playground/src/common/request.ts @@ -6,6 +6,7 @@ interface StartRequestConfig { userId: number, language: string voiceType: string + graphName: string | null } interface GenAgoraDataConfig { @@ -34,14 +35,15 @@ export const apiGenAgoraData = async (config: GenAgoraDataConfig) => { export const apiStartService = async (config: StartRequestConfig): Promise => { const url = `${REQUEST_URL}/start` - const { language, channel, userId, voiceType } = config + const { language, channel, userId, voiceType, graphName } = config const data = { request_id: genUUID(), agora_asr_language: language, channel_name: channel, openai_proxy_url: "", remote_stream_id: userId, - voice_type: voiceType + voice_type: voiceType, + graph_name: graphName } let resp: any = await fetch(url, { method: "POST", diff --git a/playground/src/components/setting/index.tsx b/playground/src/components/setting/index.tsx index d48feb30..b9328d47 100644 --- a/playground/src/components/setting/index.tsx +++ b/playground/src/components/setting/index.tsx @@ -51,11 +51,14 @@ const Setting = () => { message.success("Agent disconnected") stopPing() } else { + let params = new URLSearchParams(document.location.search); + let graph_name = params.get("graph_name"); const res = await apiStartService({ channel, userId, language: lang, - voiceType: voice + voiceType: voice, + graphName: graph_name, }) const { code, msg } = res || {} if (code != 0) {