sunholo 0.109.5__py3-none-any.whl → 0.110.1__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.
@@ -36,10 +36,18 @@ def do_discovery_engine(message_data:str, metadata:dict, config:ConfigManager=No
36
36
  log.info(f"Found vectorstore {vectorstore}")
37
37
  if value.get('read_only'):
38
38
  continue
39
+ gcp_config = config.vacConfig("gcp_config")
40
+ if not gcp_config:
41
+ project_id = get_gcp_project()
42
+ else:
43
+ project_id = gcp_config.get("project_id")
44
+
45
+ if not project_id:
46
+ raise ValueError("Couldn't retrieve project_id for vertex_ai_search")
39
47
  #location = gcp_config.get('location')
40
48
  corpus = DiscoveryEngineClient(
41
49
  data_store_id=config.vector_name,
42
- project_id=get_gcp_project(),
50
+ project_id=project_id
43
51
  # location needs to be 'eu' or 'us' which doesn't work with other configurations
44
52
  #location=location or global_location
45
53
  )
@@ -11,7 +11,8 @@ def create_new_discovery_engine(config:ConfigManager):
11
11
  if "chunk_size" in chunker_config:
12
12
  chunk_size = chunker_config["chunk_size"]
13
13
 
14
- project_id = get_gcp_project()
14
+ gcp_config = config.vacConfig("gcp_config")
15
+ project_id = gcp_config.get("project_id") or get_gcp_project()
15
16
  if not project_id:
16
17
  raise ValueError("Could not find project_id in gcp_config")
17
18
 
@@ -37,7 +37,9 @@ def get_all_chunks(question:str, config:ConfigManager):
37
37
  num_chunks = value.get('num_chunks') or 3
38
38
  gcp_config = config.vacConfig("gcp_config")
39
39
  project_id = gcp_config.get('project_id')
40
- chunk = get_chunks(question, vector_name, num_chunks, project_id=project_id)
40
+ serving_config = value.get('serving_config')
41
+
42
+ chunk = get_chunks(question, vector_name, num_chunks, project_id=project_id, serving_config=serving_config)
41
43
  if chunk:
42
44
  chunks.append(chunk)
43
45
  if chunks:
@@ -46,10 +48,12 @@ def get_all_chunks(question:str, config:ConfigManager):
46
48
  log.warning(f"No chunks found for {vector_name}")
47
49
  return None
48
50
 
49
- def get_chunks(question, vector_name, num_chunks, project_id=None):
51
+ def get_chunks(question, vector_name, num_chunks, project_id=None, serving_config=None):
52
+ if serving_config is None:
53
+ serving_config = "default_serving_config"
50
54
  de = DiscoveryEngineClient(vector_name, project_id=project_id or get_gcp_project(include_config=True))
51
55
  try:
52
- return de.get_chunks(question, num_previous_chunks=num_chunks, num_next_chunks=num_chunks)
56
+ return de.get_chunks(question, num_previous_chunks=num_chunks, num_next_chunks=num_chunks, serving_config=serving_config)
53
57
  except Exception as err:
54
58
  log.error(f"No discovery engine chunks found: {str(err)}")
55
59
 
@@ -51,6 +51,7 @@ VIDEO_MIMES = [
51
51
  AUDIO_MIMES = [
52
52
  'audio/wav',
53
53
  'audio/mp3',
54
+ 'audio/mpeg', #added
54
55
  'audio/aiff',
55
56
  'audio/aac',
56
57
  'audio/ogg',
@@ -105,6 +106,8 @@ async def construct_file_content(gs_list, bucket:str):
105
106
  continue
106
107
  if the_mime_type in ALLOWED_MIME_TYPES:
107
108
  file_list.append(element)
109
+ else:
110
+ log.warning(f'{the_mime_type} is not in allowed MIME types for {element.get("name")}')
108
111
 
109
112
  if not file_list:
110
113
  return {"role": "user", "parts": [{"text": "No eligible contentTypes were found"}]}
sunholo/utils/config.py CHANGED
@@ -211,6 +211,8 @@ def load_config_key(key: str, vector_name: str, kind: str):
211
211
  config = configs_by_kind[kind]
212
212
 
213
213
  apiVersion = config.get('apiVersion')
214
+ if apiVersion is None:
215
+ raise ValueError("Could not find apiVersion for config")
214
216
 
215
217
  log.debug(f"Fetching '{key}' for '{vector_name}' from '{kind}/{apiVersion}'")
216
218
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.109.5
3
+ Version: 0.110.1
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.109.5.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.110.1.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -71,10 +71,10 @@ sunholo/database/sql/sb/delete_source_row.sql,sha256=r6fEuUKdbiLHCDGKSbKINDCpJjs
71
71
  sunholo/database/sql/sb/return_sources.sql,sha256=89KAnxfK8n_qGK9jy1OQT8f9n4uYUtYL5cCxbC2mj_c,255
72
72
  sunholo/database/sql/sb/setup.sql,sha256=CvoFvZQev2uWjmFa3aj3m3iuPFzAAJZ0S7Qi3L3-zZI,89
73
73
  sunholo/discovery_engine/__init__.py,sha256=hLgqRDJ22Aov9o2QjAEfsVgnL3kMdM-g5p8RJ9OyKdQ,130
74
- sunholo/discovery_engine/chunker_handler.py,sha256=Fv4BLOBi_7ap3AiAy4TlTN48CLZSMurJ3TkvC75Euro,5123
75
- sunholo/discovery_engine/create_new.py,sha256=NzhSh6nG6nQ5J9gZh8IDph4JiEVT_DC5GGvP0GuwTWs,943
74
+ sunholo/discovery_engine/chunker_handler.py,sha256=5tw5_jalNQosf7uFyCmsYA__VdNpWC1PPVVa420CzWU,5479
75
+ sunholo/discovery_engine/create_new.py,sha256=jWg5LW-QpFE8zq50ShaQJB3Wu8loiWB0P4lRWaCHpss,1023
76
76
  sunholo/discovery_engine/discovery_engine_client.py,sha256=jfIayVUOPM4svGF1S5Kk60rIG-xSo_e3zOHtBRg0nZA,22002
77
- sunholo/discovery_engine/get_ai_search_chunks.py,sha256=7a83FnEDb5hn9j167XC_mN-3l-Sa-p_Yvivmu_DDN_0,4090
77
+ sunholo/discovery_engine/get_ai_search_chunks.py,sha256=hsFGOQugSeTMPEaQ16XTs_D45F8NABBm2IsAEdTk7kQ,4316
78
78
  sunholo/embedder/__init__.py,sha256=sI4N_CqgEVcrMDxXgxKp1FsfsB4FpjoXgPGkl4N_u4I,44
79
79
  sunholo/embedder/embed_chunk.py,sha256=_FdO4-9frUJlDPqXv2Ai49ejUrrMTMGti3D7bfJGfy8,6984
80
80
  sunholo/excel/__init__.py,sha256=AqTMN9K4qJYi4maEgoORc5oxDVGO_eqmwzDaVP37JgY,56
@@ -86,7 +86,7 @@ sunholo/gcs/download_url.py,sha256=Ul81n1rklr8WogPsuxWWD1Nr8RHU451LzHPMJNhAKzw,6
86
86
  sunholo/gcs/extract_and_sign.py,sha256=paRrTCvCN5vkQwCB7OSkxWi-pfOgOtZ0bwdXE08c3Ps,1546
87
87
  sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
88
88
  sunholo/genai/__init__.py,sha256=6SWK7uV5F625J-P3xQoD6WKL59a9RSaidj-Guslyt8Q,192
89
- sunholo/genai/file_handling.py,sha256=vWkekjcKEpvavuO46Ogrqi8Ng1LPu-7iGgaWwDV4dsk,7665
89
+ sunholo/genai/file_handling.py,sha256=N2AOqBaPJ9xGMQ1T_W45-rENyaMK7RRSBUZOOVrCDIg,7803
90
90
  sunholo/genai/images.py,sha256=EyjsDqt6XQw99pZUQamomCpMOoIah9bp3XY94WPU7Ms,1678
91
91
  sunholo/genai/init.py,sha256=yG8E67TduFCTQPELo83OJuWfjwTnGZsyACospahyEaY,687
92
92
  sunholo/genai/process_funcs_cls.py,sha256=7_RQMqIAZ3nPP-GFgCHBvS39fwuWuGtvSyuJaJN_G3E,31590
@@ -132,7 +132,7 @@ sunholo/tools/web_browser.py,sha256=8Gdf02F4zCOeSnijnfaL6jzk4oaSI0cj48o-esoWzwE,
132
132
  sunholo/utils/__init__.py,sha256=Hv02T5L2zYWvCso5hzzwm8FQogwBq0OgtUbN_7Quzqc,89
133
133
  sunholo/utils/api_key.py,sha256=Ct4bIAQZxzPEw14hP586LpVxBAVi_W9Serpy0BK-7KI,244
134
134
  sunholo/utils/big_context.py,sha256=gJIP7_ZL-YSLhOMq8jmFTMqH1wq8eB1NK7oKPeZAq2s,5578
135
- sunholo/utils/config.py,sha256=aG29MXcL5qzQMtCMqcdy-2ysDCYf9Zn_ZLk5NNOQNSE,8982
135
+ sunholo/utils/config.py,sha256=uXD9cCLjZzdNpH5qZ2oVEo5Zb5EDkP9KxxjtriG9LgY,9074
136
136
  sunholo/utils/config_class.py,sha256=aNhxhEHIxRvqQNq_9wFJt1yM9U1ypahCVZ3NzPWuay4,9843
137
137
  sunholo/utils/config_schema.py,sha256=Wv-ncitzljOhgbDaq9qnFqH5LCuxNv59dTGDWgd1qdk,4189
138
138
  sunholo/utils/gcp.py,sha256=uueODEpA-P6O15-t0hmcGC9dONLO_hLfzSsSoQnkUss,4854
@@ -150,9 +150,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
150
150
  sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
151
151
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
152
152
  sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
153
- sunholo-0.109.5.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
154
- sunholo-0.109.5.dist-info/METADATA,sha256=Otmc-ulFD1PWOgeoOh0pbNnsEI_4z_Ve3Ir2wX8BTpE,8705
155
- sunholo-0.109.5.dist-info/WHEEL,sha256=a7TGlA-5DaHMRrarXjVbQagU3Man_dCnGIWMJr5kRWo,91
156
- sunholo-0.109.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
157
- sunholo-0.109.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
158
- sunholo-0.109.5.dist-info/RECORD,,
153
+ sunholo-0.110.1.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
154
+ sunholo-0.110.1.dist-info/METADATA,sha256=eXAFbYzilR7c5qWIbYvvWimEAt3ID_5rN8R3yyPUb-0,8705
155
+ sunholo-0.110.1.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
156
+ sunholo-0.110.1.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
157
+ sunholo-0.110.1.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
158
+ sunholo-0.110.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.4.0)
2
+ Generator: setuptools (75.5.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5