Commit 562e40a7 authored by Jun Siang Cheah's avatar Jun Siang Cheah
Browse files

Merge branch 'dev' into feat/trusted-email-header

parents 0e3b7a11 587a8c59
...@@ -360,4 +360,4 @@ ...@@ -360,4 +360,4 @@
"You": "Tu", "You": "Tu",
"You're a helpful assistant.": "Ets un assistent útil.", "You're a helpful assistant.": "Ets un assistent útil.",
"You're now logged in.": "Ara estàs connectat." "You're now logged in.": "Ara estàs connectat."
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
"code": "ja-JP", "code": "ja-JP",
"title": "Japanese" "title": "Japanese"
}, },
{
"code": "ko-KR",
"title": "Korean"
},
{ {
"code": "nl-NL", "code": "nl-NL",
"title": "Dutch (Netherlands)" "title": "Dutch (Netherlands)"
...@@ -67,4 +71,4 @@ ...@@ -67,4 +71,4 @@
"code": "zh-TW", "code": "zh-TW",
"title": "Chinese (Traditional)" "title": "Chinese (Traditional)"
} }
] ]
\ No newline at end of file
This diff is collapsed.
...@@ -360,4 +360,4 @@ ...@@ -360,4 +360,4 @@
"You": "Вы", "You": "Вы",
"You're a helpful assistant.": "Вы полезный ассистент.", "You're a helpful assistant.": "Вы полезный ассистент.",
"You're now logged in.": "Вы вошли в систему." "You're now logged in.": "Вы вошли в систему."
} }
\ No newline at end of file
This diff is collapsed.
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
let messagesContainerElement: HTMLDivElement; let messagesContainerElement: HTMLDivElement;
let currentRequestId = null; let currentRequestId = null;
let showModelSelector = false;
let selectedModels = ['']; let selectedModels = [''];
let selectedModelfile = null; let selectedModelfile = null;
...@@ -533,6 +534,8 @@ ...@@ -533,6 +534,8 @@
console.log(docs); console.log(docs);
console.log(model);
const res = await generateOpenAIChatCompletion( const res = await generateOpenAIChatCompletion(
localStorage.token, localStorage.token,
{ {
...@@ -585,7 +588,9 @@ ...@@ -585,7 +588,9 @@
max_tokens: $settings?.options?.num_predict ?? undefined, max_tokens: $settings?.options?.num_predict ?? undefined,
docs: docs.length > 0 ? docs : undefined docs: docs.length > 0 ? docs : undefined
}, },
model.source === 'litellm' ? `${LITELLM_API_BASE_URL}/v1` : `${OPENAI_API_BASE_URL}` model?.source?.toLowerCase() === 'litellm'
? `${LITELLM_API_BASE_URL}/v1`
: `${OPENAI_API_BASE_URL}`
); );
if (res && res.ok) { if (res && res.ok) {
...@@ -776,7 +781,7 @@ ...@@ -776,7 +781,7 @@
titleModelId, titleModelId,
userPrompt, userPrompt,
titleModel?.external ?? false titleModel?.external ?? false
? titleModel.source === 'litellm' ? titleModel?.source?.toLowerCase() === 'litellm'
? `${LITELLM_API_BASE_URL}/v1` ? `${LITELLM_API_BASE_URL}/v1`
: `${OPENAI_API_BASE_URL}` : `${OPENAI_API_BASE_URL}`
: `${OLLAMA_API_BASE_URL}/v1` : `${OLLAMA_API_BASE_URL}/v1`
...@@ -837,7 +842,16 @@ ...@@ -837,7 +842,16 @@
</svelte:head> </svelte:head>
<div class="h-screen max-h-[100dvh] w-full flex flex-col"> <div class="h-screen max-h-[100dvh] w-full flex flex-col">
<Navbar {title} shareEnabled={messages.length > 0} {initNewChat} {tags} {addTag} {deleteTag} /> <Navbar
{title}
bind:selectedModels
bind:showModelSelector
shareEnabled={messages.length > 0}
{initNewChat}
{tags}
{addTag}
{deleteTag}
/>
<div class="flex flex-col flex-auto"> <div class="flex flex-col flex-auto">
<div <div
class=" pb-2.5 flex flex-col justify-between w-full flex-auto overflow-auto h-0" class=" pb-2.5 flex flex-col justify-between w-full flex-auto overflow-auto h-0"
...@@ -849,15 +863,7 @@ ...@@ -849,15 +863,7 @@
messagesContainerElement.clientHeight + 5; messagesContainerElement.clientHeight + 5;
}} }}
> >
<div <div class=" h-full w-full flex flex-col pt-2 pb-4">
class="{$settings?.fullScreenMode ?? null
? 'max-w-full'
: 'max-w-2xl md:px-0'} mx-auto w-full px-4"
>
<ModelSelector bind:selectedModels />
</div>
<div class=" h-full w-full flex flex-col py-8">
<Messages <Messages
chatId={$chatId} chatId={$chatId}
{selectedModels} {selectedModels}
......
...@@ -56,8 +56,10 @@ ...@@ -56,8 +56,10 @@
let currentRequestId = null; let currentRequestId = null;
// let chatId = $page.params.id; // let chatId = $page.params.id;
let showModelSelector = false;
let selectedModels = ['']; let selectedModels = [''];
let selectedModelfile = null; let selectedModelfile = null;
$: selectedModelfile = $: selectedModelfile =
selectedModels.length === 1 && selectedModels.length === 1 &&
$modelfiles.filter((modelfile) => modelfile.tagName === selectedModels[0]).length > 0 $modelfiles.filter((modelfile) => modelfile.tagName === selectedModels[0]).length > 0
...@@ -600,7 +602,9 @@ ...@@ -600,7 +602,9 @@
max_tokens: $settings?.options?.num_predict ?? undefined, max_tokens: $settings?.options?.num_predict ?? undefined,
docs: docs.length > 0 ? docs : undefined docs: docs.length > 0 ? docs : undefined
}, },
model.source === 'litellm' ? `${LITELLM_API_BASE_URL}/v1` : `${OPENAI_API_BASE_URL}` model?.source?.toLowerCase() === 'litellm'
? `${LITELLM_API_BASE_URL}/v1`
: `${OPENAI_API_BASE_URL}`
); );
if (res && res.ok) { if (res && res.ok) {
...@@ -791,7 +795,7 @@ ...@@ -791,7 +795,7 @@
titleModelId, titleModelId,
userPrompt, userPrompt,
titleModel?.external ?? false titleModel?.external ?? false
? titleModel.source === 'litellm' ? titleModel?.source?.toLowerCase() === 'litellm'
? `${LITELLM_API_BASE_URL}/v1` ? `${LITELLM_API_BASE_URL}/v1`
: `${OPENAI_API_BASE_URL}` : `${OPENAI_API_BASE_URL}`
: `${OLLAMA_API_BASE_URL}/v1` : `${OLLAMA_API_BASE_URL}/v1`
...@@ -861,6 +865,8 @@ ...@@ -861,6 +865,8 @@
<div class="min-h-screen max-h-screen w-full flex flex-col"> <div class="min-h-screen max-h-screen w-full flex flex-col">
<Navbar <Navbar
{title} {title}
bind:selectedModels
bind:showModelSelector
shareEnabled={messages.length > 0} shareEnabled={messages.length > 0}
initNewChat={async () => { initNewChat={async () => {
if (currentRequestId !== null) { if (currentRequestId !== null) {
...@@ -885,15 +891,7 @@ ...@@ -885,15 +891,7 @@
messagesContainerElement.clientHeight + 5; messagesContainerElement.clientHeight + 5;
}} }}
> >
<div <div class=" h-full w-full flex flex-col py-4">
class="{$settings?.fullScreenMode ?? null
? 'max-w-full'
: 'max-w-2xl md:px-0'} mx-auto w-full px-4"
>
<ModelSelector bind:selectedModels />
</div>
<div class=" h-full w-full flex flex-col py-8">
<Messages <Messages
chatId={$chatId} chatId={$chatId}
{selectedModels} {selectedModels}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment