sunholo 0.83.4__py3-none-any.whl → 0.83.5__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.
@@ -9,6 +9,7 @@ except ImportError:
9
9
  pass
10
10
 
11
11
  from .database import get_vector_size
12
+ from .uuid import generate_uuid_from_object_id
12
13
  from ..custom_logging import log
13
14
  from ..utils import ConfigManager
14
15
 
@@ -122,10 +123,10 @@ class AlloyDBClient:
122
123
  region=self.config["region"],
123
124
  cluster=self.config["cluster"],
124
125
  instance=self.config["instance"],
125
- password=self.password,
126
126
  database=self.database,
127
127
  ip_type=self.config.get("ip_type") or IPTypes.PRIVATE
128
128
  )
129
+ self._loop = engine._loop
129
130
 
130
131
  log.info(f"Created AlloyDB engine for {engine}")
131
132
 
@@ -190,6 +191,34 @@ class AlloyDBClient:
190
191
  await conn.close()
191
192
 
192
193
  return result
194
+
195
+ def get_document_from_docstore(self, source:str, vector_name):
196
+ query = self._get_document_from_docstore(source, vector_name)
197
+
198
+ return self.execute_sql(query)
199
+
200
+ async def get_document_from_docstore_async(self, source:str, vector_name:str):
201
+ query = self._get_document_from_docstore(source, vector_name)
202
+
203
+ document = await self.execute_sql_async(query)
204
+
205
+ return document
206
+
207
+ def _get_document_from_docstore(self, source:str, vector_name:str):
208
+ if not isinstance(source, str):
209
+ raise ValueError("The 'source' parameter must be a single string, not a list of strings or other iterable.")
210
+
211
+ table_name = f"{vector_name}_docstore"
212
+ doc_id = generate_uuid_from_object_id(source)
213
+
214
+ query = f"""
215
+ SELECT *
216
+ FROM {table_name}
217
+ WHERE doc_id = {doc_id}
218
+ LIMIT 1;
219
+ """
220
+
221
+ return query
193
222
 
194
223
  async def get_sources_from_docstore_async(self, sources, vector_name, search_type="OR", just_source_name=False):
195
224
  """Fetches sources from the docstore asynchronously."""
@@ -233,7 +262,7 @@ class AlloyDBClient:
233
262
  FROM {table_name}
234
263
  WHERE {conditions}
235
264
  ORDER BY langchain_metadata->>'objectId' ASC
236
- LIMIT 500;
265
+ LIMIT 50;
237
266
  """
238
267
 
239
268
  return query
@@ -89,7 +89,7 @@ class ConfigManager:
89
89
  continue
90
90
  if filename.endswith(('.yaml', '.yml', '.json')):
91
91
  config_file = os.path.join(folder, filename)
92
- log.debug(f"Checking config file: {config_file}")
92
+
93
93
  if filename in self.config_cache:
94
94
  cached_config, cache_time = self.config_cache[filename]
95
95
  time_to_recache = (current_time - cache_time)
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.83.4
3
+ Version: 0.83.5
4
4
  Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
5
5
  Home-page: https://github.com/sunholo-data/sunholo-py
6
- Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.83.4.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.83.5.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -21,7 +21,7 @@ License-File: LICENSE.txt
21
21
  Requires-Dist: google-auth
22
22
  Requires-Dist: ruamel.yaml
23
23
  Requires-Dist: langchain >=0.2.12
24
- Requires-Dist: langchain-experimental >=0.0.61
24
+ Requires-Dist: langchain-experimental ==0.0.63
25
25
  Requires-Dist: langchain-community >=0.2.11
26
26
  Provides-Extra: all
27
27
  Requires-Dist: asyncpg ; extra == 'all'
@@ -59,7 +59,7 @@ sunholo/components/retriever.py,sha256=bKIVT7_18Ut3OJd0E0jyiISPnD9qkHWVjcQPT4i1_
59
59
  sunholo/components/vectorstore.py,sha256=xKk7micTRwZckaI7U6PxvFz_ZSjCH48xPTDYiDcv2tc,5913
60
60
  sunholo/database/__init__.py,sha256=bpB5Nk21kwqYj-qdVnvNgXjLsbflnH4g-San7OHMqR4,283
61
61
  sunholo/database/alloydb.py,sha256=YH8wNPS8gN-TDZEXQcVHxwd1NScHRfAxma3gK4R6KCk,11740
62
- sunholo/database/alloydb_client.py,sha256=Ws_GfoST_WHqq7iISW06dqFeOnfbjdPaEl9qNm3cGEc,13651
62
+ sunholo/database/alloydb_client.py,sha256=JYozFOOdeDNEB1D2_If488qS1Qc7emHowUEQL0fgU1E,14617
63
63
  sunholo/database/database.py,sha256=VqhZdkXUNdvWn8sUcUV3YNby1JDVf7IykPVXWBtxo9U,7361
64
64
  sunholo/database/lancedb.py,sha256=DyfZntiFKBlVPaFooNN1Z6Pl-LAs4nxWKKuq8GBqN58,715
65
65
  sunholo/database/static_dbs.py,sha256=8cvcMwUK6c32AS2e_WguKXWMkFf5iN3g9WHzsh0C07Q,442
@@ -118,7 +118,7 @@ sunholo/utils/__init__.py,sha256=Hv02T5L2zYWvCso5hzzwm8FQogwBq0OgtUbN_7Quzqc,89
118
118
  sunholo/utils/api_key.py,sha256=Ct4bIAQZxzPEw14hP586LpVxBAVi_W9Serpy0BK-7KI,244
119
119
  sunholo/utils/big_context.py,sha256=gJIP7_ZL-YSLhOMq8jmFTMqH1wq8eB1NK7oKPeZAq2s,5578
120
120
  sunholo/utils/config.py,sha256=aG29MXcL5qzQMtCMqcdy-2ysDCYf9Zn_ZLk5NNOQNSE,8982
121
- sunholo/utils/config_class.py,sha256=ygKw3E-Q6MLc1XZKRULCTPTibsOFlEfyCA3GyxOhPa8,9869
121
+ sunholo/utils/config_class.py,sha256=tp3mXrwbgOISvI1iT-NhEffD6QpIUK65ik7aT_gi-5o,9819
122
122
  sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
123
123
  sunholo/utils/gcp.py,sha256=uueODEpA-P6O15-t0hmcGC9dONLO_hLfzSsSoQnkUss,4854
124
124
  sunholo/utils/gcp_project.py,sha256=Fa0IhCX12bZ1ctF_PKN8PNYd7hihEUfb90kilBfUDjg,1411
@@ -134,9 +134,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
134
134
  sunholo/vertex/memory_tools.py,sha256=q_phxgGX2TG2j2MXNULF2xGzQnQPENwjPN9nZ_A9Gh0,7526
135
135
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
136
136
  sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
137
- sunholo-0.83.4.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
138
- sunholo-0.83.4.dist-info/METADATA,sha256=5ET_6DFTvDaLytFoVb5we2TYf0vMyhK657U1MYmTm0o,7413
139
- sunholo-0.83.4.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
140
- sunholo-0.83.4.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
141
- sunholo-0.83.4.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
142
- sunholo-0.83.4.dist-info/RECORD,,
137
+ sunholo-0.83.5.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
138
+ sunholo-0.83.5.dist-info/METADATA,sha256=05IvbTEGbeGoW5dwFBd2IUAEBd7nFySYZcQConfSrLs,7413
139
+ sunholo-0.83.5.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
140
+ sunholo-0.83.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
141
+ sunholo-0.83.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
142
+ sunholo-0.83.5.dist-info/RECORD,,