mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-02 00:25:06 +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': [
|
'react-refresh/only-export-components': 'off',
|
||||||
'warn',
|
|
||||||
{ allowConstantExport: true },
|
|
||||||
],
|
|
||||||
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
||||||
'check-file/filename-naming-convention': [
|
'check-file/filename-naming-convention': [
|
||||||
'error',
|
'error',
|
||||||
|
|||||||
@ -1075,3 +1075,13 @@ export enum WebhookStatus {
|
|||||||
Live = 'live',
|
Live = 'live',
|
||||||
Stopped = 'stopped',
|
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({
|
const type = useWatch({
|
||||||
control: form.control,
|
control: form.control,
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import {
|
|||||||
AgentVariableType,
|
AgentVariableType,
|
||||||
BeginId,
|
BeginId,
|
||||||
BeginQueryType,
|
BeginQueryType,
|
||||||
|
BeginQueryTypeMap,
|
||||||
JsonSchemaDataType,
|
JsonSchemaDataType,
|
||||||
Operator,
|
Operator,
|
||||||
VariableType,
|
VariableType,
|
||||||
@ -463,7 +464,14 @@ export function useGetVariableLabelOrTypeByValue({
|
|||||||
|
|
||||||
const getType = useCallback(
|
const getType = useCallback(
|
||||||
(val?: string) => {
|
(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],
|
[findAgentStructuredOutputTypeByValue, getItem],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user