sunholo 0.105.3__py3-none-any.whl → 0.105.5__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.
@@ -129,7 +129,7 @@ class AlloyDBClient:
129
129
  log.error("Can't create AlloyDBEngine - install via `pip install sunholo[gcp,database]`")
130
130
  raise ValueError("Can't import AlloyDBEngine")
131
131
 
132
- log.info(f"Inititaing AlloyDB Langchain engine for database: {self.database}")
132
+ log.info(f"Inititaing AlloyDB Langchain engine for database: {self.database} with config: {self.config}")
133
133
 
134
134
  from google.cloud.alloydb.connector import IPTypes
135
135
  engine = AlloyDBEngine.from_instance(
@@ -81,7 +81,9 @@ class GenAIFunctionProcessor:
81
81
  self.model_name = "gemini-1.5-flash"
82
82
  if config:
83
83
  self.model_name = config.vacConfig("model") if config.vacConfig("llm") == "vertex" else "gemini-1.5-flash"
84
- elif model_name:
84
+
85
+ if model_name:
86
+ log.info(f"Overriding agent model name {self.model_name} with model {model_name}")
85
87
  self.model_name = model_name
86
88
 
87
89
  self.trace = trace
@@ -457,6 +459,7 @@ class GenAIFunctionProcessor:
457
459
  log.info(f"== Start input content for loop [{guardrail}]\n ## Content: {content_parse}")
458
460
  this_text = "" # reset for this loop
459
461
  response = None
462
+ executed_responses = []
460
463
  loop_span = span.span(
461
464
  name=f"loop_{guardrail}",
462
465
  model=self.model_name,
@@ -509,28 +512,28 @@ class GenAIFunctionProcessor:
509
512
  gen.end(output=response.to_dict()) if gen else None
510
513
  else:
511
514
  gen.end(output="No response received") if gen else None
515
+
512
516
 
513
- for chunk in response:
514
- if not chunk:
515
- continue
517
+ for chunk in response:
518
+ if not chunk:
519
+ continue
516
520
 
517
- 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=}")
518
532
  try:
519
- if hasattr(chunk, 'text') and isinstance(chunk.text, str):
520
- token = chunk.text
521
- token_queue.append(token)
522
- this_text += token
523
- else:
524
- log.info("skipping chunk with no text")
525
-
526
- except ValueError as err:
527
- token_queue.append(f"{str(err)} for {chunk=}")
528
- try:
529
- executed_responses = self.process_funcs(response, loop_span=loop_span)
530
- except Exception as err:
531
- log.error(f"Error in executions: {str(err)}")
532
- executed_responses = []
533
- 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=}")
534
537
 
535
538
  log.info(f"[{guardrail}] {executed_responses=}")
536
539
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.105.3
3
+ Version: 0.105.5
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.3.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.105.5.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=0Zljdy_AHCJE88_HD1nKc74x6edByuZUzYlaNbSJnn8,18916
62
+ sunholo/database/alloydb_client.py,sha256=kg6J8pCqBkjfEkXdhU8mwxdaI7w-cSE9AxKHWuYmzaM,18943
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
@@ -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=8wKBFzZ59q9Djrl7AYOfciuH9PWeTnaHrLDYDiPmzhE,31430
91
+ sunholo/genai/process_funcs_cls.py,sha256=OVSrSmeEhCvfEAtpVKhrwpgc_UJLHy6948Zz1fnE0lk,31617
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.3.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
- sunholo-0.105.3.dist-info/METADATA,sha256=pUNOX0YMdJYBo_SwC0LhTRf67huFAFrR1XSr8oqucIw,8312
152
- sunholo-0.105.3.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
153
- sunholo-0.105.3.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
- sunholo-0.105.3.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
- sunholo-0.105.3.dist-info/RECORD,,
150
+ sunholo-0.105.5.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
+ sunholo-0.105.5.dist-info/METADATA,sha256=h66mRPiUU9v8mcO8Kn0hrl7S3SaiO3YGmHGxHPkXIWg,8312
152
+ sunholo-0.105.5.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
153
+ sunholo-0.105.5.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
+ sunholo-0.105.5.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
+ sunholo-0.105.5.dist-info/RECORD,,