agenta 0.17.6a0__py3-none-any.whl → 0.17.6a1__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.
Potentially problematic release.
This version of agenta might be problematic. Click here for more details.
- agenta/sdk/decorators/llm_entrypoint.py +2 -0
- agenta/sdk/decorators/tracing.py +26 -15
- {agenta-0.17.6a0.dist-info → agenta-0.17.6a1.dist-info}/METADATA +1 -1
- {agenta-0.17.6a0.dist-info → agenta-0.17.6a1.dist-info}/RECORD +6 -6
- {agenta-0.17.6a0.dist-info → agenta-0.17.6a1.dist-info}/WHEEL +0 -0
- {agenta-0.17.6a0.dist-info → agenta-0.17.6a1.dist-info}/entry_points.txt +0 -0
|
@@ -83,9 +83,11 @@ class entrypoint(BaseDecorator):
|
|
|
83
83
|
{"config": config_params, "environment": "playground"}
|
|
84
84
|
)
|
|
85
85
|
|
|
86
|
+
# Exceptions are all handled inside self.execute_function()
|
|
86
87
|
llm_result = await self.execute_function(
|
|
87
88
|
func, *args, params=func_params, config_params=config_params
|
|
88
89
|
)
|
|
90
|
+
|
|
89
91
|
return llm_result
|
|
90
92
|
|
|
91
93
|
@functools.wraps(func)
|
agenta/sdk/decorators/tracing.py
CHANGED
|
@@ -58,19 +58,24 @@ class instrument(BaseDecorator):
|
|
|
58
58
|
try:
|
|
59
59
|
result = await func(*args, **kwargs)
|
|
60
60
|
self.tracing.update_span_status(span=span, value="OK")
|
|
61
|
-
except Exception as e:
|
|
62
|
-
result = str(e)
|
|
63
|
-
self.tracing.set_span_attribute(
|
|
64
|
-
{"traceback_exception": traceback.format_exc()}
|
|
65
|
-
)
|
|
66
|
-
self.tracing.update_span_status(span=span, value="ERROR")
|
|
67
|
-
finally:
|
|
68
61
|
self.tracing.end_span(
|
|
69
62
|
outputs=(
|
|
70
63
|
{"message": result} if not isinstance(result, dict) else result
|
|
71
64
|
)
|
|
72
65
|
)
|
|
73
|
-
|
|
66
|
+
return result
|
|
67
|
+
|
|
68
|
+
except Exception as e:
|
|
69
|
+
result = {
|
|
70
|
+
"message": str(e),
|
|
71
|
+
"stacktrace": traceback.format_exc(),
|
|
72
|
+
}
|
|
73
|
+
self.tracing.set_span_attribute(
|
|
74
|
+
{"traceback_exception": traceback.format_exc()}
|
|
75
|
+
)
|
|
76
|
+
self.tracing.update_span_status(span=span, value="ERROR")
|
|
77
|
+
self.tracing.end_span(outputs=result)
|
|
78
|
+
raise e
|
|
74
79
|
|
|
75
80
|
@wraps(func)
|
|
76
81
|
def sync_wrapper(*args, **kwargs):
|
|
@@ -89,17 +94,23 @@ class instrument(BaseDecorator):
|
|
|
89
94
|
try:
|
|
90
95
|
result = func(*args, **kwargs)
|
|
91
96
|
self.tracing.update_span_status(span=span, value="OK")
|
|
92
|
-
except Exception as e:
|
|
93
|
-
result = str(e)
|
|
94
|
-
self.tracing.set_span_attribute(
|
|
95
|
-
{"traceback_exception": traceback.format_exc()}
|
|
96
|
-
)
|
|
97
|
-
self.tracing.update_span_status(span=span, value="ERROR")
|
|
98
|
-
finally:
|
|
99
97
|
self.tracing.end_span(
|
|
100
98
|
outputs=(
|
|
101
99
|
{"message": result} if not isinstance(result, dict) else result
|
|
102
100
|
)
|
|
103
101
|
)
|
|
102
|
+
return result
|
|
103
|
+
|
|
104
|
+
except Exception as e:
|
|
105
|
+
result = {
|
|
106
|
+
"message": str(e),
|
|
107
|
+
"stacktrace": traceback.format_exc(),
|
|
108
|
+
}
|
|
109
|
+
self.tracing.set_span_attribute(
|
|
110
|
+
{"traceback_exception": traceback.format_exc()}
|
|
111
|
+
)
|
|
112
|
+
self.tracing.update_span_status(span=span, value="ERROR")
|
|
113
|
+
self.tracing.end_span(outputs=result)
|
|
114
|
+
raise e
|
|
104
115
|
|
|
105
116
|
return async_wrapper if is_coroutine_function else sync_wrapper
|
|
@@ -131,8 +131,8 @@ agenta/sdk/agenta_init.py,sha256=aKCJRoZ6nsY3dHWwvgxdxyJhYL3n5xEcD6ZJiqshchQ,995
|
|
|
131
131
|
agenta/sdk/client.py,sha256=trKyBOYFZRk0v5Eptxvh87yPf50Y9CqY6Qgv4Fy-VH4,2142
|
|
132
132
|
agenta/sdk/context.py,sha256=q-PxL05-I84puunUAs9LGsffEXcYhDxhQxjuOz2vK90,901
|
|
133
133
|
agenta/sdk/decorators/base.py,sha256=9aNdX5h8a2mFweuhdO-BQPwXGKY9ONPIdLRhSGAGMfY,217
|
|
134
|
-
agenta/sdk/decorators/llm_entrypoint.py,sha256=
|
|
135
|
-
agenta/sdk/decorators/tracing.py,sha256=
|
|
134
|
+
agenta/sdk/decorators/llm_entrypoint.py,sha256=awdd2fSjVKIz3MVmElHw8_nJxFvePI_zMdPd_QWxIM0,22827
|
|
135
|
+
agenta/sdk/decorators/tracing.py,sha256=4Ta9UN3pjQhxST6lnPaNz1GwnoXz2EHjq5JGqd4g8qw,3817
|
|
136
136
|
agenta/sdk/router.py,sha256=0sbajvn5C7t18anH6yNo7-oYxldHnYfwcbmQnIXBePw,269
|
|
137
137
|
agenta/sdk/tracing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
138
138
|
agenta/sdk/tracing/callbacks.py,sha256=8XYcGC4EZQ0lBn2IWmtPH_yC5Hu6Yu-NkdZRuY7CoTw,6816
|
|
@@ -159,7 +159,7 @@ agenta/templates/simple_prompt/app.py,sha256=kODgF6lhzsaJPdgL5b21bUki6jkvqjWZzWR
|
|
|
159
159
|
agenta/templates/simple_prompt/env.example,sha256=g9AE5bYcGPpxawXMJ96gh8oenEPCHTabsiOnfQo3c5k,70
|
|
160
160
|
agenta/templates/simple_prompt/requirements.txt,sha256=ywRglRy7pPkw8bljmMEJJ4aOOQKrt9FGKULZ-DGkoBU,23
|
|
161
161
|
agenta/templates/simple_prompt/template.toml,sha256=DQBtRrF4GU8LBEXOZ-GGuINXMQDKGTEG5y37tnvIUIE,60
|
|
162
|
-
agenta-0.17.
|
|
163
|
-
agenta-0.17.
|
|
164
|
-
agenta-0.17.
|
|
165
|
-
agenta-0.17.
|
|
162
|
+
agenta-0.17.6a1.dist-info/METADATA,sha256=C8nSi2ONQxN_eJvqInko-n097OcsZ6atl5OBVq5pWtM,26460
|
|
163
|
+
agenta-0.17.6a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
164
|
+
agenta-0.17.6a1.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
|
|
165
|
+
agenta-0.17.6a1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|