filter ``\ncommitmsg to
``commitmsg
This commit is contained in:
parent
8ab29050e6
commit
93714a2255
@ -108,7 +108,8 @@ export async function sendMessage(message: any, panel: vscode.WebviewPanel): Pro
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onData = (partialResponse: ChatResponse) => {
|
const onData = (partialResponse: ChatResponse) => {
|
||||||
MessageHandler.sendMessage(panel, { command: 'receiveMessagePartial', text: partialResponse.response, user: partialResponse.user, date: partialResponse.date }, false);
|
const responseText = partialResponse.response.replace(/```\ncommitmsg/g, "```commitmsg");
|
||||||
|
MessageHandler.sendMessage(panel, { command: 'receiveMessagePartial', text: responseText, user: partialResponse.user, date: partialResponse.date }, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const chatResponse = await devChat.chat(parsedMessage.text, chatOptions, onData);
|
const chatResponse = await devChat.chat(parsedMessage.text, chatOptions, onData);
|
||||||
@ -117,7 +118,8 @@ export async function sendMessage(message: any, panel: vscode.WebviewPanel): Pro
|
|||||||
messageHistory.add(panel, {request: message.text, text: parsedMessage.text, parent_hash, hash: chatResponse['prompt-hash'], user: chatResponse.user, date: chatResponse.date });
|
messageHistory.add(panel, {request: message.text, text: parsedMessage.text, parent_hash, hash: chatResponse['prompt-hash'], user: chatResponse.user, date: chatResponse.date });
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageHandler.sendMessage(panel, { command: 'receiveMessage', text: chatResponse.response, hash: chatResponse['prompt-hash'], user: chatResponse.user, date: chatResponse.date, isError: chatResponse.isError });
|
const responseText = chatResponse.response.replace(/```\ncommitmsg/g, "```commitmsg");
|
||||||
|
MessageHandler.sendMessage(panel, { command: 'receiveMessage', text: responseText, hash: chatResponse['prompt-hash'], user: chatResponse.user, date: chatResponse.date, isError: chatResponse.isError });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user