Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
feat(schema): Wave 6 - AI agent + chat model field hint enrichment
trohitg07e1f86601bd
diff --git a/server/models/nodes.py b/server/models/nodes.pyindex 7aab0ddd..5166bf2c 100644--- a/server/models/nodes.py+++ b/server/models/nodes.py@@ -45,32 +45,60 @@ class BaseNodeParams(BaseModel):class AIChatModelParams(BaseNodeParams):"""Parameters for AI chat model nodes."""type: Literal["openaiChatModel", "anthropicChatModel", "geminiChatModel", "openrouterChatModel", "groqChatModel", "cerebrasChatModel", "deepseekChatModel", "kimiChatModel", "mistralChatModel"]- prompt: str = ""- model: str = ""- temperature: float = Field(default=0.7, ge=0.0, le=2.0)- max_tokens: Optional[int] = Field(default=1000, alias="maxTokens")- system_prompt: Optional[str] = Field(default="", alias="systemMessage")- api_key: Optional[str] = Field(default=None, alias="apiKey")+ prompt: str = Field(default="", json_schema_extra={"rows": 4})+ model: str = Field(default="", json_schema_extra={"placeholder": "Select a model..."})+ temperature: float = Field(+ default=0.7, ge=0.0, le=2.0,+ json_schema_extra={"numberStepSize": 0.1},+ )+ max_tokens: Optional[int] = Field(default=1000, alias="maxTokens", ge=1, le=128000)+ system_prompt: Optional[str] = Field(+ default="", alias="systemMessage",+ json_schema_extra={"rows": 3},+ )+ api_key: Optional[str] = Field(+ default=None, alias="apiKey",+ json_schema_extra={"password": True},+ )class AIAgentParams(BaseNodeParams):"""Parameters for AI agent node."""type: Literal["aiAgent"]- prompt: str = ""+ prompt: str = Field(+ default="",+ json_schema_extra={+ "placeholder": "Enter your prompt or use template variables...",+ "rows": 4,+ },+ )provider: Literal["openai", "anthropic", "gemini", "openrouter", "groq", "cerebras", "deepseek", "kimi", "mistral"] = "openai"- model: str = ""- temperature: float = Field(default=0.7, ge=0.0, le=2.0)- max_tokens: Optional[int] = Field(default=1000, alias="maxTokens")- system_message: Optional[str] = Field(default="You are a helpful assistant", alias="systemMessage")- api_key: Optional[str] = Field(default=None, alias="apiKey")+ model: str = Field(default="", json_schema_extra={"placeholder": "Select a model..."})+ temperature: float = Field(+ default=0.7, ge=0.0, le=2.0,+ json_schema_extra={"numberStepSize": 0.1},+ )+ max_tokens: Optional[int] = Field(default=1000, alias="maxTokens", ge=1, le=200000)+ system_message: Optional[str] = Field(+ default="You are a helpful assistant",+ alias="systemMessage",+ json_schema_extra={"rows": 3},+ )+ api_key: Optional[str] = Field(+ default=None, alias="apiKey",+ json_schema_extra={"password": True},+ )class ChatAgentParams(BaseNodeParams):"""Parameters for chat agent node (skill-based)."""type: Literal["chatAgent"]provider: Literal["openai", "anthropic", "gemini", "openrouter", "groq", "cerebras", "deepseek", "kimi", "mistral"] = "openai"- model: str = ""- api_key: Optional[str] = Field(default=None, alias="apiKey")+ model: str = Field(default="", json_schema_extra={"placeholder": "Select a model..."})+ api_key: Optional[str] = Field(+ default=None, alias="apiKey",+ json_schema_extra={"password": True},+ )class SpecializedAgentParams(BaseNodeParams):@@ -85,16 +113,38 @@ class SpecializedAgentParams(BaseNodeParams):"orchestrator_agent", "ai_employee", "rlm_agent", "claude_code_agent","deep_agent",]- prompt: str = ""+ prompt: str = Field(+ default="",+ json_schema_extra={+ "placeholder": "Enter your prompt or use template variables...",+ "rows": 4,+ },+ )provider: Literal["openai", "anthropic", "gemini", "openrouter", "groq", "cerebras", "deepseek", "kimi", "mistral"] = "openai"- model: str = ""- temperature: float = Field(default=0.7, ge=0.0, le=2.0)- max_tokens: Optional[int] = Field(default=1000, alias="maxTokens")- system_message: Optional[str] = Field(default="", alias="systemMessage")- api_key: Optional[str] = Field(default=None, alias="apiKey")+ model: str = Field(default="", json_schema_extra={"placeholder": "Select a model..."})+ temperature: float = Field(+ default=0.7, ge=0.0, le=2.0,+ json_schema_extra={"numberStepSize": 0.1},+ )+ max_tokens: Optional[int] = Field(default=1000, alias="maxTokens", ge=1, le=200000)+ system_message: Optional[str] = Field(+ default="",+ alias="systemMessage",+ json_schema_extra={"rows": 3},+ )+ api_key: Optional[str] = Field(+ default=None, alias="apiKey",+ json_schema_extra={"password": True},+ )thinking_enabled: bool = Field(default=False, alias="thinkingEnabled")- thinking_budget: int = Field(default=2048, alias="thinkingBudget", ge=1024, le=16000)- reasoning_effort: Literal["minimal", "low", "medium", "high"] = Field(default="medium", alias="reasoningEffort")+ thinking_budget: int = Field(+ default=2048, alias="thinkingBudget", ge=1024, le=16000,+ json_schema_extra={"displayOptions": {"show": {"thinking_enabled": [True]}}},+ )+ reasoning_effort: Literal["minimal", "low", "medium", "high"] = Field(+ default="medium", alias="reasoningEffort",+ json_schema_extra={"displayOptions": {"show": {"thinking_enabled": [True]}}},+ )class SimpleMemoryParams(BaseNodeParams):diff --git a/server/tests/test_node_spec.py b/server/tests/test_node_spec.pyindex b3d53f15..232f9c2e 100644--- a/server/tests/test_node_spec.py+++ b/server/tests/test_node_spec.py@@ -524,3 +524,31 @@ class TestDisplayOptionsEnrichment:spec = get_node_spec("tasks")tl = spec["inputs"]["properties"]["tasklistId"]assert tl["loadOptionsMethod"] == "googleTasklists"++ def test_ai_agent_temperature_step_size(self):+ spec = get_node_spec("aiAgent")+ temp = spec["inputs"]["properties"]["temperature"]+ assert temp["numberStepSize"] == 0.1++ def test_ai_agent_prompt_carries_placeholder_and_rows(self):+ spec = get_node_spec("aiAgent")+ prompt = spec["inputs"]["properties"]["prompt"]+ assert prompt["placeholder"] == "Enter your prompt or use template variables..."+ assert prompt["rows"] == 4++ def test_ai_agent_api_key_password_masked(self):+ spec = get_node_spec("aiAgent")+ api_key = spec["inputs"]["properties"]["apiKey"]+ assert api_key["password"] is True++ def test_specialized_agent_thinking_budget_gated(self):+ spec = get_node_spec("coding_agent")+ budget = spec["inputs"]["properties"]["thinkingBudget"]+ assert budget["displayOptions"]["show"]["thinking_enabled"] == [True]+ effort = spec["inputs"]["properties"]["reasoningEffort"]+ assert effort["displayOptions"]["show"]["thinking_enabled"] == [True]++ def test_chat_model_password_masked(self):+ spec = get_node_spec("openaiChatModel")+ api_key = spec["inputs"]["properties"]["apiKey"]+ assert api_key["password"] is True