vector-vault 7.2.4__tar.gz → 7.2.5__tar.gz
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.
- {vector_vault-7.2.4 → vector_vault-7.2.5}/PKG-INFO +1 -1
- {vector_vault-7.2.4 → vector_vault-7.2.5}/setup.py +1 -1
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vector_vault.egg-info/PKG-INFO +1 -1
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vectorvault/ai.py +16 -12
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vectorvault/vault.py +33 -2
- {vector_vault-7.2.4 → vector_vault-7.2.5}/LICENSE +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/README.md +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/setup.cfg +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vector_vault.egg-info/SOURCES.txt +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vector_vault.egg-info/dependency_links.txt +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vector_vault.egg-info/requires.txt +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vector_vault.egg-info/top_level.txt +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vectorvault/__init__.py +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vectorvault/cloud_api.py +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vectorvault/cloudmanager.py +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vectorvault/credentials_manager.py +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vectorvault/itemize.py +0 -0
- {vector_vault-7.2.4 → vector_vault-7.2.5}/vectorvault/utils.py +0 -0
|
@@ -395,20 +395,24 @@ class GrokPlatform(LLMPlatform):
|
|
|
395
395
|
|
|
396
396
|
# Example model token limits for xAI Grok (adjust as needed)
|
|
397
397
|
self.model_token_limits = {
|
|
398
|
+
"grok-code-fast": 256000,
|
|
398
399
|
"grok-4": 256000,
|
|
399
|
-
"grok-
|
|
400
|
-
"grok-
|
|
401
|
-
"grok-3
|
|
402
|
-
"grok-3-mini
|
|
403
|
-
"grok-2-vision-latest":
|
|
404
|
-
"default": "grok-
|
|
400
|
+
"grok-4-fast-reasoning": 2000000,
|
|
401
|
+
"grok-4-fast-non-reasoning": 2000000,
|
|
402
|
+
"grok-3": 131072,
|
|
403
|
+
"grok-3-mini": 131072,
|
|
404
|
+
"grok-2-vision-latest": 32768,
|
|
405
|
+
"default": "grok-4-fast-non-reasoning",
|
|
405
406
|
}
|
|
406
407
|
self.front_model_token_limits = {
|
|
407
|
-
"grok-
|
|
408
|
-
"grok-
|
|
409
|
-
"grok-
|
|
410
|
-
"grok-
|
|
411
|
-
"
|
|
408
|
+
"grok-code-fast": 256000,
|
|
409
|
+
"grok-4": 256000,
|
|
410
|
+
"grok-4-fast-reasoning": 2000000,
|
|
411
|
+
"grok-4-fast-non-reasoning": 2000000,
|
|
412
|
+
"grok-3": 131072,
|
|
413
|
+
"grok-3-mini": 131072,
|
|
414
|
+
"grok-2-vision-latest": 32768,
|
|
415
|
+
"default": "grok-4-fast-non-reasoning",
|
|
412
416
|
}
|
|
413
417
|
|
|
414
418
|
self.default_model = self.model_token_limits["default"]
|
|
@@ -520,7 +524,7 @@ class GrokPlatform(LLMPlatform):
|
|
|
520
524
|
}
|
|
521
525
|
]
|
|
522
526
|
"""
|
|
523
|
-
model = model if model else
|
|
527
|
+
model = model if model else "grok-2-vision-latest"
|
|
524
528
|
if not image_path and not image_url:
|
|
525
529
|
raise ValueError("Must specify either image_path or image_url.")
|
|
526
530
|
|
|
@@ -852,7 +852,7 @@ class Vault:
|
|
|
852
852
|
def load_vectors(self, vault = None):
|
|
853
853
|
start_time = time.time()
|
|
854
854
|
vault = vault if vault else self.vault
|
|
855
|
-
t = T(target=self.load_mapping())
|
|
855
|
+
t = T(target=self.load_mapping, args=(vault,))
|
|
856
856
|
t.start()
|
|
857
857
|
temp_file_path = self.cloud_manager.download_to_temp_file(name_vecs(vault, self.user, self.api))
|
|
858
858
|
self._vectors = get_vectors(self.dims)
|
|
@@ -1003,7 +1003,7 @@ class Vault:
|
|
|
1003
1003
|
Internal function that returns vector similar items. Requires input vector, returns similar items
|
|
1004
1004
|
'''
|
|
1005
1005
|
try:
|
|
1006
|
-
self.load_vectors()
|
|
1006
|
+
self.load_vectors(vault)
|
|
1007
1007
|
start_time = time.time()
|
|
1008
1008
|
if not include_distances:
|
|
1009
1009
|
vecs = self.vectors.get_nns_by_vector(vector, n)
|
|
@@ -1181,6 +1181,37 @@ class Vault:
|
|
|
1181
1181
|
return self.get_items_by_vector(vector, n, include_distances = include_distances, vault = vault if vault else self.vault)
|
|
1182
1182
|
|
|
1183
1183
|
|
|
1184
|
+
def get_similar_from_vaults(self, text: str, n: int = 4, vaults: List[str] = None):
|
|
1185
|
+
'''
|
|
1186
|
+
Searches for the n most similar items in each of the provided vaults, combines the results,
|
|
1187
|
+
sorts by distance, and returns the closest n items overall (with distances).
|
|
1188
|
+
|
|
1189
|
+
Args:
|
|
1190
|
+
text: The query text to embed and search with
|
|
1191
|
+
n: The number of nearest items to retrieve per vault, and the number of items to return overall
|
|
1192
|
+
vaults: A non-empty list of vault names to search
|
|
1193
|
+
|
|
1194
|
+
Returns:
|
|
1195
|
+
A list of up to n items, each including a 'distance' field
|
|
1196
|
+
'''
|
|
1197
|
+
if not vaults or not isinstance(vaults, list):
|
|
1198
|
+
raise ValueError("A non-empty list of vaults must be provided.")
|
|
1199
|
+
|
|
1200
|
+
T(target=self.cloud_manager.build_update, args=(n,)).start()
|
|
1201
|
+
vector = self.process_batch([text], never_stop=False, loop_timeout=180)[0]
|
|
1202
|
+
|
|
1203
|
+
combined_results = []
|
|
1204
|
+
for v in vaults:
|
|
1205
|
+
try:
|
|
1206
|
+
results = self.get_items_by_vector(vector, n, include_distances=True, vault=v)
|
|
1207
|
+
combined_results.extend(results)
|
|
1208
|
+
except Exception:
|
|
1209
|
+
# Skip vaults that cannot be loaded or queried
|
|
1210
|
+
continue
|
|
1211
|
+
|
|
1212
|
+
combined_sorted = sorted(combined_results, key=lambda x: x.get('distance', float('inf')))
|
|
1213
|
+
return combined_sorted[:n]
|
|
1214
|
+
|
|
1184
1215
|
def add_item(self, text: str, meta: dict = None, name: str = None):
|
|
1185
1216
|
"""
|
|
1186
1217
|
If your text length is greater than 15000 characters, you should use Vault.split_text(your_text) to
|
|
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
|