File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
unstructured_platform_plugins/etl_uvicorn Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1111from opentelemetry .instrumentation .fastapi import FastAPIInstrumentor
1212from pydantic import BaseModel , Field , create_model
1313from starlette .responses import RedirectResponse
14+ from unstructured_ingest .v2 .interfaces import FileData
1415from uvicorn .config import LOG_LEVELS
1516from uvicorn .importer import import_from_string
1617
@@ -171,6 +172,11 @@ async def run_job(request: input_schema_model) -> ResponseType:
171172 log_func_and_body (func = func , body = request .json ())
172173 # Create dictionary from pydantic model while preserving underlying types
173174 request_dict = {f : getattr (request , f ) for f in request .model_fields }
175+ # Map FileData back to original dataclass if present
176+ if "file_data" in request_dict :
177+ request_dict ["file_data" ] = FileData .from_dict (
178+ request_dict ["file_data" ].model_dump ()
179+ )
174180 map_inputs (func = func , raw_inputs = request_dict )
175181 if logger .level == LOG_LEVELS .get ("trace" , logging .NOTSET ):
176182 logger .log (level = logger .level , msg = f"passing inputs to function: { request_dict } " )
You can’t perform that action at this time.
0 commit comments