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

@ -45,8 +45,6 @@ class SuperuserWorkflowRunResponse(BaseModel):
cost_info: Optional[dict]
initial_context: Optional[dict]
gathered_context: Optional[dict]
admin_comment: Optional[str]
admin_comment_ts: Optional[datetime]
created_at: datetime
@ -151,49 +149,3 @@ async def get_workflow_runs(
limit=limit,
total_pages=total_pages,
)
# ------------------ Admin Comment ------------------
class AdminCommentRequest(BaseModel):
admin_comment: str
class AdminCommentResponse(BaseModel):
success: bool
admin_comment: str
admin_comment_ts: datetime
# ------------------ Routes ------------------
@router.post("/workflow-runs/{run_id}/comment", response_model=AdminCommentResponse)
async def set_admin_comment(
run_id: int,
request: AdminCommentRequest,
user: UserModel = Depends(get_superuser),
):
"""Add or update an *admin-only* comment for a workflow run.
The comment is stored inside the ``annotations`` JSON column under the
``admin_comment`` key so that it does not interfere with any other
annotations recorded by the system.
"""
await db_client.update_admin_comment(
run_id=run_id, admin_comment=request.admin_comment
)
# Fetch the updated run to get the timestamp from annotations
updated_run = await db_client.get_workflow_run_by_id(run_id)
admin_comment_ts = None
if updated_run and updated_run.annotations:
admin_comment_ts = updated_run.annotations.get("admin_comment_ts")
return AdminCommentResponse(
success=True,
admin_comment=request.admin_comment,
admin_comment_ts=admin_comment_ts,
)