sunholo 0.91.0__py3-none-any.whl → 0.91.2__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.
@@ -63,7 +63,7 @@ class AlloyDBClient:
63
63
  if not alloydb_config:
64
64
  raise ValueError("Must specify vac.alloydb_config")
65
65
  self.config = alloydb_config
66
- self.vector_name = self.config.vector_name
66
+ self.vector_name = self.config.get("vac")
67
67
  project_id = alloydb_config["project_id"]
68
68
  region = alloydb_config["region"]
69
69
  cluster_name = alloydb_config["cluster"]
@@ -141,13 +141,16 @@ class AlloyDBClient:
141
141
 
142
142
  return engine
143
143
 
144
- def _get_embedder(self, vector_name):
145
- return get_embeddings(vector_name)
144
+ def _get_embedder(self):
145
+ return get_embeddings(self.vector_name)
146
146
 
147
- def get_vectorstore(self):
147
+ def get_vectorstore(self, vector_name:str=None):
148
148
  if self.engine_type != "langchain":
149
149
  raise ValueError("Not available using pg8000 engine")
150
150
 
151
+ if vector_name:
152
+ self.vector_name = vector_name
153
+
151
154
  if self.vector_name is None:
152
155
  raise ValueError("No vectorname found - init with ConfigManager?")
153
156
 
@@ -158,14 +161,16 @@ class AlloyDBClient:
158
161
  self.vectorstore = AlloyDBVectorStore.create_sync(
159
162
  engine=self.engine,
160
163
  table_name=table_name,
161
- embedding_service=self._get_embedder(self.vector_name),
164
+ embedding_service=self._get_embedder(),
162
165
  metadata_columns=["source", "docstore_doc_id"]
163
166
  #metadata_columns=["source", "eventTime"]
164
167
  )
165
168
 
166
169
  return self.vectorstore
167
170
 
168
- def _similarity_search(self, query, source_filter:str="", free_filter:str=None):
171
+ def _similarity_search(self, query, source_filter:str="", free_filter:str=None, vector_name:str=None):
172
+
173
+ self.get_vectorstore(vector_name)
169
174
 
170
175
  if free_filter is None:
171
176
  source_filter_cmd = f"source %LIKE% {source_filter}" if source_filter else None
@@ -176,14 +181,21 @@ class AlloyDBClient:
176
181
 
177
182
  return query, source_filter_cmd
178
183
 
179
- def similarity_search(self, query, source_filter:str="", free_filter:str=None, k:int=5):
184
+ def similarity_search(self, query:str, source_filter:str="", free_filter:str=None, k:int=5, vector_name:str=None):
180
185
 
181
- query, source_filter_cmd = self._similarity_search(query, source_filter, free_filter)
186
+ query, source_filter_cmd = self._similarity_search(query,
187
+ source_filter=source_filter,
188
+ free_filter=free_filter,
189
+ vector_name=vector_name)
182
190
 
183
191
  return self.vectorstore.similarity_search(query, filter=source_filter_cmd, k=k)
184
192
 
185
- async def asimilarity_search(self, query, source_filter:str="", free_filter:str=None, k:int=5):
186
- query, source_filter_cmd = self._similarity_search(query, source_filter, free_filter)
193
+ async def asimilarity_search(self, query:str, source_filter:str="", free_filter:str=None, k:int=5, vector_name:str=None):
194
+
195
+ query, source_filter_cmd = self._similarity_search(query,
196
+ source_filter=source_filter,
197
+ free_filter=free_filter,
198
+ vector_name=vector_name)
187
199
 
188
200
  return await self.vectorstore.asimilarity_search(query, filter=source_filter_cmd, k=k)
189
201
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.91.0
3
+ Version: 0.91.2
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.91.0.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.91.2.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -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=gMTV1rno3pZfPQy-I3YBE_MiXQePcu8Mcki_Kmq3Hj0,17019
62
+ sunholo/database/alloydb_client.py,sha256=remimbHWWzmDMfycpI5jCgb9T0vYbs1q0OqDKIgePZw,17664
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
@@ -144,9 +144,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
144
144
  sunholo/vertex/memory_tools.py,sha256=q_phxgGX2TG2j2MXNULF2xGzQnQPENwjPN9nZ_A9Gh0,7526
145
145
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
146
146
  sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
147
- sunholo-0.91.0.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
148
- sunholo-0.91.0.dist-info/METADATA,sha256=88KfGdcucBZTtc-oEMicxB6actR75TcMt0ktdqvbJ_4,7806
149
- sunholo-0.91.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
150
- sunholo-0.91.0.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
151
- sunholo-0.91.0.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
152
- sunholo-0.91.0.dist-info/RECORD,,
147
+ sunholo-0.91.2.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
148
+ sunholo-0.91.2.dist-info/METADATA,sha256=POJto1kGkfk5Bp3a_jzmO-0iUKwHAHfv1yrsVo0hsU8,7806
149
+ sunholo-0.91.2.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
150
+ sunholo-0.91.2.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
151
+ sunholo-0.91.2.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
152
+ sunholo-0.91.2.dist-info/RECORD,,