From 70333c4dcf8f8fddb92eeab9352328a998fb5581 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 18:56:49 +0000 Subject: [PATCH] feat: Enable Code Interpreter via URL parameter Adds the ability to enable the Code Interpreter feature by appending `code-interpreter=true` to the chat URL. The `Chat.svelte` component's `initNewChat` function has been updated to parse this URL parameter. If present, it sets the `codeInterpreterEnabled` state variable to true. This change leverages the existing mechanisms for: - Saving and restoring `codeInterpreterEnabled` state to/from localStorage. - Displaying and toggling the Code Interpreter state via the existing UI button in the `MessageInput` component. No new UI elements were added as the existing UI correctly reflects the feature's state. --- src/lib/components/chat/Chat.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 89fa81462..bb4544b78 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -813,6 +813,10 @@ imageGenerationEnabled = true; } + if ($page.url.searchParams.get('code-interpreter') === 'true') { + codeInterpreterEnabled = true; + } + if ($page.url.searchParams.get('tools')) { selectedToolIds = $page.url.searchParams .get('tools')