Skip to content

Commit db5b11e

Browse files
author
Jicheng Lu
committed
add agent template config panel
1 parent e7c8ade commit db5b11e

7 files changed

Lines changed: 438 additions & 22 deletions

File tree

src/lib/helpers/enums.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ const reasoningEffortLevel = {
249249
};
250250
export const ReasoningEffortLevel = Object.freeze(reasoningEffortLevel);
251251

252+
const responseFormat = {
253+
Json: "json",
254+
Xml: "xml",
255+
Md: "markdown",
256+
Yaml: "yaml"
257+
};
258+
export const ResponseFormat = Object.freeze(responseFormat);
259+
252260
const timeRange = {
253261
Last15Minutes: "Last 15 minutes",
254262
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

src/lib/scss/app.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ File: Main Css File
9494
@import "custom/pages/jobs";
9595
@import "custom/pages/conversation";
9696
@import "custom/pages/agent";
97+
@import "custom/pages/agent_template";
9798
@import "custom/pages/knowledgebase";
9899
@import "custom/pages/users";
99100
@import "custom/pages/roles";
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
.template-content-wrapper {
2+
display: flex;
3+
flex-direction: row;
4+
gap: 0;
5+
position: relative;
6+
align-items: stretch;
7+
height: 380px;
8+
9+
.template-editor-area {
10+
flex: 1;
11+
min-width: 0;
12+
display: flex;
13+
14+
.template-textarea {
15+
flex: 1;
16+
scrollbar-width: thin;
17+
resize: none;
18+
}
19+
}
20+
21+
.config-toggle-btn {
22+
display: flex;
23+
align-items: center;
24+
justify-content: center;
25+
width: 20px;
26+
cursor: pointer;
27+
color: var(--bs-primary);
28+
font-size: 18px;
29+
user-select: none;
30+
flex-shrink: 0;
31+
opacity: 0.7;
32+
transition: opacity 0.2s ease;
33+
34+
&:hover {
35+
opacity: 1;
36+
}
37+
38+
&:focus {
39+
outline: none;
40+
}
41+
}
42+
43+
.template-config-panel {
44+
width: 0;
45+
overflow: hidden;
46+
transition: width 0.3s ease;
47+
border-left: none;
48+
flex-shrink: 0;
49+
50+
&.expanded {
51+
width: 260px;
52+
border-left: 1px solid var(--bs-border-color);
53+
overflow-y: auto;
54+
scrollbar-width: thin;
55+
}
56+
57+
.template-config-content {
58+
padding: 10px;
59+
display: flex;
60+
flex-direction: column;
61+
height: 100%;
62+
63+
.config-section {
64+
display: flex;
65+
flex-direction: column;
66+
gap: 10px;
67+
}
68+
69+
.config-field {
70+
display: flex;
71+
flex-direction: column;
72+
gap: 2px;
73+
}
74+
75+
.config-label {
76+
font-size: 0.8rem;
77+
font-weight: 500;
78+
margin-bottom: 0;
79+
white-space: nowrap;
80+
}
81+
}
82+
}
83+
84+
@media (max-width: 768px) {
85+
flex-direction: column;
86+
87+
.config-toggle-btn {
88+
width: 100%;
89+
height: 24px;
90+
flex-direction: row;
91+
92+
.mdi {
93+
transform: rotate(90deg);
94+
}
95+
}
96+
97+
.template-config-panel {
98+
width: 100% !important;
99+
height: 0;
100+
transition: height 0.3s ease;
101+
border-left: none;
102+
103+
&.expanded {
104+
width: 100% !important;
105+
height: auto;
106+
border-left: none;
107+
border-top: 1px solid var(--bs-border-color);
108+
}
109+
}
110+
}
111+
}

src/routes/page/agent/[agentId]/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
import { myInfo } from '$lib/services/auth-service';
1515
import AgentInstruction from './agent-components/agent-instruction.svelte';
1616
import AgentOverview from './agent-components/agent-overview.svelte';
17+
import AgentTemplate from './agent-components/templates/agent-template.svelte';
1718
import AgentFunction from './agent-components/agent-function.svelte';
1819
import AgentTabs from './agent-tabs.svelte';
19-
import AgentTemplate from './agent-components/agent-template.svelte';
2020
2121
/** @type {import('$agentTypes').AgentModel} */
2222
let agent = $state(/** @type {any} */ (undefined));

0 commit comments

Comments
 (0)