Skip to content

Self-improving AI Employees for everyone

Add prompt and system message parameters to Chat Agent

trohitg41d4e2fcda85
diff --git a/client/src/nodeDefinitions/aiAgentNodes.ts b/client/src/nodeDefinitions/aiAgentNodes.ts
index b4403b28..867e8050 100644
--- a/client/src/nodeDefinitions/aiAgentNodes.ts
+++ b/client/src/nodeDefinitions/aiAgentNodes.ts
@@ -231,6 +231,23 @@ export const aiAgentNodes: Record<string, INodeTypeDescription> = {
dynamicOptions: true,
dependsOn: ['provider']
}
+ },
+ {
+ displayName: 'Prompt',
+ name: 'prompt',
+ type: 'string',
+ default: '',
+ typeOptions: { rows: 4 },
+ description: 'The message to send to the AI. Use {{chatTrigger.message}} or leave empty to auto-use connected node output.',
+ placeholder: '{{chatTrigger.message}}'
+ },
+ {
+ displayName: 'System Message',
+ name: 'systemMessage',
+ type: 'string',
+ default: 'You are a helpful assistant.',
+ typeOptions: { rows: 3 },
+ description: 'Define the behavior and personality of the AI agent'
}
]
},
diff --git a/client/src/nodeDefinitions/skillNodes.ts b/client/src/nodeDefinitions/skillNodes.ts
index c77a9ce7..2da2256c 100644
--- a/client/src/nodeDefinitions/skillNodes.ts
+++ b/client/src/nodeDefinitions/skillNodes.ts
@@ -63,15 +63,15 @@ function createSkillNode(config: {
}
export const skillNodes: Record<string, INodeTypeDescription> = {
- // Claude Assistant Skill - Default assistant personality
+ // Assistant Personality Skill - Default assistant personality
claudeSkill: createSkillNode({
name: 'claudeSkill',
- displayName: 'Claude Assistant',
- icon: '🤖',
+ displayName: 'Assistant Personality',
+ icon: '✨',
color: '#D97706',
skillName: 'claude-assistant',
subtitle: 'AI Personality',
- description: 'Default Claude assistant with helpful, harmless, and honest responses'
+ description: 'Default assistant personality with helpful, harmless, and honest responses'
}),
// WhatsApp Skill - Send and receive messages
diff --git a/server/services/handlers/ai.py b/server/services/handlers/ai.py
index 4bb90aa0..ae0388c4 100644
--- a/server/services/handlers/ai.py
+++ b/server/services/handlers/ai.py
@@ -177,6 +177,7 @@ async def handle_chat_agent(
workflow_id = context.get('workflow_id')
memory_data: Optional[Dict[str, Any]] = None
skill_data: List[Dict[str, Any]] = []
+ input_data: Optional[Dict[str, Any]] = None
logger.info(f"[Chat Agent] Processing node {node_id}, workflow_id={workflow_id}")
@@ -222,6 +223,24 @@ async def handle_chat_agent(
skill_data.append(skill_entry)
logger.debug(f"Chat Agent connected skill: {skill_type}")
+ # Input data detection - nodes connected to input-main
+ elif target_handle == 'input-main' or target_handle is None:
+ source_output = context.get('outputs', {}).get(source_node_id)
+ if source_output:
+ input_data = source_output
+ logger.debug(f"Chat Agent input from {source_node.get('type')}: {list(source_output.keys())}")
+
+ # Auto-use input data if prompt is empty (fallback for trigger nodes)
+ if not parameters.get('prompt') and input_data:
+ prompt = (
+ input_data.get('message') or
+ input_data.get('text') or
+ input_data.get('content') or
+ str(input_data)
+ )
+ parameters = {**parameters, 'prompt': prompt}
+ logger.info(f"[Chat Agent] Auto-using input as prompt: {prompt[:100] if len(str(prompt)) > 100 else prompt}...")
+
# Get broadcaster for real-time status updates
from services.status_broadcaster import get_status_broadcaster
broadcaster = get_status_broadcaster()