agenta 0.43.1__py3-none-any.whl → 0.44.0__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/agenta_init.py CHANGED
@@ -11,7 +11,7 @@ from agenta.sdk.tracing import Tracing
11
11
  from agenta.sdk.context.routing import routing_context
12
12
 
13
13
 
14
- log = get_module_logger(__file__)
14
+ log = get_module_logger(__name__)
15
15
 
16
16
 
17
17
  class AgentaSingleton:
@@ -38,7 +38,7 @@ from agenta.sdk.types import (
38
38
 
39
39
  import agenta as ag
40
40
 
41
- log = get_module_logger(__file__)
41
+ log = get_module_logger(__name__)
42
42
 
43
43
  AGENTA_RUNTIME_PREFIX = environ.get("AGENTA_RUNTIME_PREFIX", "")
44
44
 
@@ -7,7 +7,7 @@ from agenta.sdk.tracing.spans import CustomSpan
7
7
  from agenta.sdk.utils.exceptions import suppress # TODO: use it !
8
8
  from agenta.sdk.utils.logging import get_module_logger
9
9
 
10
- log = get_module_logger(__file__)
10
+ log = get_module_logger(__name__)
11
11
 
12
12
 
13
13
  def litellm_handler():
@@ -1,25 +1,54 @@
1
+ from typing import Optional, Literal
2
+
1
3
  from agenta.sdk.utils.logging import get_module_logger
2
4
  from agenta.sdk.utils.exceptions import handle_exceptions
3
5
 
4
6
  import agenta as ag
5
7
 
6
- log = get_module_logger(__file__)
8
+ log = get_module_logger(__name__)
9
+
10
+ AppType = Literal["SERVICE:completion", "SERVICE:chat", "CUSTOM"]
11
+
12
+ DEFAULT_APP_TYPE = "SERVICE:completion"
13
+
14
+
15
+ AppType = Literal["SERVICE:completion", "SERVICE:chat", "CUSTOM"]
16
+
17
+ DEFAULT_APP_TYPE = "SERVICE:completion"
7
18
 
8
19
 
9
20
  class AppManager:
10
21
  @classmethod
11
22
  @handle_exceptions()
12
- def create(cls, *, app_slug: str, template_key: str):
23
+ def create(
24
+ cls,
25
+ *,
26
+ app_slug: str,
27
+ template_key: Optional[AppType] = None,
28
+ app_type: Optional[AppType] = DEFAULT_APP_TYPE,
29
+ ):
30
+ template_key = template_key or app_type
31
+
13
32
  app_response = ag.api.apps.create_app(
14
- app_name=app_slug, template_key=template_key
33
+ app_name=app_slug,
34
+ template_key=template_key,
15
35
  )
16
36
  return app_response
17
37
 
18
38
  @classmethod
19
39
  @handle_exceptions()
20
- async def acreate(cls, *, app_slug: str, template_key: str):
40
+ async def acreate(
41
+ cls,
42
+ *,
43
+ app_slug: str,
44
+ template_key: Optional[AppType] = None,
45
+ app_type: Optional[AppType] = DEFAULT_APP_TYPE,
46
+ ):
47
+ template_key = template_key or app_type
48
+
21
49
  app_response = await ag.async_api.apps.create_app(
22
- app_name=app_slug, template_key=template_key
50
+ app_name=app_slug,
51
+ template_key=template_key,
23
52
  )
24
53
  return app_response
25
54
 
@@ -11,7 +11,7 @@ from agenta.sdk.context.routing import routing_context
11
11
 
12
12
  T = TypeVar("T", bound=BaseModel)
13
13
 
14
- log = get_module_logger(__file__)
14
+ log = get_module_logger(__name__)
15
15
 
16
16
  AVAILABLE_ENVIRONMENTS = ["development", "production", "staging"]
17
17
 
@@ -51,10 +51,10 @@ class ConfigManager:
51
51
 
52
52
  if not parameters:
53
53
  return None
54
- if "ag_config" in parameters:
55
- parameters = parameters["ag_config"]
54
+
56
55
  if not schema:
57
56
  return parameters
57
+
58
58
  return schema(**parameters)
59
59
 
60
60
  @staticmethod
@@ -97,10 +97,9 @@ class ConfigManager:
97
97
  environment_slug=environment_slug,
98
98
  environment_version=environment_version,
99
99
  )
100
- if "ag_config" in config.params:
101
- params = config.params["ag_config"]
102
- else:
103
- params = config.params
100
+
101
+ params = config.params
102
+
104
103
  if schema:
105
104
  return schema(**params)
106
105
 
@@ -146,10 +145,8 @@ class ConfigManager:
146
145
  environment_slug=environment_slug,
147
146
  environment_version=environment_version,
148
147
  )
149
- if "ag_config" in config.params:
150
- params = config.params["ag_config"]
151
- else:
152
- params = config.params
148
+
149
+ params = config.params
153
150
 
154
151
  if schema:
155
152
  return schema(**params)
@@ -13,7 +13,7 @@ from agenta.client.backend.types.reference_request_model import ReferenceRequest
13
13
 
14
14
  import agenta as ag
15
15
 
16
- log = get_module_logger(__file__)
16
+ log = get_module_logger(__name__)
17
17
 
18
18
 
19
19
  class SharedManager:
@@ -15,7 +15,7 @@ from agenta.sdk.utils.logging import get_module_logger
15
15
 
16
16
  import agenta as ag
17
17
 
18
- log = get_module_logger(__file__)
18
+ log = get_module_logger(__name__)
19
19
 
20
20
  AGENTA_RUNTIME_PREFIX = getenv("AGENTA_RUNTIME_PREFIX", "")
21
21
 
@@ -18,7 +18,7 @@ from agenta.sdk.utils.cache import TTLLRUCache
18
18
 
19
19
  from agenta.sdk.utils.logging import get_module_logger
20
20
 
21
- log = get_module_logger(__file__)
21
+ log = get_module_logger(__name__)
22
22
 
23
23
 
24
24
  class InlineTraceExporter(SpanExporter):
@@ -16,7 +16,7 @@ from opentelemetry.sdk.trace.export import (
16
16
  from agenta.sdk.utils.logging import get_module_logger
17
17
  from agenta.sdk.tracing.conventions import Reference
18
18
 
19
- log = get_module_logger(__file__)
19
+ log = get_module_logger(__name__)
20
20
 
21
21
 
22
22
  class TraceProcessor(BatchSpanProcessor):
@@ -24,7 +24,7 @@ from agenta.sdk.tracing.conventions import Reference, is_valid_attribute_key
24
24
  from agenta.sdk.tracing.propagation import extract, inject
25
25
  from agenta.sdk.utils.cache import TTLLRUCache
26
26
 
27
- log = get_module_logger(__file__)
27
+ log = get_module_logger(__name__)
28
28
 
29
29
 
30
30
  class Tracing(metaclass=Singleton):
@@ -5,7 +5,7 @@ from inspect import iscoroutinefunction
5
5
 
6
6
  from agenta.sdk.utils.logging import get_module_logger
7
7
 
8
- log = get_module_logger(__file__)
8
+ log = get_module_logger(__name__)
9
9
 
10
10
 
11
11
  def display_exception(message: str):
@@ -3,7 +3,7 @@ from functools import wraps
3
3
 
4
4
  from agenta.sdk.utils.logging import get_module_logger
5
5
 
6
- log = get_module_logger(__file__)
6
+ log = get_module_logger(__name__)
7
7
 
8
8
 
9
9
  def timeit(func):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: agenta
3
- Version: 0.43.1
3
+ Version: 0.44.0
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
@@ -16,7 +16,8 @@ Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Topic :: Software Development :: Libraries
18
18
  Requires-Dist: fastapi (>=0.100.0)
19
- Requires-Dist: httpx (>=0.24,<0.28)
19
+ Requires-Dist: h11 (>=0.16.0)
20
+ Requires-Dist: httpx (>=0.28.0)
20
21
  Requires-Dist: importlib-metadata (>=8.0.0,<9.0)
21
22
  Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
22
23
  Requires-Dist: litellm (>=1.61.15,<2.0.0)
@@ -199,29 +199,29 @@ agenta/client/types/provider_kind.py~feat_model-registry,sha256=u_fXncQyXH3pfh2w
199
199
  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
- agenta/sdk/agenta_init.py,sha256=hyE_PGHtiqn29iftqqplJJCnn5xPPLa09fzBtU84EBY,6111
202
+ agenta/sdk/agenta_init.py,sha256=fZQdPO0i9fub17N7KmUamT2OgAmQekwRo7iFpg8hfL0,6111
203
203
  agenta/sdk/assets.py,sha256=z6pUK5b9dZMD7vaaghDu1w9lMD_IopspbgVxmop5PLY,8181
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
207
207
  agenta/sdk/context/tracing.py,sha256=xjErrXP1Nq1AfL-Cif1l-lNEfs12eQ3v_VCRgoKe7nY,743
208
208
  agenta/sdk/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
209
- agenta/sdk/decorators/routing.py,sha256=RUq55Y3GHkQilJlobQmUHnHBmPZrhHgQyPxKF_D9RXo,24799
209
+ agenta/sdk/decorators/routing.py,sha256=B3nplfdFk774KLf_cs72ovx_06nfdpYM8tp6RHd38Z0,24799
210
210
  agenta/sdk/decorators/tracing.py,sha256=n3AZWw8HHKUoIHD79_ktPQcoZRIw3RthSxU5xkO-skg,10109
211
211
  agenta/sdk/litellm/__init__.py,sha256=Bpz1gfHQc0MN1yolWcjifLWznv6GjHggvRGQSpxpihM,37
212
- agenta/sdk/litellm/litellm.py,sha256=vZYuzcSss04zE258eC-3xjKjY-HToafB1ekjmKjMR4U,10202
212
+ agenta/sdk/litellm/litellm.py,sha256=dCjw0H_jD3L3UQ3l9SbLm5dfeIGnel6dPtQYJ78beYM,10202
213
213
  agenta/sdk/litellm/mockllm.py,sha256=8V6dqdv8eA4P-VoXIwHNYlIjHG189P14POSfSfluVw0,678
214
214
  agenta/sdk/litellm/mocks/__init__.py,sha256=0bGjOOWXz8BxE0rvRWciPP7SAegO2mgi_UtWw8jTlDk,866
215
215
  agenta/sdk/managers/__init__.py,sha256=SN-LRwG0pRRDV3u2Q4JiiSTigN3-mYpzGNM35RzT4mc,238
216
- agenta/sdk/managers/apps.py,sha256=T8sGAcrLDLn4qotxpaSY0pWrdWtpu6PL2w5Obq6nvsE,1748
217
- agenta/sdk/managers/config.py,sha256=B4QGnP9jkmIEkl_QR1hF3XyqeiRCEOy_LySbXnsGp9I,7790
216
+ agenta/sdk/managers/apps.py,sha256=hfkXat6cgZUDdW02LlMaMgO1e05m1Me3BKgSyFF9kVc,2359
217
+ agenta/sdk/managers/config.py,sha256=Dl1L4KGvj3h_temzJzn7FVHacABRuB2Q7_x98EpZJQo,7494
218
218
  agenta/sdk/managers/deployment.py,sha256=SEokjZeh6n7HRKZ92Y0WncdG49hIFx-Z3B3HAl2kmUg,1174
219
219
  agenta/sdk/managers/secrets.py,sha256=QFWLQY3Enev187sNOvV3yBBYFwcPoDnInwgwlRD0SEw,7458
220
- agenta/sdk/managers/shared.py,sha256=LUX9RC5tfq5sZZi9ElGanSJ0B-4KV93LVUiUqfJ74xY,21559
220
+ agenta/sdk/managers/shared.py,sha256=kI3w74E4rS3YDORG2e-_r0Pz5KslTRzRBK7vgyOeaJA,21559
221
221
  agenta/sdk/managers/variant.py,sha256=A5ga3mq3b0weUTXa9HO72MGaspthGcu1uK9K5OnP738,4172
222
222
  agenta/sdk/managers/vault.py,sha256=054ce9X_xKa2M4NtQWz-GugO6q_pYVWCP3IxbAJJcRw,337
223
223
  agenta/sdk/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
224
- agenta/sdk/middleware/auth.py,sha256=Kl7jSI2kVLETebBQj6R5HoxtTmSbsEkAORLhuhcv9YA,10156
224
+ agenta/sdk/middleware/auth.py,sha256=xS8lVlPmapvxz_bbZ2XPxcllA0kK7iFR8TMoMVymp4M,10156
225
225
  agenta/sdk/middleware/config.py,sha256=9yFFlrkcoGNczj0ZfkbliWIt1S84cnEvB4RMCzdbBWc,7715
226
226
  agenta/sdk/middleware/cors.py,sha256=q3r7lGkrIdMcT_vuhsburMcjG7pyl7w0ycxrIrGJ2e8,921
227
227
  agenta/sdk/middleware/inline.py,sha256=ee8E4XBGcRSrHTvblqX1yRXuTN_sxLm7lY1jnywrBG8,901
@@ -232,24 +232,24 @@ agenta/sdk/router.py,sha256=mOguvtOwl2wmyAgOuWTsf98pQwpNiUILKIo67W_hR3A,119
232
232
  agenta/sdk/tracing/__init__.py,sha256=rQNe5-zT5Kt7_CDhq-lnUIi1EYTBVzVf_MbfcIxVD98,41
233
233
  agenta/sdk/tracing/attributes.py,sha256=DwjjOk3mGOvz0jYu8EYr3hhItvawK5GX80_MfciqPrc,5559
234
234
  agenta/sdk/tracing/conventions.py,sha256=JBtznBXZ3aRkGKkLl7cPwdMNh3w1G-H2Ta2YrAxbr38,950
235
- agenta/sdk/tracing/exporters.py,sha256=ib-VSMaqKn3XDrChjjHlsPJ9Fu3ePgIYR-TAWxSJv9Q,3251
235
+ agenta/sdk/tracing/exporters.py,sha256=Vs1aQLRrWvYgWxjPmlfBWTN4wmUzBREqjTdIV1XcV9o,3251
236
236
  agenta/sdk/tracing/inline.py,sha256=tY9mH1zMlJMqf2WWKJdakLtMHJKNeYRaynqvsPeqpTY,31312
237
- agenta/sdk/tracing/processors.py,sha256=zEuyvFc6vLHGjHMU64gfme-tVtm89uLA3eCpiUgf2A8,4310
237
+ agenta/sdk/tracing/processors.py,sha256=MZZvvjL2HeFIS2TKX0nrxTenoY0_oKHdNEU7QgxeNpk,4310
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
- agenta/sdk/tracing/tracing.py,sha256=g4eFgd_piVn0M5kwlaZUrJBU4DG7kxErWe9meXPgcgI,7211
240
+ agenta/sdk/tracing/tracing.py,sha256=62y9ZAs8ZfjOZmlTYVHniewqZRZeNwz76XGd8cczmY4,7211
241
241
  agenta/sdk/types.py,sha256=247cPB451E91icR198wTXvJG0Hgm2HNtC0H2MmqUwTE,19042
242
242
  agenta/sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
243
243
  agenta/sdk/utils/cache.py,sha256=69pQCtmh10DiYoOdKv4t2fCYDQCuWZtH4uy36kXewpw,1372
244
244
  agenta/sdk/utils/constants.py,sha256=zW3R4rjXOo2L5lz6q84l_zYuOM9u4mpPRHw_B1Dr_hI,67
245
245
  agenta/sdk/utils/costs.py,sha256=i8C7ud__pThLS55XkN4YW8czXtGeXr2mx7jjcOFeiXg,5955
246
- agenta/sdk/utils/exceptions.py,sha256=4zTyG5WDpXRkgK7yzUQ80Efc-KUJPKl0Tts_utYLAK8,1504
246
+ agenta/sdk/utils/exceptions.py,sha256=Dq3lh5Ug7IhF4nvYRXXlwhgxEuByOnT1w0uVMZx1eaM,1504
247
247
  agenta/sdk/utils/globals.py,sha256=9ixKS8aI6ZWgsjT8WngvTg4dsnP2cKErNJngHxzdK9U,256
248
248
  agenta/sdk/utils/helpers.py,sha256=utrxDoELpR6QgFgHCEAWrWW4TYWXA10q72Gs5R78Ens,181
249
249
  agenta/sdk/utils/logging.py,sha256=gBk2ecRvltN7f8qtnUHXBiZPWOdArN_b5civ_3w_Oek,8225
250
250
  agenta/sdk/utils/preinit.py,sha256=YlJL7RLfel0R7DFp-jK7OV-z4ZIQJM0oupYlk7g8b5o,1278
251
251
  agenta/sdk/utils/singleton.py,sha256=17Ph7LGnnV8HkPjImruKita2ni03Ari5jr0jqm__4sc,312
252
- agenta/sdk/utils/timing.py,sha256=hVzkF7ObjrBlRcB2lMowE8nUkWgYqU2kIJoqRZNXKdM,1556
253
- agenta-0.43.1.dist-info/METADATA,sha256=qdUTY7LOFkk8VpDYl4j8VlnUBV5BS8DjtExgasAYGgo,31359
254
- agenta-0.43.1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
255
- agenta-0.43.1.dist-info/RECORD,,
252
+ agenta/sdk/utils/timing.py,sha256=nZR-kudVUtKFlHuBhztgSGxj7FVnCB4Uv6sfg-1dkrQ,1556
253
+ agenta-0.44.0.dist-info/METADATA,sha256=rMuaT_v7rmsHlzIWnk-lmmQHiXLKQE4Uw46ltLbK8cU,31385
254
+ agenta-0.44.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
255
+ agenta-0.44.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.2
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any