exporting parseReasoningFromString()

874affb2f295994c228e9729dd3912e27cee67ed

qvink <qvink@users.noreply.github.com>

2 files changed, +3 -2Ignore whitespace
public/scripts/reasoning.js+1 -1
@@ -1075,7 +1075,7 @@ export function removeReasoningFromString(str) {
10751075 * @param {boolean} [options.strict=true] Whether the reasoning block **has** to be at the beginning of the provided string (excluding whitespaces), or can be anywhere in it
10761076 * @returns {ParsedReasoning|null} Parsed reasoning block and message content
10771077 */
10781078export function parseReasoningFromString(str, { strict = true } = {}) {
10791079 // Both prefix and suffix must be defined
10801080 if (!power_user.reasoning.prefix || !power_user.reasoning.suffix) {
10811081 return null;
public/scripts/st-context.js+2 -1
@@ -79,7 +79,7 @@ import { timestampToMoment, uuidv4 } from './utils.js';
7979import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';
8080import { convertCharacterBook, loadWorldInfo, saveWorldInfo, updateWorldInfoList } from './world-info.js';
8181import { ChatCompletionService, TextCompletionService } from './custom-request.js';
8282import { updateReasoningUI, parseReasoningFromString } from './reasoning.js';
8383
8484export function getContext() {
8585 return {
@@ -213,6 +213,7 @@ export function getContext() {
213213 ChatCompletionService,
214214 TextCompletionService,
215215 updateReasoningUI,
216+ parseReasoningFromString,
216217 unshallowCharacter,
217218 unshallowGroupMembers,
218219 };