agenta 0.17.5__py3-none-any.whl → 0.17.6a0__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.

@@ -55,7 +55,9 @@ def litellm_handler():
55
55
  "message": kwargs.get(
56
56
  "complete_streaming_response"
57
57
  ), # the complete streamed response (only set if `completion(..stream=True)`)
58
- "usage": response_obj.usage.dict(), # litellm calculates usage
58
+ "usage": response_obj.usage.dict()
59
+ if hasattr(response_obj, "usage")
60
+ else None, # litellm calculates usage
59
61
  "cost": kwargs.get(
60
62
  "response_cost"
61
63
  ), # litellm calculates response cost
@@ -69,7 +71,9 @@ def litellm_handler():
69
71
  self._trace.end_span(
70
72
  outputs={
71
73
  "message": response_obj.choices[0].message.content,
72
- "usage": response_obj.usage.dict(), # litellm calculates usage
74
+ "usage": response_obj.usage.dict()
75
+ if hasattr(response_obj, "usage")
76
+ else None, # litellm calculates usage
73
77
  "cost": kwargs.get(
74
78
  "response_cost"
75
79
  ), # litellm calculates response cost
@@ -93,7 +97,9 @@ def litellm_handler():
93
97
  self._trace.end_span(
94
98
  outputs={
95
99
  "message": kwargs["exception"], # the Exception raised
96
- "usage": response_obj.usage.dict(), # litellm calculates usage
100
+ "usage": response_obj.usage.dict()
101
+ if hasattr(response_obj, "usage")
102
+ else None, # litellm calculates usage
97
103
  "cost": kwargs.get(
98
104
  "response_cost"
99
105
  ), # litellm calculates response cost
@@ -109,7 +115,9 @@ def litellm_handler():
109
115
  "message": kwargs.get(
110
116
  "complete_streaming_response"
111
117
  ), # the complete streamed response (only set if `completion(..stream=True)`)
112
- "usage": response_obj.usage.dict(), # litellm calculates usage
118
+ "usage": response_obj.usage.dict()
119
+ if hasattr(response_obj, "usage")
120
+ else None, # litellm calculates usage
113
121
  "cost": kwargs.get(
114
122
  "response_cost"
115
123
  ), # litellm calculates response cost
@@ -123,7 +131,9 @@ def litellm_handler():
123
131
  self._trace.end_span(
124
132
  outputs={
125
133
  "message": response_obj.choices[0].message.content,
126
- "usage": response_obj.usage.dict(), # litellm calculates usage
134
+ "usage": response_obj.usage.dict()
135
+ if hasattr(response_obj, "usage")
136
+ else None, # litellm calculates usage
127
137
  "cost": kwargs.get(
128
138
  "response_cost"
129
139
  ), # litellm calculates response cost
@@ -147,7 +157,9 @@ def litellm_handler():
147
157
  self._trace.end_span(
148
158
  outputs={
149
159
  "message": kwargs["exception"], # the Exception raised
150
- "usage": response_obj.usage.dict(), # litellm calculates usage
160
+ "usage": response_obj.usage.dict()
161
+ if hasattr(response_obj, "usage")
162
+ else None, # litellm calculates usage
151
163
  "cost": kwargs.get(
152
164
  "response_cost"
153
165
  ), # litellm calculates response cost
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agenta
3
- Version: 0.17.5
3
+ Version: 0.17.6a0
4
4
  Summary: The SDK for agenta is an open-source LLMOps platform.
5
5
  Home-page: https://agenta.ai
6
6
  Keywords: LLMOps,LLM,evaluation,prompt engineering
@@ -135,7 +135,7 @@ agenta/sdk/decorators/llm_entrypoint.py,sha256=o1kD14dfXLV3p1OyzgCUA6mIoyDV_YuW_
135
135
  agenta/sdk/decorators/tracing.py,sha256=_6lbnhoJgz6q6OkMDNWoLstuv-ZvTz9ExcetW2sTiEY,3447
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=E5cA6dzut90WSQ38Zy2y1XkiP6wRQ1j1CGcEo5oCsWc,6312
138
+ agenta/sdk/tracing/callbacks.py,sha256=8XYcGC4EZQ0lBn2IWmtPH_yC5Hu6Yu-NkdZRuY7CoTw,6816
139
139
  agenta/sdk/tracing/context_manager.py,sha256=HskDaiORoOhjeN375gm05wYnieQzh5UnoIsnSAHkAyc,252
140
140
  agenta/sdk/tracing/llm_tracing.py,sha256=fHtc1tKgdR2CDnFMrfDIxSvyjwFW3Qk2RE8P-y_tCM0,11361
141
141
  agenta/sdk/tracing/logger.py,sha256=GfH7V-jBHcn7h5dbdrnkDMe_ml3wkXFBeoQiqR4KVRc,474
@@ -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.5.dist-info/METADATA,sha256=t2FWDTfX0KJuqDUrim87E_dysSTg1fr5L7-BC2BiPw4,26458
163
- agenta-0.17.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
164
- agenta-0.17.5.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
165
- agenta-0.17.5.dist-info/RECORD,,
162
+ agenta-0.17.6a0.dist-info/METADATA,sha256=hkjAIZXUsRD9McyZ1QjQOvl7oKS9TezoybQGp0d-ioo,26460
163
+ agenta-0.17.6a0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
164
+ agenta-0.17.6a0.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
165
+ agenta-0.17.6a0.dist-info/RECORD,,