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/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