code: def test_chat_completion_stream(client):
      try:
          # Your test data
          litellm.set_verbose = False
          from litellm.proxy.utils import get_instance_fn
  
          my_custom_logger = get_instance_fn(
              value="custom_callbacks.my_custom_logger",
              config_file_path=python_file_path,
          )
  
          print("id of initialized custom logger", id(my_custom_logger))
  
          litellm.callbacks = [my_custom_logger]
          import json
  
          print("initialized proxy")
          # import the initialized custom logger
          print(litellm.callbacks)
  
          print("LiteLLM Callbacks", litellm.callbacks)
          print("my_custom_logger", my_custom_logger)
  
          assert (
              my_custom_logger.streaming_response_obj == None
          )  # no streaming response obj is set pre call
  
          test_data = {
              "model": "Azure OpenAI GPT-4 Canada",
              "messages": [
                  {
                      "role": "user",
                      "content": "write 1 line poem about LiteLLM",
                  },
              ],
              "max_tokens": 40,
              "stream": True,  # streaming  call
          }
  
          response = client.post(
              "/chat/completions", json=test_data, headers=headers
          )
          print("made request", response.status_code, response.text)
          complete_response = ""
          for line in response.iter_lines():
              if line:
                  # Process the streaming data line here
                  print("\n\n Line", line)
                  print(line)
                  line = str(line)
  
                  json_data = line.replace("data: ", "")
  
                  if "[DONE]" in json_data:
                      break
  
                  # Parse the JSON string
                  data = json.loads(json_data)
  
                  print("\n\n decode_data", data)
  
                  # Access the content of choices[0]['message']['content']
                  content = data["choices"][0]["delta"]["content"] or ""
  
                  # Process the content as needed
                  print("Content:", content)
  
                  complete_response += content
  
          print(
              "\n\nHERE is the complete streaming response string",
              complete_response,
          )
          print("\n\nHERE IS the streaming Response from callback\n\n")
          print(my_custom_logger.streaming_response_obj)
          import time
  
          time.sleep(0.5)
  
          streamed_response = my_custom_logger.streaming_response_obj
          assert (
              complete_response
              == streamed_response["choices"][0]["message"]["content"]
          )
  
      except Exception as e:
          pytest.fail(f"LiteLLM Proxy test failed. Exception {str(e)}")
  
file_path: litellm/litellm/tests/test_proxy_custom_logger.py
imports: import sys, os
  import traceback
  from dotenv import load_dotenv
  import os, io, asyncio
  import pytest
  import litellm
  from litellm import embedding, completion, completion_cost, Timeout
  from litellm import RateLimitError
  import importlib, inspect
  from fastapi.testclient import TestClient
  from fastapi import FastAPI
  from litellm.proxy.proxy_server import router, save_worker_config, initialize, startup_event
label_desc: Use image node_id 4 for calling a global function with example usage: test_chat_completion_stream(client) without return types