File tree 5 files changed +10
-4
lines changed
app/configuration/dataset-config
workflow/nodes/knowledge-retrieval
5 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ const DatasetConfig: FC = () => {
270
270
handleMetadataModelChange = { handleMetadataModelChange }
271
271
handleMetadataCompletionParamsChange = { handleMetadataCompletionParamsChange }
272
272
isCommonVariable
273
- availableCommonStringVars = { promptVariablesToSelect . filter ( item => item . type === MetadataFilteringVariableType . string ) }
273
+ availableCommonStringVars = { promptVariablesToSelect . filter ( item => item . type === MetadataFilteringVariableType . string || item . type === MetadataFilteringVariableType . select ) }
274
274
availableCommonNumberVars = { promptVariablesToSelect . filter ( item => item . type === MetadataFilteringVariableType . number ) }
275
275
/>
276
276
</ div >
Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ const ConditionItem = ({
77
77
78
78
const valueAndValueMethod = useMemo ( ( ) => {
79
79
if (
80
- ( currentMetadata ?. type === MetadataFilteringVariableType . string || currentMetadata ?. type === MetadataFilteringVariableType . number )
80
+ ( currentMetadata ?. type === MetadataFilteringVariableType . string ||
81
+ currentMetadata ?. type === MetadataFilteringVariableType . number ||
82
+ currentMetadata ?. type === MetadataFilteringVariableType . select )
81
83
&& typeof condition . value === 'string'
82
84
) {
83
85
const regex = isCommonVariable ? COMMON_VARIABLE_REGEX : VARIABLE_REGEX
@@ -140,7 +142,9 @@ const ConditionItem = ({
140
142
</ div >
141
143
< div className = 'border-t border-t-divider-subtle' >
142
144
{
143
- ! comparisonOperatorNotRequireValue ( condition . comparison_operator ) && currentMetadata ?. type === MetadataFilteringVariableType . string && (
145
+ ! comparisonOperatorNotRequireValue ( condition . comparison_operator ) &&
146
+ ( currentMetadata ?. type === MetadataFilteringVariableType . string ||
147
+ currentMetadata ?. type === MetadataFilteringVariableType . select ) && (
144
148
< ConditionString
145
149
valueMethod = { localValueMethod }
146
150
onValueMethodChange = { handleValueMethodChange }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export const isComparisonOperatorNeedTranslate = (operator?: ComparisonOperator)
22
22
export const getOperators = ( type ?: MetadataFilteringVariableType ) => {
23
23
switch ( type ) {
24
24
case MetadataFilteringVariableType . string :
25
+ case MetadataFilteringVariableType . select :
25
26
return [
26
27
ComparisonOperator . is ,
27
28
ComparisonOperator . isNot ,
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const MetadataIcon = ({
18
18
return (
19
19
< >
20
20
{
21
- type === MetadataFilteringVariableType . string && (
21
+ ( type === MetadataFilteringVariableType . string || type === MetadataFilteringVariableType . select ) && (
22
22
< RiTextSnippet className = { cn ( 'h-3.5 w-3.5' , className ) } />
23
23
)
24
24
}
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ export enum MetadataFilteringVariableType {
80
80
string = 'string' ,
81
81
number = 'number' ,
82
82
time = 'time' ,
83
+ select = 'select' ,
83
84
}
84
85
85
86
export type MetadataFilteringCondition = {
You can’t perform that action at this time.
0 commit comments