From dfdb7922a56358980b0c2c7509bb1bb273e0fcc4 Mon Sep 17 00:00:00 2001 From: Yazhou Cao Date: Mon, 11 Mar 2024 13:21:22 +0800 Subject: [PATCH] Fix typing errors --- vision_agent/image_utils.py | 2 +- vision_agent/tools/tools.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vision_agent/image_utils.py b/vision_agent/image_utils.py index 78022342..86533972 100644 --- a/vision_agent/image_utils.py +++ b/vision_agent/image_utils.py @@ -7,7 +7,7 @@ from PIL import Image -def b64_to_pil(b64_str: str) -> Image: +def b64_to_pil(b64_str: str) -> Image.Image: # , can't be encoded in b64 data so must be part of prefix if "," in b64_str: b64_str = b64_str.split(",")[1] diff --git a/vision_agent/tools/tools.py b/vision_agent/tools/tools.py index 4d41871e..474eba1e 100644 --- a/vision_agent/tools/tools.py +++ b/vision_agent/tools/tools.py @@ -60,8 +60,8 @@ def __call__(self, image: Union[str, Path, ImageType]) -> List[Dict]: ) resp_json: Dict[str, Any] = res.json() if resp_json["statusCode"] != 200: - _LOGGER.error(f"Request failed: {resp_json['data']}") - return cast(str, resp_json["data"]) + _LOGGER.error(f"Request failed: {resp_json}") + return cast(List[Dict], resp_json["data"]) class GroundingSAM(ImageTool):