Skip to content

Commit b7986cf

Browse files
authored
Merge pull request #394 from iceljc/features/refine-llm-config
refine llm configs
2 parents 3de9387 + 13dbf7c commit b7986cf

File tree

24 files changed

+1147
-224
lines changed

24 files changed

+1147
-224
lines changed

package-lock.json

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

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
},
3838
"type": "module",
3939
"dependencies": {
40+
"@codemirror/commands": "^6.10.0",
41+
"@codemirror/lang-python": "^6.2.1",
42+
"@codemirror/language": "^6.11.3",
43+
"@codemirror/state": "^6.5.2",
44+
"@codemirror/theme-one-dark": "^6.1.3",
45+
"@codemirror/view": "^6.38.6",
4046
"@ernane/svelte-star-rating": "^1.1.4",
4147
"@fullcalendar/common": "^5.11.5",
4248
"@microsoft/signalr": "^8.0.0",
@@ -59,6 +65,7 @@
5965
"overlayscrollbars-svelte": "^0.5.2",
6066
"qs": "^6.14.0",
6167
"svelte-awesome-color-picker": "^2.4.7",
68+
"svelte-codemirror-editor": "^1.4.1",
6269
"svelte-collapse": "^0.1.2",
6370
"svelte-file-dropzone": "^2.0.2",
6471
"svelte-flatpickr": "^3.3.3",

src/lib/helpers/enums.js

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ const agentType = {
7777
};
7878
export const AgentType = Object.freeze(agentType);
7979

80+
const agentCodeScriptType = {
81+
Src: 'src',
82+
Test: 'test'
83+
};
84+
export const AgentCodeScriptType = Object.freeze(agentCodeScriptType);
85+
8086
const routingMode = {
8187
Eager: "eager",
8288
Lazy: "lazy"
@@ -203,14 +209,34 @@ const globalEvent = {
203209
export const GlobalEvent = Object.freeze(globalEvent);
204210

205211
const llmModelType = {
206-
Text: 1,
207-
Chat: 2,
208-
Image: 3,
209-
Embedding: 4,
210-
Audio: 5
212+
All: "All",
213+
Text: "Text",
214+
Chat: "Chat",
215+
Image: "Image",
216+
Embedding: "Embedding",
217+
Audio: "Audio",
218+
Realtime: "Realtime",
219+
Web: "Web"
211220
};
212221
export const LlmModelType = Object.freeze(llmModelType);
213222

223+
const llmModelCapability = {
224+
All: "All",
225+
Text: "Text",
226+
Chat: "Chat",
227+
ImageReading: "ImageReading",
228+
ImageGeneration: "ImageGeneration",
229+
ImageEdit: "ImageEdit",
230+
ImageVariation: "ImageVariation",
231+
Embedding: "Embedding",
232+
AudioTranscription: "AudioTranscription",
233+
AudioGeneration: "AudioGeneration",
234+
Realtime: "Realtime",
235+
WebSearch: "WebSearch",
236+
PdfReading: "PdfReading"
237+
};
238+
export const LlmModelCapability = Object.freeze(llmModelCapability);
239+
214240
const reasoningEffortLevel = {
215241
Minimal: "minimal",
216242
Low: "low",

src/lib/helpers/http.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function skipLoader(config) {
7474
new RegExp('http(s*)://(.*?)/knowledge/vector/(.*?)/create', 'g'),
7575
new RegExp('http(s*)://(.*?)/knowledge/document/(.*?)/page', 'g'),
7676
new RegExp('http(s*)://(.*?)/users', 'g'),
77-
new RegExp('http(s*)://(.*?)/instruct/chat-completion', 'g')
77+
new RegExp('http(s*)://(.*?)/instruct/chat-completion', 'g'),
78+
new RegExp('http(s*)://(.*?)/agent/(.*?)/code-scripts', 'g')
7879
];
7980

8081
/** @type {RegExp[]} */

src/lib/helpers/types/agentTypes.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
* @property {number} max_recursion_depth
1919
* @property {number?} [max_output_tokens]
2020
* @property {string?} [reasoning_effort_level]
21+
* @property {any} [image_generation]
22+
* @property {any} [image_edit]
23+
* @property {any} [audio_transcription]
24+
* @property {any} [realtime]
2125
*/
2226

2327

@@ -105,6 +109,34 @@
105109
* @property {string} [direct_agent_id] - Run task directly in this agent.
106110
*/
107111

112+
/**
113+
* @typedef {Object} AgentCodeScriptFilter
114+
* @property {string[]?} [scriptNames]
115+
* @property {string[]?} [scriptTypes]
116+
*/
117+
118+
119+
/**
120+
* @typedef {Object} AgentCodeScriptViewModel
121+
* @property {string?} [uid]
122+
* @property {string} name
123+
* @property {string} content
124+
* @property {string} script_type
125+
*/
126+
127+
/**
128+
* @typedef {Object} AgentCodeScriptUpdateOptions
129+
* @property {boolean?} [delete_if_not_included]
130+
* @property {boolean?} [is_upsert]
131+
*/
132+
133+
/**
134+
* @typedef {Object} AgentCodeScriptUpdateModel
135+
* @property {AgentCodeScriptViewModel[]?} [code_scripts]
136+
* @property {AgentCodeScriptUpdateOptions?} [options]
137+
*/
138+
139+
108140
/**
109141
* @typedef {Object} ChannelInstruction
110142
* @property {string} [uid]

src/lib/helpers/types/commonTypes.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@
3939
*/
4040

4141
/**
42-
* @typedef {Object} LlmConfigOption
43-
* @property {number?} [type]
42+
* @typedef {Object} LlmConfigFilter
43+
* @property {string[]?} [providers]
44+
* @property {string[]?} [modelIds]
45+
* @property {string[]?} [modelNames]
46+
* @property {string[]?} [modelTypes]
47+
* @property {string[]?} [modelCapabilities]
4448
* @property {boolean?} [multiModal]
45-
* @property {boolean?} [imageGeneration]
4649
*/
4750

4851
/**
@@ -55,6 +58,8 @@
5558
* @typedef {Object} LlmModelSetting
5659
* @property {string} name
5760
* @property {string} type
61+
* @property {string[]} capabilities
62+
* @property {boolean} multiModal
5863
* @property {any} reasoning
5964
*/
6065

src/lib/helpers/types/knowledgeTypes.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* @property {number} [confidence] - Confidence.
1717
* @property {boolean} [with_vector] - Include vector or not.
1818
* @property {VectorFilterGroup[]} [filter_groups] - Search filter groups.
19+
* @property {VectorSearchParam} [search_param] - Search params.
1920
*/
2021

2122
/**
@@ -28,6 +29,11 @@
2829
* @property {VectorSort?} [order_by] - Sort by.
2930
*/
3031

32+
/**
33+
* @typedef {Object} VectorSearchParam
34+
* @property {boolean?} [exact_search] - Exact search or not.
35+
*/
36+
3137
/**
3238
* @typedef {Object} VectorFilterGroup
3339
* @property {string} [logical_operator] - The logical operator.

src/lib/scss/custom/pages/_agent.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,20 @@
143143
}
144144
}
145145

146+
.agent-config-container {
147+
padding: 10px;
148+
border: 1px dashed var(--bs-primary);
149+
border-radius: 5px;
150+
}
151+
146152
.agent-utility-container {
147153
display: flex;
148154
flex-direction: column;
149155
gap: 10px;
150156
max-height: 500px;
151157
overflow-y: auto;
152158
scrollbar-width: thin;
159+
padding: 0px 10px;
153160

154161
.merge-utility {
155162
display: flex;
@@ -266,4 +273,17 @@
266273
&.show {
267274
opacity: 1 !important;
268275
}
276+
}
277+
278+
.code-editor {
279+
max-height: 500px;
280+
overflow-y: auto;
281+
scrollbar-width: thin;
282+
resize: none;
283+
284+
.cm-editor {
285+
min-width: 1000px;
286+
overflow-x: auto;
287+
scrollbar-width: thin;
288+
}
269289
}

0 commit comments

Comments
 (0)