vision-agent 0.2.205__tar.gz → 0.2.206__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.205 → vision_agent-0.2.206}/PKG-INFO +1 -1
  2. {vision_agent-0.2.205 → vision_agent-0.2.206}/pyproject.toml +1 -1
  3. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/tools/planner_tools.py +12 -5
  4. {vision_agent-0.2.205 → vision_agent-0.2.206}/LICENSE +0 -0
  5. {vision_agent-0.2.205 → vision_agent-0.2.206}/README.md +0 -0
  6. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/.sim_tools/df.csv +0 -0
  7. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/.sim_tools/embs.npy +0 -0
  8. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/__init__.py +0 -0
  9. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/README.md +0 -0
  10. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/__init__.py +0 -0
  11. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/agent.py +0 -0
  12. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/agent_utils.py +0 -0
  13. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/types.py +0 -0
  14. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent.py +0 -0
  15. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_coder.py +0 -0
  16. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_coder_prompts.py +0 -0
  17. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_coder_prompts_v2.py +0 -0
  18. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_coder_v2.py +0 -0
  19. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_planner.py +0 -0
  20. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_planner_prompts.py +0 -0
  21. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_planner_prompts_v2.py +0 -0
  22. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_planner_v2.py +0 -0
  23. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_prompts.py +0 -0
  24. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_prompts_v2.py +0 -0
  25. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/agent/vision_agent_v2.py +0 -0
  26. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/clients/__init__.py +0 -0
  27. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/clients/http.py +0 -0
  28. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/clients/landing_public_api.py +0 -0
  29. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/fonts/__init__.py +0 -0
  30. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/fonts/default_font_ch_en.ttf +0 -0
  31. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/lmm/__init__.py +0 -0
  32. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/lmm/lmm.py +0 -0
  33. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/lmm/types.py +0 -0
  34. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/tools/__init__.py +0 -0
  35. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/tools/meta_tools.py +0 -0
  36. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/tools/prompts.py +0 -0
  37. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/tools/tool_utils.py +0 -0
  38. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/tools/tools.py +0 -0
  39. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/tools/tools_types.py +0 -0
  40. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/utils/__init__.py +0 -0
  41. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/utils/exceptions.py +0 -0
  42. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/utils/execute.py +0 -0
  43. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/utils/image_utils.py +0 -0
  44. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/utils/sim.py +0 -0
  45. {vision_agent-0.2.205 → vision_agent-0.2.206}/vision_agent/utils/type_defs.py +0 -0
  46. {vision_agent-0.2.205 → vision_agent-0.2.206}/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.205
3
+ Version: 0.2.206
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.205"
7
+ version = "0.2.206"
8
8
  description = "Toolset for Vision Agent"
9
9
  authors = ["Landing AI <dev@landing.ai>"]
10
10
  readme = "README.md"
@@ -2,6 +2,7 @@ import inspect
2
2
  import logging
3
3
  import shutil
4
4
  import tempfile
5
+ from functools import lru_cache
5
6
  from typing import Any, Callable, Dict, List, Optional, Tuple, cast
6
7
 
7
8
  import libcst as cst
@@ -32,15 +33,19 @@ from vision_agent.utils.execute import (
32
33
  MimeType,
33
34
  )
34
35
  from vision_agent.utils.image_utils import convert_to_b64
35
- from vision_agent.utils.sim import load_cached_sim
36
+ from vision_agent.utils.sim import Sim, load_cached_sim
36
37
 
37
38
  TOOL_FUNCTIONS = {tool.__name__: tool for tool in T.TOOLS}
38
- TOOL_RECOMMENDER = load_cached_sim(T.TOOLS_DF)
39
39
 
40
40
  _LOGGER = logging.getLogger(__name__)
41
41
  EXAMPLES = f"\n{TEST_TOOLS_EXAMPLE1}\n{TEST_TOOLS_EXAMPLE2}\n"
42
42
 
43
43
 
44
+ @lru_cache(maxsize=1)
45
+ def get_tool_recommender() -> Sim:
46
+ return load_cached_sim(T.TOOLS_DF)
47
+
48
+
44
49
  def format_tool_output(tool_thoughts: str, tool_docstring: str) -> str:
45
50
  return_str = "[get_tool_for_task output]\n"
46
51
  if tool_thoughts.strip() != "":
@@ -52,7 +57,7 @@ def format_tool_output(tool_thoughts: str, tool_docstring: str) -> str:
52
57
 
53
58
 
54
59
  def extract_tool_info(
55
- tool_choice_context: Dict[str, Any]
60
+ tool_choice_context: Dict[str, Any],
56
61
  ) -> Tuple[Optional[Callable], str, str, str]:
57
62
  tool_thoughts = tool_choice_context.get("thoughts", "")
58
63
  tool_docstring = ""
@@ -124,7 +129,7 @@ def run_tool_testing(
124
129
  f"I need models from the {category.strip()} category of tools. {task}"
125
130
  )
126
131
 
127
- tool_docs = TOOL_RECOMMENDER.top_k(category, k=10, thresh=0.2)
132
+ tool_docs = get_tool_recommender().top_k(category, k=10, thresh=0.2)
128
133
  if exclude_tools is not None and len(exclude_tools) > 0:
129
134
  cleaned_tool_docs = []
130
135
  for tool_doc in tool_docs:
@@ -246,7 +251,9 @@ def get_tool_for_task(
246
251
  context=f"<code>\n{code}\n</code>\n<tool_output>\n{tool_output_str}\n</tool_output>",
247
252
  previous_attempts=error_message,
248
253
  )
249
- tool_choice_context_dict = extract_json(lmm.generate(prompt, media=image_paths)) # type: ignore
254
+ tool_choice_context_dict = extract_json(
255
+ lmm.generate(prompt, media=image_paths) # type: ignore
256
+ )
250
257
  tool, tool_thoughts, tool_docstring, error_message = extract_tool_info(
251
258
  tool_choice_context_dict
252
259
  )
File without changes
File without changes