mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
wip commit
This commit is contained in:
parent
c33b3a3894
commit
5fb8ef9bec
|
@ -83,7 +83,7 @@ export const promptTypeOptions: INodeProperties = {
|
|||
description: 'Use an expression to reference data in previous nodes or enter static text',
|
||||
},
|
||||
],
|
||||
default: 'auto',
|
||||
default: 'define',
|
||||
};
|
||||
|
||||
export const textInput: INodeProperties = {
|
||||
|
|
|
@ -1116,8 +1116,6 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
|||
return;
|
||||
}
|
||||
|
||||
adjustNewNodes(sourceNode, targetNode, { parentIsNew, childIsNew });
|
||||
|
||||
workflowsStore.addConnection({
|
||||
connection: mappedConnection,
|
||||
});
|
||||
|
@ -1125,6 +1123,7 @@ export function useCanvasOperations({ router }: { router: ReturnType<typeof useR
|
|||
void nextTick(() => {
|
||||
nodeHelpers.updateNodeInputIssues(sourceNode);
|
||||
nodeHelpers.updateNodeInputIssues(targetNode);
|
||||
adjustNewNodes(sourceNode, targetNode, { parentIsNew, childIsNew });
|
||||
});
|
||||
|
||||
if (!keepPristine) {
|
||||
|
|
|
@ -39,10 +39,25 @@ export function adjustNewNodes(
|
|||
}
|
||||
|
||||
function adjustNewChild(parent: AddedNode, child: AddedNode) {
|
||||
if (!PROMPT_PROVIDER_NODE_NAMES.includes(parent.type) && AI_NODES.includes(child.type)) {
|
||||
Object.assign<AddedNode, Partial<INode>>(child, {
|
||||
parameters: { promptType: 'define' },
|
||||
});
|
||||
console.log('parent', parent);
|
||||
console.log('child', child);
|
||||
if (AI_NODES.includes(child.type)) {
|
||||
const { getCurrentWorkflow } = useWorkflowsStore();
|
||||
const workflow = getCurrentWorkflow();
|
||||
|
||||
const ps = [parent, ...(child.name ? workflow.getParentNodesByDepth(child.name, 1) : [])];
|
||||
console.log('parents', ps);
|
||||
if (
|
||||
ps.some((x) =>
|
||||
PROMPT_PROVIDER_NODE_NAMES.includes(
|
||||
'type' in x ? x.type : (workflow.getNode(x?.name ?? '')?.type ?? ''),
|
||||
),
|
||||
)
|
||||
) {
|
||||
Object.assign<AddedNode, Partial<INode>>(child, {
|
||||
parameters: { promptType: 'auto' },
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +67,7 @@ function adjustNewParent(parent: AddedNode, child: AddedNode) {
|
|||
const workflow = getCurrentWorkflow();
|
||||
|
||||
// If a memory node is added to an Agent, the memory node is actually the parent since it provides input
|
||||
// So we need to look for the Agent's parents to determine if there is a prompt provider
|
||||
// So we need to look for the Agent's parents to determine if there is a sessionId provider
|
||||
const ps = workflow.getParentNodesByDepth(child.name, 1);
|
||||
if (
|
||||
!ps.some((x) => PROMPT_PROVIDER_NODE_NAMES.includes(workflow.getNode(x.name)?.type ?? ''))
|
||||
|
|
Loading…
Reference in a new issue