vision-agent 0.2.206__tar.gz → 0.2.208__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.206 → vision_agent-0.2.208}/PKG-INFO +1 -1
  2. {vision_agent-0.2.206 → vision_agent-0.2.208}/pyproject.toml +1 -1
  3. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_coder_v2.py +2 -2
  4. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/tools/__init__.py +1 -0
  5. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/tools/planner_tools.py +1 -8
  6. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/tools/tool_utils.py +3 -5
  7. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/tools/tools.py +7 -0
  8. {vision_agent-0.2.206 → vision_agent-0.2.208}/LICENSE +0 -0
  9. {vision_agent-0.2.206 → vision_agent-0.2.208}/README.md +0 -0
  10. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/.sim_tools/df.csv +0 -0
  11. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/.sim_tools/embs.npy +0 -0
  12. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/__init__.py +0 -0
  13. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/README.md +0 -0
  14. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/__init__.py +0 -0
  15. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/agent.py +0 -0
  16. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/agent_utils.py +0 -0
  17. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/types.py +0 -0
  18. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent.py +0 -0
  19. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_coder.py +0 -0
  20. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_coder_prompts.py +0 -0
  21. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_coder_prompts_v2.py +0 -0
  22. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_planner.py +0 -0
  23. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_planner_prompts.py +0 -0
  24. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_planner_prompts_v2.py +0 -0
  25. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_planner_v2.py +0 -0
  26. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_prompts.py +0 -0
  27. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_prompts_v2.py +0 -0
  28. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/agent/vision_agent_v2.py +0 -0
  29. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/clients/__init__.py +0 -0
  30. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/clients/http.py +0 -0
  31. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/clients/landing_public_api.py +0 -0
  32. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/fonts/__init__.py +0 -0
  33. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/fonts/default_font_ch_en.ttf +0 -0
  34. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/lmm/__init__.py +0 -0
  35. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/lmm/lmm.py +0 -0
  36. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/lmm/types.py +0 -0
  37. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/tools/meta_tools.py +0 -0
  38. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/tools/prompts.py +0 -0
  39. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/tools/tools_types.py +0 -0
  40. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/utils/__init__.py +0 -0
  41. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/utils/exceptions.py +0 -0
  42. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/utils/execute.py +0 -0
  43. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/utils/image_utils.py +0 -0
  44. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/utils/sim.py +0 -0
  45. {vision_agent-0.2.206 → vision_agent-0.2.208}/vision_agent/utils/type_defs.py +0 -0
  46. {vision_agent-0.2.206 → vision_agent-0.2.208}/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.206
3
+ Version: 0.2.208
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.206"
7
+ version = "0.2.208"
8
8
  description = "Toolset for Vision Agent"
9
9
  authors = ["Landing AI <dev@landing.ai>"]
10
10
  readme = "README.md"
@@ -34,7 +34,7 @@ from vision_agent.utils.execute import (
34
34
  CodeInterpreterFactory,
35
35
  Execution,
36
36
  )
37
- from vision_agent.utils.sim import Sim, load_cached_sim
37
+ from vision_agent.utils.sim import Sim
38
38
 
39
39
  _CONSOLE = Console()
40
40
 
@@ -316,7 +316,7 @@ class VisionAgentCoderV2(AgentCoder):
316
316
  elif isinstance(tool_recommender, Sim):
317
317
  self.tool_recommender = tool_recommender
318
318
  else:
319
- self.tool_recommender = load_cached_sim(T.TOOLS_DF)
319
+ self.tool_recommender = T.get_tool_recommender()
320
320
 
321
321
  self.verbose = verbose
322
322
  self.code_sandbox_runtime = code_sandbox_runtime
@@ -45,6 +45,7 @@ from .tools import (
45
45
  generate_pose_image,
46
46
  generate_soft_edge_image,
47
47
  get_tool_documentation,
48
+ get_tool_recommender,
48
49
  git_vqa_v2,
49
50
  gpt4o_image_vqa,
50
51
  gpt4o_video_vqa,
@@ -2,7 +2,6 @@ import inspect
2
2
  import logging
3
3
  import shutil
4
4
  import tempfile
5
- from functools import lru_cache
6
5
  from typing import Any, Callable, Dict, List, Optional, Tuple, cast
7
6
 
8
7
  import libcst as cst
@@ -33,7 +32,6 @@ from vision_agent.utils.execute import (
33
32
  MimeType,
34
33
  )
35
34
  from vision_agent.utils.image_utils import convert_to_b64
36
- from vision_agent.utils.sim import Sim, load_cached_sim
37
35
 
38
36
  TOOL_FUNCTIONS = {tool.__name__: tool for tool in T.TOOLS}
39
37
 
@@ -41,11 +39,6 @@ _LOGGER = logging.getLogger(__name__)
41
39
  EXAMPLES = f"\n{TEST_TOOLS_EXAMPLE1}\n{TEST_TOOLS_EXAMPLE2}\n"
42
40
 
43
41
 
44
- @lru_cache(maxsize=1)
45
- def get_tool_recommender() -> Sim:
46
- return load_cached_sim(T.TOOLS_DF)
47
-
48
-
49
42
  def format_tool_output(tool_thoughts: str, tool_docstring: str) -> str:
50
43
  return_str = "[get_tool_for_task output]\n"
51
44
  if tool_thoughts.strip() != "":
@@ -129,7 +122,7 @@ def run_tool_testing(
129
122
  f"I need models from the {category.strip()} category of tools. {task}"
130
123
  )
131
124
 
132
- tool_docs = get_tool_recommender().top_k(category, k=10, thresh=0.2)
125
+ tool_docs = T.get_tool_recommender().top_k(category, k=10, thresh=0.2)
133
126
  if exclude_tools is not None and len(exclude_tools) > 0:
134
127
  cleaned_tool_docs = []
135
128
  for tool_doc in tool_docs:
@@ -41,11 +41,6 @@ def send_inference_request(
41
41
  metadata_payload: Optional[Dict[str, Any]] = None,
42
42
  is_form: bool = False,
43
43
  ) -> Any:
44
- # TODO: runtime_tag and function_name should be metadata_payload and not included
45
- # in the service payload
46
- if runtime_tag := os.environ.get("RUNTIME_TAG", ""):
47
- payload["runtime_tag"] = runtime_tag
48
-
49
44
  url = f"{_LND_API_URL_v2 if v2 else _LND_API_URL}/{endpoint_name}"
50
45
  if "TOOL_ENDPOINT_URL" in os.environ:
51
46
  url = os.environ["TOOL_ENDPOINT_URL"]
@@ -55,6 +50,9 @@ def send_inference_request(
55
50
  headers["Authorization"] = os.environ["TOOL_ENDPOINT_AUTH"]
56
51
  headers.pop("apikey")
57
52
 
53
+ if runtime_tag := os.environ.get("RUNTIME_TAG", ""):
54
+ headers["runtime_tag"] = runtime_tag
55
+
58
56
  session = _create_requests_session(
59
57
  url=url,
60
58
  num_retry=3,
@@ -4,6 +4,7 @@ import logging
4
4
  import os
5
5
  import tempfile
6
6
  import urllib.request
7
+ from functools import lru_cache
7
8
  from importlib import resources
8
9
  from pathlib import Path
9
10
  from typing import Any, Dict, List, Optional, Tuple, Union, cast
@@ -45,6 +46,7 @@ from vision_agent.utils.image_utils import (
45
46
  rle_decode,
46
47
  rle_decode_array,
47
48
  )
49
+ from vision_agent.utils.sim import Sim, load_cached_sim
48
50
  from vision_agent.utils.video import (
49
51
  extract_frames_from_video,
50
52
  frames_to_bytes,
@@ -80,6 +82,11 @@ _OCR_URL = "https://app.landing.ai/ocr/v1/detect-text"
80
82
  _LOGGER = logging.getLogger(__name__)
81
83
 
82
84
 
85
+ @lru_cache(maxsize=1)
86
+ def get_tool_recommender() -> Sim:
87
+ return load_cached_sim(TOOLS_DF)
88
+
89
+
83
90
  def grounding_dino(
84
91
  prompt: str,
85
92
  image: np.ndarray,
File without changes
File without changes