"...composable_kernel_onnxruntime.git" did not exist on "12235112a10ecbe47acead9a03564cb42c4624c2"
Unverified Commit 635951b5 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge branch 'dev' into feat/backend-web-search

parents 8b3e370a bf604bc0
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.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -366,7 +366,8 @@ ...@@ -366,7 +366,8 @@
}, },
format: $settings.requestFormat ?? undefined, format: $settings.requestFormat ?? undefined,
keep_alive: $settings.keepAlive ?? undefined, keep_alive: $settings.keepAlive ?? undefined,
docs: docs.length > 0 ? docs : undefined docs: docs.length > 0 ? docs : undefined,
citations: docs.length > 0
}); });
if (res && res.ok) { if (res && res.ok) {
...@@ -401,6 +402,11 @@ ...@@ -401,6 +402,11 @@
console.log(line); console.log(line);
let data = JSON.parse(line); let data = JSON.parse(line);
if ('citations' in data) {
responseMessage.citations = data.citations;
continue;
}
if ('detail' in data) { if ('detail' in data) {
throw data; throw data;
} }
...@@ -598,7 +604,8 @@ ...@@ -598,7 +604,8 @@
num_ctx: $settings?.options?.num_ctx ?? undefined, num_ctx: $settings?.options?.num_ctx ?? undefined,
frequency_penalty: $settings?.options?.repeat_penalty ?? undefined, frequency_penalty: $settings?.options?.repeat_penalty ?? undefined,
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,
citations: docs.length > 0
}, },
model?.source?.toLowerCase() === 'litellm' model?.source?.toLowerCase() === 'litellm'
? `${LITELLM_API_BASE_URL}/v1` ? `${LITELLM_API_BASE_URL}/v1`
...@@ -614,7 +621,7 @@ ...@@ -614,7 +621,7 @@
const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks); const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks);
for await (const update of textStream) { for await (const update of textStream) {
const { value, done } = update; const { value, done, citations } = update;
if (done || stopResponseFlag || _chatId !== $chatId) { if (done || stopResponseFlag || _chatId !== $chatId) {
responseMessage.done = true; responseMessage.done = true;
messages = messages; messages = messages;
...@@ -626,6 +633,11 @@ ...@@ -626,6 +633,11 @@
break; break;
} }
if (citations) {
responseMessage.citations = citations;
continue;
}
if (responseMessage.content == '' && value == '\n') { if (responseMessage.content == '' && value == '\n') {
continue; continue;
} else { } else {
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
<div class=" flex flex-col justify-center"> <div class=" flex flex-col justify-center">
<div class=" px-6 pt-4"> <div class=" px-6 pt-4">
<div class=" flex justify-between items-center"> <div class=" flex justify-between items-center">
<div class="flex items-center text-2xl font-semibold">Dashboard</div> <div class="flex items-center text-2xl font-semibold">{$i18n.t('Dashboard')}</div>
<div> <div>
<Tooltip content={$i18n.t('Admin Settings')}> <Tooltip content={$i18n.t('Admin Settings')}>
<button <button
...@@ -140,8 +140,10 @@ ...@@ -140,8 +140,10 @@
</div> </div>
</div> </div>
<div class="px-6 flex text-sm gap-2.5"> <div class="px-5 flex text-sm gap-2.5">
<div class="py-3 border-b font-medium text-gray-100 cursor-pointer">Overview</div> <div class="py-3 border-b font-medium text-gray-100 cursor-pointer">
{$i18n.t('Overview')}
</div>
<!-- <div class="py-3 text-gray-300 cursor-pointer">Users</div> --> <!-- <div class="py-3 text-gray-300 cursor-pointer">Users</div> -->
</div> </div>
...@@ -268,7 +270,7 @@ ...@@ -268,7 +270,7 @@
<td class="px-3 py-2 text-right"> <td class="px-3 py-2 text-right">
<div class="flex justify-end w-full"> <div class="flex justify-end w-full">
{#if user.role !== 'admin'} {#if user.role !== 'admin'}
<Tooltip content="Chats"> <Tooltip content={$i18n.t('Chats')}>
<button <button
class="self-center w-fit text-sm px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5 rounded-xl" class="self-center w-fit text-sm px-2 py-2 hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
on:click={async () => { on:click={async () => {
......
...@@ -378,7 +378,8 @@ ...@@ -378,7 +378,8 @@
}, },
format: $settings.requestFormat ?? undefined, format: $settings.requestFormat ?? undefined,
keep_alive: $settings.keepAlive ?? undefined, keep_alive: $settings.keepAlive ?? undefined,
docs: docs.length > 0 ? docs : undefined docs: docs.length > 0 ? docs : undefined,
citations: docs.length > 0
}); });
if (res && res.ok) { if (res && res.ok) {
...@@ -413,6 +414,11 @@ ...@@ -413,6 +414,11 @@
console.log(line); console.log(line);
let data = JSON.parse(line); let data = JSON.parse(line);
if ('citations' in data) {
responseMessage.citations = data.citations;
continue;
}
if ('detail' in data) { if ('detail' in data) {
throw data; throw data;
} }
...@@ -610,7 +616,8 @@ ...@@ -610,7 +616,8 @@
num_ctx: $settings?.options?.num_ctx ?? undefined, num_ctx: $settings?.options?.num_ctx ?? undefined,
frequency_penalty: $settings?.options?.repeat_penalty ?? undefined, frequency_penalty: $settings?.options?.repeat_penalty ?? undefined,
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,
citations: docs.length > 0
}, },
model?.source?.toLowerCase() === 'litellm' model?.source?.toLowerCase() === 'litellm'
? `${LITELLM_API_BASE_URL}/v1` ? `${LITELLM_API_BASE_URL}/v1`
...@@ -626,7 +633,7 @@ ...@@ -626,7 +633,7 @@
const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks); const textStream = await createOpenAITextStream(res.body, $settings.splitLargeChunks);
for await (const update of textStream) { for await (const update of textStream) {
const { value, done } = update; const { value, done, citations } = update;
if (done || stopResponseFlag || _chatId !== $chatId) { if (done || stopResponseFlag || _chatId !== $chatId) {
responseMessage.done = true; responseMessage.done = true;
messages = messages; messages = messages;
...@@ -638,6 +645,11 @@ ...@@ -638,6 +645,11 @@
break; break;
} }
if (citations) {
responseMessage.citations = citations;
continue;
}
if (responseMessage.content == '' && value == '\n') { if (responseMessage.content == '' && value == '\n') {
continue; continue;
} else { } else {
......
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