Merge branch 'staging' into bogus-localstorage

This commit is contained in:
Cohee
2025-02-12 10:38:54 +02:00
2 changed files with 17 additions and 2 deletions

View File

@@ -446,6 +446,20 @@ function setReasoningEventHandlers() {
});
}
/**
* Removes reasoning from a string if auto-parsing is enabled.
* @param {string} str Input string
* @returns {string} Output string
*/
export function removeReasoningFromString(str) {
if (!power_user.reasoning.auto_parse) {
return str;
}
const parsedReasoning = parseReasoningFromString(str);
return parsedReasoning?.content ?? str;
}
/**
* Parses reasoning from a string using the power user reasoning settings.
* @typedef {Object} ParsedReasoning