forked from phoenix/litellm-mirror
fix(utils.py): add more logging
This commit is contained in:
parent
bdf29ca71f
commit
d6669fe9e3
4 changed files with 4 additions and 0 deletions
BIN
dist/litellm-1.12.6.dev1-py3-none-any.whl
vendored
Normal file
BIN
dist/litellm-1.12.6.dev1-py3-none-any.whl
vendored
Normal file
Binary file not shown.
BIN
dist/litellm-1.12.6.dev1.tar.gz
vendored
Normal file
BIN
dist/litellm-1.12.6.dev1.tar.gz
vendored
Normal file
Binary file not shown.
|
@ -190,6 +190,7 @@ async def acompletion(*args, **kwargs):
|
|||
# Call the synchronous function using run_in_executor
|
||||
response = await loop.run_in_executor(None, func_with_context)
|
||||
if kwargs.get("stream", False): # return an async generator
|
||||
print_verbose(f"ENTERS STREAMING FOR ACOMPLETION")
|
||||
return _async_streaming(response=response, model=model, custom_llm_provider=custom_llm_provider, args=args)
|
||||
else:
|
||||
return response
|
||||
|
@ -202,6 +203,7 @@ async def acompletion(*args, **kwargs):
|
|||
async def _async_streaming(response, model, custom_llm_provider, args):
|
||||
try:
|
||||
async for line in response:
|
||||
print_verbose(f"line in async streaming: {line}")
|
||||
yield line
|
||||
except Exception as e:
|
||||
raise exception_type(
|
||||
|
@ -1217,6 +1219,7 @@ def completion(
|
|||
# "SageMaker is currently not supporting streaming responses."
|
||||
|
||||
# fake streaming for sagemaker
|
||||
print_verbose(f"ENTERS SAGEMAKER CUSTOMSTREAMWRAPPER")
|
||||
resp_string = model_response["choices"][0]["message"]["content"]
|
||||
response = CustomStreamWrapper(
|
||||
resp_string, model, custom_llm_provider="sagemaker", logging_obj=logging
|
||||
|
|
|
@ -5685,6 +5685,7 @@ class CustomStreamWrapper:
|
|||
else:
|
||||
chunk = next(self.completion_stream)
|
||||
if chunk is not None and chunk != b'':
|
||||
print_verbose(f"PROCESSED CHUNK PRE CHUNK CREATOR: {chunk}")
|
||||
response = self.chunk_creator(chunk=chunk)
|
||||
if response is None:
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue