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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user