sunholo 0.101.12__py3-none-any.whl → 0.101.13__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.
@@ -7,7 +7,7 @@ from ..utils.api_key import has_multivac_api_key
7
7
  import asyncio
8
8
  from threading import Thread
9
9
 
10
- def direct_vac(vac_input: dict, vac_name: str, chat_history=[]):
10
+ def direct_vac(vac_input: dict, vac_name: str, chat_history=None):
11
11
  """
12
12
  This lets VACs call other VAC Q&A endpoints within their code
13
13
  """
@@ -42,6 +42,8 @@ def direct_vac(vac_input: dict, vac_name: str, chat_history=[]):
42
42
 
43
43
  # Prepare the kwargs for send_to_qa by copying vac_input and adding more values
44
44
  qa_kwargs = vac_input.copy()
45
+ if not chat_history:
46
+ chat_history = []
45
47
 
46
48
  # Add additional arguments
47
49
  qa_kwargs.update({
@@ -68,7 +70,7 @@ def direct_vac(vac_input: dict, vac_name: str, chat_history=[]):
68
70
 
69
71
  return answer
70
72
 
71
- async def async_direct_vac(vac_input: dict, vac_name: str, chat_history=[]):
73
+ async def async_direct_vac(vac_input: dict, vac_name: str, chat_history=None):
72
74
  """
73
75
  Asynchronous version of direct_vac using send_to_qa_async.
74
76
  Allows VACs to call other VAC Q&A endpoints without blocking the event loop.
@@ -105,6 +107,9 @@ async def async_direct_vac(vac_input: dict, vac_name: str, chat_history=[]):
105
107
  # Prepare the kwargs for send_to_qa_async by copying vac_input and adding more values
106
108
  qa_kwargs = vac_input.copy()
107
109
 
110
+ if not chat_history:
111
+ chat_history = []
112
+
108
113
  # Add additional arguments
109
114
  qa_kwargs.update({
110
115
  'vector_name': vac_name,
@@ -138,7 +143,7 @@ async def async_direct_vac(vac_input: dict, vac_name: str, chat_history=[]):
138
143
 
139
144
  return answer
140
145
 
141
- def direct_vac_stream(vac_input: dict, vac_name: str, chat_history=[]):
146
+ def direct_vac_stream(vac_input: dict, vac_name: str, chat_history=None):
142
147
 
143
148
  if 'user_input' not in vac_input:
144
149
  raise ValueError('vac_input must contain at least "user_input" key - got {vac_input}')
@@ -146,6 +151,9 @@ def direct_vac_stream(vac_input: dict, vac_name: str, chat_history=[]):
146
151
  user_id = vac_input.get('user_id')
147
152
  session_id = vac_input.get('session_id')
148
153
  image_uri = vac_input.get('image_url') or vac_input.get('image_uri')
154
+
155
+ if not chat_history:
156
+ chat_history = []
149
157
 
150
158
  log.info(f"Streaming invoke_vac_qa with {vac_input=}")
151
159
  def stream_response():
@@ -196,7 +204,7 @@ def direct_vac_stream(vac_input: dict, vac_name: str, chat_history=[]):
196
204
 
197
205
 
198
206
 
199
- async def async_direct_vac_stream(vac_input: dict, vac_name: str, chat_history=[]):
207
+ async def async_direct_vac_stream(vac_input: dict, vac_name: str, chat_history=None):
200
208
  """
201
209
  Asynchronous version of direct_vac_stream.
202
210
  Streams responses from VAC Q&A endpoints without blocking the event loop.
@@ -209,13 +217,15 @@ async def async_direct_vac_stream(vac_input: dict, vac_name: str, chat_history=[
209
217
  image_uri = vac_input.get('image_url') or vac_input.get('image_uri')
210
218
 
211
219
  log.info(f"Streaming invoke_vac_qa with vac_input={vac_input}")
220
+ if not chat_history:
221
+ chat_history = []
212
222
 
213
223
  def sync_stream_response():
214
224
  generate = generate_proxy_stream(
215
225
  send_to_qa,
216
226
  vac_input["user_input"],
217
227
  vector_name=vac_name,
218
- chat_history=chat_history,
228
+ chat_history=chat_history or [],
219
229
  generate_f_output=lambda x: x, # Replace with actual processing function
220
230
  stream_wait_time=0.5,
221
231
  stream_timeout=120,
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.101.12
3
+ Version: 0.101.13
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.101.12.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.101.13.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -92,7 +92,7 @@ sunholo/genai/process_funcs_cls.py,sha256=eCXRd4Aa9SNPdAjqN6Y2GYX_o5nlktHaS0zNk8
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
95
- sunholo/invoke/direct_vac_func.py,sha256=GXSCMkC6vOWGUtQjxy-ZpTrMvJa3CgcW-y9mDpJwWC8,9533
95
+ sunholo/invoke/direct_vac_func.py,sha256=dACx3Zh7uZnuWLIFYiyLoyXUhh5-eUpd2RatDUd9ov8,9753
96
96
  sunholo/invoke/invoke_vac_utils.py,sha256=sJc1edHTHMzMGXjji1N67c3iUaP7BmAL5nj82Qof63M,2053
97
97
  sunholo/langfuse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
98
98
  sunholo/langfuse/callback.py,sha256=jl0SZsFS53uMW9DGeM9SOL_EsRZsba0wwFGLqKzu9_U,1684
@@ -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.101.12.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
- sunholo-0.101.12.dist-info/METADATA,sha256=h_2izJTdUl4s1xSKwohq96RPsT8Mz-c-0fwkuFBgRKM,8314
152
- sunholo-0.101.12.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
153
- sunholo-0.101.12.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
- sunholo-0.101.12.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
- sunholo-0.101.12.dist-info/RECORD,,
150
+ sunholo-0.101.13.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
151
+ sunholo-0.101.13.dist-info/METADATA,sha256=oyveQGMkcMQEef5c_L4T_A4nUMWQXDkYo9X_4Yqk454,8314
152
+ sunholo-0.101.13.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
153
+ sunholo-0.101.13.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
154
+ sunholo-0.101.13.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
155
+ sunholo-0.101.13.dist-info/RECORD,,