diff --git a/src/lib/ae_elements/AE_AITools.svelte b/src/lib/ae_elements/AE_AITools.svelte index 1b1b5d5f..ad6529a3 100644 --- a/src/lib/ae_elements/AE_AITools.svelte +++ b/src/lib/ae_elements/AE_AITools.svelte @@ -39,18 +39,26 @@ let { content, summary = $bindable(), - model = $bindable('dgrzone-deepseek-8b-quick'), - baseUrl = $bindable('https://ai.dgrzone.com/api'), - token = $bindable(''), - systemPrompt = $bindable('You are a helpful assistant.'), - maxTokens = $bindable(512), - temperature = $bindable(0.7), + model = $bindable(), + baseUrl = $bindable(), + token = $bindable(), + systemPrompt = $bindable(), + maxTokens = $bindable(), + temperature = $bindable(), onSave, onSyncConfig, buttonClass = "btn btn-sm preset-tonal-primary shadow-lg hover:scale-105 transition-all", log_lvl = 0 }: Props = $props(); + // Apply defaults if undefined (Safe for Svelte 5 Runes) + if (model === undefined) model = 'dgrzone-deepseek-8b-quick'; + if (baseUrl === undefined) baseUrl = 'https://ai.dgrzone.com/api'; + if (token === undefined) token = ''; + if (systemPrompt === undefined) systemPrompt = 'You are a helpful assistant.'; + if (maxTokens === undefined) maxTokens = 512; + if (temperature === undefined) temperature = 0.7; + // Internal State let ae_promises: any = $state(null); let show_modal = $state(false); diff --git a/src/lib/app_components/e_app_codemirror_v5.svelte b/src/lib/app_components/e_app_codemirror_v5.svelte index 16b431e5..675c846c 100644 --- a/src/lib/app_components/e_app_codemirror_v5.svelte +++ b/src/lib/app_components/e_app_codemirror_v5.svelte @@ -29,7 +29,7 @@ let { content = 'test test test test', - new_content = $bindable(''), + new_content = $bindable(), editorView = $bindable(), // Exposed for external control theme_mode = 'light', extensions = [],