fix log bug
This commit is contained in:
@@ -398,8 +398,11 @@ const refineMessage = async (messageId: string) => {
|
|||||||
|
|
||||||
if (!settings.enableStreaming) {
|
if (!settings.enableStreaming) {
|
||||||
const fullResponseJson = JSON.parse(response);
|
const fullResponseJson = JSON.parse(response);
|
||||||
|
settings.addLog('response', fullResponseJson);
|
||||||
const refinedText = fullResponseJson.choices?.[0]?.message?.content || response;
|
const refinedText = fullResponseJson.choices?.[0]?.message?.content || response;
|
||||||
settings.updateChatMessage(activeSession.value.id, messageId, { translated: refinedText });
|
settings.updateChatMessage(activeSession.value.id, messageId, { translated: refinedText });
|
||||||
|
} else {
|
||||||
|
settings.addLog('response', '(Streaming output captured)');
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
settings.addLog('error', String(err));
|
settings.addLog('error', String(err));
|
||||||
|
|||||||
Reference in New Issue
Block a user