From 08ff1d8d8883fdb43142b6c86b1b01ca675bd9be Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 29 Mar 2025 15:03:10 -0700 Subject: [PATCH] refac --- src/lib/components/common/Collapsible.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/components/common/Collapsible.svelte b/src/lib/components/common/Collapsible.svelte index 9e7fc36bb..dfed04acf 100644 --- a/src/lib/components/common/Collapsible.svelte +++ b/src/lib/components/common/Collapsible.svelte @@ -55,7 +55,7 @@ function formatJSONString(obj) { try { - const parsed = JSON.parse(obj); + const parsed = JSON.parse(JSON.parse(obj)); // If parsed is an object/array, then it's valid JSON if (typeof parsed === 'object') { return JSON.stringify(parsed, null, 2); @@ -192,8 +192,8 @@ {#if open && !hide}
{#if attributes?.type === 'tool_calls'} - {@const args = JSON.parse(decode(attributes?.arguments))} - {@const result = JSON.parse(decode(attributes?.result ?? ''))} + {@const args = decode(attributes?.arguments)} + {@const result = decode(attributes?.result ?? '')} {#if attributes?.done === 'true'}