agenta 0.47.0__py3-none-any.whl → 0.48.1__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/assets.py CHANGED
@@ -24,14 +24,15 @@ supported_llm_models = {
24
24
  "deepinfra/mistralai/Mistral-7B-Instruct-v0.1",
25
25
  ],
26
26
  "Gemini": [
27
+ "gemini/gemini-2.5-flash-preview-05-20",
27
28
  "gemini/gemini-2.5-flash-preview-04-17",
28
- "gemini/gemini-2.5-pro-exp-03-25",
29
29
  "gemini/gemini-2.0-flash-001",
30
+ "gemini/gemini-2.5-pro-preview-05-06",
30
31
  "gemini/gemini-2.0-flash-lite-preview-02-05",
31
32
  "gemini/gemini-1.5-pro-latest",
33
+ "gemini/gemini-2.0-flash-lite",
32
34
  "gemini/gemini-1.5-flash",
33
35
  "gemini/gemini-1.5-flash-8b",
34
- "gemini/gemma-3-27b-it",
35
36
  ],
36
37
  "Groq": [
37
38
  "groq/deepseek-r1-distill-llama-70b",
@@ -20,7 +20,7 @@ from agenta.sdk.tracing.conventions import Reference
20
20
  log = get_module_logger(__name__)
21
21
 
22
22
 
23
- class TraceProcessor(BatchSpanProcessor):
23
+ class TraceProcessor(SpanProcessor):
24
24
  def __init__(
25
25
  self,
26
26
  span_exporter: SpanExporter,
@@ -31,14 +31,6 @@ class TraceProcessor(BatchSpanProcessor):
31
31
  max_export_batch_size: int = None,
32
32
  export_timeout_millis: float = None,
33
33
  ):
34
- super().__init__(
35
- span_exporter,
36
- _DEFAULT_MAX_QUEUE_SIZE,
37
- 5 * 1000 if inline else _DEFAULT_SCHEDULE_DELAY_MILLIS, # < 5 seconds
38
- _DEFAULT_MAX_EXPORT_BATCH_SIZE,
39
- 500 if inline else _DEFAULT_EXPORT_TIMEOUT_MILLIS, # < 1 second
40
- )
41
-
42
34
  self.references = references or dict()
43
35
  self.inline = inline is True
44
36
 
@@ -49,6 +41,18 @@ class TraceProcessor(BatchSpanProcessor):
49
41
  self._spans: Dict[int, List[ReadableSpan]] = dict()
50
42
  # --- INLINE
51
43
 
44
+ # --- DISTRIBUTED
45
+ else:
46
+ # Use composition instead of inheritance to avoid relying on BatchSpanProcessor internals
47
+ self._delegate = BatchSpanProcessor(
48
+ span_exporter,
49
+ max_queue_size or _DEFAULT_MAX_QUEUE_SIZE,
50
+ schedule_delay_millis or _DEFAULT_SCHEDULE_DELAY_MILLIS,
51
+ max_export_batch_size or _DEFAULT_MAX_EXPORT_BATCH_SIZE,
52
+ export_timeout_millis or _DEFAULT_EXPORT_TIMEOUT_MILLIS,
53
+ )
54
+ # --- DISTRIBUTED
55
+
52
56
  def on_start(
53
57
  self,
54
58
  span: Span,
@@ -79,9 +83,6 @@ class TraceProcessor(BatchSpanProcessor):
79
83
  ):
80
84
  # --- INLINE
81
85
  if self.inline:
82
- if self.done:
83
- return
84
-
85
86
  if span.context.trace_id not in self._spans:
86
87
  self._spans[span.context.trace_id] = list()
87
88
 
@@ -95,7 +96,7 @@ class TraceProcessor(BatchSpanProcessor):
95
96
 
96
97
  # --- DISTRIBUTED
97
98
  else:
98
- super().on_end(span)
99
+ self._delegate.on_end(span)
99
100
  # --- DISTRIBUTED
100
101
 
101
102
  def export(
@@ -106,11 +107,7 @@ class TraceProcessor(BatchSpanProcessor):
106
107
  if self.inline:
107
108
  spans = self._spans[trace_id]
108
109
 
109
- for span in spans:
110
- self.queue.appendleft(span)
111
-
112
- with self.condition:
113
- self.condition.notify()
110
+ self._exporter.export(spans)
114
111
 
115
112
  del self._spans[trace_id]
116
113
  # --- INLINE
@@ -119,11 +116,35 @@ class TraceProcessor(BatchSpanProcessor):
119
116
  self,
120
117
  timeout_millis: int = None,
121
118
  ) -> bool:
122
- ret = super().force_flush(timeout_millis)
119
+ # --- INLINE
120
+ if self.inline:
121
+ try:
122
+ ret = self._exporter.force_flush(timeout_millis)
123
+ except: # pylint: disable=bare-except
124
+ ret = True
125
+ # --- INLINE
126
+
127
+ # --- DISTRIBUTED
128
+ else:
129
+ ret = self._delegate.force_flush(timeout_millis)
130
+ # --- DISTRIBUTED
123
131
 
124
132
  if not ret:
125
133
  log.warning("Agenta - Skipping export due to timeout.")
126
134
 
135
+ return ret
136
+
137
+ def shutdown(self) -> None:
138
+ # --- INLINE
139
+ if self.inline:
140
+ self._exporter.shutdown()
141
+ # --- INLINE
142
+
143
+ # --- DISTRIBUTED
144
+ else:
145
+ self._delegate.shutdown()
146
+ # --- DISTRIBUTED
147
+
127
148
  def is_ready(
128
149
  self,
129
150
  trace_id: Optional[int] = None,
@@ -1,10 +1,4 @@
1
1
  from typing import Any, Optional
2
- from dotenv import load_dotenv
3
-
4
- # from .context import setup_db
5
-
6
- load_dotenv()
7
- # setup_db()
8
2
 
9
3
 
10
4
  class PreInitObject:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: agenta
3
- Version: 0.47.0
3
+ Version: 0.48.1
4
4
  Summary: The SDK for agenta is an open-source LLMOps platform.
5
5
  Keywords: LLMOps,LLM,evaluation,prompt engineering
6
6
  Author: Mahmoud Mabrouk
@@ -200,7 +200,7 @@ agenta/config.py,sha256=0VrTqduB4g8Mt_Ll7ffFcEjKF5qjTUIxmUtTPW2ygWw,653
200
200
  agenta/config.toml,sha256=sIORbhnyct2R9lJrquxhNL4pHul3O0R7iaipCoja5MY,193
201
201
  agenta/sdk/__init__.py,sha256=m5UxAteSVzJtYhSsmUmdGFsyFdZO6jlfvOpJi_4mK_E,2118
202
202
  agenta/sdk/agenta_init.py,sha256=-0m0IH6K2Nic8Vftt5ENdRxpChhsaihKLtMWn8jzoJs,6610
203
- agenta/sdk/assets.py,sha256=viDrSsQfVnMEVkzxRVcQ3WsOuhD5HPfaslLwm9uV0MA,8271
203
+ agenta/sdk/assets.py,sha256=h-0OD9K6GOMUDkWOO30Je4hCMhMg2UzI1ccgkN3RICc,8331
204
204
  agenta/sdk/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
205
205
  agenta/sdk/context/exporting.py,sha256=16X8fgMhl58gehSlqANX97FiKxx4TkGiG4d2B0-7ZX0,516
206
206
  agenta/sdk/context/routing.py,sha256=FEsjw8EttI1SMyUo96ptcUsvHJnhoKwdr1szlkxxJNU,598
@@ -234,7 +234,7 @@ agenta/sdk/tracing/attributes.py,sha256=DwjjOk3mGOvz0jYu8EYr3hhItvawK5GX80_Mfciq
234
234
  agenta/sdk/tracing/conventions.py,sha256=JBtznBXZ3aRkGKkLl7cPwdMNh3w1G-H2Ta2YrAxbr38,950
235
235
  agenta/sdk/tracing/exporters.py,sha256=Vs1aQLRrWvYgWxjPmlfBWTN4wmUzBREqjTdIV1XcV9o,3251
236
236
  agenta/sdk/tracing/inline.py,sha256=ShPAAjk_26I4hgrmC6y0n-I9gxB3Q4VeEYhhsLHInPU,31454
237
- agenta/sdk/tracing/processors.py,sha256=vDzQItQnDG_bL5rWRZjh-8DOLcfhXJcMVCAbStiTVDA,5102
237
+ agenta/sdk/tracing/processors.py,sha256=wweg31mAWiytFPsjPP3zTDqFidjLzyFXNVdXBt1o3Sw,5748
238
238
  agenta/sdk/tracing/propagation.py,sha256=EeOqDMqnh_MoEhGd1do_vy_tQBYUcoC8kpLqVoZeqg0,2561
239
239
  agenta/sdk/tracing/spans.py,sha256=nqUOjjirBxB8Eacv8Qj4Ra_6rknGi3lbJdNyKmk5ODQ,3707
240
240
  agenta/sdk/tracing/tracing.py,sha256=Yv42drWc2tVu4YugHKWYsgTSf1y7Y9boYL8akxKT4eA,9503
@@ -247,9 +247,9 @@ agenta/sdk/utils/exceptions.py,sha256=Dq3lh5Ug7IhF4nvYRXXlwhgxEuByOnT1w0uVMZx1ea
247
247
  agenta/sdk/utils/globals.py,sha256=9ixKS8aI6ZWgsjT8WngvTg4dsnP2cKErNJngHxzdK9U,256
248
248
  agenta/sdk/utils/helpers.py,sha256=gfvQ-2-M_tZonFJtSdC0F7CNFcHyUG1CTgGQNwxRt2g,1169
249
249
  agenta/sdk/utils/logging.py,sha256=j4NzpFk2ilOM10sRBOxCjmansDHSx6HwMV8IAEreRb8,8386
250
- agenta/sdk/utils/preinit.py,sha256=YlJL7RLfel0R7DFp-jK7OV-z4ZIQJM0oupYlk7g8b5o,1278
250
+ agenta/sdk/utils/preinit.py,sha256=1TAAHhYyYnLLwvzwnf33Qwkou7tI3iITlVt-1kcyGaM,1186
251
251
  agenta/sdk/utils/singleton.py,sha256=17Ph7LGnnV8HkPjImruKita2ni03Ari5jr0jqm__4sc,312
252
252
  agenta/sdk/utils/timing.py,sha256=nZR-kudVUtKFlHuBhztgSGxj7FVnCB4Uv6sfg-1dkrQ,1556
253
- agenta-0.47.0.dist-info/METADATA,sha256=2LjpV1wQBIt5iJKrEUpF-2-uA9zTtNENFrDgem725DE,31433
254
- agenta-0.47.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
255
- agenta-0.47.0.dist-info/RECORD,,
253
+ agenta-0.48.1.dist-info/METADATA,sha256=ZMcNgq1u-xqeKbmDqAs9bdxt7_ztPw7TNd_5g2QXWWg,31433
254
+ agenta-0.48.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
255
+ agenta-0.48.1.dist-info/RECORD,,