Update VOICE_CONFIG to use new FastGPT state-enabled configuration and add TEXT_DELTA log group for websocket responses.
This commit is contained in:
2
.env
2
.env
@@ -9,4 +9,4 @@ DELETE_SESSION_URL=http://101.89.151.141:3000/api/core/chat/delHistory?chatId={c
|
|||||||
DELETE_CHAT_URL=http://101.89.151.141:3000/api/core/chat/item/delete?contentId={contentId}&chatId={chatId}&appId={appId}
|
DELETE_CHAT_URL=http://101.89.151.141:3000/api/core/chat/item/delete?contentId={contentId}&chatId={chatId}&appId={appId}
|
||||||
GET_CHAT_RECORDS_URL=http://101.89.151.141:3000/api/core/chat/getPaginationRecords
|
GET_CHAT_RECORDS_URL=http://101.89.151.141:3000/api/core/chat/getPaginationRecords
|
||||||
|
|
||||||
VOICE_CONFIG=config/voice-xfyun.json
|
VOICE_CONFIG=config/voice-fastgpt-state-xfyunSuperTTS.json
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const MAX_WS_LOG_LINES = 120;
|
|||||||
const MAX_GROUP_CHILDREN_RENDER = 100;
|
const MAX_GROUP_CHILDREN_RENDER = 100;
|
||||||
const WS_LOG_GROUP_KEYS = {
|
const WS_LOG_GROUP_KEYS = {
|
||||||
AUDIO_DELTA: "recv:response.audio.delta",
|
AUDIO_DELTA: "recv:response.audio.delta",
|
||||||
|
TEXT_DELTA: "recv:response.text.delta",
|
||||||
AUDIO_SEND: "send:input.audio",
|
AUDIO_SEND: "send:input.audio",
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -205,6 +206,9 @@ function wsLogGroupLabel(groupKey) {
|
|||||||
if (groupKey === WS_LOG_GROUP_KEYS.AUDIO_DELTA) {
|
if (groupKey === WS_LOG_GROUP_KEYS.AUDIO_DELTA) {
|
||||||
return "response.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) {
|
if (groupKey === WS_LOG_GROUP_KEYS.AUDIO_SEND) {
|
||||||
return "input.audio binary";
|
return "input.audio binary";
|
||||||
}
|
}
|
||||||
@@ -430,6 +434,22 @@ function logWsPayload(direction, payload) {
|
|||||||
);
|
);
|
||||||
return;
|
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));
|
addWsLog(direction, compactWsPayload(payload));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user