vision-agent 0.2.222__tar.gz → 0.2.224__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. {vision_agent-0.2.222 → vision_agent-0.2.224}/PKG-INFO +1 -1
  2. {vision_agent-0.2.222 → vision_agent-0.2.224}/pyproject.toml +1 -1
  3. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/tools/tool_utils.py +5 -1
  4. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/tools/tools.py +14 -5
  5. {vision_agent-0.2.222 → vision_agent-0.2.224}/LICENSE +0 -0
  6. {vision_agent-0.2.222 → vision_agent-0.2.224}/README.md +0 -0
  7. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/.sim_tools/df.csv +0 -0
  8. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/.sim_tools/embs.npy +0 -0
  9. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/__init__.py +0 -0
  10. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/README.md +0 -0
  11. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/__init__.py +0 -0
  12. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/agent.py +0 -0
  13. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/agent_utils.py +0 -0
  14. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/types.py +0 -0
  15. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent.py +0 -0
  16. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_coder.py +0 -0
  17. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_coder_prompts.py +0 -0
  18. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_coder_prompts_v2.py +0 -0
  19. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_coder_v2.py +0 -0
  20. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_planner.py +0 -0
  21. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_planner_prompts.py +0 -0
  22. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_planner_prompts_v2.py +0 -0
  23. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_planner_v2.py +0 -0
  24. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_prompts.py +0 -0
  25. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_prompts_v2.py +0 -0
  26. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/agent/vision_agent_v2.py +0 -0
  27. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/clients/__init__.py +0 -0
  28. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/clients/http.py +0 -0
  29. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/clients/landing_public_api.py +0 -0
  30. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/fonts/__init__.py +0 -0
  31. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/fonts/default_font_ch_en.ttf +0 -0
  32. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/lmm/__init__.py +0 -0
  33. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/lmm/lmm.py +0 -0
  34. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/lmm/types.py +0 -0
  35. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/tools/__init__.py +0 -0
  36. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/tools/meta_tools.py +0 -0
  37. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/tools/planner_tools.py +0 -0
  38. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/tools/prompts.py +0 -0
  39. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/tools/tools_types.py +0 -0
  40. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/utils/__init__.py +0 -0
  41. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/utils/exceptions.py +0 -0
  42. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/utils/execute.py +0 -0
  43. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/utils/image_utils.py +0 -0
  44. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/utils/sim.py +0 -0
  45. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/utils/type_defs.py +0 -0
  46. {vision_agent-0.2.222 → vision_agent-0.2.224}/vision_agent/utils/video.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vision-agent
3
- Version: 0.2.222
3
+ Version: 0.2.224
4
4
  Summary: Toolset for Vision Agent
5
5
  Author: Landing AI
6
6
  Author-email: dev@landing.ai
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "vision-agent"
7
- version = "0.2.222"
7
+ version = "0.2.224"
8
8
  description = "Toolset for Vision Agent"
9
9
  authors = ["Landing AI <dev@landing.ai>"]
10
10
  readme = "README.md"
@@ -25,6 +25,10 @@ _LND_API_URL = f"{_LND_BASE_URL}/v1/agent/model"
25
25
  _LND_API_URL_v2 = f"{_LND_BASE_URL}/v1/tools"
26
26
 
27
27
 
28
+ def should_report_tool_traces() -> bool:
29
+ return bool(os.environ.get("REPORT_TOOL_TRACES", False))
30
+
31
+
28
32
  class ToolCallTrace(BaseModel):
29
33
  endpoint_url: str
30
34
  type: str
@@ -251,7 +255,7 @@ def _call_post(
251
255
  tool_call_trace.response = result
252
256
  return result
253
257
  finally:
254
- if tool_call_trace is not None:
258
+ if tool_call_trace is not None and should_report_tool_traces():
255
259
  trace = tool_call_trace.model_dump()
256
260
  display({MimeType.APPLICATION_JSON: trace}, raw=True)
257
261
 
@@ -32,6 +32,7 @@ from vision_agent.tools.tool_utils import (
32
32
  nms,
33
33
  send_inference_request,
34
34
  send_task_inference_request,
35
+ should_report_tool_traces,
35
36
  single_nms,
36
37
  )
37
38
  from vision_agent.tools.tools_types import JobStatus
@@ -94,6 +95,9 @@ def _display_tool_trace(
94
95
  # such as video bytes, which can be slow. Since this is calculated inside the
95
96
  # function we can't capture it with a decarator without adding it as a return value
96
97
  # which would change the function signature and affect the agent.
98
+ if not should_report_tool_traces():
99
+ return
100
+
97
101
  files_in_b64: List[Tuple[str, str]]
98
102
  if isinstance(files, str):
99
103
  files_in_b64 = [("images", files)]
@@ -264,7 +268,7 @@ def od_sam2_video_tracking(
264
268
  image_size = frames[0].shape[:2]
265
269
 
266
270
  def _transform_detections(
267
- input_list: List[Optional[List[Dict[str, Any]]]]
271
+ input_list: List[Optional[List[Dict[str, Any]]]],
268
272
  ) -> List[Optional[Dict[str, Any]]]:
269
273
  output_list: List[Optional[Dict[str, Any]]] = []
270
274
 
@@ -506,7 +510,7 @@ def owlv2_sam2_instance_segmentation(
506
510
  )
507
511
 
508
512
  _display_tool_trace(
509
- countgd_sam2_instance_segmentation.__name__,
513
+ owlv2_sam2_instance_segmentation.__name__,
510
514
  {
511
515
  "prompts": prompt,
512
516
  "confidence": box_threshold,
@@ -2243,15 +2247,17 @@ def save_image(image: np.ndarray, file_path: str) -> None:
2243
2247
  >>> save_image(image)
2244
2248
  """
2245
2249
  Path(file_path).parent.mkdir(parents=True, exist_ok=True)
2246
- from IPython.display import display
2247
-
2248
2250
  if not isinstance(image, np.ndarray) or (
2249
2251
  image.shape[0] == 0 and image.shape[1] == 0
2250
2252
  ):
2251
2253
  raise ValueError("The image is not a valid NumPy array with shape (H, W, C)")
2252
2254
 
2253
2255
  pil_image = Image.fromarray(image.astype(np.uint8)).convert("RGB")
2254
- display(pil_image)
2256
+ if should_report_tool_traces():
2257
+ from IPython.display import display
2258
+
2259
+ display(pil_image)
2260
+
2255
2261
  pil_image.save(file_path)
2256
2262
 
2257
2263
 
@@ -2302,6 +2308,9 @@ def save_video(
2302
2308
 
2303
2309
  def _save_video_to_result(video_uri: str) -> None:
2304
2310
  """Saves a video into the result of the code execution (as an intermediate output)."""
2311
+ if not should_report_tool_traces():
2312
+ return
2313
+
2305
2314
  from IPython.display import display
2306
2315
 
2307
2316
  serializer = FileSerializer(video_uri)
File without changes
File without changes