fix - add real streaming for anthropic pass through

This commit is contained in:
Ishaan Jaff 2024-11-21 16:20:30 -08:00
parent 470d4608ff
commit 7a6cc9c861

View file

@ -180,8 +180,11 @@ async def anthropic_proxy_route(
## check for streaming ## check for streaming
is_streaming_request = False is_streaming_request = False
if "stream" in str(updated_url): # anthropic is streaming when 'stream' = True is in the body
is_streaming_request = True if request.method == "POST":
_request_body = await request.json()
if _request_body.get("stream"):
is_streaming_request = True
## CREATE PASS-THROUGH ## CREATE PASS-THROUGH
endpoint_func = create_pass_through_route( endpoint_func = create_pass_through_route(