fix(utils.py): fix vertex anthropic streaming

This commit is contained in:
Krrish Dholakia 2024-07-03 18:43:46 -07:00
parent 46800ba20a
commit 4a6471e075
4 changed files with 22 additions and 202 deletions

View file

@ -2028,18 +2028,18 @@ def completion(
acompletion=acompletion,
)
if (
"stream" in optional_params
and optional_params["stream"] == True
and acompletion == False
):
response = CustomStreamWrapper(
model_response,
model,
custom_llm_provider="vertex_ai",
logging_obj=logging,
)
return response
if (
"stream" in optional_params
and optional_params["stream"] == True
and acompletion == False
):
response = CustomStreamWrapper(
model_response,
model,
custom_llm_provider="vertex_ai",
logging_obj=logging,
)
return response
response = model_response
elif custom_llm_provider == "predibase":
tenant_id = (