Skip to content

Commit

Permalink
fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Aug 26, 2024
1 parent 41d4718 commit 3f2867e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vision_agent/agent/agent_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
import json
import logging
import re
import sys
from typing import Any, Dict, Optional

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3f2867e

Please sign in to comment.