Skip to content

Commit fceaada

Browse files
committed
better
1 parent 6341f44 commit fceaada

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

unstructured_platform_plugins/etl_uvicorn/api_generator.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ def log_func_and_body(func: Callable, body: Optional[str] = None) -> None:
4747
logger.log(level=logger.level, msg=msg)
4848

4949

50-
async def invoke_async_gen_func(func: Callable, kwargs: Optional[dict[str, Any]] = None) -> Any:
51-
kwargs = kwargs or {}
52-
async for val in func(**kwargs):
53-
yield val
54-
55-
5650
async def invoke_func(func: Callable, kwargs: Optional[dict[str, Any]] = None) -> Any:
5751
kwargs = kwargs or {}
5852
if inspect.iscoroutinefunction(func):
@@ -129,7 +123,7 @@ async def wrap_fn(func: Callable, kwargs: Optional[dict[str, Any]] = None) -> In
129123
# Stream response if function is an async generator
130124

131125
async def _stream_response():
132-
async for output in invoke_async_gen_func(func=func, kwargs=request_dict):
126+
async for output in func(**(request_dict or {})):
133127
yield InvokeResponse(
134128
usage=usage, status_code=status.HTTP_200_OK, output=output
135129
).model_dump_json() + "\n"

0 commit comments

Comments
 (0)