vision-agent 0.2.61__py3-none-any.whl → 0.2.63__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -97,6 +97,7 @@ def extract_json(json_str: str) -> Dict[str, Any]:
97
97
  try:
98
98
  json_dict = json.loads(json_str)
99
99
  except json.JSONDecodeError:
100
+ input_json_str = json_str
100
101
  if "```json" in json_str:
101
102
  json_str = json_str[json_str.find("```json") + len("```json") :]
102
103
  json_str = json_str[: json_str.find("```")]
@@ -104,7 +105,12 @@ def extract_json(json_str: str) -> Dict[str, Any]:
104
105
  json_str = json_str[json_str.find("```") + len("```") :]
105
106
  # get the last ``` not one from an intermediate string
106
107
  json_str = json_str[: json_str.find("}```")]
107
- json_dict = json.loads(json_str)
108
+ try:
109
+ json_dict = json.loads(json_str)
110
+ except json.JSONDecodeError as e:
111
+ error_msg = f"Could not extract JSON from the given str: {json_str}.\nFunction input:\n{input_json_str}"
112
+ _LOGGER.exception(error_msg)
113
+ raise ValueError(error_msg) from e
108
114
  return json_dict # type: ignore
109
115
 
110
116
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vision-agent
3
- Version: 0.2.61
3
+ Version: 0.2.63
4
4
  Summary: Toolset for Vision Agent
5
5
  Author: Landing AI
6
6
  Author-email: dev@landing.ai
@@ -242,7 +242,6 @@ You can then run Vision Agent using the Azure OpenAI models:
242
242
 
243
243
  ```python
244
244
  import vision_agent as va
245
- import vision_agent.tools as T
246
245
  agent = va.agent.AzureVisionAgent()
247
246
  ```
248
247
 
@@ -1,7 +1,7 @@
1
1
  vision_agent/__init__.py,sha256=EAb4-f9iyuEYkBrX4ag1syM8Syx8118_t0R6_C34M9w,57
2
2
  vision_agent/agent/__init__.py,sha256=IUwfbPMcT8X_rnXMLmI8gJ4ltsHy_XSs9eLiKURJxeY,81
3
3
  vision_agent/agent/agent.py,sha256=ZK-5lOtd9-eD9aWcXssJpnOyvZuO7_5hAmnb-6sWVe8,569
4
- vision_agent/agent/vision_agent.py,sha256=FF71-UucLXANgU1wJrSBRf9zSj1qufWVfaUyzFJ30Ps,24896
4
+ vision_agent/agent/vision_agent.py,sha256=TVODnpLVlAtqnvSMUQ0wC5YyDxt2U9KRK5V13dxhUA4,25194
5
5
  vision_agent/agent/vision_agent_prompts.py,sha256=bMXdZYf6kbikHn__tCGrYE1QvXC88EmpMpM_97V6szA,8472
6
6
  vision_agent/fonts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  vision_agent/fonts/default_font_ch_en.ttf,sha256=1YM0Z3XqLDjSNbF7ihQFSAIUdjF9m1rtHiNC_6QosTE,1594400
@@ -17,7 +17,7 @@ vision_agent/utils/image_utils.py,sha256=_cdiS5YrLzqkq_ZgFUO897m5M4_SCIThwUy4lOk
17
17
  vision_agent/utils/sim.py,sha256=ci6Eta73dDgLP1Ajtknbgmf1g8aAvBHqlVQvBuLMKXQ,4427
18
18
  vision_agent/utils/type_defs.py,sha256=BlI8ywWHAplC7kYWLvt4AOdnKpEW3qWEFm-GEOSkrFQ,1792
19
19
  vision_agent/utils/video.py,sha256=rNmU9KEIkZB5-EztZNlUiKYN0mm_55A_2VGUM0QpqLA,8779
20
- vision_agent-0.2.61.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
21
- vision_agent-0.2.61.dist-info/METADATA,sha256=2qsWbUJSz4flesypPK_CRBxJ70NlZ1xCpfhwejWPj_I,8348
22
- vision_agent-0.2.61.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
23
- vision_agent-0.2.61.dist-info/RECORD,,
20
+ vision_agent-0.2.63.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
21
+ vision_agent-0.2.63.dist-info/METADATA,sha256=clb-wEt_PcXS2I27fGICOau8hbsrkQLuhDVD0pnH1QQ,8317
22
+ vision_agent-0.2.63.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
23
+ vision_agent-0.2.63.dist-info/RECORD,,