code: def test_unary_streaming_websocket_same_deployment(serve_instance):
      app = FastAPI()
  
      @serve.deployment
      @serve.ingress(app)
      class RenaissanceMan:
          @app.get("/")
          def say_hi(self):
              return "hi"
  
          @app.get("/stream")
          def gen_hi(self) -> StreamingResponse:
              def gen():
                  for i in range(5):
                      yield "hi"
  
              return StreamingResponse(gen(), media_type="text/plain")
  
          @app.websocket("/ws")
          async def ws_hi(self, ws: WebSocket):
              try:
                  await ws.accept()
                  await ws.send_text(await ws.receive_text())
              except WebSocketDisconnect:
                  pass
  
      serve.run(RenaissanceMan.bind())
  
      assert requests.get("http://localhost:8000/").json() == "hi"
  
      r = requests.get("http://localhost:8000/stream", stream=True)
      r.raise_for_status()
      for chunk in r.iter_content(chunk_size=None, decode_unicode=True):
          assert chunk == "hi"
  
      with connect("ws://localhost:8000/ws") as ws:
          ws.send("hi")
          assert ws.recv() == "hi"
  
file_path: ray/python/ray/serve/tests/test_websockets.py
imports: import asyncio
  import sys
  import pytest
  import requests
  from fastapi import FastAPI, WebSocket, WebSocketDisconnect
  from starlette.responses import StreamingResponse
  from websockets.exceptions import ConnectionClosed
  from websockets.sync.client import connect
  from ray import serve
label_desc: Use image node_id 4 for calling a global function with example usage: test_unary_streaming_websocket_same_deployment(serve_instance) and returns: str, StreamingResponse