diff --git a/litellm/tests/test_streaming.py b/litellm/tests/test_streaming.py index 314b8736b6..7947de8382 100644 --- a/litellm/tests/test_streaming.py +++ b/litellm/tests/test_streaming.py @@ -351,7 +351,7 @@ def test_completion_cohere_stream_bad_key(): def test_completion_azure_stream(): try: - litellm.set_verbose = True + litellm.set_verbose = False messages = [ {"role": "system", "content": "You are a helpful assistant."}, { diff --git a/litellm/utils.py b/litellm/utils.py index 15dc71926d..268b2f2ce2 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -4458,6 +4458,7 @@ class CustomStreamWrapper: def chunk_creator(self, chunk): model_response = ModelResponse(stream=True, model=self.model) + print_verbose(f"model_response finish reason 1: {model_response.choices[0].finish_reason}") try: # return this for all models completion_obj = {"content": ""} @@ -4497,6 +4498,7 @@ class CustomStreamWrapper: print_verbose(f"len(completion_obj['content']: {len(completion_obj['content'])}") if response_obj["is_finished"]: model_response.choices[0].finish_reason = response_obj["finish_reason"] + print_verbose(f"model_response finish reason 2: {model_response.choices[0].finish_reason}") elif self.custom_llm_provider and self.custom_llm_provider == "maritalk": response_obj = self.handle_maritalk_chunk(chunk) completion_obj["content"] = response_obj["text"] @@ -4601,6 +4603,7 @@ class CustomStreamWrapper: model_response.model = self.model print_verbose(f"model_response: {model_response}; completion_obj: {completion_obj}") + print_verbose(f"model_response finish reason 3: {model_response.choices[0].finish_reason}") if len(completion_obj["content"]) > 0: # cannot set content of an OpenAI Object to be an empty string hold, model_response_str = self.check_special_tokens(completion_obj["content"]) if hold is False: