mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-07 05:05:50 +00:00
Update ui-bindings.js
This commit is contained in:
@@ -732,14 +732,8 @@ function addMessage(role, content) {
|
|||||||
.replace(/<tool_code(?:\s+[^>]*)?>[\s\S]*?<\/tool_code>/gi, '')
|
.replace(/<tool_code(?:\s+[^>]*)?>[\s\S]*?<\/tool_code>/gi, '')
|
||||||
.trim();
|
.trim();
|
||||||
|
|
||||||
const tools = [
|
const toolNames = Object.keys(tools);
|
||||||
'read_world_info', 'read_world_entry', 'write_world_info_entry', 'create_world_book',
|
const regex = new RegExp(`<(${toolNames.join('|')})(?:\\s+[^>]*)?>[\\s\\S]*?<\\/\\1>`, 'gi');
|
||||||
'read_character_card', 'update_character_card', 'edit_character_text',
|
|
||||||
'edit_world_info_entry',
|
|
||||||
'manage_first_message', 'use_tool'
|
|
||||||
];
|
|
||||||
|
|
||||||
const regex = new RegExp(`<(${tools.join('|')})(?:\\s+[^>]*)?>[\\s\\S]*?<\\/\\1>`, 'gi');
|
|
||||||
displayContent = displayContent.replace(regex, '').trim();
|
displayContent = displayContent.replace(regex, '').trim();
|
||||||
|
|
||||||
if (!displayContent && role === 'executor') {
|
if (!displayContent && role === 'executor') {
|
||||||
|
|||||||
Reference in New Issue
Block a user