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