diff --git a/app/client/platforms/alibaba.ts b/app/client/platforms/alibaba.ts index 86229a147..57f8bc3fd 100644 --- a/app/client/platforms/alibaba.ts +++ b/app/client/platforms/alibaba.ts @@ -13,6 +13,7 @@ import { LLMApi, LLMModel, SpeechOptions, + TranscriptionOptions, MultimodalContent, } from "../api"; import Locale from "../../locales"; @@ -89,6 +90,10 @@ export class QwenApi implements LLMApi { throw new Error("Method not implemented."); } + transcription(options: TranscriptionOptions): Promise { + throw new Error("Method not implemented."); + } + async chat(options: ChatOptions) { const messages = options.messages.map((v) => ({ role: v.role, diff --git a/app/client/platforms/anthropic.ts b/app/client/platforms/anthropic.ts index 1a83bd53a..24f76f31d 100644 --- a/app/client/platforms/anthropic.ts +++ b/app/client/platforms/anthropic.ts @@ -1,5 +1,11 @@ import { Anthropic, ApiPath } from "@/app/constant"; -import { ChatOptions, getHeaders, LLMApi, SpeechOptions } from "../api"; +import { + ChatOptions, + getHeaders, + LLMApi, + SpeechOptions, + TranscriptionOptions, +} from "../api"; import { useAccessStore, useAppConfig, @@ -77,6 +83,10 @@ export class ClaudeApi implements LLMApi { throw new Error("Method not implemented."); } + transcription(options: TranscriptionOptions): Promise { + throw new Error("Method not implemented."); + } + extractMessage(res: any) { console.log("[Response] claude response: ", res); diff --git a/app/client/platforms/baidu.ts b/app/client/platforms/baidu.ts index 2511a696b..a809183c0 100644 --- a/app/client/platforms/baidu.ts +++ b/app/client/platforms/baidu.ts @@ -15,6 +15,7 @@ import { LLMModel, MultimodalContent, SpeechOptions, + TranscriptionOptions, } from "../api"; import Locale from "../../locales"; import { @@ -81,6 +82,10 @@ export class ErnieApi implements LLMApi { throw new Error("Method not implemented."); } + transcription(options: TranscriptionOptions): Promise { + throw new Error("Method not implemented."); + } + async chat(options: ChatOptions) { const messages = options.messages.map((v) => ({ // "error_code": 336006, "error_msg": "the role of message with even index in the messages must be user or function", diff --git a/app/client/platforms/bytedance.ts b/app/client/platforms/bytedance.ts index 000a9e278..25b45e485 100644 --- a/app/client/platforms/bytedance.ts +++ b/app/client/platforms/bytedance.ts @@ -14,6 +14,7 @@ import { LLMModel, MultimodalContent, SpeechOptions, + TranscriptionOptions, } from "../api"; import Locale from "../../locales"; import { @@ -83,6 +84,10 @@ export class DoubaoApi implements LLMApi { throw new Error("Method not implemented."); } + transcription(options: TranscriptionOptions): Promise { + throw new Error("Method not implemented."); + } + async chat(options: ChatOptions) { const messages = options.messages.map((v) => ({ role: v.role, diff --git a/app/client/platforms/google.ts b/app/client/platforms/google.ts index 7265a500b..40d49373e 100644 --- a/app/client/platforms/google.ts +++ b/app/client/platforms/google.ts @@ -6,6 +6,7 @@ import { LLMModel, LLMUsage, SpeechOptions, + TranscriptionOptions, } from "../api"; import { useAccessStore, @@ -68,6 +69,10 @@ export class GeminiProApi implements LLMApi { throw new Error("Method not implemented."); } + transcription(options: TranscriptionOptions): Promise { + throw new Error("Method not implemented."); + } + async chat(options: ChatOptions): Promise { const apiClient = this; let multimodal = false; diff --git a/app/client/platforms/iflytek.ts b/app/client/platforms/iflytek.ts index 55a39d0cc..fcff72ca6 100644 --- a/app/client/platforms/iflytek.ts +++ b/app/client/platforms/iflytek.ts @@ -13,6 +13,7 @@ import { LLMApi, LLMModel, SpeechOptions, + TranscriptionOptions, } from "../api"; import Locale from "../../locales"; import { @@ -64,6 +65,10 @@ export class SparkApi implements LLMApi { throw new Error("Method not implemented."); } + transcription(options: TranscriptionOptions): Promise { + throw new Error("Method not implemented."); + } + async chat(options: ChatOptions) { const messages: ChatOptions["messages"] = []; for (const v of options.messages) { diff --git a/app/client/platforms/moonshot.ts b/app/client/platforms/moonshot.ts index e0ef3494f..b32e4213a 100644 --- a/app/client/platforms/moonshot.ts +++ b/app/client/platforms/moonshot.ts @@ -20,6 +20,7 @@ import { LLMApi, LLMModel, SpeechOptions, + TranscriptionOptions, } from "../api"; import { getClientConfig } from "@/app/config/client"; import { getMessageTextContent } from "@/app/utils"; @@ -63,6 +64,10 @@ export class MoonshotApi implements LLMApi { throw new Error("Method not implemented."); } + transcription(options: TranscriptionOptions): Promise { + throw new Error("Method not implemented."); + } + async chat(options: ChatOptions) { const messages: ChatOptions["messages"] = []; for (const v of options.messages) { diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 0ba062b75..029eeb074 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -34,6 +34,7 @@ import { LLMUsage, MultimodalContent, SpeechOptions, + TranscriptionOptions, } from "../api"; import Locale from "../../locales"; import { getClientConfig } from "@/app/config/client"; diff --git a/app/client/platforms/tencent.ts b/app/client/platforms/tencent.ts index 3610fac0a..67ad64dcb 100644 --- a/app/client/platforms/tencent.ts +++ b/app/client/platforms/tencent.ts @@ -9,6 +9,7 @@ import { LLMModel, MultimodalContent, SpeechOptions, + TranscriptionOptions, } from "../api"; import Locale from "../../locales"; import { @@ -93,6 +94,10 @@ export class HunyuanApi implements LLMApi { throw new Error("Method not implemented."); } + transcription(options: TranscriptionOptions): Promise { + throw new Error("Method not implemented."); + } + async chat(options: ChatOptions) { const visionModel = isVisionModel(options.config.model); const messages = options.messages.map((v, index) => ({ diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 43718aa32..a1584d899 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -99,6 +99,7 @@ import { } from "./ui-lib"; import { useNavigate } from "react-router-dom"; import { + CHAT_PAGE_SIZE, DEFAULT_STT_ENGINE, DEFAULT_TTS_ENGINE, FIREFOX_DEFAULT_STT_ENGINE, diff --git a/app/locales/cn.ts b/app/locales/cn.ts index e5bcca0ed..eaa799a04 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -538,6 +538,16 @@ const cn = { SubTitle: "生成语音的速度", }, }, + STT: { + Enable: { + Title: "启用语音转文本", + SubTitle: "启用语音转文本", + }, + Engine: { + Title: "转换引擎", + SubTitle: "音频转换引擎", + }, + }, }, Store: { DefaultTopic: "新的聊天", diff --git a/app/locales/en.ts b/app/locales/en.ts index 120457522..f715d0889 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -546,6 +546,16 @@ const en: LocaleType = { }, Engine: "TTS Engine", }, + STT: { + Enable: { + Title: "Enable STT", + SubTitle: "Enable Speech-to-Text", + }, + Engine: { + Title: "STT Engine", + SubTitle: "Text-to-Speech Engine", + }, + }, }, Store: { DefaultTopic: "New Conversation",