LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
UN-2427 [FIX] Resolve "unexpected keyword argument 'api_key'" in deployment execution GET (#1408)
vishnuszipstack55f1596f9d80
diff --git a/backend/api_v2/api_deployment_views.py b/backend/api_v2/api_deployment_views.pyindex 61f4e4ee9..e13b211b4 100644--- a/backend/api_v2/api_deployment_views.py+++ b/backend/api_v2/api_deployment_views.py@@ -17,6 +17,7 @@ from workflow_manager.workflow_v2.dto import ExecutionResponsefrom api_v2.api_deployment_dto_registry import ApiDeploymentDTORegistryfrom api_v2.constants import ApiExecutionfrom api_v2.deployment_helper import DeploymentHelper+from api_v2.dto import DeploymentExecutionDTOfrom api_v2.exceptions import NoActiveAPIKeyErrorfrom api_v2.models import APIDeploymentfrom api_v2.serializers import (@@ -49,9 +50,10 @@ class DeploymentExecution(views.APIView):request: Request,org_name: str,api_name: str,- api: APIDeployment,- api_key: str,+ deployment_execution_dto: DeploymentExecutionDTO,) -> Response:+ api: APIDeployment = deployment_execution_dto.api+ api_key: str = deployment_execution_dto.api_keyserializer = ExecutionRequestSerializer(data=request.data, context={"api": api, "api_key": api_key})@@ -84,7 +86,11 @@ class DeploymentExecution(views.APIView):@DeploymentHelper.validate_api_keydef get(- self, request: Request, org_name: str, api_name: str, api: APIDeployment+ self,+ request: Request,+ org_name: str,+ api_name: str,+ deployment_execution_dto: DeploymentExecutionDTO,) -> Response:serializer = ExecutionQuerySerializer(data=request.query_params)serializer.is_valid(raise_exception=True)diff --git a/backend/api_v2/deployment_helper.py b/backend/api_v2/deployment_helper.pyindex 3851ca153..6af12cef0 100644--- a/backend/api_v2/deployment_helper.py+++ b/backend/api_v2/deployment_helper.py@@ -19,6 +19,7 @@ from workflow_manager.workflow_v2.models import Workflow, WorkflowExecutionfrom workflow_manager.workflow_v2.workflow_helper import WorkflowHelperfrom api_v2.api_key_validator import BaseAPIKeyValidator+from api_v2.dto import DeploymentExecutionDTOfrom api_v2.exceptions import (ApiKeyCreateException,APINotFound,@@ -52,8 +53,11 @@ class DeploymentHelper(BaseAPIKeyValidator):api_name = kwargs.get("api_name") or request.data.get("api_name")api_deployment = DeploymentHelper.get_deployment_by_api_name(api_name=api_name)DeploymentHelper.validate_api(api_deployment=api_deployment, api_key=api_key)- kwargs["api"] = api_deployment- kwargs["api_key"] = api_key++ deployment_execution_dto = DeploymentExecutionDTO(+ api=api_deployment, api_key=api_key+ )+ kwargs["deployment_execution_dto"] = deployment_execution_dtoreturn func(self, request, *args, **kwargs)@staticmethoddiff --git a/backend/api_v2/dto.py b/backend/api_v2/dto.pynew file mode 100644index 000000000..93df13e44--- /dev/null+++ b/backend/api_v2/dto.py@@ -0,0 +1,11 @@+from dataclasses import dataclass++from api_v2.models import APIDeployment+++@dataclass+class DeploymentExecutionDTO:+ """DTO for deployment execution viewset."""++ api: APIDeployment+ api_key: str