code: def text_generator(request: Request):
      # download the image
      dl_request = requests.get(request.image_url, stream=True)
      dl_request.raise_for_status()
  
      # compose a JSON Predict request (send JPEG image in base64).
      jpeg_bytes = base64.b64encode(dl_request.content).decode("utf-8")
      predict_request = '{"instances" : [{"b64": "%s"}]}' % jpeg_bytes
  
      # make prediction
      response = requests.post(app.server_url, data=predict_request)
      response.raise_for_status()
      label_id = response.json()["predictions"][0]["classes"]
      return {"image_prediction": app.labels[label_id]}
  
file_path: cortex/test/apis/realtime/multi-container/app/main.py
imports: import base64
  import requests
  from fastapi import FastAPI
  from pydantic import BaseModel
label_desc: Use image node_id 2 for calling a global function with example usage: text_generator(request) and returns: dict