| 1992 | */ | 1992 | */ |
| 1993 | export function renderStoryString(params, { customStoryString = null, customInstructSettings = null } = {}) { | 1993 | export function renderStoryString(params, { customStoryString = null, customInstructSettings = null } = {}) { |
| 1994 | try { | 1994 | try { |
| 1995 | const storyString = structuredClone(customStoryString ?? power_user.context.story_string); | 1995 | const storyString = customStoryString ?? power_user.context.story_string; |
| 1996 | const instructSettings = customInstructSettings ?? power_user.instruct; | 1996 | const instructSettings = structuredClone(customInstructSettings ?? power_user.instruct); |
| 1997 | | 1997 | |
| 1998 | // Validate and log possible warnings/errors | 1998 | // Validate and log possible warnings/errors |
| 1999 | validateStoryString(storyString, params); | 1999 | validateStoryString(storyString, params); |