unstructured-platform-plugins 0.0.28__tar.gz → 0.0.30__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/PKG-INFO +2 -1
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/pyproject.toml +1 -0
- unstructured_platform_plugins-0.0.30/unstructured_platform_plugins/__version__.py +1 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/etl_uvicorn/api_generator.py +9 -2
- unstructured_platform_plugins-0.0.28/unstructured_platform_plugins/__version__.py +0 -1
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/.gitignore +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/LICENSE.md +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/README.md +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/__init__.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/etl_uvicorn/__init__.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/etl_uvicorn/errors.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/etl_uvicorn/main.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/etl_uvicorn/otel.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/etl_uvicorn/utils.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/exceptions.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/schema/__init__.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/schema/filedata_meta.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/schema/json_schema.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/schema/model.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/schema/usage.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/schema/utils.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/type_hints.py +0 -0
- {unstructured_platform_plugins-0.0.28 → unstructured_platform_plugins-0.0.30}/unstructured_platform_plugins/validate_api.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: unstructured_platform_plugins
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.30
|
|
4
4
|
Summary: Wrapper to convert arbitrary code into a uvicorn/fastapi implementation for Unstructured Platform
|
|
5
5
|
License-File: LICENSE.md
|
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
17
17
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
18
|
Requires-Python: >=3.10
|
|
19
19
|
Requires-Dist: click
|
|
20
|
+
Requires-Dist: dataclasses-json
|
|
20
21
|
Requires-Dist: fastapi
|
|
21
22
|
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc
|
|
22
23
|
Requires-Dist: opentelemetry-instrumentation-fastapi
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.30" # pragma: no cover
|
|
@@ -11,7 +11,7 @@ from fastapi.responses import StreamingResponse
|
|
|
11
11
|
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
|
|
12
12
|
from pydantic import BaseModel, Field, create_model
|
|
13
13
|
from starlette.responses import RedirectResponse
|
|
14
|
-
from unstructured_ingest.data_types.file_data import file_data_from_dict
|
|
14
|
+
from unstructured_ingest.data_types.file_data import BatchFileData, FileData, file_data_from_dict
|
|
15
15
|
from uvicorn.config import LOG_LEVELS
|
|
16
16
|
from uvicorn.importer import import_from_string
|
|
17
17
|
|
|
@@ -31,6 +31,8 @@ from unstructured_platform_plugins.schema.json_schema import (
|
|
|
31
31
|
schema_to_base_model,
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
+
FileDataType = Union[FileData, BatchFileData]
|
|
35
|
+
|
|
34
36
|
|
|
35
37
|
class EtlApiException(Exception):
|
|
36
38
|
pass
|
|
@@ -137,7 +139,8 @@ def _wrap_in_fastapi(
|
|
|
137
139
|
class InvokeResponse(BaseModel):
|
|
138
140
|
usage: list[UsageData]
|
|
139
141
|
status_code: int
|
|
140
|
-
|
|
142
|
+
file_data: Optional[FileDataType] = None
|
|
143
|
+
filedata_meta: Optional[filedata_meta_model] = None
|
|
141
144
|
status_code_text: Optional[str] = None
|
|
142
145
|
output: Optional[response_type] = None
|
|
143
146
|
message_channels: MessageChannels = Field(default_factory=MessageChannels)
|
|
@@ -177,6 +180,7 @@ def _wrap_in_fastapi(
|
|
|
177
180
|
),
|
|
178
181
|
status_code=status.HTTP_200_OK,
|
|
179
182
|
output=output,
|
|
183
|
+
file_data=request_dict.get("file_data", None),
|
|
180
184
|
).model_dump_json()
|
|
181
185
|
+ "\n"
|
|
182
186
|
)
|
|
@@ -202,6 +206,7 @@ def _wrap_in_fastapi(
|
|
|
202
206
|
filedata_meta=filedata_meta_model.model_validate(filedata_meta.model_dump()),
|
|
203
207
|
status_code=status.HTTP_200_OK,
|
|
204
208
|
output=output,
|
|
209
|
+
file_data=request_dict.get("file_data", None),
|
|
205
210
|
)
|
|
206
211
|
except UnrecoverableException as ex:
|
|
207
212
|
logger.info("Unrecoverable error occurred during plugin invocation")
|
|
@@ -211,6 +216,7 @@ def _wrap_in_fastapi(
|
|
|
211
216
|
status_code=512,
|
|
212
217
|
status_code_text=ex.message,
|
|
213
218
|
filedata_meta=filedata_meta_model.model_validate(filedata_meta.model_dump()),
|
|
219
|
+
file_data=request_dict.get("file_data", None),
|
|
214
220
|
)
|
|
215
221
|
except Exception as invoke_error:
|
|
216
222
|
logger.error(f"failed to invoke plugin: {invoke_error}", exc_info=True)
|
|
@@ -221,6 +227,7 @@ def _wrap_in_fastapi(
|
|
|
221
227
|
filedata_meta=filedata_meta_model.model_validate(filedata_meta.model_dump()),
|
|
222
228
|
status_code=http_error.status_code,
|
|
223
229
|
status_code_text=f"[{invoke_error.__class__.__name__}] {invoke_error}",
|
|
230
|
+
file_data=request_dict.get("file_data", None),
|
|
224
231
|
)
|
|
225
232
|
|
|
226
233
|
if input_schema_model.model_fields:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.28" # pragma: no cover
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|