Add support for Xfyun ASR and TTS services in the backend
- Introduce new Xfyun ASR and TTS services, enabling integration with iFlytek's voice recognition and synthesis capabilities. - Update AssistantConfig model to include interface types for STT and TTS. - Enhance credential testing to validate Xfyun credentials. - Modify service factory to create Xfyun services based on configuration. - Update README with new configuration details for Xfyun integration. - Add new frontend components for visualizing audio streams and managing user interactions.
This commit is contained in:
@@ -60,6 +60,7 @@ import { AuraVisualizer } from "@/components/ui/aura-visualizer";
|
||||
import { NebulaVisualizer } from "@/components/ui/nebula-visualizer";
|
||||
import { SpectrumVisualizer } from "@/components/ui/spectrum-visualizer";
|
||||
import { WaveVisualizer } from "@/components/ui/wave-visualizer";
|
||||
import { WaveformTimelinePanel } from "@/components/ui/waveform-timeline";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
@@ -1856,6 +1857,7 @@ function DebugVoicePanel({
|
||||
error,
|
||||
micWarning,
|
||||
localStream,
|
||||
remoteStream,
|
||||
messages,
|
||||
audioInputs,
|
||||
selectedDeviceId,
|
||||
@@ -2032,6 +2034,13 @@ function DebugVoicePanel({
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 底部双轨波形:用户麦克风 + 助手音频,可折叠 */}
|
||||
<WaveformTimelinePanel
|
||||
userStream={localStream}
|
||||
agentStream={remoteStream}
|
||||
active={status === "connected"}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -809,11 +809,18 @@ export function ComponentsModelsPage() {
|
||||
htmlFor="model-api-key"
|
||||
hint={{
|
||||
description:
|
||||
"访问模型服务的鉴权密钥,由服务商控制台生成,请妥善保管勿泄露。",
|
||||
example: "sk-xxxxxxxx",
|
||||
form.interfaceType === "xfyun"
|
||||
? "讯飞需要三段凭证,使用 JSON 存入现有 API Key 字段。"
|
||||
: "访问模型服务的鉴权密钥,由服务商控制台生成,请妥善保管勿泄露。",
|
||||
example:
|
||||
form.interfaceType === "xfyun"
|
||||
? '{"appId":"...","apiKey":"...","apiSecret":"..."}'
|
||||
: "sk-xxxxxxxx",
|
||||
}}
|
||||
>
|
||||
API Key
|
||||
{form.interfaceType === "xfyun"
|
||||
? "Xfyun Credential JSON"
|
||||
: "API Key"}
|
||||
</FieldLabel>
|
||||
{hasStoredApiKey && (
|
||||
<div className="mb-2 flex items-center gap-2 text-xs text-muted-foreground">
|
||||
@@ -832,7 +839,9 @@ export function ComponentsModelsPage() {
|
||||
placeholder={
|
||||
hasStoredApiKey
|
||||
? "已配置,留空则保持不变"
|
||||
: "请输入 API Key"
|
||||
: form.interfaceType === "xfyun"
|
||||
? '{"appId":"...","apiKey":"...","apiSecret":"..."}'
|
||||
: "请输入 API Key"
|
||||
}
|
||||
autoComplete="new-password"
|
||||
className="border-hairline-strong bg-background pr-10 text-foreground placeholder:text-muted-soft"
|
||||
@@ -852,6 +861,12 @@ export function ComponentsModelsPage() {
|
||||
仅显示当前密钥首尾用于识别。留空可保持原密钥,输入新值将覆盖原密钥。
|
||||
</p>
|
||||
)}
|
||||
{form.interfaceType === "xfyun" && (
|
||||
<p className="mt-2 text-xs leading-5 text-muted-foreground">
|
||||
ASR 的模型 ID 使用 iat;普通 TTS 使用 tts;超拟人 TTS 使用
|
||||
supertts。超拟人服务也可通过包含 /private/ 的 API URL 自动识别。
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user