code: def test_async_text_completion_stream():
      # tests atext_completion + streaming - assert only one finish reason sent
      litellm.set_verbose = False
      print("test_async_text_completion with stream")
  
      async def test_get_response():
          try:
              response = await litellm.atext_completion(
                  model="gpt-3.5-turbo-instruct",
                  prompt="good morning",
                  stream=True,
              )
              print(f"response: {response}")
  
              num_finish_reason = 0
              async for chunk in response:
                  print(chunk)
                  if (
                      chunk["choices"][0].get("finish_reason")
                      is not None
                  ):
                      num_finish_reason += 1
                      print(
                          "finish_reason",
                          chunk["choices"][0].get("finish_reason"),
                      )
  
              assert (
                  num_finish_reason == 1
              ), f"expected only one finish reason. Got {num_finish_reason}"
          except Exception as e:
              pytest.fail(
                  f"GOT exception for gpt-3.5 instruct In streaming{e}"
              )
  
      asyncio.run(test_get_response())
  
file_path: litellm/litellm/tests/test_text_completion.py
imports: import sys, os, asyncio
  import traceback
  from dotenv import load_dotenv
  import os, io
  import pytest
  import litellm
  from litellm import embedding, completion, text_completion, completion_cost, atext_completion
  from litellm import RateLimitError
label_desc: Use image node_id 10 for calling a global function with example usage: test_async_text_completion_stream() without return types