vision-agent 0.2.220__py3-none-any.whl → 0.2.222__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
vision_agent/utils/sim.py CHANGED
@@ -12,7 +12,12 @@ import requests
12
12
  from openai import AzureOpenAI, OpenAI
13
13
  from scipy.spatial.distance import cosine # type: ignore
14
14
 
15
- from vision_agent.tools.tools import TOOLS_DF, stella_embeddings
15
+ from vision_agent.tools.tool_utils import (
16
+ _LND_API_KEY,
17
+ _create_requests_session,
18
+ _LND_API_URL_v2,
19
+ )
20
+ from vision_agent.tools.tools import TOOLS_DF
16
21
 
17
22
 
18
23
  @lru_cache(maxsize=1)
@@ -45,6 +50,24 @@ def load_cached_sim(
45
50
  return sim
46
51
 
47
52
 
53
+ def stella_embeddings(prompts: List[str]) -> List[np.ndarray]:
54
+ # implement stella here so we don't display embeddings which can be costly
55
+ payload = {
56
+ "input": prompts,
57
+ "model": "stella1.5b",
58
+ }
59
+ url = f"{_LND_API_URL_v2}/embeddings"
60
+ headers = {"apikey": _LND_API_KEY}
61
+ session = _create_requests_session(
62
+ url=url,
63
+ num_retry=3,
64
+ headers=headers,
65
+ )
66
+ response = session.post(url, data=payload).json()
67
+ data = response["data"]
68
+ return [np.array(d["embedding"]) for d in data]
69
+
70
+
48
71
  class Sim:
49
72
  def __init__(
50
73
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vision-agent
3
- Version: 0.2.220
3
+ Version: 0.2.222
4
4
  Summary: Toolset for Vision Agent
5
5
  Author: Landing AI
6
6
  Author-email: dev@landing.ai
@@ -1,5 +1,5 @@
1
- vision_agent/.sim_tools/df.csv,sha256=aTpXEOmdIhomzCB4c_qprECxrxTdudet3FK_C3TTzKw,42927
2
- vision_agent/.sim_tools/embs.npy,sha256=22NYWI7NswR367TwyD3s8I8td7ai2ZumgRLWsE6ajtM,270464
1
+ vision_agent/.sim_tools/df.csv,sha256=1cpUFKN48Iuq6HvaG5OhbHs2RghESicb3ouKVTLhm-s,43360
2
+ vision_agent/.sim_tools/embs.npy,sha256=Nji50P_8aV0hhyxp-Kfh_YmXAFWTHSwwBGrNJWitHPU,270464
3
3
  vision_agent/__init__.py,sha256=EAb4-f9iyuEYkBrX4ag1syM8Syx8118_t0R6_C34M9w,57
4
4
  vision_agent/agent/README.md,sha256=Q4w7FWw38qaWosQYAZ7NqWx8Q5XzuWrlv7nLhjUd1-8,5527
5
5
  vision_agent/agent/__init__.py,sha256=M8CffavdIh8Zh-skznLHIaQkYGCGK7vk4dq1FaVkbs4,617
@@ -13,7 +13,7 @@ vision_agent/agent/vision_agent_coder_prompts_v2.py,sha256=9v5HwbNidSzYUEFl6ZMni
13
13
  vision_agent/agent/vision_agent_coder_v2.py,sha256=G3I8O89gzE2VczQGPWV149aYaOjbbfB1lmgGuwFWvo4,16118
14
14
  vision_agent/agent/vision_agent_planner.py,sha256=fFzjNkZBKkh8Y_oS06ATI4qz31xmIJvixb_tV1kX8KA,18590
15
15
  vision_agent/agent/vision_agent_planner_prompts.py,sha256=mn9NlZpRkW4XAvlNuMZwIs1ieHCFds5aYZJ55WXupZY,6733
16
- vision_agent/agent/vision_agent_planner_prompts_v2.py,sha256=TENjNF_mQHw6RHic24TrP5b7-Q5KWiJardtP9_hitdw,33420
16
+ vision_agent/agent/vision_agent_planner_prompts_v2.py,sha256=lzfJFvBYW_-Ue4OevgljI8bAQxgKC4Rdv5SmP6UsAxE,34102
17
17
  vision_agent/agent/vision_agent_planner_v2.py,sha256=vvxfmGydBIKB8CtNSAJyPvdEXkG7nIO5-Hs2SjNc48Y,20465
18
18
  vision_agent/agent/vision_agent_prompts.py,sha256=NtGdCfzzilCRtscKALC9FK55d1h4CBpMnbhLzg0PYlc,13772
19
19
  vision_agent/agent/vision_agent_prompts_v2.py,sha256=-vCWat-ARlCOOOeIDIFhg-kcwRRwjTXYEwsvvqPeaCs,1972
@@ -26,21 +26,21 @@ vision_agent/fonts/default_font_ch_en.ttf,sha256=1YM0Z3XqLDjSNbF7ihQFSAIUdjF9m1r
26
26
  vision_agent/lmm/__init__.py,sha256=jyY1sJb_tYKg5-Wzs3p1lvwFkc-aUNZfMcLy3TOC4Zg,100
27
27
  vision_agent/lmm/lmm.py,sha256=x_nIyDNDZwq4-pfjnJTmcyyJZ2_B7TjkA5jZp88YVO8,17103
28
28
  vision_agent/lmm/types.py,sha256=ZEXR_ptBL0ZwDMTDYkgxUCmSZFmBYPQd2jreNzr_8UY,221
29
- vision_agent/tools/__init__.py,sha256=XrViKgxqMjY1Ep3QCBootXqftDBlrtH6M7qIVXOq_MY,2809
29
+ vision_agent/tools/__init__.py,sha256=15O7eQVn0bitmzUO5OxKdA618PoiLt6Z02gmKsSNMFM,2765
30
30
  vision_agent/tools/meta_tools.py,sha256=TPeS7QWnc_PmmU_ndiDT03dXbQ5yDSP33E7U8cSj7Ls,28660
31
31
  vision_agent/tools/planner_tools.py,sha256=CvaJ2vGM8O_CYvsoSk1avxAMqpIu3tv4C2bY0p1X-X4,13519
32
32
  vision_agent/tools/prompts.py,sha256=V1z4YJLXZuUl_iZ5rY0M5hHc_2tmMEUKr0WocXKGt4E,1430
33
33
  vision_agent/tools/tool_utils.py,sha256=LAnrb_nY6PNVamqJahRN-J0cuOy4gsKvCtSuXJf0RsI,10075
34
- vision_agent/tools/tools.py,sha256=FAfqeXCjHH7glqDte9arq0JhFyMbGXtkNLRGQ7udSPY,96411
34
+ vision_agent/tools/tools.py,sha256=46XafZnutSNmis6qa9BFc_QVzo6056lY3BKb_1N2ot0,91119
35
35
  vision_agent/tools/tools_types.py,sha256=8hYf2OZhI58gvf65KGaeGkt4EQ56nwLFqIQDPHioOBc,2339
36
36
  vision_agent/utils/__init__.py,sha256=QKk4zVjMwGxQI0MQ-aZZA50N-qItxRY4EB9CwQkZ2HY,185
37
37
  vision_agent/utils/exceptions.py,sha256=booSPSuoULF7OXRr_YbC4dtKt6gM_HyiFQHBuaW86C4,2052
38
38
  vision_agent/utils/execute.py,sha256=vOEP5Ys7S2lc0_7pOJbgk7OaWi85hrCNu9_8Bo3zk6I,29356
39
39
  vision_agent/utils/image_utils.py,sha256=z_ONgcza125B10NkoGwPOzXnL470bpTWZbkB16NeeH0,12188
40
- vision_agent/utils/sim.py,sha256=u6a04nOc34FJcpMN0mb9eZImDIfNGYQscHWN53Hav6I,8482
40
+ vision_agent/utils/sim.py,sha256=znsInUDrsyBi3OlgAlV3rDn5UQQRfJAWXTXm7D7eJA8,9125
41
41
  vision_agent/utils/type_defs.py,sha256=BE12s3JNQy36QvauXHjwyeffVh5enfcvd4vTzSwvEZI,1384
42
42
  vision_agent/utils/video.py,sha256=e1VwKhXzzlC5LcFMyrcQYrPnpnX4wxDpnQ-76sB4jgM,6001
43
- vision_agent-0.2.220.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
44
- vision_agent-0.2.220.dist-info/METADATA,sha256=f4eSfCTMOzJWa2cTUbU01362RE6dZj3Ix43BXf0pdr0,20039
45
- vision_agent-0.2.220.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
46
- vision_agent-0.2.220.dist-info/RECORD,,
43
+ vision_agent-0.2.222.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
44
+ vision_agent-0.2.222.dist-info/METADATA,sha256=Rcgt4WGB0f0ke8f-leTCCvixPfvznUb-TuTxniecTLk,20039
45
+ vision_agent-0.2.222.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
46
+ vision_agent-0.2.222.dist-info/RECORD,,