mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-02 08:35:08 +08:00
### What problem does this PR solve? Feat: Construct a dynamic variable assignment form #10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -7,8 +7,11 @@ import {
|
||||
} from '../constant';
|
||||
import useGraphStore from '../store';
|
||||
|
||||
function splitValue(value?: string) {
|
||||
return typeof value === 'string' ? value?.split('@') : [];
|
||||
}
|
||||
function getNodeId(value: string) {
|
||||
return value.split('@').at(0);
|
||||
return splitValue(value).at(0);
|
||||
}
|
||||
|
||||
export function useShowSecondaryMenu() {
|
||||
@ -63,7 +66,7 @@ export function useFindAgentStructuredOutputLabel() {
|
||||
}>,
|
||||
) => {
|
||||
// agent structured output
|
||||
const fields = value.split('@');
|
||||
const fields = splitValue(value);
|
||||
if (
|
||||
getOperatorTypeFromId(fields.at(0)) === Operator.Agent &&
|
||||
fields.at(1)?.startsWith(AgentStructuredOutputField)
|
||||
@ -130,7 +133,7 @@ export function useFindAgentStructuredOutputTypeByValue() {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
const fields = value.split('@');
|
||||
const fields = splitValue(value);
|
||||
const nodeId = fields.at(0);
|
||||
const jsonSchema = filterStructuredOutput(value);
|
||||
|
||||
@ -163,7 +166,7 @@ export function useFindAgentStructuredOutputLabelByValue() {
|
||||
const operatorName = getNode(getNodeId(value ?? ''))?.data.name;
|
||||
|
||||
if (operatorName) {
|
||||
return operatorName + ' / ' + value?.split('@').at(1);
|
||||
return operatorName + ' / ' + splitValue(value).at(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user