vector-vault 2.7.1__tar.gz → 2.7.2__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-2.7.1 → vector_vault-2.7.2}/PKG-INFO +1 -1
- {vector_vault-2.7.1 → vector_vault-2.7.2}/setup.py +1 -1
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vector_vault.egg-info/PKG-INFO +1 -1
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/cloudmanager.py +3 -8
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/itemize.py +1 -1
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/tools_gpt.py +1 -1
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/vault.py +26 -25
- {vector_vault-2.7.1 → vector_vault-2.7.2}/LICENSE +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/README.md +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/setup.cfg +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vector_vault.egg-info/SOURCES.txt +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vector_vault.egg-info/dependency_links.txt +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vector_vault.egg-info/requires.txt +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vector_vault.egg-info/top_level.txt +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/__init__.py +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/ai.py +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/cloud_api.py +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/creds.py +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/download.py +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/vecreq.py +0 -0
- {vector_vault-2.7.1 → vector_vault-2.7.2}/vectorvault/wrap.py +0 -0
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
import tempfile
|
|
17
17
|
import os
|
|
18
18
|
import json
|
|
19
|
-
from creds import CustomCredentials
|
|
20
|
-
from vecreq import call_proj
|
|
21
|
-
from itemize import cloud_name
|
|
19
|
+
from .creds import CustomCredentials
|
|
20
|
+
from .vecreq import call_proj
|
|
21
|
+
from .itemize import cloud_name
|
|
22
22
|
from google.cloud import storage
|
|
23
23
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
24
24
|
|
|
@@ -126,11 +126,6 @@ class CloudManager:
|
|
|
126
126
|
print(f"Item at path {old_path} does not exist.")
|
|
127
127
|
|
|
128
128
|
def delete_and_rename_all_items_after(self, item_id):
|
|
129
|
-
"""
|
|
130
|
-
Deletes an item specified by item_id and renames all subsequent items
|
|
131
|
-
by decrementing their item_ids by one.
|
|
132
|
-
"""
|
|
133
|
-
|
|
134
129
|
# Delete the specified item
|
|
135
130
|
self.delete_item(item_id)
|
|
136
131
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# is strictly forbidden unless prior written permission is obtained
|
|
14
14
|
# from Vector Vault. See license for consent.import datetime
|
|
15
15
|
|
|
16
|
-
from vecreq import call_name_vecs, call_buildpath
|
|
16
|
+
from .vecreq import call_name_vecs, call_buildpath
|
|
17
17
|
from annoy import AnnoyIndex
|
|
18
18
|
import threading
|
|
19
19
|
from copy import deepcopy
|
|
@@ -18,15 +18,14 @@ import tempfile
|
|
|
18
18
|
import os
|
|
19
19
|
import time
|
|
20
20
|
import re
|
|
21
|
-
import openai
|
|
22
21
|
import json
|
|
23
22
|
import traceback
|
|
24
23
|
from concurrent.futures import ThreadPoolExecutor
|
|
25
|
-
from cloudmanager import CloudManager
|
|
26
|
-
from ai import AI
|
|
27
|
-
from itemize import itemize, name_vecs, get_item, get_vectors, build_return, cloud_name
|
|
28
|
-
from vecreq import call_get_similar
|
|
29
|
-
from tools_gpt import ToolsGPT
|
|
24
|
+
from .cloudmanager import CloudManager
|
|
25
|
+
from .ai import AI, openai
|
|
26
|
+
from .itemize import itemize, name_vecs, get_item, get_vectors, build_return, cloud_name
|
|
27
|
+
from .vecreq import call_get_similar
|
|
28
|
+
from .tools_gpt import ToolsGPT
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
class Vault:
|
|
@@ -96,7 +95,7 @@ class Vault:
|
|
|
96
95
|
if self.saved_already == True:
|
|
97
96
|
self.clear_cache()
|
|
98
97
|
print("The last save was aborted before the build process finished. Clearing cache to start again...")
|
|
99
|
-
self.saved_already = True
|
|
98
|
+
self.saved_already = True # Make sure the if the save process is interrupted, data will not get corrupted
|
|
100
99
|
start_time = time.time()
|
|
101
100
|
self.vectors.build(trees)
|
|
102
101
|
|
|
@@ -143,29 +142,31 @@ class Vault:
|
|
|
143
142
|
self.cloud_manager.delete()
|
|
144
143
|
print('Vault deleted')
|
|
145
144
|
|
|
146
|
-
def
|
|
145
|
+
def delete_items(self, item_ids : list[int]) -> None:
|
|
147
146
|
'''
|
|
148
|
-
Deletes
|
|
147
|
+
Deletes one or more items from item_id(s) passed in.
|
|
148
|
+
item_ids is a list of one or more integers
|
|
149
149
|
'''
|
|
150
150
|
if self.verbose == True:
|
|
151
151
|
print('Deleting item and rebuilding database...')
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
153
|
+
for item_id in item_ids:
|
|
154
|
+
num_existing_items = self.vectors.get_n_items()
|
|
155
|
+
self.cloud_manager.delete_and_rename_all_items_after(item_id)
|
|
156
|
+
new_index = get_vectors(self.dims)
|
|
157
|
+
plus_one = 0
|
|
158
|
+
|
|
159
|
+
for i in range((num_existing_items - 1)):
|
|
160
|
+
if i in item_ids:
|
|
161
|
+
# equals 0 until the item being deleting has been removed
|
|
162
|
+
plus_one += 1
|
|
163
|
+
else:
|
|
164
|
+
vector = self.vectors.get_item_vector(i - plus_one)
|
|
165
|
+
new_index.add_item(i - plus_one, vector)
|
|
166
|
+
|
|
167
|
+
self.x = i + 1
|
|
168
|
+
self.vectors = new_index
|
|
169
|
+
print(f'Item {item_id} deleted')
|
|
169
170
|
|
|
170
171
|
def check_index(self):
|
|
171
172
|
'''
|
|
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
|