Skip to content

Commit fc1e3ad

Browse files
committed
2 parents 39da37e + 52a5847 commit fc1e3ad

31 files changed

Lines changed: 1063 additions & 105 deletions

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ PUBLIC_ALLOW_SIGNUP=true
2323
PUBLIC_AUTH_ENABLE_SSO=true
2424
PUBLIC_AUTH_ENABLE_FIND_PWD=true
2525
PUBLIC_ENVIRONMENTS=[]
26-
PUBLIC_PRIMARY_COLOR=#556ee6
26+
PUBLIC_PRIMARY_COLOR="#556ee6"
2727
PUBLIC_SECONDARY_COLOR=

package-lock.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"svelte-codemirror-editor": "^2.1.0",
7474
"svelte-collapse": "^0.1.2",
7575
"svelte-file-dropzone": "^2.0.2",
76+
"svelte-hero-icons": "^5.2.0",
7677
"svelte-i18n": "^4.0.0",
7778
"svelte-json-tree": "^2.2.0",
7879
"svelte-jsoneditor": "^3.11.0",

src/lib/common/embedding/EmbeddingPage.svelte

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { onMount } from 'svelte';
33
import { page } from '$app/stores';
44
import { getUserStore, globalMenuStore } from '$lib/helpers/store';
5+
import { getCleanUrl } from '$lib/helpers/utils/common';
56
67
let {
78
htmlTagId = 'embedding-page',
@@ -12,6 +13,39 @@
1213
/** @type {string} */
1314
let curSlug = $state('');
1415
16+
/** @type {boolean} */
17+
let fullScreen = $state(false);
18+
19+
$effect(() => {
20+
const footer = document.querySelector('.footer');
21+
const pageContent = document.querySelector('.page-content');
22+
23+
if (fullScreen) {
24+
if (footer instanceof HTMLElement) {
25+
footer.style.display = 'none';
26+
}
27+
if (pageContent instanceof HTMLElement) {
28+
pageContent.style.paddingBottom = '0';
29+
}
30+
} else {
31+
if (footer instanceof HTMLElement) {
32+
footer.style.display = '';
33+
}
34+
if (pageContent instanceof HTMLElement) {
35+
pageContent.style.paddingBottom = '';
36+
}
37+
}
38+
39+
return () => {
40+
if (footer instanceof HTMLElement) {
41+
footer.style.display = '';
42+
}
43+
if (pageContent instanceof HTMLElement) {
44+
pageContent.style.paddingBottom = '';
45+
}
46+
};
47+
});
48+
1549
// @ts-ignore
1650
let slug = $derived($page.params[slugName]);
1751
@@ -25,14 +59,15 @@
2559
2660
onMount(() => {
2761
const menuUnsubscribe = globalMenuStore.subscribe((/** @type {import('$pluginTypes').PluginMenuDefModel[]} */ menu) => {
28-
const url = getPathUrl();
29-
let found = menu.find(x => x.link === url);
62+
const url = getCleanPath(getPathUrl());
63+
let found = menu.find(x => getCleanPath(x.link) === url);
3064
label = found?.label || '';
3165
if (!found?.embeddingInfo) {
32-
const subFound = menu.find(x => !!x.subMenu?.find(y => y.link === url));
33-
found = subFound?.subMenu?.find(x => x.link === url);
66+
const subFound = menu.find(x => !!x.subMenu?.find(y => getCleanPath(y.link) === url));
67+
found = subFound?.subMenu?.find(x => getCleanPath(x.link) === url);
3468
label = found?.label || '';
3569
}
70+
fullScreen = found?.embeddingInfo?.fullScreen || false;
3671
embed(found?.embeddingInfo || null);
3772
});
3873
@@ -77,9 +112,13 @@
77112
}
78113
}
79114
115+
/** @param {string} url */
116+
const getCleanPath = (url) => {
117+
return getCleanUrl((url || '').split('?')[0]);
118+
};
119+
80120
const getPathUrl = () => {
81-
const path = $page.url.pathname;
82-
return path?.startsWith('/') ? path.substring(1) : path;
121+
return $page.url.pathname || '';
83122
};
84123
</script>
85124

src/lib/common/modals/DialogModal.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
sm: 'max-w-sm',
2424
md: 'max-w-md',
2525
lg: 'max-w-lg',
26-
xl: 'max-w-xl'
26+
xl: 'max-w-xl',
27+
'2xl': 'max-w-2xl',
28+
'3xl': 'max-w-3xl',
29+
'4xl': 'max-w-4xl',
30+
'5xl': 'max-w-5xl'
2731
};
2832
2933
/** @param {any} e */
@@ -56,7 +60,7 @@
5660
<!-- svelte-ignore a11y_no_static_element_interactions -->
5761
<!-- svelte-ignore a11y_click_events_have_key_events -->
5862
<div
59-
class="fixed inset-0 z-[9999] flex items-start justify-center pt-[10vh] bg-black/50"
63+
class="fixed inset-0 z-[9999] flex items-start justify-center pt-[2%] bg-black/50"
6064
transition:fade={{ duration: 150 }}
6165
onclick={handleBackdropClick}
6266
>

src/lib/common/modals/PlainModal.svelte

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
let {
55
isOpen = false,
6-
size = 'lg',
6+
size = 'xl',
77
title = '',
88
containerClasses = '',
99
containerStyles = '',
@@ -17,7 +17,11 @@
1717
sm: 'max-w-sm',
1818
md: 'max-w-md',
1919
lg: 'max-w-lg',
20-
xl: 'max-w-xl'
20+
xl: 'max-w-xl',
21+
'2xl': 'max-w-2xl',
22+
'3xl': 'max-w-3xl',
23+
'4xl': 'max-w-4xl',
24+
'5xl': 'max-w-5xl'
2125
};
2226
2327
/** @param {MouseEvent} e */
@@ -32,17 +36,17 @@
3236
<!-- svelte-ignore a11y_no_static_element_interactions -->
3337
<!-- svelte-ignore a11y_click_events_have_key_events -->
3438
<div
35-
class="fixed inset-0 z-[9999] flex items-start justify-center pt-[10vh] bg-black/50"
39+
class={`fixed inset-0 z-[9999] flex items-start justify-center pt-[2%] bg-black/50 ${containerClasses}`}
3640
transition:fade={{ duration: 150 }}
3741
onclick={handleBackdropClick}
3842
>
3943
<div
40-
class={`bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full ${sizeClasses[size] || 'max-w-lg'} mx-4 ${containerClasses}`}
44+
class={`bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full ${sizeClasses[size] || 'max-w-lg'} mx-4 modal-content`}
4145
style={containerStyles}
4246
>
4347
<!-- Header -->
4448
{#if title}
45-
<div class="flex items-center justify-between p-3 border-b border-gray-200 dark:border-gray-700">
49+
<div class="flex items-center justify-between p-3 border-b border-gray-200 dark:border-gray-700 modal-title">
4650
<div class="font-semibold text-lg">{title}</div>
4751
<button
4852
type="button"
@@ -56,7 +60,7 @@
5660
{/if}
5761

5862
<!-- Body -->
59-
<div class="p-3" style={bodyStyles}>
63+
<div class="p-3 modal-body" style={bodyStyles}>
6064
{@render children?.()}
6165
</div>
6266
</div>

src/lib/common/modals/StateModal.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@
2323
sm: 'max-w-sm',
2424
md: 'max-w-md',
2525
lg: 'max-w-lg',
26-
xl: 'max-w-xl'
26+
xl: 'max-w-xl',
27+
'2xl': 'max-w-2xl',
28+
'3xl': 'max-w-3xl',
29+
'4xl': 'max-w-4xl',
30+
'5xl': 'max-w-5xl'
2731
};
2832
2933
/** @type {import('$conversationTypes').UserStateDetailModel} */
@@ -153,7 +157,7 @@
153157
<!-- svelte-ignore a11y_no_static_element_interactions -->
154158
<!-- svelte-ignore a11y_click_events_have_key_events -->
155159
<div
156-
class="fixed inset-0 z-[9999] flex items-start justify-center pt-[10vh] bg-black/50"
160+
class="fixed inset-0 z-[9999] flex items-start justify-center pt-[2%] bg-black/50"
157161
transition:fade={{ duration: 150 }}
158162
onclick={handleBackdropClick}
159163
>

src/lib/common/spinners/Loader.svelte

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66
* disableDefaultStyles?: boolean,
77
* containerClasses?: string,
88
* containerStyles?: string,
9-
* size?: number
9+
* size?: number,
10+
* color?: string
1011
* }}
1112
*/
1213
let {
1314
disableDefaultStyles = false,
1415
containerClasses = '',
1516
containerStyles = '',
16-
size = 100
17+
size = 100,
18+
color = 'var(--bs-primary)'
1719
} = $props();
1820
</script>
1921

2022
<div
2123
class="{disableDefaultStyles ? '' : 'loader'} {containerClasses}"
2224
style={`${containerStyles}`}
2325
>
24-
<Circle {size} color="var(--bs-primary)" unit="px" duration="1s" />
26+
<Circle {size} {color} unit="px" duration="1s" />
2527
</div>

src/lib/helpers/enums.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const richType = {
2929
Generic: 'generic_template',
3030
Upload: 'upload_template',
3131
ProgramCode: 'program_code',
32+
Embedding: 'embedding_template'
3233
}
3334
export const RichType = Object.freeze(richType);
3435

@@ -249,6 +250,14 @@ const reasoningEffortLevel = {
249250
};
250251
export const ReasoningEffortLevel = Object.freeze(reasoningEffortLevel);
251252

253+
const responseFormat = {
254+
Json: "json",
255+
Xml: "xml",
256+
Md: "markdown",
257+
Yaml: "yaml"
258+
};
259+
export const ResponseFormat = Object.freeze(responseFormat);
260+
252261
const timeRange = {
253262
Last15Minutes: "Last 15 minutes",
254263
Last30Minutes: "Last 30 minutes",

src/lib/helpers/types/agentTypes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* @property {string?} [uid]
99
* @property {string} name
1010
* @property {string} content
11+
* @property {string?} [response_format]
12+
* @property {AgentTemplateConfig?} [llm_config]
1113
*/
1214

1315
/**
@@ -23,6 +25,14 @@
2325
* @property {any} [realtime]
2426
*/
2527

28+
/**
29+
* @typedef {Object} AgentTemplateConfig
30+
* @property {string?} provider
31+
* @property {string?} model
32+
* @property {number?} [max_output_tokens]
33+
* @property {string?} [reasoning_effort_level]
34+
*/
35+
2636

2737
/**
2838
* @typedef {Object} RouterSettings

0 commit comments

Comments
 (0)