mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
exporting parseReasoningFromString()
This commit is contained in:
@@ -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;
|
||||||
|
@@ -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,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user