sunholo 0.89.7__py3-none-any.whl → 0.89.9__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/langfuse/evals.py CHANGED
@@ -1,4 +1,6 @@
1
1
  import os
2
+ import json
3
+
2
4
  from ..pubsub import decode_pubsub_message
3
5
  from langfuse import Langfuse
4
6
  from ..custom_logging import log
@@ -27,12 +29,18 @@ def pubsub_to_evals(data: dict, eval_funcs: list=[eval_length]) -> dict:
27
29
  # Decode the message
28
30
  message_data, metadata, vector_name = decode_pubsub_message(data)
29
31
 
30
- if 'trace_id' not in message_data:
31
- raise ValueError('No trace_id found in message data')
32
+ try:
33
+ the_json = json.loads(message_data)
34
+ except Exception as e:
35
+ log.error(f"Could not load message {message_data} as JSON - {str(e)}")
36
+ return None, {"metadata": f"Could not load message as JSON - {str(e)}"}
37
+
38
+ if 'trace_id' not in the_json:
39
+ raise ValueError(f'No trace_id found in json data {the_json=}')
32
40
 
33
- trace_id = message_data.pop('trace_id', None)
41
+ trace_id = the_json.pop('trace_id', None)
34
42
 
35
- return do_evals(trace_id, eval_funcs, **message_data)
43
+ return do_evals(trace_id, eval_funcs, **the_json)
36
44
 
37
45
 
38
46
  def direct_langfuse_evals(data, eval_funcs: list=[eval_length]):
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.89.7
3
+ Version: 0.89.9
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.89.7.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.89.9.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -94,7 +94,7 @@ sunholo/invoke/direct_vac_func.py,sha256=fuTJlH5PsqWhN_yVMaWisHCTZU1JEUz8I8yVbWs
94
94
  sunholo/invoke/invoke_vac_utils.py,sha256=sJc1edHTHMzMGXjji1N67c3iUaP7BmAL5nj82Qof63M,2053
95
95
  sunholo/langfuse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
96
96
  sunholo/langfuse/callback.py,sha256=jl0SZsFS53uMW9DGeM9SOL_EsRZsba0wwFGLqKzu9_U,1684
97
- sunholo/langfuse/evals.py,sha256=aGrU2DOR2hmI0ST613gBIT0v6IhEF1MIK1aOpuD2yR0,2909
97
+ sunholo/langfuse/evals.py,sha256=gDtbY1Oq6iXp4bommMXzuWh0DVAQ26rL6_3Ww1Esfxc,3160
98
98
  sunholo/langfuse/prompts.py,sha256=27BsVfihM6-h1jscbkGSO4HsATl-d4ZN6tcNCVztWoY,1300
99
99
  sunholo/llamaindex/__init__.py,sha256=DlY_cHWCsVEV1C5WBgDdHRgOMlJc8pDoCRukUJ8PT9w,88
100
100
  sunholo/llamaindex/get_files.py,sha256=6rhXCDqQ_lrIapISQ_OYQDjiSATXvS_9m3qq53-oIl0,781
@@ -144,9 +144,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
144
144
  sunholo/vertex/memory_tools.py,sha256=q_phxgGX2TG2j2MXNULF2xGzQnQPENwjPN9nZ_A9Gh0,7526
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.89.7.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
148
- sunholo-0.89.7.dist-info/METADATA,sha256=x7xML4fBGhjEtcjjCXUlu0IAl68yMNy7Njth-JN6FtU,7706
149
- sunholo-0.89.7.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
150
- sunholo-0.89.7.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
151
- sunholo-0.89.7.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
152
- sunholo-0.89.7.dist-info/RECORD,,
147
+ sunholo-0.89.9.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
148
+ sunholo-0.89.9.dist-info/METADATA,sha256=WybbLLxtpvmCLBdI-nKfMe4p45urDEpUeMxnfF0i2wo,7706
149
+ sunholo-0.89.9.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
150
+ sunholo-0.89.9.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
151
+ sunholo-0.89.9.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
152
+ sunholo-0.89.9.dist-info/RECORD,,