From 3f2867efd50bcdf7aea0bf0b327562d8292c7620 Mon Sep 17 00:00:00 2001 From: Dillon Laird Date: Sun, 25 Aug 2024 20:10:44 -0700 Subject: [PATCH] fix type error --- vision_agent/agent/agent_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vision_agent/agent/agent_utils.py b/vision_agent/agent/agent_utils.py index a443c94d..8bcd124d 100644 --- a/vision_agent/agent/agent_utils.py +++ b/vision_agent/agent/agent_utils.py @@ -1,6 +1,6 @@ -import re import json import logging +import re import sys from typing import Any, Dict, Optional @@ -15,7 +15,7 @@ def _extract_sub_json(json_str: str) -> Optional[Dict[str, Any]]: json_str = match.group() try: json_dict = json.loads(json_str) - return json_dict + return json_dict # type: ignore except json.JSONDecodeError: return None return None @@ -39,7 +39,7 @@ def extract_json(json_str: str) -> Dict[str, Any]: except json.JSONDecodeError as e: json_dict = _extract_sub_json(json_str) if json_dict is not None: - return json_dict + return json_dict # type: ignore error_msg = f"Could not extract JSON from the given str: {json_str}.\nFunction input:\n{input_json_str}" _LOGGER.exception(error_msg) raise ValueError(error_msg) from e