From d07c813ef90546a1a140119a741b27ab15364bd6 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 12 Mar 2024 11:15:14 -0700 Subject: [PATCH] test: add more logging for failing test --- litellm/llms/anthropic.py | 6 +++++- litellm/utils.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/litellm/llms/anthropic.py b/litellm/llms/anthropic.py index e74b2d0e570..969260a1340 100644 --- a/litellm/llms/anthropic.py +++ b/litellm/llms/anthropic.py @@ -180,11 +180,12 @@ def completion( "headers": headers, }, ) - + print_verbose(f"_is_function_call: {_is_function_call}") ## COMPLETION CALL if ( stream is not None and stream == True and _is_function_call == False ): # if function call - fake the streaming (need complete blocks for output parsing in openai format) + print_verbose(f"makes anthropic streaming POST request") data["stream"] = stream response = requests.post( api_base, @@ -289,6 +290,9 @@ def completion( completion_stream = model_response_iterator( model_response=streaming_model_response ) + print_verbose( + f"Returns anthropic CustomStreamWrapper with 'cached_response' streaming object" + ) return CustomStreamWrapper( completion_stream=completion_stream, model=model, diff --git a/litellm/utils.py b/litellm/utils.py index 0369e8b57d6..b03be46b3d0 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -9373,7 +9373,9 @@ 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}") + print_verbose( + f"PROCESSED CHUNK PRE CHUNK CREATOR: {chunk}; custom_llm_provider: {self.custom_llm_provider}" + ) response: Optional[ModelResponse] = self.chunk_creator(chunk=chunk) print_verbose(f"PROCESSED CHUNK POST CHUNK CREATOR: {response}")