sunholo 0.103.2__py3-none-any.whl → 0.103.3__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.
- sunholo/agents/dispatch_to_qa.py +5 -3
- sunholo/agents/flask/vac_routes.py +5 -3
- sunholo/genai/process_funcs_cls.py +3 -1
- {sunholo-0.103.2.dist-info → sunholo-0.103.3.dist-info}/METADATA +2 -2
- {sunholo-0.103.2.dist-info → sunholo-0.103.3.dist-info}/RECORD +9 -9
- {sunholo-0.103.2.dist-info → sunholo-0.103.3.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.103.2.dist-info → sunholo-0.103.3.dist-info}/WHEEL +0 -0
- {sunholo-0.103.2.dist-info → sunholo-0.103.3.dist-info}/entry_points.txt +0 -0
- {sunholo-0.103.2.dist-info → sunholo-0.103.3.dist-info}/top_level.txt +0 -0
sunholo/agents/dispatch_to_qa.py
CHANGED
|
@@ -19,6 +19,7 @@ import aiohttp
|
|
|
19
19
|
from .langserve import prepare_request_data
|
|
20
20
|
import traceback
|
|
21
21
|
from .route import route_endpoint
|
|
22
|
+
import os
|
|
22
23
|
|
|
23
24
|
try:
|
|
24
25
|
from langfuse import Langfuse
|
|
@@ -86,7 +87,8 @@ def prep_request_payload(user_input, chat_history, vector_name, stream, **kwargs
|
|
|
86
87
|
if 'vector_name' not in qna_data:
|
|
87
88
|
qna_data['vector_name'] = vector_name
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
if not kwargs.get('trace_id'):
|
|
91
|
+
qna_data['trace_id'] = add_langfuse_trace(qna_endpoint)
|
|
90
92
|
|
|
91
93
|
return qna_endpoint, qna_data
|
|
92
94
|
|
|
@@ -94,9 +96,9 @@ def add_langfuse_trace(qna_endpoint):
|
|
|
94
96
|
if not langfuse:
|
|
95
97
|
return None
|
|
96
98
|
|
|
97
|
-
trace = langfuse.trace(name = f'
|
|
99
|
+
trace = langfuse.trace(name = f'dispatch/{os.path.basename(qna_endpoint)}')
|
|
98
100
|
|
|
99
|
-
log.info('Adding langfuse trace {trace.id}')
|
|
101
|
+
log.info(f'Adding langfuse trace {trace.id}')
|
|
100
102
|
|
|
101
103
|
return trace.id
|
|
102
104
|
|
|
@@ -357,7 +357,7 @@ if __name__ == "__main__":
|
|
|
357
357
|
|
|
358
358
|
try:
|
|
359
359
|
if span:
|
|
360
|
-
|
|
360
|
+
gen = span.generation(
|
|
361
361
|
name="vac_interpreter",
|
|
362
362
|
metadata=vac_config.configs_by_kind,
|
|
363
363
|
input = all_input,
|
|
@@ -371,7 +371,7 @@ if __name__ == "__main__":
|
|
|
371
371
|
**all_input["kwargs"]
|
|
372
372
|
)
|
|
373
373
|
if span:
|
|
374
|
-
|
|
374
|
+
gen.end(output=bot_output)
|
|
375
375
|
# {"answer": "The answer", "source_documents": [{"page_content": "The page content", "metadata": "The metadata"}]}
|
|
376
376
|
bot_output = parse_output(bot_output)
|
|
377
377
|
if trace:
|
|
@@ -383,7 +383,9 @@ if __name__ == "__main__":
|
|
|
383
383
|
|
|
384
384
|
except Exception as err:
|
|
385
385
|
bot_output = {'answer': f'QNA_ERROR: An error occurred while processing /vac/{vector_name}: {str(err)} traceback: {traceback.format_exc()}'}
|
|
386
|
-
|
|
386
|
+
if span:
|
|
387
|
+
gen.end(output=bot_output)
|
|
388
|
+
|
|
387
389
|
if trace:
|
|
388
390
|
span.end(output=jsonify(bot_output))
|
|
389
391
|
trace.update(output=jsonify(bot_output))
|
|
@@ -266,7 +266,9 @@ class GenAIFunctionProcessor:
|
|
|
266
266
|
params_obj = {key: val for key, val in fn.args.items()}
|
|
267
267
|
|
|
268
268
|
params = ', '.join(f'{key}={val}' for key, val in params_obj.items())
|
|
269
|
-
log.info(f"Executing {function_name} with params {params}")
|
|
269
|
+
log.info(f"Executing {function_name} with params {params} (Total Characters: {len(params)})")
|
|
270
|
+
if len(params)>8000:
|
|
271
|
+
log.warning(f"Total parameters are over 8000 characters - it may not work properly: {params[:10000]}....[{len(params)}]")
|
|
270
272
|
|
|
271
273
|
# Check if the function is in our dictionary of available functions
|
|
272
274
|
if function_name in self.funcs:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.103.
|
|
3
|
+
Version: 0.103.3
|
|
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.103.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.103.3.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -2,7 +2,7 @@ sunholo/__init__.py,sha256=lLuVyilzmDbTaiAptR8SZzpbUNsgwHFsp4Ejbr5EApI,1136
|
|
|
2
2
|
sunholo/custom_logging.py,sha256=YfIN1oP3dOEkkYkyRBU8BGS3uJFGwUDsFCl8mIVbwvE,12225
|
|
3
3
|
sunholo/agents/__init__.py,sha256=X2I3pPkGeKWjc3d0QgSpkTyqD8J8JtrEWqwrumf1MMc,391
|
|
4
4
|
sunholo/agents/chat_history.py,sha256=Gph_CdlP2otYnNdR1q1Umyyyvcad2F6K3LxU5yBQ9l0,5387
|
|
5
|
-
sunholo/agents/dispatch_to_qa.py,sha256=
|
|
5
|
+
sunholo/agents/dispatch_to_qa.py,sha256=AwLS41oK6iS8xre-HuWjS4jj9dvU-evWI58EYfG65fg,8879
|
|
6
6
|
sunholo/agents/langserve.py,sha256=C46ph2mnygr6bdHijYWYyfQDI9ylAF0_9Kx2PfcCJpU,4414
|
|
7
7
|
sunholo/agents/pubsub.py,sha256=TscZN_6am6DfaQkC-Yl18ZIBOoLE-0nDSiil6GpQEh4,1344
|
|
8
8
|
sunholo/agents/route.py,sha256=mV8tGABbSqcg3PQL02MgQOs41gKEHLMyIJJJcTuFdbE,2988
|
|
@@ -14,7 +14,7 @@ sunholo/agents/fastapi/qna_routes.py,sha256=lKHkXPmwltu9EH3RMwmD153-J6pE7kWQ4BhB
|
|
|
14
14
|
sunholo/agents/flask/__init__.py,sha256=poJDKMr2qj8qMb99JqCvCPSiEt1tj2tLQ3hKW3f2aVw,107
|
|
15
15
|
sunholo/agents/flask/base.py,sha256=FgSaCODyoTtlstJtsqlLPScdgRUtv9_plxftdzHdVFo,809
|
|
16
16
|
sunholo/agents/flask/qna_routes.py,sha256=uwUD1yrzOPH27m2AXpiQrPk_2VfJOQOM6dAynOWQtoQ,22532
|
|
17
|
-
sunholo/agents/flask/vac_routes.py,sha256=
|
|
17
|
+
sunholo/agents/flask/vac_routes.py,sha256=sFjVXxudKP3SMO2hpcSbPZRZFBfrJr0tDQmlHTzn5E0,27181
|
|
18
18
|
sunholo/archive/__init__.py,sha256=qNHWm5rGPVOlxZBZCpA1wTYPbalizRT7f8X4rs2t290,31
|
|
19
19
|
sunholo/archive/archive.py,sha256=PxVfDtO2_2ZEEbnhXSCbXLdeoHoQVImo4y3Jr2XkCFY,1204
|
|
20
20
|
sunholo/auth/__init__.py,sha256=TeP-OY0XGxYV_8AQcVGoh35bvyWhNUcMRfhuD5l44Sk,91
|
|
@@ -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=
|
|
91
|
+
sunholo/genai/process_funcs_cls.py,sha256=6NZiYd9VWEzRN_-25PvOpBnQcfuJfWMuqi2hgAYm9ls,29530
|
|
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.103.
|
|
151
|
-
sunholo-0.103.
|
|
152
|
-
sunholo-0.103.
|
|
153
|
-
sunholo-0.103.
|
|
154
|
-
sunholo-0.103.
|
|
155
|
-
sunholo-0.103.
|
|
150
|
+
sunholo-0.103.3.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
151
|
+
sunholo-0.103.3.dist-info/METADATA,sha256=c9RZHjm11DZGjxIeguvv05L1UzrVTS3SqgHAPsKy_bE,8312
|
|
152
|
+
sunholo-0.103.3.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
153
|
+
sunholo-0.103.3.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
154
|
+
sunholo-0.103.3.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
155
|
+
sunholo-0.103.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|