better type name, simplified context

This commit is contained in:
bmen25124
2025-03-13 02:27:03 +03:00
parent ddb77732f2
commit 92dacdb386
3 changed files with 5 additions and 7 deletions

View File

@ -3739,9 +3739,9 @@ async function sendMessage(prompt, image, generationType, additionalNegativePref
};
context.chat.push(message);
const messageId = context.chat.length - 1;
await eventSource.emit(event_types.MESSAGE_RECEIVED, messageId, 'stable-diffusion');
await eventSource.emit(event_types.MESSAGE_RECEIVED, messageId, 'extension');
context.addOneMessage(message);
await eventSource.emit(event_types.CHARACTER_MESSAGE_RENDERED, messageId, 'stable-diffusion');
await eventSource.emit(event_types.CHARACTER_MESSAGE_RENDERED, messageId, 'extension');
await context.saveChat();
}

View File

@ -246,9 +246,9 @@ export async function getGroupChat(groupId, reload = false) {
}
chat.push(mes);
await eventSource.emit(event_types.MESSAGE_RECEIVED, (chat.length - 1), 'group_first_message');
await eventSource.emit(event_types.MESSAGE_RECEIVED, (chat.length - 1), 'first_message');
addOneMessage(mes);
await eventSource.emit(event_types.CHARACTER_MESSAGE_RENDERED, (chat.length - 1), 'group_first_message');
await eventSource.emit(event_types.CHARACTER_MESSAGE_RENDERED, (chat.length - 1), 'first_message');
}
}
await saveGroupChat(groupId, false);

View File

@ -149,9 +149,7 @@ export function getContext() {
unregisterFunctionTool: ToolManager.unregisterFunctionTool.bind(ToolManager),
isToolCallingSupported: ToolManager.isToolCallingSupported.bind(ToolManager),
canPerformToolCalls: ToolManager.canPerformToolCalls.bind(ToolManager),
registerFunctionToolsOpenAI: ToolManager.registerFunctionToolsOpenAI.bind(ToolManager),
invokeFunctionTools: ToolManager.invokeFunctionTools.bind(ToolManager),
saveFunctionToolInvocations: ToolManager.saveFunctionToolInvocations.bind(ToolManager),
ToolManager,
registerDebugFunction,
/** @deprecated Use renderExtensionTemplateAsync instead. */
renderExtensionTemplate,