agenta 0.50.0__py3-none-any.whl → 0.50.2__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.

@@ -352,7 +352,7 @@ class entrypoint:
352
352
  return await self.handle_success(result, inline)
353
353
 
354
354
  except Exception as error: # pylint: disable=broad-except
355
- self.handle_failure(error)
355
+ await self.handle_failure(error, inline)
356
356
 
357
357
  async def handle_success(
358
358
  self,
@@ -360,8 +360,9 @@ class entrypoint:
360
360
  inline: bool,
361
361
  ):
362
362
  data = None
363
- tree = None
364
363
  content_type = "text/plain"
364
+
365
+ tree = None
365
366
  tree_id = None
366
367
  trace_id = None
367
368
  span_id = None
@@ -369,6 +370,7 @@ class entrypoint:
369
370
  with suppress():
370
371
  if isinstance(result, (dict, list)):
371
372
  content_type = "application/json"
373
+
372
374
  data = self.patch_result(result)
373
375
 
374
376
  (
@@ -381,8 +383,8 @@ class entrypoint:
381
383
  try:
382
384
  return BaseResponse(
383
385
  data=data,
384
- tree=tree,
385
386
  content_type=content_type,
387
+ tree=tree,
386
388
  tree_id=tree_id,
387
389
  trace_id=trace_id,
388
390
  span_id=span_id,
@@ -402,9 +404,10 @@ class entrypoint:
402
404
  content_type=content_type,
403
405
  )
404
406
 
405
- def handle_failure(
407
+ async def handle_failure(
406
408
  self,
407
409
  error: Exception,
410
+ inline: bool,
408
411
  ):
409
412
  display_exception("Application Exception")
410
413
 
@@ -416,9 +419,29 @@ class entrypoint:
416
419
 
417
420
  stacktrace = format_exception(error, value=error, tb=error.__traceback__) # type: ignore
418
421
 
422
+ tree = None
423
+ tree_id = None
424
+ trace_id = None
425
+ span_id = None
426
+
427
+ with suppress():
428
+ (
429
+ tree,
430
+ tree_id,
431
+ trace_id,
432
+ span_id,
433
+ ) = await self.fetch_inline_trace(inline)
434
+
419
435
  raise HTTPException(
420
436
  status_code=status_code,
421
- detail={"message": str(error), "stacktrace": stacktrace},
437
+ detail=dict(
438
+ message=str(error),
439
+ stacktrace=stacktrace,
440
+ tree=tree,
441
+ tree_id=tree_id,
442
+ trace_id=trace_id,
443
+ span_id=span_id,
444
+ ),
422
445
  )
423
446
 
424
447
  def patch_result(
@@ -1009,18 +1009,21 @@ def parse_inline_trace(
1009
1009
  ##############################################
1010
1010
 
1011
1011
  spans = [
1012
- loads(
1013
- span_dto.model_dump_json(
1014
- exclude_none=True,
1015
- exclude_defaults=True,
1016
- )
1012
+ span_dto.model_dump(
1013
+ mode="json",
1014
+ exclude_none=True,
1015
+ exclude_defaults=True,
1017
1016
  )
1018
1017
  for span_dto in agenta_span_dtos
1019
1018
  ]
1020
1019
  inline_trace = AgentaNodesResponse(
1021
1020
  version="1.0.0",
1022
1021
  nodes=[AgentaNodeDto(**span) for span in spans],
1023
- ).model_dump(exclude_none=True, exclude_unset=True)
1022
+ ).model_dump(
1023
+ mode="json",
1024
+ exclude_none=True,
1025
+ exclude_unset=True,
1026
+ )
1024
1027
  return inline_trace
1025
1028
 
1026
1029
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: agenta
3
- Version: 0.50.0
3
+ Version: 0.50.2
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
@@ -313,7 +313,7 @@ agenta/sdk/context/exporting.py,sha256=16X8fgMhl58gehSlqANX97FiKxx4TkGiG4d2B0-7Z
313
313
  agenta/sdk/context/routing.py,sha256=FEsjw8EttI1SMyUo96ptcUsvHJnhoKwdr1szlkxxJNU,598
314
314
  agenta/sdk/context/tracing.py,sha256=xjErrXP1Nq1AfL-Cif1l-lNEfs12eQ3v_VCRgoKe7nY,743
315
315
  agenta/sdk/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
316
- agenta/sdk/decorators/routing.py,sha256=L3o0Q9flBfb2UIfCIx0OWzkP0W-45_GQ3-Ri8phwNlU,25678
316
+ agenta/sdk/decorators/routing.py,sha256=7oWQTOuxV9uAbyBXvMThA3P_UnBdHx-T6mgZ50mFqVY,26178
317
317
  agenta/sdk/decorators/tracing.py,sha256=6xwN9AomDND_5wL21NXFoZsdwTBuITw2I39GNqNGD-4,10044
318
318
  agenta/sdk/litellm/__init__.py,sha256=Bpz1gfHQc0MN1yolWcjifLWznv6GjHggvRGQSpxpihM,37
319
319
  agenta/sdk/litellm/litellm.py,sha256=dCjw0H_jD3L3UQ3l9SbLm5dfeIGnel6dPtQYJ78beYM,10202
@@ -340,7 +340,7 @@ agenta/sdk/tracing/__init__.py,sha256=rQNe5-zT5Kt7_CDhq-lnUIi1EYTBVzVf_MbfcIxVD9
340
340
  agenta/sdk/tracing/attributes.py,sha256=DwjjOk3mGOvz0jYu8EYr3hhItvawK5GX80_MfciqPrc,5559
341
341
  agenta/sdk/tracing/conventions.py,sha256=JBtznBXZ3aRkGKkLl7cPwdMNh3w1G-H2Ta2YrAxbr38,950
342
342
  agenta/sdk/tracing/exporters.py,sha256=hSQCyQScaIihBy3oBjhY2BZZxyP_zTm3xHwB-iQHnsI,3448
343
- agenta/sdk/tracing/inline.py,sha256=ShPAAjk_26I4hgrmC6y0n-I9gxB3Q4VeEYhhsLHInPU,31454
343
+ agenta/sdk/tracing/inline.py,sha256=rvulLQqtCWrpJmzlg0fo31_YLhq8KBTTOPPPyQt5WCE,31477
344
344
  agenta/sdk/tracing/processors.py,sha256=wZWF8vTEouhbGxbfPGXVQJI53CcXFByqxHiCSIzJV-4,5407
345
345
  agenta/sdk/tracing/propagation.py,sha256=EeOqDMqnh_MoEhGd1do_vy_tQBYUcoC8kpLqVoZeqg0,2561
346
346
  agenta/sdk/tracing/spans.py,sha256=nqUOjjirBxB8Eacv8Qj4Ra_6rknGi3lbJdNyKmk5ODQ,3707
@@ -357,6 +357,6 @@ agenta/sdk/utils/logging.py,sha256=j4NzpFk2ilOM10sRBOxCjmansDHSx6HwMV8IAEreRb8,8
357
357
  agenta/sdk/utils/preinit.py,sha256=1TAAHhYyYnLLwvzwnf33Qwkou7tI3iITlVt-1kcyGaM,1186
358
358
  agenta/sdk/utils/singleton.py,sha256=17Ph7LGnnV8HkPjImruKita2ni03Ari5jr0jqm__4sc,312
359
359
  agenta/sdk/utils/timing.py,sha256=nZR-kudVUtKFlHuBhztgSGxj7FVnCB4Uv6sfg-1dkrQ,1556
360
- agenta-0.50.0.dist-info/METADATA,sha256=DnlZWnLgz_NRS6WF-vy2uSViLYgVUnBh_EQQOwliJvE,31512
361
- agenta-0.50.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
362
- agenta-0.50.0.dist-info/RECORD,,
360
+ agenta-0.50.2.dist-info/METADATA,sha256=Svx_2JUtKDhNYQP9AU3Da7zTCrbRn1fH1vWtUNYgdEY,31512
361
+ agenta-0.50.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
362
+ agenta-0.50.2.dist-info/RECORD,,