agenta 0.27.7a2__py3-none-any.whl → 0.28.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/cli/main.py +4 -51
- agenta/client/backend/apps/client.py +12 -58
- agenta/client/backend/evaluations/client.py +0 -11
- agenta/client/backend/testsets/client.py +8 -40
- agenta/sdk/agenta_init.py +4 -9
- agenta/sdk/decorators/routing.py +24 -42
- agenta/sdk/litellm/litellm.py +30 -75
- agenta/sdk/middleware/auth.py +9 -6
- agenta/sdk/tracing/context.py +6 -6
- agenta/sdk/tracing/inline.py +19 -11
- agenta/sdk/tracing/processors.py +1 -3
- agenta/sdk/tracing/tracing.py +1 -5
- agenta/sdk/utils/exceptions.py +15 -9
- agenta/sdk/utils/logging.py +5 -1
- {agenta-0.27.7a2.dist-info → agenta-0.28.0.dist-info}/METADATA +1 -1
- {agenta-0.27.7a2.dist-info → agenta-0.28.0.dist-info}/RECORD +18 -19
- agenta/sdk/utils/debug.py +0 -68
- {agenta-0.27.7a2.dist-info → agenta-0.28.0.dist-info}/WHEEL +0 -0
- {agenta-0.27.7a2.dist-info → agenta-0.28.0.dist-info}/entry_points.txt +0 -0
agenta/sdk/utils/debug.py
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
from inspect import iscoroutinefunction
|
|
2
|
-
from functools import wraps
|
|
3
|
-
|
|
4
|
-
from agenta.sdk.utils.logging import log
|
|
5
|
-
|
|
6
|
-
DEBUG = False
|
|
7
|
-
SHIFT = 7
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def debug(shift=1, req=False, res=False, chars=[">", "<"]):
|
|
11
|
-
def log_decorator(f):
|
|
12
|
-
is_async = iscoroutinefunction(f)
|
|
13
|
-
|
|
14
|
-
@wraps(f)
|
|
15
|
-
async def async_log_wrapper(*args, **kwargs):
|
|
16
|
-
if DEBUG:
|
|
17
|
-
log.debug(
|
|
18
|
-
" ".join(
|
|
19
|
-
[
|
|
20
|
-
chars[0] * shift + " " * (SHIFT - shift),
|
|
21
|
-
f.__name__ + " ()",
|
|
22
|
-
str(args) if req else "",
|
|
23
|
-
str(kwargs) if req else "",
|
|
24
|
-
]
|
|
25
|
-
)
|
|
26
|
-
)
|
|
27
|
-
result = await f(*args, **kwargs)
|
|
28
|
-
if DEBUG:
|
|
29
|
-
log.debug(
|
|
30
|
-
" ".join(
|
|
31
|
-
[
|
|
32
|
-
chars[1] * shift + " " * (SHIFT - shift),
|
|
33
|
-
f.__name__ + " <-",
|
|
34
|
-
str(result) if res else "",
|
|
35
|
-
]
|
|
36
|
-
)
|
|
37
|
-
)
|
|
38
|
-
return result
|
|
39
|
-
|
|
40
|
-
@wraps(f)
|
|
41
|
-
def log_wrapper(*args, **kwargs):
|
|
42
|
-
if DEBUG:
|
|
43
|
-
log.debug(
|
|
44
|
-
" ".join(
|
|
45
|
-
[
|
|
46
|
-
chars[0] * shift + " " * (SHIFT - shift),
|
|
47
|
-
f.__name__ + " ()",
|
|
48
|
-
str(args) if req else "",
|
|
49
|
-
str(kwargs) if req else "",
|
|
50
|
-
]
|
|
51
|
-
)
|
|
52
|
-
)
|
|
53
|
-
result = f(*args, **kwargs)
|
|
54
|
-
if DEBUG:
|
|
55
|
-
log.debug(
|
|
56
|
-
" ".join(
|
|
57
|
-
[
|
|
58
|
-
chars[1] * shift + " " * (SHIFT - shift),
|
|
59
|
-
f.__name__ + " <-",
|
|
60
|
-
str(result) if res else "",
|
|
61
|
-
]
|
|
62
|
-
)
|
|
63
|
-
)
|
|
64
|
-
return result
|
|
65
|
-
|
|
66
|
-
return async_log_wrapper if is_async else log_wrapper
|
|
67
|
-
|
|
68
|
-
return log_decorator
|
|
File without changes
|
|
File without changes
|