diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 325964b1a..ec8a79bbc 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -22,7 +22,6 @@ Noticed something off? Have an idea? Check our [Issues tab](https://github.com/o > [!IMPORTANT] > > - **Template Compliance:** Please be aware that failure to follow the provided issue template, or not providing the requested information at all, will likely result in your issue being closed without further consideration. This approach is critical for maintaining the manageability and integrity of issue tracking. -> > - **Detail is Key:** To ensure your issue is understood and can be effectively addressed, it's imperative to include comprehensive details. Descriptions should be clear, including steps to reproduce, expected outcomes, and actual results. Lack of sufficient detail may hinder our ability to resolve your issue. ### 🧭 Scope of Support diff --git a/src/app.html b/src/app.html index 5d48e1d7e..718f7e194 100644 --- a/src/app.html +++ b/src/app.html @@ -1,4 +1,4 @@ - +
diff --git a/src/lib/apis/openai/index.ts b/src/lib/apis/openai/index.ts index 2a52ebb32..b075d634b 100644 --- a/src/lib/apis/openai/index.ts +++ b/src/lib/apis/openai/index.ts @@ -260,7 +260,7 @@ export const getOpenAIModelsDirect = async ( throw error; } - const models = Array.isArray(res) ? res : res?.data ?? null; + const models = Array.isArray(res) ? res : (res?.data ?? null); return models .map((model) => ({ id: model.id, name: model.name ?? model.id, external: true })) diff --git a/src/lib/components/ChangelogModal.svelte b/src/lib/components/ChangelogModal.svelte index 48156f924..6a24ea5d9 100644 --- a/src/lib/components/ChangelogModal.svelte +++ b/src/lib/components/ChangelogModal.svelte @@ -75,12 +75,12 @@ class="font-semibold uppercase text-xs {section === 'added' ? 'text-white bg-blue-600' : section === 'fixed' - ? 'text-white bg-green-600' - : section === 'changed' - ? 'text-white bg-yellow-600' - : section === 'removed' - ? 'text-white bg-red-600' - : ''} w-fit px-3 rounded-full my-2.5" + ? 'text-white bg-green-600' + : section === 'changed' + ? 'text-white bg-yellow-600' + : section === 'removed' + ? 'text-white bg-red-600' + : ''} w-fit px-3 rounded-full my-2.5" > {section} diff --git a/src/lib/components/admin/Settings/Documents.svelte b/src/lib/components/admin/Settings/Documents.svelte index 1b0b2c3fa..bac84902f 100644 --- a/src/lib/components/admin/Settings/Documents.svelte +++ b/src/lib/components/admin/Settings/Documents.svelte @@ -112,7 +112,7 @@ url: OpenAIUrl, batch_size: OpenAIBatchSize } - } + } : {}) }).catch(async (error) => { toast.error(error); diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 2c42c2046..a290d5d3d 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -579,8 +579,8 @@ let selectedModelIds = modelId ? [modelId] : atSelectedModel !== undefined - ? [atSelectedModel.id] - : selectedModels; + ? [atSelectedModel.id] + : selectedModels; // Create response messages for each selected model const responseMessageIds = {}; @@ -739,11 +739,11 @@ ? await getAndUpdateUserLocation(localStorage.token) : undefined )}${ - responseMessage?.userContext ?? null + (responseMessage?.userContext ?? null) ? `\n\nUser Context:\n${responseMessage?.userContext ?? ''}` : '' }` - } + } : undefined, ...messages ] @@ -811,10 +811,10 @@ options: { ...(params ?? $settings.params ?? {}), stop: - params?.stop ?? $settings?.params?.stop ?? undefined + (params?.stop ?? $settings?.params?.stop ?? undefined) ? (params?.stop.split(',').map((token) => token.trim()) ?? $settings.params.stop).map( (str) => decodeURIComponent(JSON.parse('"' + str.replace(/\"/g, '\\"') + '"')) - ) + ) : undefined, num_predict: params?.max_tokens ?? $settings?.params?.max_tokens ?? undefined, repeat_penalty: @@ -1056,10 +1056,10 @@ stream: true, model: model.id, stream_options: - model.info?.meta?.capabilities?.usage ?? false + (model.info?.meta?.capabilities?.usage ?? false) ? { include_usage: true - } + } : undefined, messages: [ params?.system || $settings.system || (responseMessage?.userContext ?? null) @@ -1072,11 +1072,11 @@ ? await getAndUpdateUserLocation(localStorage.token) : undefined )}${ - responseMessage?.userContext ?? null + (responseMessage?.userContext ?? null) ? `\n\nUser Context:\n${responseMessage?.userContext ?? ''}` : '' }` - } + } : undefined, ...messages ] @@ -1092,7 +1092,7 @@ text: arr.length - 1 !== idx ? message.content - : message?.raContent ?? message.content + : (message?.raContent ?? message.content) }, ...message.files .filter((file) => file.type === 'image') @@ -1103,20 +1103,20 @@ } })) ] - } + } : { content: arr.length - 1 !== idx ? message.content - : message?.raContent ?? message.content - }) + : (message?.raContent ?? message.content) + }) })), seed: params?.seed ?? $settings?.params?.seed ?? undefined, stop: - params?.stop ?? $settings?.params?.stop ?? undefined + (params?.stop ?? $settings?.params?.stop ?? undefined) ? (params?.stop.split(',').map((token) => token.trim()) ?? $settings.params.stop).map( (str) => decodeURIComponent(JSON.parse('"' + str.replace(/\"/g, '\\"') + '"')) - ) + ) : undefined, temperature: params?.temperature ?? $settings?.params?.temperature ?? undefined, top_p: params?.top_p ?? $settings?.params?.top_p ?? undefined, diff --git a/src/lib/components/chat/MessageInput/CallOverlay.svelte b/src/lib/components/chat/MessageInput/CallOverlay.svelte index e28b4b5bd..ac14cc74e 100644 --- a/src/lib/components/chat/MessageInput/CallOverlay.svelte +++ b/src/lib/components/chat/MessageInput/CallOverlay.svelte @@ -609,10 +609,10 @@ style="font-size:{rmsLevel * 100 > 4 ? '4.5' : rmsLevel * 100 > 2 - ? '4.25' - : rmsLevel * 100 > 1 - ? '3.75' - : '3.5'}rem;width: 100%; text-align:center;" + ? '4.25' + : rmsLevel * 100 > 1 + ? '3.75' + : '3.5'}rem;width: 100%; text-align:center;" > {emoji} @@ -658,10 +658,10 @@ class=" {rmsLevel * 100 > 4 ? ' size-[4.5rem]' : rmsLevel * 100 > 2 - ? ' size-16' - : rmsLevel * 100 > 1 - ? 'size-14' - : 'size-12'} transition-all rounded-full {(model?.info?.meta + ? ' size-16' + : rmsLevel * 100 > 1 + ? 'size-14' + : 'size-12'} transition-all rounded-full {(model?.info?.meta ?.profile_image_url ?? '/static/favicon.png') !== '/static/favicon.png' ? ' bg-cover bg-center bg-no-repeat' : 'bg-black dark:bg-white'} bg-black dark:bg-white" @@ -691,10 +691,10 @@ style="font-size:{rmsLevel * 100 > 4 ? '13' : rmsLevel * 100 > 2 - ? '12' - : rmsLevel * 100 > 1 - ? '11.5' - : '11'}rem;width:100%;text-align:center;" + ? '12' + : rmsLevel * 100 > 1 + ? '11.5' + : '11'}rem;width:100%;text-align:center;" > {emoji} @@ -740,10 +740,10 @@ class=" {rmsLevel * 100 > 4 ? ' size-52' : rmsLevel * 100 > 2 - ? 'size-48' - : rmsLevel * 100 > 1 - ? 'size-[11.5rem]' - : 'size-44'} transition-all rounded-full {(model?.info?.meta + ? 'size-48' + : rmsLevel * 100 > 1 + ? 'size-[11.5rem]' + : 'size-44'} transition-all rounded-full {(model?.info?.meta ?.profile_image_url ?? '/static/favicon.png') !== '/static/favicon.png' ? ' bg-cover bg-center bg-no-repeat' : 'bg-black dark:bg-white'} " diff --git a/src/lib/components/chat/MessageInput/Documents.svelte b/src/lib/components/chat/MessageInput/Documents.svelte index 64c4bc458..50956e4c0 100644 --- a/src/lib/components/chat/MessageInput/Documents.svelte +++ b/src/lib/components/chat/MessageInput/Documents.svelte @@ -27,7 +27,7 @@ title: $i18n.t('All Documents'), collection_names: $documents.map((doc) => doc.collection_name) } - ] + ] : []), ...$documents .reduce((a, e, i, arr) => { diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 9e3c147b1..fb6754e86 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -305,7 +305,7 @@ {#each messages as message, messageIdx}