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:
Xin Wang
2026-06-11 10:51:08 +08:00
parent c69dec04e0
commit e25dfd4003
19 changed files with 1595 additions and 71 deletions

View File

@@ -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>