import hashlib def buildImage(response, action, outputs): if hasattr(action, "image"): if response is not None: image_bytes = response.content outputs[action.image] = image_bytes image_sha = hashlib.sha256(image_bytes).hexdigest() outputs[f"{action.image}_hash"] = image_sha else: print("No response received"), return outputs