diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 82300969c..5b3315844 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -24,5 +24,8 @@ module.exports = { browser: true, es2017: true, node: true + }, + globals: { + globalThis: false // false means it is not writeable } }; diff --git a/src/lib/commandCenter/panels/ai.svelte b/src/lib/commandCenter/panels/ai.svelte index 6eb8a3de5..a8b4486a9 100644 --- a/src/lib/commandCenter/panels/ai.svelte +++ b/src/lib/commandCenter/panels/ai.svelte @@ -10,8 +10,10 @@ import CoolerAppwrite from '$lib/images/appwrite-cooler.svg'; import { VARS } from '$lib/system'; + const endpoint = VARS.APPWRITE_ENDPOINT ?? `${globalThis?.location?.origin}/v1`; + const { input, handleSubmit, completion, isLoading, complete } = useCompletion({ - api: VARS.APPWRITE_ENDPOINT + '/console/assistant' + api: endpoint + '/console/assistant' }); const examples = [