Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

schema and settings are updated (#738)

ali6fe853d56618
diff --git a/backend/adapter_processor_v2/migrations/0001_initial.py b/backend/adapter_processor_v2/migrations/0001_initial.py
index 9835825db..7edc333f2 100644
--- a/backend/adapter_processor_v2/migrations/0001_initial.py
+++ b/backend/adapter_processor_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -12,9 +12,9 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
+ ("tenant_account_v2", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("account_v2", "0001_initial"),
- ("tenant_account_v2", "0001_initial"),
]
operations = [
diff --git a/backend/api_v2/migrations/0001_initial.py b/backend/api_v2/migrations/0001_initial.py
index 89653832b..306c6dfc1 100644
--- a/backend/api_v2/migrations/0001_initial.py
+++ b/backend/api_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -13,8 +13,9 @@ class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ("account_v2", "0001_initial"),
("workflow_v2", "0001_initial"),
+ ("account_v2", "0001_initial"),
+ ("pipeline_v2", "0001_initial"),
]
operations = [
@@ -164,7 +165,9 @@ class Migration(migrations.Migration):
(
"api",
models.ForeignKey(
+ blank=True,
db_comment="Foreign key reference to the APIDeployment model.",
+ null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="api_keys",
to="api_v2.apideployment",
@@ -192,6 +195,16 @@ class Migration(migrations.Migration):
to=settings.AUTH_USER_MODEL,
),
),
+ (
+ "pipeline",
+ models.ForeignKey(
+ blank=True,
+ db_comment="Foreign key reference to the Pipeline model.",
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ to="pipeline_v2.pipeline",
+ ),
+ ),
],
options={
"verbose_name": "Api Deployment key",
diff --git a/backend/backend/settings/base.py b/backend/backend/settings/base.py
index cb87a99cb..b78d8d2fe 100644
--- a/backend/backend/settings/base.py
+++ b/backend/backend/settings/base.py
@@ -51,45 +51,6 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# Load default log from env
DEFAULT_LOG_LEVEL = os.environ.get("DEFAULT_LOG_LEVEL", "INFO")
-LOGGING = {
- "version": 1,
- "disable_existing_loggers": False,
- "filters": {
- "request_id": {"()": "log_request_id.filters.RequestIDFilter"},
- "tenant_context": {"()": "django_tenants.log.TenantContextFilter"},
- },
- "formatters": {
- "enriched": {
- "format": (
- "%(levelname)s : [%(asctime)s] [%(schema_name)s:%(domain_url)s]"
- "{module:%(module)s process:%(process)d "
- "thread:%(thread)d request_id:%(request_id)s} :- %(message)s"
- ),
- },
- "verbose": {
- "format": "[%(asctime)s] %(levelname)s %(name)s: %(message)s",
- "datefmt": "%d/%b/%Y %H:%M:%S",
- },
- "simple": {
- "format": "{levelname} {message}",
- "style": "{",
- },
- },
- "handlers": {
- "console": {
- "level": DEFAULT_LOG_LEVEL, # Set the desired logging level here
- "class": "logging.StreamHandler",
- "filters": ["request_id", "tenant_context"],
- "formatter": "enriched",
- },
- },
- "root": {
- "handlers": ["console"],
- "level": DEFAULT_LOG_LEVEL,
- # Set the desired logging level here as well
- },
-}
-
ENV_FILE = find_dotenv()
if ENV_FILE:
@@ -197,6 +158,44 @@ CSRF_TRUSTED_ORIGINS = [WEB_APP_ORIGIN_URL]
CORS_ALLOW_ALL_ORIGINS = False
if not check_feature_flag_status(FeatureFlag.MULTI_TENANCY_V2):
+ LOGGING = {
+ "version": 1,
+ "disable_existing_loggers": False,
+ "filters": {
+ "request_id": {"()": "log_request_id.filters.RequestIDFilter"},
+ "tenant_context": {"()": "django_tenants.log.TenantContextFilter"},
+ },
+ "formatters": {
+ "enriched": {
+ "format": (
+ "%(levelname)s : [%(asctime)s] [%(schema_name)s:%(domain_url)s]"
+ "{module:%(module)s process:%(process)d "
+ "thread:%(thread)d request_id:%(request_id)s} :- %(message)s"
+ ),
+ },
+ "verbose": {
+ "format": "[%(asctime)s] %(levelname)s %(name)s: %(message)s",
+ "datefmt": "%d/%b/%Y %H:%M:%S",
+ },
+ "simple": {
+ "format": "{levelname} {message}",
+ "style": "{",
+ },
+ },
+ "handlers": {
+ "console": {
+ "level": DEFAULT_LOG_LEVEL, # Set the desired logging level here
+ "class": "logging.StreamHandler",
+ "filters": ["request_id", "tenant_context"],
+ "formatter": "enriched",
+ },
+ },
+ "root": {
+ "handlers": ["console"],
+ "level": DEFAULT_LOG_LEVEL,
+ # Set the desired logging level here as well
+ },
+ }
SHARED_APPS = (
# Multitenancy
"django_tenants",
@@ -255,6 +254,43 @@ if not check_feature_flag_status(FeatureFlag.MULTI_TENANCY_V2):
"notification",
)
else:
+ LOGGING = {
+ "version": 1,
+ "disable_existing_loggers": False,
+ "filters": {
+ "request_id": {"()": "log_request_id.filters.RequestIDFilter"},
+ },
+ "formatters": {
+ "enriched": {
+ "format": (
+ "%(levelname)s : [%(asctime)s]"
+ "{module:%(module)s process:%(process)d "
+ "thread:%(thread)d request_id:%(request_id)s} :- %(message)s"
+ ),
+ },
+ "verbose": {
+ "format": "[%(asctime)s] %(levelname)s %(name)s: %(message)s",
+ "datefmt": "%d/%b/%Y %H:%M:%S",
+ },
+ "simple": {
+ "format": "{levelname} {message}",
+ "style": "{",
+ },
+ },
+ "handlers": {
+ "console": {
+ "level": DEFAULT_LOG_LEVEL, # Set the desired logging level here
+ "class": "logging.StreamHandler",
+ "filters": ["request_id"],
+ "formatter": "enriched",
+ },
+ },
+ "root": {
+ "handlers": ["console"],
+ "level": DEFAULT_LOG_LEVEL,
+ # Set the desired logging level here as well
+ },
+ }
SHARED_APPS = (
# Multitenancy
# "django_tenants",
@@ -283,7 +319,7 @@ else:
"django_celery_beat",
)
v2_apps = (
- "migration_tools",
+ "migrating.v2",
# "account_v2",
"connector_auth_v2",
"tenant_account_v2",
@@ -297,6 +333,7 @@ else:
"platform_settings_v2",
"api_v2",
"usage_v2",
+ "notification_v2",
"prompt_studio.prompt_profile_manager_v2",
"prompt_studio.prompt_studio_v2",
"prompt_studio.prompt_studio_core_v2",
diff --git a/backend/connector_v2/migrations/0001_initial.py b/backend/connector_v2/migrations/0001_initial.py
index 91d2d043e..89db7ba28 100644
--- a/backend/connector_v2/migrations/0001_initial.py
+++ b/backend/connector_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -12,9 +12,9 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
+ ("workflow_v2", "0001_initial"),
("connector_auth_v2", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ("workflow_v2", "0001_initial"),
("account_v2", "0001_initial"),
]
diff --git a/backend/notification_v2/migrations/0001_initial.py b/backend/notification_v2/migrations/0001_initial.py
new file mode 100644
index 000000000..abe592b8d
--- /dev/null
+++ b/backend/notification_v2/migrations/0001_initial.py
@@ -0,0 +1,127 @@
+# Generated by Django 4.2.1 on 2024-09-25 09:55
+
+import uuid
+
+import django.db.models.deletion
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ("api_v2", "0001_initial"),
+ ("pipeline_v2", "0001_initial"),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name="Notification",
+ fields=[
+ ("created_at", models.DateTimeField(auto_now_add=True)),
+ ("modified_at", models.DateTimeField(auto_now=True)),
+ (
+ "id",
+ models.UUIDField(
+ default=uuid.uuid4,
+ editable=False,
+ primary_key=True,
+ serialize=False,
+ ),
+ ),
+ (
+ "name",
+ models.CharField(
+ db_comment="Name of the notification.",
+ default="Notification",
+ max_length=255,
+ ),
+ ),
+ ("url", models.URLField(null=True)),
+ (
+ "authorization_key",
+ models.CharField(blank=True, max_length=255, null=True),
+ ),
+ (
+ "authorization_header",
+ models.CharField(blank=True, max_length=255, null=True),
+ ),
+ (
+ "authorization_type",
+ models.CharField(
+ choices=[
+ ("BEARER", "Bearer"),
+ ("API_KEY", "Api key"),
+ ("CUSTOM_HEADER", "Custom header"),
+ ("NONE", "None"),
+ ],
+ default="NONE",
+ max_length=50,
+ ),
+ ),
+ ("max_retries", models.IntegerField(default=0)),
+ (
+ "platform",
+ models.CharField(
+ blank=True,
+ choices=[("SLACK", "Slack"), ("API", "Api")],
+ max_length=50,
+ null=True,
+ ),
+ ),
+ (
+ "notification_type",
+ models.CharField(
+ choices=[("WEBHOOK", "Webhook")],
+ default="WEBHOOK",
+ max_length=50,
+ ),
+ ),
+ (
+ "is_active",
+ models.BooleanField(
+ db_comment="Flag indicating whether the notification is active or not.",
+ default=True,
+ ),
+ ),
+ (
+ "api",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="notifications",
+ to="api_v2.apideployment",
+ ),
+ ),
+ (
+ "pipeline",
+ models.ForeignKey(
+ blank=True,
+ null=True,
+ on_delete=django.db.models.deletion.CASCADE,
+ related_name="notifications",
+ to="pipeline_v2.pipeline",
+ ),
+ ),
+ ],
+ options={
+ "verbose_name": "Notification",
+ "verbose_name_plural": "Notifications",
+ "db_table": "notification",
+ },
+ ),
+ migrations.AddConstraint(
+ model_name="notification",
+ constraint=models.UniqueConstraint(
+ fields=("name", "pipeline"), name="unique_name_pipeline"
+ ),
+ ),
+ migrations.AddConstraint(
+ model_name="notification",
+ constraint=models.UniqueConstraint(
+ fields=("name", "api"), name="unique_name_api"
+ ),
+ ),
+ ]
diff --git a/backend/pipeline_v2/migrations/0001_initial.py b/backend/pipeline_v2/migrations/0001_initial.py
index 47c8eebbb..dea797756 100644
--- a/backend/pipeline_v2/migrations/0001_initial.py
+++ b/backend/pipeline_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -12,9 +12,9 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
+ ("workflow_v2", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("account_v2", "0001_initial"),
- ("workflow_v2", "0001_initial"),
]
operations = [
@@ -32,13 +32,33 @@ class Migration(migrations.Migration):
serialize=False,
),
),
- ("pipeline_name", models.CharField(default="", max_length=32)),
+ (
+ "pipeline_name",
+ models.CharField(default="", max_length=32, unique=True),
+ ),
("app_id", models.TextField(blank=True, max_length=32, null=True)),
- ("active", models.BooleanField(default=False)),
- ("scheduled", models.BooleanField(default=False)),
+ (
+ "active",
+ models.BooleanField(
+ db_comment="Indicates whether the pipeline is active",
+ default=False,
+ ),
+ ),
+ (
+ "scheduled",
+ models.BooleanField(
+ db_comment="Indicates whether the pipeline is scheduled",
+ default=False,
+ ),
+ ),
(
"cron_string",
- models.TextField(db_comment="UNIX cron string", max_length=256),
+ models.TextField(
+ blank=True,
+ db_comment="UNIX cron string",
+ max_length=256,
+ null=True,
+ ),
),
(
"pipeline_type",
@@ -89,7 +109,7 @@ class Migration(migrations.Migration):
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
- related_name="pipelines_created",
+ related_name="created_pipeline",
to=settings.AUTH_USER_MODEL,
),
),
@@ -99,7 +119,7 @@ class Migration(migrations.Migration):
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
- related_name="pipelines_modified",
+ related_name="modified_pipeline",
to=settings.AUTH_USER_MODEL,
),
),
@@ -118,7 +138,7 @@ class Migration(migrations.Migration):
"workflow",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
- related_name="pipelines",
+ related_name="pipeline_workflows",
to="workflow_v2.workflow",
),
),
@@ -132,13 +152,7 @@ class Migration(migrations.Migration):
migrations.AddConstraint(
model_name="pipeline",
constraint=models.UniqueConstraint(
- fields=("id", "pipeline_type"), name="unique_pipeline_entity"
- ),
- ),
- migrations.AddConstraint(
- model_name="pipeline",
- constraint=models.UniqueConstraint(
- fields=("pipeline_name", "organization"), name="unique_pipeline_name"
+ fields=("id", "pipeline_type"), name="unique_pipeline"
),
),
]
diff --git a/backend/prompt_studio/prompt_profile_manager_v2/migrations/0001_initial.py b/backend/prompt_studio/prompt_profile_manager_v2/migrations/0001_initial.py
index 01a98c45a..220a5b93f 100644
--- a/backend/prompt_studio/prompt_profile_manager_v2/migrations/0001_initial.py
+++ b/backend/prompt_studio/prompt_profile_manager_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -12,9 +12,9 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ("prompt_studio_core_v2", "0001_initial"),
("adapter_processor_v2", "0001_initial"),
+ ("prompt_studio_core_v2", "0001_initial"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
diff --git a/backend/prompt_studio/prompt_studio_document_manager_v2/migrations/0001_initial.py b/backend/prompt_studio/prompt_studio_document_manager_v2/migrations/0001_initial.py
index 6df0ccc49..388dd6e0a 100644
--- a/backend/prompt_studio/prompt_studio_document_manager_v2/migrations/0001_initial.py
+++ b/backend/prompt_studio/prompt_studio_document_manager_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -12,8 +12,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("prompt_studio_core_v2", "0001_initial"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
diff --git a/backend/prompt_studio/prompt_studio_index_manager_v2/migrations/0001_initial.py b/backend/prompt_studio/prompt_studio_index_manager_v2/migrations/0001_initial.py
index f587ef667..53b6be990 100644
--- a/backend/prompt_studio/prompt_studio_index_manager_v2/migrations/0001_initial.py
+++ b/backend/prompt_studio/prompt_studio_index_manager_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -12,8 +12,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("prompt_studio_document_manager_v2", "0001_initial"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("prompt_profile_manager_v2", "0001_initial"),
]
diff --git a/backend/prompt_studio/prompt_studio_output_manager_v2/migrations/0001_initial.py b/backend/prompt_studio/prompt_studio_output_manager_v2/migrations/0001_initial.py
index 825ad27c0..76218a734 100644
--- a/backend/prompt_studio/prompt_studio_output_manager_v2/migrations/0001_initial.py
+++ b/backend/prompt_studio/prompt_studio_output_manager_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -13,10 +13,10 @@ class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ("prompt_studio_v2", "0001_initial"),
- ("prompt_profile_manager_v2", "0001_initial"),
("prompt_studio_core_v2", "0001_initial"),
("prompt_studio_document_manager_v2", "0001_initial"),
+ ("prompt_studio_v2", "0001_initial"),
+ ("prompt_profile_manager_v2", "0001_initial"),
]
operations = [
@@ -46,6 +46,14 @@ class Migration(migrations.Migration):
blank=True, db_comment="Field to store chunks used", null=True
),
),
+ (
+ "challenge_data",
+ models.JSONField(
+ blank=True,
+ db_comment="Field to store challenge data",
+ null=True,
+ ),
+ ),
(
"eval_metrics",
models.JSONField(
diff --git a/backend/prompt_studio/prompt_studio_registry_v2/migrations/0001_initial.py b/backend/prompt_studio/prompt_studio_registry_v2/migrations/0001_initial.py
index 393fbd21f..9e5e86693 100644
--- a/backend/prompt_studio/prompt_studio_registry_v2/migrations/0001_initial.py
+++ b/backend/prompt_studio/prompt_studio_registry_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -13,8 +13,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("prompt_studio_core_v2", "0001_initial"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("account_v2", "0001_initial"),
]
diff --git a/backend/prompt_studio/prompt_studio_v2/migrations/0001_initial.py b/backend/prompt_studio/prompt_studio_v2/migrations/0001_initial.py
index 117bc51c7..79fefe9c3 100644
--- a/backend/prompt_studio/prompt_studio_v2/migrations/0001_initial.py
+++ b/backend/prompt_studio/prompt_studio_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -12,8 +12,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("prompt_studio_core_v2", "0001_initial"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("prompt_profile_manager_v2", "0001_initial"),
]
@@ -47,6 +47,7 @@ class Migration(migrations.Migration):
("date", "Response sent as date"),
("boolean", "Response sent as boolean"),
("json", "Response sent as json"),
+ ("table", "Response sent as table"),
],
db_comment="Field to store the type in which the response to be returned.",
default="Text",
@@ -141,8 +142,8 @@ class Migration(migrations.Migration):
models.ForeignKey(
blank=True,
null=True,
- on_delete=django.db.models.deletion.CASCADE,
- related_name="tool_studio_prompts",
+ on_delete=django.db.models.deletion.SET_NULL,
+ related_name="mapped_prompt",
to="prompt_studio_core_v2.customtool",
),
),
diff --git a/backend/tenant_account_v2/migrations/0001_initial.py b/backend/tenant_account_v2/migrations/0001_initial.py
index 70c7ba135..a8ab67c84 100644
--- a/backend/tenant_account_v2/migrations/0001_initial.py
+++ b/backend/tenant_account_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import django.db.models.deletion
from django.conf import settings
@@ -10,8 +10,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("account_v2", "0001_initial"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
diff --git a/backend/tool_instance_v2/migrations/0001_initial.py b/backend/tool_instance_v2/migrations/0001_initial.py
index 4e75c99e5..ed853fb12 100644
--- a/backend/tool_instance_v2/migrations/0001_initial.py
+++ b/backend/tool_instance_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -12,9 +12,9 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ("connector_v2", "0001_initial"),
("workflow_v2", "0001_initial"),
+ ("connector_v2", "0001_initial"),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
diff --git a/backend/usage_v2/migrations/0001_initial.py b/backend/usage_v2/migrations/0001_initial.py
index 28dfd79c7..e8f51a403 100644
--- a/backend/usage_v2/migrations/0001_initial.py
+++ b/backend/usage_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -135,9 +135,7 @@ class Migration(migrations.Migration):
options={
"db_table": "usage",
"indexes": [
- models.Index(
- fields=["run_id"], name="token_usage_run_id_cd3578_idx"
- )
+ models.Index(fields=["run_id"], name="usage_run_id_c84096_idx")
],
},
),
diff --git a/backend/workflow_manager/endpoint_v2/exceptions.py b/backend/workflow_manager/endpoint_v2/exceptions.py
index 7028eec28..9a1b03488 100644
--- a/backend/workflow_manager/endpoint_v2/exceptions.py
+++ b/backend/workflow_manager/endpoint_v2/exceptions.py
@@ -1,9 +1,21 @@
+from typing import Optional
+
from rest_framework.exceptions import APIException
class InvalidInputDirectory(APIException):
status_code = 400
- default_detail = "The provided directory is invalid."
+ default_detail = "The provided path is not a valid directory."
+
+ def __init__(
+ self,
+ dir: Optional[str] = None,
+ detail: Optional[str] = None,
+ code: Optional[str] = None,
+ ):
+ if dir:
+ detail = self.default_detail.replace("path", f"path '{dir}'")
+ super().__init__(detail, code)
class InvalidSourceConnectionType(APIException):
@@ -41,6 +53,14 @@ class FileHashNotFound(APIException):
default_detail = "Internal server error: File hash not found."
+class FileHashMismatched(APIException):
+ status_code = 400
+ default_detail = (
+ "The file's hash does not match the expected value. "
+ "The file may have been altered."
+ )
+
+
class ToolMetadataNotFound(APIException):
status_code = 500
default_detail = "Internal server error: Tool metadata not found."
diff --git a/backend/workflow_manager/endpoint_v2/migrations/0001_initial.py b/backend/workflow_manager/endpoint_v2/migrations/0001_initial.py
index 1cc0d1b1b..3032ad1d1 100644
--- a/backend/workflow_manager/endpoint_v2/migrations/0001_initial.py
+++ b/backend/workflow_manager/endpoint_v2/migrations/0001_initial.py
@@ -1,4 +1,4 @@
-# Generated by Django 4.2.1 on 2024-07-29 09:16
+# Generated by Django 4.2.1 on 2024-09-25 09:55
import uuid
@@ -11,8 +11,8 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- ("connector_v2", "0001_initial"),
("workflow_v2", "0001_initial"),
+ ("connector_v2", "0001_initial"),
]
operations = [
diff --git a/backend/workflow_manager/workflow_v2/workflow_helper.py b/backend/workflow_manager/workflow_v2/workflow_helper.py
index c94b2d576..01c2e1e62 100644
--- a/backend/workflow_manager/workflow_v2/workflow_helper.py
+++ b/backend/workflow_manager/workflow_v2/workflow_helper.py
@@ -5,8 +5,8 @@ import traceback
from typing import Any, Optional
from account_v2.constants import Common
-from api.utils import APIDeploymentUtils
from api_v2.models import APIDeployment
+from api_v2.utils import APIDeploymentUtils
from celery import current_task
from celery import exceptions as celery_exceptions
from celery import shared_task