|
@@ -18,7 +18,8 @@
|
|
extractParagraphsForAudio,
|
|
extractParagraphsForAudio,
|
|
extractSentencesForAudio,
|
|
extractSentencesForAudio,
|
|
cleanText,
|
|
cleanText,
|
|
- getMessageContentParts
|
|
|
|
|
|
+ getMessageContentParts,
|
|
|
|
+ sanitizeResponseContent
|
|
} from '$lib/utils';
|
|
} from '$lib/utils';
|
|
import { WEBUI_BASE_URL } from '$lib/constants';
|
|
import { WEBUI_BASE_URL } from '$lib/constants';
|
|
|
|
|
|
@@ -73,6 +74,7 @@
|
|
prompt_eval_duration?: number;
|
|
prompt_eval_duration?: number;
|
|
total_duration?: number;
|
|
total_duration?: number;
|
|
load_duration?: number;
|
|
load_duration?: number;
|
|
|
|
+ usage?: unknown;
|
|
};
|
|
};
|
|
annotation?: { type: string; rating: number };
|
|
annotation?: { type: string; rating: number };
|
|
}
|
|
}
|
|
@@ -621,30 +623,32 @@
|
|
fill="currentColor"
|
|
fill="currentColor"
|
|
viewBox="0 0 24 24"
|
|
viewBox="0 0 24 24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
- ><style>
|
|
|
|
|
|
+ >
|
|
|
|
+ <style>
|
|
.spinner_S1WN {
|
|
.spinner_S1WN {
|
|
animation: spinner_MGfb 0.8s linear infinite;
|
|
animation: spinner_MGfb 0.8s linear infinite;
|
|
animation-delay: -0.8s;
|
|
animation-delay: -0.8s;
|
|
}
|
|
}
|
|
|
|
+
|
|
.spinner_Km9P {
|
|
.spinner_Km9P {
|
|
animation-delay: -0.65s;
|
|
animation-delay: -0.65s;
|
|
}
|
|
}
|
|
|
|
+
|
|
.spinner_JApP {
|
|
.spinner_JApP {
|
|
animation-delay: -0.5s;
|
|
animation-delay: -0.5s;
|
|
}
|
|
}
|
|
|
|
+
|
|
@keyframes spinner_MGfb {
|
|
@keyframes spinner_MGfb {
|
|
93.75%,
|
|
93.75%,
|
|
100% {
|
|
100% {
|
|
opacity: 0.2;
|
|
opacity: 0.2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- </style><circle class="spinner_S1WN" cx="4" cy="12" r="3" /><circle
|
|
|
|
- class="spinner_S1WN spinner_Km9P"
|
|
|
|
- cx="12"
|
|
|
|
- cy="12"
|
|
|
|
- r="3"
|
|
|
|
- /><circle class="spinner_S1WN spinner_JApP" cx="20" cy="12" r="3" /></svg
|
|
|
|
- >
|
|
|
|
|
|
+ </style>
|
|
|
|
+ <circle class="spinner_S1WN" cx="4" cy="12" r="3" />
|
|
|
|
+ <circle class="spinner_S1WN spinner_Km9P" cx="12" cy="12" r="3" />
|
|
|
|
+ <circle class="spinner_S1WN spinner_JApP" cx="20" cy="12" r="3" />
|
|
|
|
+ </svg>
|
|
{:else if speaking}
|
|
{:else if speaking}
|
|
<svg
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -697,30 +701,32 @@
|
|
fill="currentColor"
|
|
fill="currentColor"
|
|
viewBox="0 0 24 24"
|
|
viewBox="0 0 24 24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
- ><style>
|
|
|
|
|
|
+ >
|
|
|
|
+ <style>
|
|
.spinner_S1WN {
|
|
.spinner_S1WN {
|
|
animation: spinner_MGfb 0.8s linear infinite;
|
|
animation: spinner_MGfb 0.8s linear infinite;
|
|
animation-delay: -0.8s;
|
|
animation-delay: -0.8s;
|
|
}
|
|
}
|
|
|
|
+
|
|
.spinner_Km9P {
|
|
.spinner_Km9P {
|
|
animation-delay: -0.65s;
|
|
animation-delay: -0.65s;
|
|
}
|
|
}
|
|
|
|
+
|
|
.spinner_JApP {
|
|
.spinner_JApP {
|
|
animation-delay: -0.5s;
|
|
animation-delay: -0.5s;
|
|
}
|
|
}
|
|
|
|
+
|
|
@keyframes spinner_MGfb {
|
|
@keyframes spinner_MGfb {
|
|
93.75%,
|
|
93.75%,
|
|
100% {
|
|
100% {
|
|
opacity: 0.2;
|
|
opacity: 0.2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- </style><circle class="spinner_S1WN" cx="4" cy="12" r="3" /><circle
|
|
|
|
- class="spinner_S1WN spinner_Km9P"
|
|
|
|
- cx="12"
|
|
|
|
- cy="12"
|
|
|
|
- r="3"
|
|
|
|
- /><circle class="spinner_S1WN spinner_JApP" cx="20" cy="12" r="3" /></svg
|
|
|
|
- >
|
|
|
|
|
|
+ </style>
|
|
|
|
+ <circle class="spinner_S1WN" cx="4" cy="12" r="3" />
|
|
|
|
+ <circle class="spinner_S1WN spinner_Km9P" cx="12" cy="12" r="3" />
|
|
|
|
+ <circle class="spinner_S1WN spinner_JApP" cx="20" cy="12" r="3" />
|
|
|
|
+ </svg>
|
|
{:else}
|
|
{:else}
|
|
<svg
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -744,7 +750,17 @@
|
|
{#if message.info}
|
|
{#if message.info}
|
|
<Tooltip
|
|
<Tooltip
|
|
content={message.info.openai
|
|
content={message.info.openai
|
|
- ? `prompt_tokens: ${message.info.prompt_tokens ?? 'N/A'}<br/>
|
|
|
|
|
|
+ ? message.info.usage
|
|
|
|
+ ? `<pre>${sanitizeResponseContent(
|
|
|
|
+ JSON.stringify(message.info.usage, null, 2)
|
|
|
|
+ .replace(/"([^(")"]+)":/g, '$1:')
|
|
|
|
+ .slice(1, -1)
|
|
|
|
+ .split('\n')
|
|
|
|
+ .map((line) => line.slice(2))
|
|
|
|
+ .map((line) => (line.endsWith(',') ? line.slice(0, -1) : line))
|
|
|
|
+ .join('\n')
|
|
|
|
+ )}</pre>`
|
|
|
|
+ : `prompt_tokens: ${message.info.prompt_tokens ?? 'N/A'}<br/>
|
|
completion_tokens: ${message.info.completion_tokens ?? 'N/A'}<br/>
|
|
completion_tokens: ${message.info.completion_tokens ?? 'N/A'}<br/>
|
|
total_tokens: ${message.info.total_tokens ?? 'N/A'}`
|
|
total_tokens: ${message.info.total_tokens ?? 'N/A'}`
|
|
: `response_token/s: ${
|
|
: `response_token/s: ${
|
|
@@ -854,10 +870,11 @@
|
|
stroke-linejoin="round"
|
|
stroke-linejoin="round"
|
|
class="w-4 h-4"
|
|
class="w-4 h-4"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
- ><path
|
|
|
|
- d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"
|
|
|
|
- /></svg
|
|
|
|
>
|
|
>
|
|
|
|
+ <path
|
|
|
|
+ d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"
|
|
|
|
+ />
|
|
|
|
+ </svg>
|
|
</button>
|
|
</button>
|
|
</Tooltip>
|
|
</Tooltip>
|
|
|
|
|
|
@@ -903,10 +920,11 @@
|
|
stroke-linejoin="round"
|
|
stroke-linejoin="round"
|
|
class="w-4 h-4"
|
|
class="w-4 h-4"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
- ><path
|
|
|
|
- d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"
|
|
|
|
- /></svg
|
|
|
|
>
|
|
>
|
|
|
|
+ <path
|
|
|
|
+ d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"
|
|
|
|
+ />
|
|
|
|
+ </svg>
|
|
</button>
|
|
</button>
|
|
</Tooltip>
|
|
</Tooltip>
|
|
{/if}
|
|
{/if}
|
|
@@ -1079,6 +1097,7 @@
|
|
-ms-overflow-style: none; /* IE and Edge */
|
|
-ms-overflow-style: none; /* IE and Edge */
|
|
scrollbar-width: none; /* Firefox */
|
|
scrollbar-width: none; /* Firefox */
|
|
}
|
|
}
|
|
|
|
+
|
|
@keyframes shimmer {
|
|
@keyframes shimmer {
|
|
0% {
|
|
0% {
|
|
background-position: 200% 0;
|
|
background-position: 200% 0;
|