Skip to content

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

[MISC] Withdraw use_file_history from the published spec (#2290)

Chandrasekharan M5d46c66ccff8
diff --git a/backend/api_v2/serializers.py b/backend/api_v2/serializers.py
index 5bd5dc982..9e7bdf936 100644
--- a/backend/api_v2/serializers.py
+++ b/backend/api_v2/serializers.py
@@ -7,7 +7,7 @@ from urllib.parse import urlparse
from django.apps import apps
from django.core.validators import RegexValidator
from drf_spectacular.types import OpenApiTypes
-from drf_spectacular.utils import extend_schema_field
+from drf_spectacular.utils import extend_schema_field, extend_schema_serializer
from permissions.permission import mutable_workflows_for
from pipeline_v2.models import Pipeline
from prompt_studio.prompt_profile_manager_v2.models import ProfileManager
@@ -271,6 +271,7 @@ class UploadField(FileField):
"""
+@extend_schema_serializer(exclude_fields=["use_file_history"])
class ExecutionRequestSerializer(TagParamsSerializer):
"""Execution request serializer.
diff --git a/backend/api_v2/tests/test_docstudio_spec.py b/backend/api_v2/tests/test_docstudio_spec.py
index e528c5e97..a1bc9736e 100644
--- a/backend/api_v2/tests/test_docstudio_spec.py
+++ b/backend/api_v2/tests/test_docstudio_spec.py
@@ -35,7 +35,10 @@ from api_v2.management.commands.generate_docstudio_spec import (
SpecGenerationFailed,
render_spec,
)
-from api_v2.serializers import APIExecutionResponseSerializer
+from api_v2.serializers import (
+ APIExecutionResponseSerializer,
+ ExecutionRequestSerializer,
+)
#: Keys under a path item that are operations. The rest -- `parameters`,
#: `summary`, vendor extensions -- describe the path, not a call.
@@ -408,6 +411,19 @@ def test_documents_are_uploaded_as_binary_not_as_urls() -> None:
assert files["items"] == {"type": "string", "format": "binary"}
+def test_the_internal_execute_option_is_withdrawn_but_still_accepted() -> None:
+ assert "use_file_history" not in _schema("ExecuteRequest")["properties"]
+
+ request = ExecutionRequestSerializer(
+ data={
+ "use_file_history": True,
+ "presigned_urls": ["https://bucket.s3.amazonaws.com/doc.pdf"],
+ }
+ )
+ assert request.is_valid(), request.errors
+ assert request.validated_data["use_file_history"] is True
+
+
def test_the_result_a_pending_execution_omits_is_documented_nullable() -> None:
"""Both endpoints send `result: null` until the execution finishes, and a
generated deserialiser iterates that field.
diff --git a/specs/docstudio-oss.json b/specs/docstudio-oss.json
index 36a7ffe20..ea8039b3a 100644
--- a/specs/docstudio-oss.json
+++ b/specs/docstudio-oss.json
@@ -239,10 +239,6 @@
"maximum": 300,
"minimum": -1,
"type": "integer"
- },
- "use_file_history": {
- "default": false,
- "type": "boolean"
}
},
"type": "object"