sunholo 0.105.4__py3-none-any.whl → 0.105.6__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.
@@ -459,6 +459,7 @@ class GenAIFunctionProcessor:
459
459
  log.info(f"== Start input content for loop [{guardrail}]\n ## Content: {content_parse}")
460
460
  this_text = "" # reset for this loop
461
461
  response = None
462
+ executed_responses = []
462
463
  loop_span = span.span(
463
464
  name=f"loop_{guardrail}",
464
465
  model=self.model_name,
@@ -511,28 +512,28 @@ class GenAIFunctionProcessor:
511
512
  gen.end(output=response.to_dict()) if gen else None
512
513
  else:
513
514
  gen.end(output="No response received") if gen else None
515
+
514
516
 
515
- for chunk in response:
516
- if not chunk:
517
- continue
517
+ for chunk in response:
518
+ if not chunk:
519
+ continue
518
520
 
519
- log.debug(f"[{guardrail}] {chunk=}")
521
+ log.debug(f"[{guardrail}] {chunk=}")
522
+ try:
523
+ if hasattr(chunk, 'text') and isinstance(chunk.text, str):
524
+ token = chunk.text
525
+ token_queue.append(token)
526
+ this_text += token
527
+ else:
528
+ log.info("skipping chunk with no text")
529
+
530
+ except ValueError as err:
531
+ token_queue.append(f"{str(err)} for {chunk=}")
520
532
  try:
521
- if hasattr(chunk, 'text') and isinstance(chunk.text, str):
522
- token = chunk.text
523
- token_queue.append(token)
524
- this_text += token
525
- else:
526
- log.info("skipping chunk with no text")
527
-
528
- except ValueError as err:
529
- token_queue.append(f"{str(err)} for {chunk=}")
530
- try:
531
- executed_responses = self.process_funcs(response, loop_span=loop_span)
532
- except Exception as err:
533
- log.error(f"Error in executions: {str(err)}")
534
- executed_responses = []
535
- token_queue.append(f"{str(err)} for {response=}")
533
+ executed_responses = self.process_funcs(response, loop_span=loop_span)
534
+ except Exception as err:
535
+ log.error(f"Error in executions: {str(err)}")
536
+ token_queue.append(f"{str(err)} for {response=}")
536
537
 
537
538
  log.info(f"[{guardrail}] {executed_responses=}")
538
539
 
@@ -608,14 +609,13 @@ class GenAIFunctionProcessor:
608
609
  this_text += token
609
610
  token_queue.append(token)
610
611
  fn_exec_one.end(output=token) if fn_exec_one else None
611
-
612
+ fn_exec.end(output=this_text) if fn_exec else None
613
+
612
614
  else:
613
615
  token = "\nNo function executions were found\n"
614
616
  token_queue.append(token)
615
617
  this_text += token
616
618
 
617
- fn_exec.end(output=this_text) if fn_exec else None
618
-
619
619
  if this_text:
620
620
  content.append(f"Agent: {this_text}")
621
621
  # if text includes gs:// try to download it
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.105.4
3
+ Version: 0.105.6
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.105.4.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.105.6.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -88,7 +88,7 @@ sunholo/gcs/metadata.py,sha256=oQLcXi4brsZ74aegWyC1JZmhlaEV270HS5_UWtAYYWE,898
88
88
  sunholo/genai/__init__.py,sha256=dBl6IA3-Fx6-Vx81r0XqxHlUq6WeW1iDX188dpChu8s,115
89
89
  sunholo/genai/images.py,sha256=EyjsDqt6XQw99pZUQamomCpMOoIah9bp3XY94WPU7Ms,1678
90
90
  sunholo/genai/init.py,sha256=yG8E67TduFCTQPELo83OJuWfjwTnGZsyACospahyEaY,687
91
- sunholo/genai/process_funcs_cls.py,sha256=8T0664wMeLcUIOHfa3EYHjohbMOHnzTzNz_UNhxutNM,31532
91
+ sunholo/genai/process_funcs_cls.py,sha256=_vyFOqGvHR9846ahNwj3Gl7kbYhsliCkVvI6ou925QQ,31608
92
92
  sunholo/genai/safety.py,sha256=mkFDO_BeEgiKjQd9o2I4UxB6XI7a9U-oOFjZ8LGRUC4,1238
93
93
  sunholo/invoke/__init__.py,sha256=o1RhwBGOtVK0MIdD55fAIMCkJsxTksi8GD5uoqVKI-8,184
94
94
  sunholo/invoke/async_class.py,sha256=G8vD2H94fpBc37mSJSQODEKJ67P2mPQEHabtDaLOvxE,8033
@@ -147,9 +147,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
147
147
  sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
148
148
  sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
149
149
  sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
150
- sunholo-0.105.4.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
- sunholo-0.105.4.dist-info/METADATA,sha256=mFYUzjQ7asBiG4SEi4oAVar-FbD0kgedLQ8h7C5cs6A,8312
152
- sunholo-0.105.4.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
153
- sunholo-0.105.4.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
- sunholo-0.105.4.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
- sunholo-0.105.4.dist-info/RECORD,,
150
+ sunholo-0.105.6.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
+ sunholo-0.105.6.dist-info/METADATA,sha256=n2sxhg0ilHv5x2OBEgBOSqADhdtUv9CNw2T4J1NJvoY,8312
152
+ sunholo-0.105.6.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
153
+ sunholo-0.105.6.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
+ sunholo-0.105.6.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
+ sunholo-0.105.6.dist-info/RECORD,,