vision-agent 0.2.79__py3-none-any.whl → 0.2.80__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,6 +112,11 @@ class Result:
112
112
  self.raw = copy.deepcopy(data)
113
113
 
114
114
  self.text = data.pop(MimeType.TEXT_PLAIN, None)
115
+ if self.text and (self.text.startswith("'") and self.text.endswith("'")):
116
+ # This is a workaround for the issue that str result is wrapped with single quotes by notebook.
117
+ # E.g. input text: "'flower'". what we want: "flower"
118
+ self.text = self.text[1:-1]
119
+
115
120
  self.html = data.pop(MimeType.TEXT_HTML, None)
116
121
  self.markdown = data.pop(MimeType.TEXT_MARKDOWN, None)
117
122
  self.svg = data.pop(MimeType.IMAGE_SVG, None)
vision_agent/utils/sim.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import os
2
+ from functools import lru_cache
2
3
  from pathlib import Path
3
4
  from typing import Dict, List, Optional, Sequence, Union
4
5
 
@@ -33,11 +34,7 @@ class Sim:
33
34
  model: str: The model to use for embeddings.
34
35
  """
35
36
  self.df = df
36
- if not api_key:
37
- self.client = OpenAI()
38
- else:
39
- self.client = OpenAI(api_key=api_key)
40
-
37
+ self.client = OpenAI(api_key=api_key)
41
38
  self.model = model
42
39
  if "embs" not in df.columns and sim_key is None:
43
40
  raise ValueError("key is required if no column 'embs' is present.")
@@ -57,6 +54,7 @@ class Sim:
57
54
  df = df.drop("embs", axis=1)
58
55
  df.to_csv(sim_file / "df.csv", index=False)
59
56
 
57
+ @lru_cache(maxsize=256)
60
58
  def top_k(
61
59
  self, query: str, k: int = 5, thresh: Optional[float] = None
62
60
  ) -> Sequence[Dict]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vision-agent
3
- Version: 0.2.79
3
+ Version: 0.2.80
4
4
  Summary: Toolset for Vision Agent
5
5
  Author: Landing AI
6
6
  Author-email: dev@landing.ai
@@ -13,12 +13,12 @@ vision_agent/tools/tool_utils.py,sha256=6z0jrvUnesJEFqDHZoAvbXPic8rzh0KfILL07tu0
13
13
  vision_agent/tools/tools.py,sha256=TkZqNYX-ocwdaCdXd6c6tysSa_HX2y6Nrgl4JKni4IQ,43661
14
14
  vision_agent/utils/__init__.py,sha256=CW84HnhqI6XQVuxf2KifkLnSuO7EOhmuL09-gAymAak,219
15
15
  vision_agent/utils/exceptions.py,sha256=JGiFPLAYnPpEvHfueQuJotv3rCkS-A7UAwEym56MmHM,1359
16
- vision_agent/utils/execute.py,sha256=DWFNslQVl4kpBrGJs8YGeUkOsZFykvdYNAo_DFvFIfQ,23029
16
+ vision_agent/utils/execute.py,sha256=wt7YNVn4jEzU-9ljQg2RYTcFV8qNSrS30QN3tNDRct4,23326
17
17
  vision_agent/utils/image_utils.py,sha256=_cdiS5YrLzqkq_ZgFUO897m5M4_SCIThwUy4lOklfB8,7700
18
- vision_agent/utils/sim.py,sha256=ci6Eta73dDgLP1Ajtknbgmf1g8aAvBHqlVQvBuLMKXQ,4427
18
+ vision_agent/utils/sim.py,sha256=1HTaiVaBiKeyXIy21IYGXlPw0TipOyw9FPOJDfyLI94,4409
19
19
  vision_agent/utils/type_defs.py,sha256=QeQRRIlklZMWzxROcCn5ELxP89nYdXGydy1rAiSpZZw,1384
20
20
  vision_agent/utils/video.py,sha256=rNmU9KEIkZB5-EztZNlUiKYN0mm_55A_2VGUM0QpqLA,8779
21
- vision_agent-0.2.79.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
- vision_agent-0.2.79.dist-info/METADATA,sha256=gWTSwXsZO3euICHmSJE99yiTXqnrvEf_93SK5Ry0qwU,9433
23
- vision_agent-0.2.79.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
24
- vision_agent-0.2.79.dist-info/RECORD,,
21
+ vision_agent-0.2.80.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
+ vision_agent-0.2.80.dist-info/METADATA,sha256=xflnjK1RKkn82YM_yR21jEvLqlq0RpOm1JEgETYZXos,9433
23
+ vision_agent-0.2.80.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
24
+ vision_agent-0.2.80.dist-info/RECORD,,