forked from phoenix/litellm-mirror
remove unused function stream_response
This commit is contained in:
parent
7a6cc9c861
commit
0f7caa1cdb
1 changed files with 8 additions and 27 deletions
|
@ -308,26 +308,6 @@ def get_endpoint_type(url: str) -> EndpointType:
|
||||||
return EndpointType.GENERIC
|
return EndpointType.GENERIC
|
||||||
|
|
||||||
|
|
||||||
async def stream_response(
|
|
||||||
response: httpx.Response,
|
|
||||||
request_body: Optional[dict],
|
|
||||||
logging_obj: LiteLLMLoggingObj,
|
|
||||||
endpoint_type: EndpointType,
|
|
||||||
start_time: datetime,
|
|
||||||
url: str,
|
|
||||||
) -> AsyncIterable[Union[str, bytes]]:
|
|
||||||
async for chunk in chunk_processor(
|
|
||||||
response=response,
|
|
||||||
request_body=request_body,
|
|
||||||
litellm_logging_obj=logging_obj,
|
|
||||||
endpoint_type=endpoint_type,
|
|
||||||
start_time=start_time,
|
|
||||||
passthrough_success_handler_obj=pass_through_endpoint_logging,
|
|
||||||
url_route=str(url),
|
|
||||||
):
|
|
||||||
yield chunk
|
|
||||||
|
|
||||||
|
|
||||||
async def pass_through_request( # noqa: PLR0915
|
async def pass_through_request( # noqa: PLR0915
|
||||||
request: Request,
|
request: Request,
|
||||||
target: str,
|
target: str,
|
||||||
|
@ -448,7 +428,6 @@ async def pass_through_request( # noqa: PLR0915
|
||||||
"headers": headers,
|
"headers": headers,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
if stream:
|
if stream:
|
||||||
req = async_client.build_request(
|
req = async_client.build_request(
|
||||||
"POST",
|
"POST",
|
||||||
|
@ -468,13 +447,14 @@ async def pass_through_request( # noqa: PLR0915
|
||||||
)
|
)
|
||||||
|
|
||||||
return StreamingResponse(
|
return StreamingResponse(
|
||||||
stream_response(
|
chunk_processor(
|
||||||
response=response,
|
response=response,
|
||||||
request_body=_parsed_body,
|
request_body=_parsed_body,
|
||||||
logging_obj=logging_obj,
|
litellm_logging_obj=logging_obj,
|
||||||
endpoint_type=endpoint_type,
|
endpoint_type=endpoint_type,
|
||||||
start_time=start_time,
|
start_time=start_time,
|
||||||
url=str(url),
|
passthrough_success_handler_obj=pass_through_endpoint_logging,
|
||||||
|
url_route=str(url),
|
||||||
),
|
),
|
||||||
headers=get_response_headers(response.headers),
|
headers=get_response_headers(response.headers),
|
||||||
status_code=response.status_code,
|
status_code=response.status_code,
|
||||||
|
@ -507,13 +487,14 @@ async def pass_through_request( # noqa: PLR0915
|
||||||
)
|
)
|
||||||
|
|
||||||
return StreamingResponse(
|
return StreamingResponse(
|
||||||
stream_response(
|
chunk_processor(
|
||||||
response=response,
|
response=response,
|
||||||
request_body=_parsed_body,
|
request_body=_parsed_body,
|
||||||
logging_obj=logging_obj,
|
litellm_logging_obj=logging_obj,
|
||||||
endpoint_type=endpoint_type,
|
endpoint_type=endpoint_type,
|
||||||
start_time=start_time,
|
start_time=start_time,
|
||||||
url=str(url),
|
passthrough_success_handler_obj=pass_through_endpoint_logging,
|
||||||
|
url_route=str(url),
|
||||||
),
|
),
|
||||||
headers=get_response_headers(response.headers),
|
headers=get_response_headers(response.headers),
|
||||||
status_code=response.status_code,
|
status_code=response.status_code,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue