vision-agent 0.2.108__py3-none-any.whl → 0.2.110__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,7 @@ from .tools import (
7
7
  TOOL_DOCSTRING,
8
8
  TOOLS,
9
9
  TOOLS_DF,
10
+ TOOLS_INFO,
10
11
  UTILITIES_DOCSTRING,
11
12
  blip_image_caption,
12
13
  clip,
@@ -52,15 +53,16 @@ def register_tool(imports: Optional[List] = None) -> Callable:
52
53
  def decorator(tool: Callable) -> Callable:
53
54
  import inspect
54
55
 
55
- from .tools import get_tool_descriptions, get_tools_df
56
+ from .tools import get_tool_descriptions, get_tools_df, get_tools_info
56
57
 
57
- global TOOLS, TOOLS_DF, TOOL_DESCRIPTIONS, TOOL_DOCSTRING
58
+ global TOOLS, TOOLS_DF, TOOL_DESCRIPTIONS, TOOL_DOCSTRING, TOOLS_INFO
58
59
 
59
60
  if tool not in TOOLS:
60
61
  TOOLS.append(tool)
61
62
  TOOLS_DF = get_tools_df(TOOLS) # type: ignore
62
63
  TOOL_DESCRIPTIONS = get_tool_descriptions(TOOLS) # type: ignore
63
64
  TOOL_DOCSTRING = get_tool_documentation(TOOLS) # type: ignore
65
+ TOOLS_INFO = get_tools_info(TOOLS) # type: ignore
64
66
 
65
67
  globals()[tool.__name__] = tool
66
68
  if imports is not None:
@@ -142,3 +142,16 @@ def get_tools_df(funcs: List[Callable[..., Any]]) -> pd.DataFrame:
142
142
  data["doc"].append(doc)
143
143
 
144
144
  return pd.DataFrame(data) # type: ignore
145
+
146
+
147
+ def get_tools_info(funcs: List[Callable[..., Any]]) -> Dict[str, str]:
148
+ data: Dict[str, str] = {}
149
+
150
+ for func in funcs:
151
+ desc = func.__doc__
152
+ if desc is None:
153
+ desc = ""
154
+
155
+ data[func.__name__] = f"{func.__name__}{inspect.signature(func)}:\n{desc}"
156
+
157
+ return data
@@ -19,6 +19,7 @@ from vision_agent.tools.tool_utils import (
19
19
  get_tool_descriptions,
20
20
  get_tool_documentation,
21
21
  get_tools_df,
22
+ get_tools_info,
22
23
  )
23
24
  from vision_agent.utils import extract_frames_from_video
24
25
  from vision_agent.utils.execute import FileSerializer, MimeType
@@ -157,7 +158,7 @@ def owl_v2(
157
158
  image_size = image.shape[:2]
158
159
  image_b64 = convert_to_b64(image)
159
160
  request_data = {
160
- "prompts": prompt.split(","),
161
+ "prompts": [s.strip() for s in prompt.split(",")],
161
162
  "image": image_b64,
162
163
  "confidence": box_threshold,
163
164
  "function_name": "owl_v2",
@@ -1317,6 +1318,7 @@ TOOLS = [
1317
1318
  TOOLS_DF = get_tools_df(TOOLS) # type: ignore
1318
1319
  TOOL_DESCRIPTIONS = get_tool_descriptions(TOOLS) # type: ignore
1319
1320
  TOOL_DOCSTRING = get_tool_documentation(TOOLS) # type: ignore
1321
+ TOOLS_INFO = get_tools_info(TOOLS) # type: ignore
1320
1322
  UTILITIES_DOCSTRING = get_tool_documentation(
1321
1323
  [
1322
1324
  save_json,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vision-agent
3
- Version: 0.2.108
3
+ Version: 0.2.110
4
4
  Summary: Toolset for Vision Agent
5
5
  Author: Landing AI
6
6
  Author-email: dev@landing.ai
@@ -14,12 +14,12 @@ vision_agent/fonts/default_font_ch_en.ttf,sha256=1YM0Z3XqLDjSNbF7ihQFSAIUdjF9m1r
14
14
  vision_agent/lmm/__init__.py,sha256=YuUZRsMHdn8cMOv6iBU8yUqlIOLrbZQqZl9KPnofsHQ,103
15
15
  vision_agent/lmm/lmm.py,sha256=TgEwrtQqpnWlBYEvsSU6DbkY3Y7MM8wRb4lMQgSiM0k,19435
16
16
  vision_agent/lmm/types.py,sha256=8TSRoTbXyCKVJiH-wHXI2OiGOMSkYv1vLGYeAXtNpOQ,153
17
- vision_agent/tools/__init__.py,sha256=MK0D8NtIChwGHwqsTz3LeV5BGuQecNVrNzUsyaEwuGA,1926
17
+ vision_agent/tools/__init__.py,sha256=NDEEOZrwpeNYhUA32bSKXrZ62uEsErb8Vn-70_0Oz1o,2033
18
18
  vision_agent/tools/meta_tools.py,sha256=v2FrLl0YwM7JwsVRfgfnryd9qorbPRiObestexbnNBs,15170
19
19
  vision_agent/tools/meta_tools_types.py,sha256=aU4knXEhm0AnDYW958T6Q6qPwN4yq8pQzQOxqFaOjzg,596
20
20
  vision_agent/tools/prompts.py,sha256=V1z4YJLXZuUl_iZ5rY0M5hHc_2tmMEUKr0WocXKGt4E,1430
21
- vision_agent/tools/tool_utils.py,sha256=ZhZ9oEcOvRSuWPy-gV0rx3pvaaXzBW-ZC3YQanXrq1g,4733
22
- vision_agent/tools/tools.py,sha256=2uUrCSyFQc1Y-CqpPK7faGnkGM7LDwdhgQJQRVLUHc8,44784
21
+ vision_agent/tools/tool_utils.py,sha256=Y7I4OBW5GwXkHQwlAXqp29WB0OOPQXAMYCAHj_Vh8eQ,5036
22
+ vision_agent/tools/tools.py,sha256=IU7jTEJ8NH5zVmFwznOLEmjOBQ7IzBJpanzpqtjoJrY,44876
23
23
  vision_agent/utils/__init__.py,sha256=CW84HnhqI6XQVuxf2KifkLnSuO7EOhmuL09-gAymAak,219
24
24
  vision_agent/utils/exceptions.py,sha256=isVH-SVL4vHj3q5kK4z7cy5_aOapAqHXWkpibfSNbUs,1659
25
25
  vision_agent/utils/execute.py,sha256=ZRxztUfZwvMvPnFbKx5W_LZzTuKl8Zf5dP3Y8P2-3nk,25093
@@ -27,7 +27,7 @@ vision_agent/utils/image_utils.py,sha256=c_g5i_cFC0C-Yw9gU_NaVgQdmBlyumw3bLIDtCU
27
27
  vision_agent/utils/sim.py,sha256=7JvtWGN0Ik5ife3qQYWs7Fm3T8AnAXGFd5HnvDC15mQ,4433
28
28
  vision_agent/utils/type_defs.py,sha256=BE12s3JNQy36QvauXHjwyeffVh5enfcvd4vTzSwvEZI,1384
29
29
  vision_agent/utils/video.py,sha256=rNmU9KEIkZB5-EztZNlUiKYN0mm_55A_2VGUM0QpqLA,8779
30
- vision_agent-0.2.108.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
31
- vision_agent-0.2.108.dist-info/METADATA,sha256=Z9yjtwIqzGGauqxS7ZWh2agdiopdl2NQ310k2HTMMDk,10732
32
- vision_agent-0.2.108.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
33
- vision_agent-0.2.108.dist-info/RECORD,,
30
+ vision_agent-0.2.110.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
31
+ vision_agent-0.2.110.dist-info/METADATA,sha256=Qcxe0Nt5ObGSUmIhqWg8B0FWjw13YW2jKyz21sbzCtI,10732
32
+ vision_agent-0.2.110.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
33
+ vision_agent-0.2.110.dist-info/RECORD,,