exporting parseReasoningFromString()

This commit is contained in:
qvink
2025-03-12 17:01:03 -06:00
parent 37819df542
commit 874affb2f2
2 changed files with 3 additions and 2 deletions

View File

@@ -1075,7 +1075,7 @@ export function removeReasoningFromString(str) {
* @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 * @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
* @returns {ParsedReasoning|null} Parsed reasoning block and message content * @returns {ParsedReasoning|null} Parsed reasoning block and message content
*/ */
function parseReasoningFromString(str, { strict = true } = {}) { export function parseReasoningFromString(str, { strict = true } = {}) {
// Both prefix and suffix must be defined // Both prefix and suffix must be defined
if (!power_user.reasoning.prefix || !power_user.reasoning.suffix) { if (!power_user.reasoning.prefix || !power_user.reasoning.suffix) {
return null; return null;

View File

@@ -79,7 +79,7 @@ import { timestampToMoment, uuidv4 } from './utils.js';
import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js'; import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';
import { convertCharacterBook, loadWorldInfo, saveWorldInfo, updateWorldInfoList } from './world-info.js'; import { convertCharacterBook, loadWorldInfo, saveWorldInfo, updateWorldInfoList } from './world-info.js';
import { ChatCompletionService, TextCompletionService } from './custom-request.js'; import { ChatCompletionService, TextCompletionService } from './custom-request.js';
import { updateReasoningUI } from './reasoning.js'; import { updateReasoningUI, parseReasoningFromString } from './reasoning.js';
export function getContext() { export function getContext() {
return { return {
@@ -213,6 +213,7 @@ export function getContext() {
ChatCompletionService, ChatCompletionService,
TextCompletionService, TextCompletionService,
updateReasoningUI, updateReasoningUI,
parseReasoningFromString,
unshallowCharacter, unshallowCharacter,
unshallowGroupMembers, unshallowGroupMembers,
}; };