{#if title !== null}
{:else}
{/if}
{#if attributes?.type === 'tool_calls'}
{@const args = decode(attributes?.arguments)}
{@const result = decode(attributes?.result ?? '')}
{@const files = parseJSONString(decode(attributes?.files ?? ''))}
{#if !grow}
{#if open && !hide}
{#if attributes?.type === 'tool_calls'}
{#if attributes?.done === 'true'}
\`\`\`json
> ${formatJSONString(args)}
> ${formatJSONString(result)}
> \`\`\``}
/>
{:else}
\`\`\`json
> ${formatJSONString(args)}
> \`\`\``}
/>
{/if}
{:else}
{/if}
{/if}
{#if attributes?.done === 'true'}
{#if typeof files === 'object'}
{#each files ?? [] as file, idx}
{#if file.startsWith('data:image/')}
{/if}
{/each}
{/if}
{/if}
{/if}
{:else if !grow}
{#if open && !hide}
{/if}
{/if}