vision-agent 0.2.205__tar.gz → 0.2.207__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {vision_agent-0.2.205 → vision_agent-0.2.207}/PKG-INFO +1 -1
- {vision_agent-0.2.205 → vision_agent-0.2.207}/pyproject.toml +1 -1
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_coder_v2.py +2 -2
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/tools/__init__.py +1 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/tools/planner_tools.py +5 -5
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/tools/tools.py +7 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/LICENSE +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/README.md +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/.sim_tools/df.csv +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/.sim_tools/embs.npy +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/__init__.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/README.md +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/__init__.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/agent.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/agent_utils.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/types.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_coder.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_coder_prompts.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_coder_prompts_v2.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_planner.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_planner_prompts.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_planner_prompts_v2.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_planner_v2.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_prompts.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_prompts_v2.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_v2.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/clients/__init__.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/clients/http.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/clients/landing_public_api.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/fonts/__init__.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/fonts/default_font_ch_en.ttf +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/lmm/__init__.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/lmm/lmm.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/lmm/types.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/tools/meta_tools.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/tools/prompts.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/tools/tool_utils.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/tools/tools_types.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/utils/__init__.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/utils/exceptions.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/utils/execute.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/utils/image_utils.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/utils/sim.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/utils/type_defs.py +0 -0
- {vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/utils/video.py +0 -0
@@ -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
|
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 =
|
319
|
+
self.tool_recommender = T.get_tool_recommender()
|
320
320
|
|
321
321
|
self.verbose = verbose
|
322
322
|
self.code_sandbox_runtime = code_sandbox_runtime
|
@@ -32,10 +32,8 @@ from vision_agent.utils.execute import (
|
|
32
32
|
MimeType,
|
33
33
|
)
|
34
34
|
from vision_agent.utils.image_utils import convert_to_b64
|
35
|
-
from vision_agent.utils.sim import load_cached_sim
|
36
35
|
|
37
36
|
TOOL_FUNCTIONS = {tool.__name__: tool for tool in T.TOOLS}
|
38
|
-
TOOL_RECOMMENDER = load_cached_sim(T.TOOLS_DF)
|
39
37
|
|
40
38
|
_LOGGER = logging.getLogger(__name__)
|
41
39
|
EXAMPLES = f"\n{TEST_TOOLS_EXAMPLE1}\n{TEST_TOOLS_EXAMPLE2}\n"
|
@@ -52,7 +50,7 @@ def format_tool_output(tool_thoughts: str, tool_docstring: str) -> str:
|
|
52
50
|
|
53
51
|
|
54
52
|
def extract_tool_info(
|
55
|
-
tool_choice_context: Dict[str, Any]
|
53
|
+
tool_choice_context: Dict[str, Any],
|
56
54
|
) -> Tuple[Optional[Callable], str, str, str]:
|
57
55
|
tool_thoughts = tool_choice_context.get("thoughts", "")
|
58
56
|
tool_docstring = ""
|
@@ -124,7 +122,7 @@ def run_tool_testing(
|
|
124
122
|
f"I need models from the {category.strip()} category of tools. {task}"
|
125
123
|
)
|
126
124
|
|
127
|
-
tool_docs =
|
125
|
+
tool_docs = T.get_tool_recommender().top_k(category, k=10, thresh=0.2)
|
128
126
|
if exclude_tools is not None and len(exclude_tools) > 0:
|
129
127
|
cleaned_tool_docs = []
|
130
128
|
for tool_doc in tool_docs:
|
@@ -246,7 +244,9 @@ def get_tool_for_task(
|
|
246
244
|
context=f"<code>\n{code}\n</code>\n<tool_output>\n{tool_output_str}\n</tool_output>",
|
247
245
|
previous_attempts=error_message,
|
248
246
|
)
|
249
|
-
tool_choice_context_dict = extract_json(
|
247
|
+
tool_choice_context_dict = extract_json(
|
248
|
+
lmm.generate(prompt, media=image_paths) # type: ignore
|
249
|
+
)
|
250
250
|
tool, tool_thoughts, tool_docstring, error_message = extract_tool_info(
|
251
251
|
tool_choice_context_dict
|
252
252
|
)
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_coder_prompts.py
RENAMED
File without changes
|
{vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_coder_prompts_v2.py
RENAMED
File without changes
|
File without changes
|
{vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_planner_prompts.py
RENAMED
File without changes
|
{vision_agent-0.2.205 → vision_agent-0.2.207}/vision_agent/agent/vision_agent_planner_prompts_v2.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|