mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-19 03:35:11 +08:00
Fix: In the agent loop, if the await response is selected as the variable, the operator cannot be selected. #12656 (#12657)
### What problem does this PR solve? Fix: In the agent loop, if the await response is selected as the variable, the operator cannot be selected. #12656 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -53,10 +53,7 @@ module.exports = {
|
||||
],
|
||||
},
|
||||
],
|
||||
'react-refresh/only-export-components': [
|
||||
'warn',
|
||||
{ allowConstantExport: true },
|
||||
],
|
||||
'react-refresh/only-export-components': 'off',
|
||||
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
||||
'check-file/filename-naming-convention': [
|
||||
'error',
|
||||
|
||||
@ -1075,3 +1075,13 @@ export enum WebhookStatus {
|
||||
Live = 'live',
|
||||
Stopped = 'stopped',
|
||||
}
|
||||
|
||||
// Map BeginQueryType to TypesWithArray
|
||||
export const BeginQueryTypeMap = {
|
||||
[BeginQueryType.Line]: TypesWithArray.String,
|
||||
[BeginQueryType.Paragraph]: TypesWithArray.String,
|
||||
[BeginQueryType.Options]: TypesWithArray.ArrayString,
|
||||
[BeginQueryType.File]: 'File',
|
||||
[BeginQueryType.Integer]: TypesWithArray.Number,
|
||||
[BeginQueryType.Boolean]: TypesWithArray.Boolean,
|
||||
};
|
||||
|
||||
@ -96,7 +96,7 @@ function ParameterForm({
|
||||
},
|
||||
[],
|
||||
);
|
||||
}, []);
|
||||
}, [t]);
|
||||
|
||||
const type = useWatch({
|
||||
control: form.control,
|
||||
|
||||
@ -18,6 +18,7 @@ import {
|
||||
AgentVariableType,
|
||||
BeginId,
|
||||
BeginQueryType,
|
||||
BeginQueryTypeMap,
|
||||
JsonSchemaDataType,
|
||||
Operator,
|
||||
VariableType,
|
||||
@ -463,7 +464,14 @@ export function useGetVariableLabelOrTypeByValue({
|
||||
|
||||
const getType = useCallback(
|
||||
(val?: string) => {
|
||||
return getItem(val)?.type || findAgentStructuredOutputTypeByValue(val);
|
||||
const currentType =
|
||||
getItem(val)?.type || findAgentStructuredOutputTypeByValue(val);
|
||||
|
||||
if (currentType && currentType in BeginQueryTypeMap) {
|
||||
return BeginQueryTypeMap[currentType as BeginQueryType];
|
||||
}
|
||||
|
||||
return currentType;
|
||||
},
|
||||
[findAgentStructuredOutputTypeByValue, getItem],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user