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) {
1075 * @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 it1075 * @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
1076 * @returns {ParsedReasoning|null} Parsed reasoning block and message content1076 * @returns {ParsedReasoning|null} Parsed reasoning block and message content
1077 */1077 */
1078function parseReasoningFromString(str, { strict = true } = {}) {1078export function parseReasoningFromString(str, { strict = true } = {}) {
1079 // Both prefix and suffix must be defined1079 // Both prefix and suffix must be defined
1080 if (!power_user.reasoning.prefix || !power_user.reasoning.suffix) {1080 if (!power_user.reasoning.prefix || !power_user.reasoning.suffix) {
1081 return null;1081 return null;
public/scripts/st-context.js+2 -1
@@ -79,7 +79,7 @@ import { timestampToMoment, uuidv4 } from './utils.js';
79import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';79import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';
80import { convertCharacterBook, loadWorldInfo, saveWorldInfo, updateWorldInfoList } from './world-info.js';80import { convertCharacterBook, loadWorldInfo, saveWorldInfo, updateWorldInfoList } from './world-info.js';
81import { ChatCompletionService, TextCompletionService } from './custom-request.js';81import { ChatCompletionService, TextCompletionService } from './custom-request.js';
82import { updateReasoningUI } from './reasoning.js';82import { updateReasoningUI, parseReasoningFromString } from './reasoning.js';
8383
84export function getContext() {84export function getContext() {
85 return {85 return {
@@ -213,6 +213,7 @@ export function getContext() {
213 ChatCompletionService,213 ChatCompletionService,
214 TextCompletionService,214 TextCompletionService,
215 updateReasoningUI,215 updateReasoningUI,
216 parseReasoningFromString,
216 unshallowCharacter,217 unshallowCharacter,
217 unshallowGroupMembers,218 unshallowGroupMembers,
218 };219 };