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

@ -1,11 +1,18 @@
"""
Shared mock fixtures and workflow helpers for unit tests.
Database setup (test DB creation, migrations, session isolation) lives in
the root api/conftest.py. This module provides lightweight, non-DB fixtures:
- Mock objects (engine, workflow model, workflow run, user config, tools)
- Pre-built WorkflowGraph fixtures for various node topologies
"""
from dataclasses import dataclass, field
from typing import Any, Dict, Optional
from unittest.mock import Mock
import pytest
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
from api.constants import DATABASE_URL
from api.services.workflow.dto import (
EdgeDataDTO,
ExtractionVariableDTO,
@ -551,22 +558,3 @@ def three_node_workflow_no_variable_extraction() -> WorkflowGraph:
],
)
return WorkflowGraph(dto)
# =============================================================================
# Database fixtures for integration tests
# =============================================================================
@pytest.fixture(scope="session")
async def db_engine():
"""Create database engine for tests."""
engine = create_async_engine(DATABASE_URL, echo=False)
yield engine
await engine.dispose()
@pytest.fixture(scope="session")
async def db_session_factory(db_engine):
"""Create session factory for tests."""
return async_sessionmaker(bind=db_engine, expire_on_commit=False)