feat: add qa node in workflow builder (#172)

* feat: add qa node in workflow builder

* feat: add qa analysis token usage in usage_info

* fix: mask the API key in QA node

* feat: add advanced configuration in QA node
This commit is contained in:
Abhishek 2026-02-25 13:53:30 +05:30 committed by GitHub
parent f1f4830012
commit a836825b83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 1619 additions and 265 deletions

View file

@ -11,6 +11,7 @@ class NodeType(str, Enum):
globalNode = "globalNode"
trigger = "trigger"
webhook = "webhook"
qa = "qa"
class Position(BaseModel):
@ -68,6 +69,13 @@ class NodeDataDTO(BaseModel):
custom_headers: Optional[list[CustomHeaderDTO]] = None
payload_template: Optional[dict] = None
retry_config: Optional[RetryConfigDTO] = None
# QA node specific fields
qa_enabled: bool = True
qa_system_prompt: Optional[str] = None
qa_model: Optional[str] = None
qa_min_call_duration: int = 15
qa_voicemail_calls: bool = False
qa_sample_rate: int = 100
class RFNodeDTO(BaseModel):
@ -78,8 +86,8 @@ class RFNodeDTO(BaseModel):
@model_validator(mode="after")
def _validate_prompt_required(self):
"""Require prompt for all node types except trigger and webhook."""
if self.type not in (NodeType.trigger, NodeType.webhook):
"""Require prompt for all node types except trigger, webhook, and qa."""
if self.type not in (NodeType.trigger, NodeType.webhook, NodeType.qa):
if not self.data.prompt or len(self.data.prompt.strip()) == 0:
raise ValueError("Prompt is required for non-trigger nodes")
return self