feat(utils.py): support sync streaming for custom llm provider

This commit is contained in:
Krrish Dholakia 2024-07-25 16:47:32 -07:00
parent fe503386ab
commit bf23aac11d
5 changed files with 139 additions and 10 deletions

View file

@ -2713,6 +2713,14 @@ def completion(
## CALL FUNCTION
response = handler_fn()
if stream is True:
return CustomStreamWrapper(
completion_stream=response,
model=model,
custom_llm_provider=custom_llm_provider,
logging_obj=logging,
)
else:
raise ValueError(
f"Unable to map your input to a model. Check your input - {args}"