sunholo 0.99.5__py3-none-any.whl → 0.99.7__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.
@@ -288,7 +288,7 @@ class DiscoveryEngineClient:
288
288
 
289
289
  log.info(f"Discovery engine async request: {search_request=}")
290
290
  search_response = await self.async_search_client.search(search_request)
291
-
291
+ log.info(f"Discovery engine async response: {search_response=}")
292
292
  if parse_chunks_to_string:
293
293
 
294
294
  big_string = await self.async_process_chunks(search_response)
@@ -345,7 +345,7 @@ class DiscoveryEngineClient:
345
345
  raise ValueError(f'No results found in response: {response=}')
346
346
 
347
347
  # Iterate through each result in the response
348
- async for result in response.results:
348
+ for result in response.results:
349
349
  chunk = result.chunk
350
350
  chunk_metadata = chunk.ChunkMetadata
351
351
 
@@ -3,6 +3,7 @@ from ..utils.gcp_project import get_gcp_project
3
3
  from ..custom_logging import log
4
4
  from .discovery_engine_client import DiscoveryEngineClient
5
5
  from ..components import load_memories
6
+ import traceback
6
7
 
7
8
  def get_all_chunks(question:str, config:ConfigManager):
8
9
  """
@@ -98,4 +99,4 @@ async def async_get_chunks(question, vector_name, num_chunks):
98
99
  try:
99
100
  return await de.async_get_chunks(question, num_previous_chunks=num_chunks, num_next_chunks=num_chunks)
100
101
  except Exception as err:
101
- log.error(f"No discovery engine chunks found: {str(err)}")
102
+ log.error(f"No discovery engine chunks found: {str(err)} {traceback.format_exc()}")
@@ -482,17 +482,20 @@ class GenAIFunctionProcessor:
482
482
  token = f"--- {fn_log} result --- \n"
483
483
  # if json dict we look for keys to extract
484
484
  if fn_result_json:
485
+ log.info(f"{fn_result_json} dict parsing")
485
486
  if fn_result_json.get('stdout'):
486
487
  text = fn_result_json.get('stdout').encode('utf-8').decode('unicode_escape')
487
488
  token += text
488
489
  if fn_result_json.get('stderr'):
489
490
  text = fn_result_json.get('stdout').encode('utf-8').decode('unicode_escape')
490
491
  token += text
491
- if not fn_result_json.get('stdout') and fn_result_json.get('stderr'):
492
- log.info(f"No recognised keys in dict: {fn_result_json=} - dumping it all")
493
- token += f"{json.dumps(fn_result_json)}\n"
492
+ # If neither 'stdout' nor 'stderr' is present, dump the entire JSON
493
+ if 'stdout' not in fn_result_json and 'stderr' not in fn_result_json:
494
+ log.info(f"No recognised keys ('stdout' or 'stderr') in dict: {fn_result_json=} - dumping it all")
495
+ token += f"{json.dumps(fn_result_json, indent=2)}\n" # Added `indent=2` for readability
494
496
  else:
495
497
  # probably a string, just return it
498
+ log.info(f"{fn_result_json} non-dict (String?) parsing")
496
499
  token += f"{fn_result}\n--- end ---\n"
497
500
 
498
501
  this_text += token
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.99.5
3
+ Version: 0.99.7
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.99.5.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.99.7.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -73,8 +73,8 @@ sunholo/database/sql/sb/setup.sql,sha256=CvoFvZQev2uWjmFa3aj3m3iuPFzAAJZ0S7Qi3L3
73
73
  sunholo/discovery_engine/__init__.py,sha256=hLgqRDJ22Aov9o2QjAEfsVgnL3kMdM-g5p8RJ9OyKdQ,130
74
74
  sunholo/discovery_engine/chunker_handler.py,sha256=Fv4BLOBi_7ap3AiAy4TlTN48CLZSMurJ3TkvC75Euro,5123
75
75
  sunholo/discovery_engine/create_new.py,sha256=NzhSh6nG6nQ5J9gZh8IDph4JiEVT_DC5GGvP0GuwTWs,943
76
- sunholo/discovery_engine/discovery_engine_client.py,sha256=uNhHDa2rCSSHZkNX2ZyWdLwEmFj36HmY0w4KiJLxEIc,21554
77
- sunholo/discovery_engine/get_ai_search_chunks.py,sha256=6SO6v_4AcrUat0bP7wqC8xg9aY916Fnw_aZsogrLx-g,3877
76
+ sunholo/discovery_engine/discovery_engine_client.py,sha256=QpTkKaoNiHgVCVcKbMyXAPtCXzpLOIpriQcZxs8zATM,21620
77
+ sunholo/discovery_engine/get_ai_search_chunks.py,sha256=27fLdDNqeac657PibHJ0XaTuSZi47fDv9FCxpPV4CaQ,3919
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=q1NiJSvEhdNrmU5ZJ-sBCMC_J5CxzrajY8LRgdPOV_M,6
86
86
  sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
87
87
  sunholo/genai/__init__.py,sha256=dBl6IA3-Fx6-Vx81r0XqxHlUq6WeW1iDX188dpChu8s,115
88
88
  sunholo/genai/init.py,sha256=yG8E67TduFCTQPELo83OJuWfjwTnGZsyACospahyEaY,687
89
- sunholo/genai/process_funcs_cls.py,sha256=feWvtWdCYYwAcEA2ZuCDY8pmLOqhoCVjkEVczZyrPDY,24988
89
+ sunholo/genai/process_funcs_cls.py,sha256=qBcwFE59QzX1ngZB0-5ajjz3LOsvgBeG5_wCk1mWTh8,25309
90
90
  sunholo/genai/safety.py,sha256=mkFDO_BeEgiKjQd9o2I4UxB6XI7a9U-oOFjZ8LGRUC4,1238
91
91
  sunholo/invoke/__init__.py,sha256=o1RhwBGOtVK0MIdD55fAIMCkJsxTksi8GD5uoqVKI-8,184
92
92
  sunholo/invoke/async_class.py,sha256=uvCP8ekUCfTRWk7xwofTzRqFykMAwrRZ4Ce_YUR6PVs,2820
@@ -144,9 +144,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
144
144
  sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
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.99.5.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
148
- sunholo-0.99.5.dist-info/METADATA,sha256=mPbrSQh6sLIRXolYX-xbtkuTVBFgqXAvTymdek-Fk5M,8310
149
- sunholo-0.99.5.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
150
- sunholo-0.99.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
151
- sunholo-0.99.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
152
- sunholo-0.99.5.dist-info/RECORD,,
147
+ sunholo-0.99.7.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
148
+ sunholo-0.99.7.dist-info/METADATA,sha256=2gAwyQSDzAlgDzjxufyJqy-zvx2HglT-pi_VsuXVwqg,8310
149
+ sunholo-0.99.7.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
150
+ sunholo-0.99.7.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
151
+ sunholo-0.99.7.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
152
+ sunholo-0.99.7.dist-info/RECORD,,