agenta 0.20.0a10__py3-none-any.whl → 0.20.0a11__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/tracing.py +1 -1
- agenta/sdk/tracing/callbacks.py +8 -6
- {agenta-0.20.0a10.dist-info → agenta-0.20.0a11.dist-info}/METADATA +1 -1
- {agenta-0.20.0a10.dist-info → agenta-0.20.0a11.dist-info}/RECORD +6 -6
- {agenta-0.20.0a10.dist-info → agenta-0.20.0a11.dist-info}/WHEEL +0 -0
- {agenta-0.20.0a10.dist-info → agenta-0.20.0a11.dist-info}/entry_points.txt +0 -0
agenta/sdk/decorators/tracing.py
CHANGED
|
@@ -79,7 +79,7 @@ class instrument(BaseDecorator):
|
|
|
79
79
|
and "cost" in result.keys()
|
|
80
80
|
and "usage" in result.keys()
|
|
81
81
|
):
|
|
82
|
-
outputs = {
|
|
82
|
+
outputs = {TRACE_DEFAULT_KEY: result["message"]}
|
|
83
83
|
|
|
84
84
|
ag.tracing.store_cost(result["cost"])
|
|
85
85
|
ag.tracing.store_usage(result["usage"])
|
agenta/sdk/tracing/callbacks.py
CHANGED
|
@@ -5,6 +5,8 @@ from agenta.sdk.tracing.logger import llm_logger as logging
|
|
|
5
5
|
|
|
6
6
|
from agenta.sdk.utils.debug import debug
|
|
7
7
|
|
|
8
|
+
TRACE_DEFAULT_KEY = "__default__"
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
def litellm_handler():
|
|
10
12
|
try:
|
|
@@ -70,7 +72,7 @@ def litellm_handler():
|
|
|
70
72
|
)
|
|
71
73
|
ag.tracing.store_outputs(
|
|
72
74
|
# the complete streamed response (only set if `completion(..stream=True)`
|
|
73
|
-
outputs={
|
|
75
|
+
outputs={TRACE_DEFAULT_KEY: kwargs.get("complete_streaming_response")},
|
|
74
76
|
span_id=self.span.id,
|
|
75
77
|
)
|
|
76
78
|
ag.tracing.close_span(span_id=self.span.id)
|
|
@@ -84,7 +86,7 @@ def litellm_handler():
|
|
|
84
86
|
response_obj.usage.dict() if hasattr(response_obj, "usage") else None
|
|
85
87
|
)
|
|
86
88
|
ag.tracing.store_outputs(
|
|
87
|
-
outputs={
|
|
89
|
+
outputs={TRACE_DEFAULT_KEY: response_obj.choices[0].message.content},
|
|
88
90
|
span_id=self.span.id,
|
|
89
91
|
)
|
|
90
92
|
ag.tracing.close_span(span_id=self.span.id)
|
|
@@ -110,7 +112,7 @@ def litellm_handler():
|
|
|
110
112
|
)
|
|
111
113
|
ag.tracing.store_outputs(
|
|
112
114
|
# the Exception raised
|
|
113
|
-
outputs={
|
|
115
|
+
outputs={TRACE_DEFAULT_KEY: repr(kwargs["exception"])},
|
|
114
116
|
span_id=self.span.id,
|
|
115
117
|
)
|
|
116
118
|
ag.tracing.close_span(span_id=self.span.id)
|
|
@@ -127,7 +129,7 @@ def litellm_handler():
|
|
|
127
129
|
)
|
|
128
130
|
ag.tracing.store_outputs(
|
|
129
131
|
# the complete streamed response (only set if `completion(..stream=True)`)
|
|
130
|
-
outputs={
|
|
132
|
+
outputs={TRACE_DEFAULT_KEY: kwargs.get("complete_streaming_response")},
|
|
131
133
|
span_id=self.span.id,
|
|
132
134
|
)
|
|
133
135
|
ag.tracing.close_span(span_id=self.span.id)
|
|
@@ -143,7 +145,7 @@ def litellm_handler():
|
|
|
143
145
|
response_obj.usage.dict() if hasattr(response_obj, "usage") else None
|
|
144
146
|
)
|
|
145
147
|
ag.tracing.store_outputs(
|
|
146
|
-
outputs={
|
|
148
|
+
outputs={TRACE_DEFAULT_KEY: response_obj.choices[0].message.content},
|
|
147
149
|
span_id=self.span.id,
|
|
148
150
|
)
|
|
149
151
|
ag.tracing.close_span(span_id=self.span.id)
|
|
@@ -171,7 +173,7 @@ def litellm_handler():
|
|
|
171
173
|
)
|
|
172
174
|
ag.tracing.store_outputs(
|
|
173
175
|
# the Exception raised
|
|
174
|
-
outputs={
|
|
176
|
+
outputs={TRACE_DEFAULT_KEY: repr(kwargs["exception"])},
|
|
175
177
|
span_id=self.span.id,
|
|
176
178
|
)
|
|
177
179
|
ag.tracing.close_span(span_id=self.span.id)
|
|
@@ -132,10 +132,10 @@ 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
134
|
agenta/sdk/decorators/llm_entrypoint.py,sha256=9GFT6dpVWY2_1Ckh1Y_N0xSXwosoSjtNtqMEM7u55uY,28224
|
|
135
|
-
agenta/sdk/decorators/tracing.py,sha256=
|
|
135
|
+
agenta/sdk/decorators/tracing.py,sha256=J9MG04g0OoN_nGB1JkkVzCX1XPaouQr93SR54-TSRTA,4379
|
|
136
136
|
agenta/sdk/router.py,sha256=0sbajvn5C7t18anH6yNo7-oYxldHnYfwcbmQnIXBePw,269
|
|
137
137
|
agenta/sdk/tracing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
138
|
-
agenta/sdk/tracing/callbacks.py,sha256=
|
|
138
|
+
agenta/sdk/tracing/callbacks.py,sha256=JD6Q7_geFzZSwCnW8u3ISw3cWCYc2TEjGg-rf-colf8,7333
|
|
139
139
|
agenta/sdk/tracing/context_manager.py,sha256=HskDaiORoOhjeN375gm05wYnieQzh5UnoIsnSAHkAyc,252
|
|
140
140
|
agenta/sdk/tracing/llm_tracing.py,sha256=FfZQcID-8E4G0R34H29SA05yFUNDMEPccb4MqVcNDLM,18064
|
|
141
141
|
agenta/sdk/tracing/logger.py,sha256=GfH7V-jBHcn7h5dbdrnkDMe_ml3wkXFBeoQiqR4KVRc,474
|
|
@@ -161,7 +161,7 @@ agenta/templates/simple_prompt/app.py,sha256=kODgF6lhzsaJPdgL5b21bUki6jkvqjWZzWR
|
|
|
161
161
|
agenta/templates/simple_prompt/env.example,sha256=g9AE5bYcGPpxawXMJ96gh8oenEPCHTabsiOnfQo3c5k,70
|
|
162
162
|
agenta/templates/simple_prompt/requirements.txt,sha256=ywRglRy7pPkw8bljmMEJJ4aOOQKrt9FGKULZ-DGkoBU,23
|
|
163
163
|
agenta/templates/simple_prompt/template.toml,sha256=DQBtRrF4GU8LBEXOZ-GGuINXMQDKGTEG5y37tnvIUIE,60
|
|
164
|
-
agenta-0.20.
|
|
165
|
-
agenta-0.20.
|
|
166
|
-
agenta-0.20.
|
|
167
|
-
agenta-0.20.
|
|
164
|
+
agenta-0.20.0a11.dist-info/METADATA,sha256=ehpOsYlSZ6gwcRxA9_kBHrCfGvaAIp9uE3aUFmOfYnQ,26463
|
|
165
|
+
agenta-0.20.0a11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
166
|
+
agenta-0.20.0a11.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
|
|
167
|
+
agenta-0.20.0a11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|