Form new chat context

This commit is contained in:
Mark Ceter
2023-05-17 18:33:14 +00:00
parent d2803f6451
commit 64ac2b2f58
2 changed files with 96 additions and 6 deletions

View File

@ -169,6 +169,7 @@ export {
getStoppingStrings,
getStatus,
reloadMarkdownProcessor,
getCurrentChatId,
chat,
this_chid,
selected_button,
@ -485,6 +486,15 @@ function reloadMarkdownProcessor(render_formulas = false) {
return converter;
}
function getCurrentChatId() {
if (selected_group) {
return groups.find(x => x.id == selected_group)?.chat_id;
}
else if (this_chid) {
return characters[this_chid].chat;
}
}
const CHARACTERS_PER_TOKEN_RATIO = 3.35;
const talkativeness_default = 0.5;