Add configuration files for FastGPT with XFYun services, including STT, TTS, and audio filtering settings. Introduce new JSON files for different service configurations and enhance logging for text delta responses in the web application.

This commit is contained in:
Xin Wang
2026-05-28 13:28:36 +08:00
parent 2d5fd65721
commit ad232fdbd9
5 changed files with 410 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ const MAX_WS_LOG_LINES = 120;
const MAX_GROUP_CHILDREN_RENDER = 100;
const WS_LOG_GROUP_KEYS = {
AUDIO_DELTA: "recv:response.audio.delta",
TEXT_DELTA: "recv:response.text.delta",
AUDIO_SEND: "send:input.audio",
};
@@ -205,6 +206,9 @@ function wsLogGroupLabel(groupKey) {
if (groupKey === WS_LOG_GROUP_KEYS.AUDIO_DELTA) {
return "response.audio.delta";
}
if (groupKey === WS_LOG_GROUP_KEYS.TEXT_DELTA) {
return "response.text.delta";
}
if (groupKey === WS_LOG_GROUP_KEYS.AUDIO_SEND) {
return "input.audio binary";
}
@@ -430,6 +434,22 @@ function logWsPayload(direction, payload) {
);
return;
}
if (direction === "recv" && payload?.type === "response.text.delta") {
const text = typeof payload.text === "string" ? payload.text : "";
const bytes = new TextEncoder().encode(text).length;
const detail =
payload.seq != null
? `seq=${payload.seq} ${JSON.stringify(truncateLogValue(text, 120))}`
: JSON.stringify(truncateLogValue(text, 120));
appendWsLogGroupItem(
WS_LOG_GROUP_KEYS.TEXT_DELTA,
"recv",
"recv",
detail,
bytes,
);
return;
}
addWsLog(direction, compactWsPayload(payload));
}