diff --git a/playground/src/app/home/page.tsx b/playground/src/app/home/page.tsx index aa5adfec..a94b9ba9 100644 --- a/playground/src/app/home/page.tsx +++ b/playground/src/app/home/page.tsx @@ -3,6 +3,7 @@ import AuthInitializer from "@/components/authInitializer" import { isMobile } from "@/common" import dynamic from 'next/dynamic' +import { useEffect, useState } from "react" const PCEntry = dynamic(() => import('@/platform/pc/entry'), { ssr: false, @@ -13,10 +14,16 @@ const MobileEntry = dynamic(() => import('@/platform/mobile/entry'), { }) export default function Home() { + const [mobile, setMobile] = useState(null); + + useEffect(() => { + setMobile(isMobile()) + }) return ( + mobile === null ? <> : - {isMobile() ? : } + {mobile ? : } ); } diff --git a/playground/src/common/constant.ts b/playground/src/common/constant.ts index 2602e7b1..a04435ca 100644 --- a/playground/src/common/constant.ts +++ b/playground/src/common/constant.ts @@ -1,4 +1,4 @@ -import { IOptions, ColorItem, LanguageOptionItem, VoiceOptionItem, GraphNameOptionItem, GraphOptionItem } from "@/types" +import { IOptions, ColorItem, LanguageOptionItem, VoiceOptionItem, GraphOptionItem } from "@/types" export const REQUEST_URL = process.env.NEXT_PUBLIC_REQUEST_URL ?? "" export const GITHUB_URL = "https://github.com/rte-design/ASTRA.ai" diff --git a/playground/src/platform/mobile/description/index.tsx b/playground/src/platform/mobile/description/index.tsx index 03d8f53b..66425d8f 100644 --- a/playground/src/platform/mobile/description/index.tsx +++ b/playground/src/platform/mobile/description/index.tsx @@ -17,6 +17,7 @@ const Description = () => { const userId = useAppSelector(state => state.global.options.userId) const language = useAppSelector(state => state.global.language) const voiceType = useAppSelector(state => state.global.voiceType) + const graphName = useAppSelector(state => state.global.graphName) const [loading, setLoading] = useState(false) useEffect(() => { @@ -44,14 +45,12 @@ const Description = () => { 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, - graphName: graph_name, + language, + voiceType, + graphName, }) const { code, msg } = res || {} if (code != 0) { diff --git a/server/internal/config.go b/server/internal/config.go index 7a19d63f..ac5bf763 100644 --- a/server/internal/config.go +++ b/server/internal/config.go @@ -12,17 +12,20 @@ type Prop struct { const ( // Extension name - extensionNameAgoraRTC = "agora_rtc" - extensionNameAzureTTS = "azure_tts" - extensionNameBedrockLLM = "bedrock_llm" - extensionNameCosyTTS = "cosy_tts" - extensionNameElevenlabsTTS = "elevenlabs_tts" - extensionNameGeminiLLM = "gemini_llm" - extensionNameLiteLLM = "litellm" - extensionNameOpenaiChatgpt = "openai_chatgpt" - extensionNamePollyTTS = "polly_tts" - extensionNameQwenLLM = "qwen_llm" - extensionNameTranscribeAsr = "transcribe_asr" + extensionNameAgoraRTC = "agora_rtc" + extensionNameAzureTTS = "azure_tts" + extensionNameBedrockLLM = "bedrock_llm" + extensionNameCosyTTS = "cosy_tts" + extensionNameElevenlabsTTS = "elevenlabs_tts" + extensionNameGeminiLLM = "gemini_llm" + extensionNameLiteLLM = "litellm" + extensionNameOpenaiChatgpt = "openai_chatgpt" + extensionNamePollyTTS = "polly_tts" + extensionNameQwenLLM = "qwen_llm" + extensionNameTranscribeAsr = "transcribe_asr" + extensionNameHttpServer = "http_server" + extensionNameAliyunAnalyticdbVectorStorage = "aliyun_analyticdb_vector_storage" + extensionNameAliyunTextEmbedding = "aliyun_text_embedding" // Language languageChinese = "zh-CN"