sunholo 0.95.3__py3-none-any.whl → 0.95.4__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.
@@ -39,17 +39,13 @@ class AsyncTaskRunner:
39
39
  async def _task_wrapper(self, name: str, func: Callable[..., Any], args: Any) -> Any:
40
40
  """Wraps the task function to process its output and handle retries."""
41
41
  async def run_func():
42
- gen = func(*args)
43
- if hasattr(gen, '__aiter__'):
44
- # If it's an async generator, consume it completely
45
- output = ''
46
- async for chunk in gen:
47
- output += chunk
48
- return output
42
+ if asyncio.iscoroutinefunction(func):
43
+ # If the function is async, await it
44
+ return await func(*args)
49
45
  else:
50
- # If it's a coroutine, await the result
51
- return await gen
52
-
46
+ # If the function is sync, run it in a thread to prevent blocking
47
+ return await asyncio.to_thread(func, *args)
48
+
53
49
  if self.retry_enabled:
54
50
  retry_kwargs = {
55
51
  'wait': wait_random_exponential(multiplier=1, max=60),
@@ -65,12 +61,4 @@ class AsyncTaskRunner:
65
61
  return await run_func()
66
62
  except Exception as e:
67
63
  log.error(f"Error in task {name}: {e}\n{traceback.format_exc()}")
68
- raise
69
-
70
- def _log_results(self, results: List[Any]):
71
- """Logs the results of the task executions."""
72
- for result in results:
73
- if isinstance(result, Exception):
74
- log.error(f"Task resulted in an error: {result}")
75
- else:
76
- log.info(f"Task completed successfully: {result}")
64
+ raise
@@ -174,15 +174,11 @@ def print_grounding_response(response):
174
174
  markdown_text += (
175
175
  f"\n**Web Search Queries:** {grounding_metadata.web_search_queries}\n"
176
176
  )
177
- if grounding_metadata.search_entry_point:
178
- markdown_text += f"\n**Search Entry Point:**\n {grounding_metadata.search_entry_point.rendered_content}\n"
179
177
  elif grounding_metadata.retrieval_queries:
180
178
  markdown_text += (
181
179
  f"\n**Retrieval Queries:** {grounding_metadata.retrieval_queries}\n"
182
180
  )
183
181
 
184
- markdown_text += "### Grounding Chunks\n"
185
-
186
182
  for index, grounding_chunk in enumerate(
187
183
  grounding_metadata.grounding_chunks, start=1
188
184
  ):
@@ -190,7 +186,9 @@ def print_grounding_response(response):
190
186
  if not context:
191
187
  print(f"Skipping Grounding Chunk {grounding_chunk}")
192
188
  continue
189
+ markdown_text += "### Grounding Chunks\n"
193
190
 
194
191
  markdown_text += f"{index}. [{context.title}]({context.uri})\n"
195
192
 
196
- return markdown_text
193
+ return {"markdown_text": markdown_text,
194
+ "search_entry_point": grounding_metadata.search_entry_point.rendered_content if grounding_metadata.search_entry_point else ""}
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.95.3
3
+ Version: 0.95.4
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.95.3.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.95.4.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -89,7 +89,7 @@ sunholo/genai/init.py,sha256=yG8E67TduFCTQPELo83OJuWfjwTnGZsyACospahyEaY,687
89
89
  sunholo/genai/process_funcs_cls.py,sha256=OCLa_yPjVlE7wY1v54SY0M6b5lpU2l3guRHb-qYOk2A,24359
90
90
  sunholo/genai/safety.py,sha256=mkFDO_BeEgiKjQd9o2I4UxB6XI7a9U-oOFjZ8LGRUC4,1238
91
91
  sunholo/invoke/__init__.py,sha256=VOpsfhNf98az3at7bMaY1Fiw4UIZAS6zMmSqWd6_ksI,141
92
- sunholo/invoke/async_class.py,sha256=NYuQU-LIhnJEmierbSwmwxXfNzmEhqDZCSx5BZDEYA8,3225
92
+ sunholo/invoke/async_class.py,sha256=uvCP8ekUCfTRWk7xwofTzRqFykMAwrRZ4Ce_YUR6PVs,2820
93
93
  sunholo/invoke/direct_vac_func.py,sha256=fuTJlH5PsqWhN_yVMaWisHCTZU1JEUz8I8yVbWsNUFE,4268
94
94
  sunholo/invoke/invoke_vac_utils.py,sha256=sJc1edHTHMzMGXjji1N67c3iUaP7BmAL5nj82Qof63M,2053
95
95
  sunholo/langfuse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -141,12 +141,12 @@ sunholo/vertex/extensions_call.py,sha256=QeQbL3aAHlc4_-SynOzooZ_3xkQWAlcgNmFBSwL
141
141
  sunholo/vertex/extensions_class.py,sha256=2QGW28lNjoMEnaoVb3QcqEDwphclIsZthnpLUi5_Ivo,21033
142
142
  sunholo/vertex/genai_functions.py,sha256=2z6grM9H0Z79Yzx88l8mE1wXck3bRa0TWvnqZZ9ifDc,2051
143
143
  sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
144
- sunholo/vertex/memory_tools.py,sha256=x3_ESOhgMpf-gNpiOzmP7YQI0l0FAoLtbAVP2K2N0OA,7724
144
+ sunholo/vertex/memory_tools.py,sha256=ZirFbS7EKxQaoRmOrb4BnG6jPJ83wt43N8M4zTVbutU,7717
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.95.3.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
148
- sunholo-0.95.3.dist-info/METADATA,sha256=BIKn4TOl_j1DzdCYb_MLEfd-3nI3aUhaofHrGXlDSbc,7889
149
- sunholo-0.95.3.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
150
- sunholo-0.95.3.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
151
- sunholo-0.95.3.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
152
- sunholo-0.95.3.dist-info/RECORD,,
147
+ sunholo-0.95.4.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
148
+ sunholo-0.95.4.dist-info/METADATA,sha256=0uNENTJHgisWBlLoAF-E2HpFxgxWiuAhxpJ9Tw9-LbE,7889
149
+ sunholo-0.95.4.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
150
+ sunholo-0.95.4.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
151
+ sunholo-0.95.4.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
152
+ sunholo-0.95.4.dist-info/RECORD,,