diff --git a/src/lib/helpers/enums.js b/src/lib/helpers/enums.js
index 46bf4ba6..87011624 100644
--- a/src/lib/helpers/enums.js
+++ b/src/lib/helpers/enums.js
@@ -185,4 +185,11 @@ const llmModelType = {
Embedding: 4,
Audio: 5
};
-export const LlmModelType = Object.freeze(llmModelType);
\ No newline at end of file
+export const LlmModelType = Object.freeze(llmModelType);
+
+const reasoningEffortLevel = {
+ Low: "low",
+ Medium: "medium",
+ High: "high"
+};
+export const ReasoningEffortLevel = Object.freeze(reasoningEffortLevel);
\ No newline at end of file
diff --git a/src/lib/helpers/types/agentTypes.js b/src/lib/helpers/types/agentTypes.js
index 5cf7c6b6..846bf31c 100644
--- a/src/lib/helpers/types/agentTypes.js
+++ b/src/lib/helpers/types/agentTypes.js
@@ -17,6 +17,7 @@
* @property {string?} model
* @property {number} max_recursion_depth
* @property {number?} [max_output_tokens]
+ * @property {string?} [reasoning_effort_level]
*/
diff --git a/src/lib/helpers/types/knowledgeTypes.js b/src/lib/helpers/types/knowledgeTypes.js
index 5a23313d..00347c9d 100644
--- a/src/lib/helpers/types/knowledgeTypes.js
+++ b/src/lib/helpers/types/knowledgeTypes.js
@@ -15,6 +15,7 @@
* @property {number} [limit] - Data limit.
* @property {number} [confidence] - Confidence.
* @property {boolean} [with_vector] - Include vector or not.
+ * @property {VectorFilterGroup[]} [filter_groups] - Search filter groups.
*/
/**
@@ -22,8 +23,14 @@
* @property {string | null} [start_id] - The start id.
* @property {number} size - Page size.
* @property {boolean} [with_vector] - Include vector or not.
- * @property {string[]} [included_payloads] - Included payload keys.
- * @property {{ key: string, value: string }[]} [search_pairs] - Search pairs.
+ * @property {string[]} [fields] - Included payload fields.
+ * @property {VectorFilterGroup[]} [filter_groups] - Search filter groups.
+ */
+
+/**
+ * @typedef {Object} VectorFilterGroup
+ * @property {string} [filter_operator] - The filter operator.
+ * @property {{ key: string, value: string }[]} [filters] - Search filters.
*/
/**
@@ -32,6 +39,7 @@
* @property {any} data - The knowledge data.
* @property {number} [score] - The knowledge score.
* @property {number[]} [vector] - The knowledge vector.
+ * @property {number} [vector_dimension] - The vector dimension.
*/
/**
diff --git a/src/lib/helpers/utils/common.js b/src/lib/helpers/utils/common.js
index d9e782ee..cf22a03b 100644
--- a/src/lib/helpers/utils/common.js
+++ b/src/lib/helpers/utils/common.js
@@ -147,7 +147,7 @@ export function splitTextByCase(str) {
if (!str) return str;
let words = str.split("_");
- if (words.length === 0) {
+ if (words.length === 1) {
// split by camel case
words = str.split(/(?=[A-Z])/);
}
diff --git a/src/lib/scss/custom/pages/_knowledgebase.scss b/src/lib/scss/custom/pages/_knowledgebase.scss
index 6a581d0f..7d1f554d 100644
--- a/src/lib/scss/custom/pages/_knowledgebase.scss
+++ b/src/lib/scss/custom/pages/_knowledgebase.scss
@@ -41,6 +41,14 @@
}
}
+.operator-tooltip {
+ .tooltip-inner {
+ width: fit-content !important;
+ max-width: 300px !important;
+ text-align: left !important;
+ }
+}
+
.knowledge-textarea {
border-radius: 5px;
border-color: var(--#{$prefix}light) !important;
@@ -245,6 +253,24 @@
font-size: 15px;
}
}
+
+ .payload-container {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ max-height: 280px;
+ overflow-y: auto;
+ scrollbar-width: none;
+
+ .payload-item {
+ display: flex;
+ gap: 10px;
+
+ .payload-item-content {
+ flex: 0.5;
+ }
+ }
+ }
}
.knowledge-doc-upload-container {
@@ -360,6 +386,9 @@
display: flex;
flex-direction: column;
gap: 10px;
+ max-height: 300px;
+ overflow-y: auto;
+ scrollbar-width: none;
.knowledge-adv-search-item {
display: flex;
diff --git a/src/routes/page/agent/[agentId]/agent-components/agent-llm-config.svelte b/src/routes/page/agent/[agentId]/agent-components/agent-llm-config.svelte
index 03613d88..1c0127e8 100644
--- a/src/routes/page/agent/[agentId]/agent-components/agent-llm-config.svelte
+++ b/src/routes/page/agent/[agentId]/agent-components/agent-llm-config.svelte
@@ -3,6 +3,7 @@
import { Card, CardBody, Input } from '@sveltestrap/sveltestrap';
import { getLlmProviders, getLlmProviderModels } from '$lib/services/llm-provider-service';
import { INTEGER_REGEX } from '$lib/helpers/constants';
+ import { ReasoningEffortLevel } from '$lib/helpers/enums';
/** @type {import('$agentTypes').AgentModel} */
export let agent;
@@ -18,6 +19,14 @@
}
const recursiveDepthLowerLimit = 1;
+ /** @type {import('$commonTypes').LabelValuePair[]} */
+ const reasonLevelOptions = [
+ { value: '', label: '' },
+ ...Object.entries(ReasoningEffortLevel).map(([k, v]) => ({
+ value: v,
+ label: v
+ }))
+ ];
let config = agent.llm_config;
@@ -89,6 +98,12 @@
handleAgentChange();
}
+ /** @param {any} e */
+ function changeReasoningEffortLevel(e) {
+ config.reasoning_effort_level = e.target.value || null;
+ handleAgentChange();
+ }
+
/** @param {any} e */
function validateIntegerInput(e) {
const reg = new RegExp(INTEGER_REGEX, 'g');
@@ -164,5 +179,20 @@
/>
+
+
+
+
+ changeReasoningEffortLevel(e)}>
+ {#each reasonLevelOptions as option}
+
+ {/each}
+
+
+
\ No newline at end of file
diff --git a/src/routes/page/knowledge-base/common/search/advanced-search.svelte b/src/routes/page/knowledge-base/common/search/advanced-search.svelte
index 4825f13d..22304bd3 100644
--- a/src/routes/page/knowledge-base/common/search/advanced-search.svelte
+++ b/src/routes/page/knowledge-base/common/search/advanced-search.svelte
@@ -1,104 +1,131 @@
@@ -118,7 +145,7 @@
/>
-
{'Advance Search'}
+
{'Advanced Filters'}
{#if showAdvSearch}
@@ -877,16 +885,12 @@
- {#if textSearch}
- onSearchItemsChanged(e)}
- disabled={disabled}
- items={[
- { key: KnowledgePayloadName.FileName, displayName: "File name" },
- { key: KnowledgePayloadName.FileSource, displayName: "File source" }
- ]}
- />
- {/if}
+
{#if isSearching}
@@ -930,6 +934,7 @@
>