agenta 0.25.4a3__py3-none-any.whl → 0.25.4a4__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.

Files changed (42) hide show
  1. agenta/__init__.py +7 -6
  2. agenta/client/backend/client.py +14 -22
  3. agenta/client/backend/core/http_client.py +15 -23
  4. agenta/client/backend/core/pydantic_utilities.py +0 -2
  5. agenta/sdk/__init__.py +6 -27
  6. agenta/sdk/agenta_init.py +26 -73
  7. agenta/sdk/config_manager.py +2 -2
  8. agenta/sdk/context.py +41 -0
  9. agenta/sdk/decorators/base.py +10 -0
  10. agenta/sdk/decorators/{routing.py → llm_entrypoint.py} +124 -137
  11. agenta/sdk/decorators/tracing.py +79 -247
  12. agenta/sdk/router.py +7 -0
  13. agenta/sdk/tracing/__init__.py +0 -1
  14. agenta/sdk/tracing/callbacks.py +187 -0
  15. agenta/sdk/tracing/llm_tracing.py +617 -0
  16. agenta/sdk/{utils/logging.py → tracing/logger.py} +5 -3
  17. agenta/sdk/tracing/tasks_manager.py +129 -0
  18. agenta/sdk/tracing/tracing_context.py +27 -0
  19. agenta/sdk/types.py +12 -0
  20. agenta/sdk/utils/debug.py +5 -5
  21. agenta/sdk/utils/globals.py +5 -3
  22. agenta/sdk/utils/{costs.py → helper/openai_cost.py} +0 -3
  23. {agenta-0.25.4a3.dist-info → agenta-0.25.4a4.dist-info}/METADATA +1 -5
  24. {agenta-0.25.4a3.dist-info → agenta-0.25.4a4.dist-info}/RECORD +26 -36
  25. agenta/sdk/context/__init__.py +0 -0
  26. agenta/sdk/context/routing.py +0 -25
  27. agenta/sdk/context/tracing.py +0 -3
  28. agenta/sdk/decorators/__init__.py +0 -0
  29. agenta/sdk/litellm/__init__.py +0 -1
  30. agenta/sdk/litellm/litellm.py +0 -277
  31. agenta/sdk/tracing/attributes.py +0 -181
  32. agenta/sdk/tracing/context.py +0 -21
  33. agenta/sdk/tracing/conventions.py +0 -43
  34. agenta/sdk/tracing/exporters.py +0 -53
  35. agenta/sdk/tracing/inline.py +0 -1305
  36. agenta/sdk/tracing/processors.py +0 -65
  37. agenta/sdk/tracing/spans.py +0 -124
  38. agenta/sdk/tracing/tracing.py +0 -174
  39. agenta/sdk/utils/exceptions.py +0 -19
  40. agenta/sdk/utils/singleton.py +0 -13
  41. {agenta-0.25.4a3.dist-info → agenta-0.25.4a4.dist-info}/WHEEL +0 -0
  42. {agenta-0.25.4a3.dist-info → agenta-0.25.4a4.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,129 @@
1
+ # Stdlib Imports
2
+ import queue
3
+ import asyncio
4
+ from logging import Logger
5
+ from typing import Coroutine, Optional, Union
6
+ from concurrent.futures import ThreadPoolExecutor
7
+
8
+ # Own Imports
9
+ from agenta.client.backend.types.error import Error
10
+ from agenta.client.backend.client import AsyncObservabilityClient
11
+
12
+
13
+ class AsyncTask(object):
14
+ """Wraps a coroutine (an asynchronous function defined with async def).
15
+
16
+ Args:
17
+ coroutine (Coroutine): asynchronous function
18
+ """
19
+
20
+ def __init__(
21
+ self,
22
+ coroutine_id: str,
23
+ coroutine_type: str,
24
+ coroutine: Coroutine,
25
+ client: AsyncObservabilityClient,
26
+ ):
27
+ self.coroutine_id = coroutine_id
28
+ self.coroutine_type = coroutine_type
29
+ self.coroutine = coroutine
30
+ self.task: Optional[asyncio.Task] = None
31
+ self.client = client
32
+
33
+ async def run(self) -> Union[asyncio.Task, Error]:
34
+ """Creates an asyncio Task from the coroutine and starts it
35
+
36
+ Returns:
37
+ Task: asyncio task
38
+ """
39
+
40
+ try:
41
+ self.task = asyncio.create_task(self.coroutine)
42
+ except Exception as exc:
43
+ return Error(message="error running task", stacktrace=str(exc))
44
+ return await self.task
45
+
46
+ def cancel(self):
47
+ """
48
+ Cancels running asyncio Task.
49
+ """
50
+
51
+ if self.task:
52
+ self.task.cancel()
53
+
54
+
55
+ class TaskQueue(object):
56
+ """Stores a list of AsyncTask instances.
57
+
58
+ Args:
59
+ tasks (List[AsyncTasks]): list of async task instances
60
+
61
+ Example Usage:
62
+ ```python
63
+ queue = TaskQueue()
64
+ queue.add_task(long_running_task(1))
65
+ queue.add_task(long_running_task(2))
66
+ ```
67
+ """
68
+
69
+ def __init__(self, num_workers: int, logger: Logger):
70
+ self.tasks = queue.Queue() # type: ignore
71
+ self._logger = logger
72
+ self._thread_pool = ThreadPoolExecutor(max_workers=num_workers)
73
+
74
+ def add_task(
75
+ self,
76
+ coroutine_id: str,
77
+ coroutine_type: str,
78
+ coroutine: Coroutine,
79
+ obs_client: AsyncObservabilityClient,
80
+ ) -> AsyncTask:
81
+ """Adds a new task to be executed.
82
+
83
+ Args:
84
+ coroutine_id (str): The Id of the coroutine
85
+ coroutine_type (str): The type of coroutine
86
+ coroutine (Coroutine): async task
87
+ obs_client (AsyncObservabilityClient): The async observability client
88
+
89
+ Returns:
90
+ AsyncTask: task to be executed
91
+ """
92
+
93
+ task = AsyncTask(coroutine_id, coroutine_type, coroutine, obs_client)
94
+ self.tasks.put(task)
95
+ return self._worker()
96
+
97
+ def _worker(self):
98
+ """
99
+ Runs task gotten from the queue in a thread pool.
100
+ """
101
+
102
+ while True:
103
+ task: AsyncTask = self.tasks.get() # type: ignore
104
+ try:
105
+ future = self._thread_pool.submit(asyncio.run, task.run())
106
+ future.result()
107
+ except Exception as exc:
108
+ self._logger.error(
109
+ f"Task '{task.coroutine_type}' failed with error: {str(exc)}"
110
+ )
111
+ break
112
+ finally:
113
+ self.tasks.task_done()
114
+ break
115
+
116
+ def _get_size(self) -> int:
117
+ """Returns the approximate number of items in the queue."""
118
+
119
+ return self.tasks.qsize()
120
+
121
+ def flush(self) -> None:
122
+ """Clears all items from the queue."""
123
+
124
+ q_size = self._get_size()
125
+ self._logger.info("Flushing queue...")
126
+ with self.tasks.mutex: # acts as a lock to ensure that only one thread can access the queue
127
+ self.tasks.join()
128
+ self._logger.info(f"Queue with {q_size} items flushed successfully")
129
+ return
@@ -0,0 +1,27 @@
1
+ from contextvars import ContextVar
2
+
3
+ from typing import Optional, Dict, List
4
+
5
+ from agenta.client.backend.types.create_span import CreateSpan
6
+
7
+ CURRENT_TRACING_CONTEXT_KEY = "current_tracing_context"
8
+
9
+
10
+ class TracingContext:
11
+ def __init__(self):
12
+ ### --- TRACE --- ###
13
+ self.trace_id: Optional[str] = None
14
+ self.trace_tags: List[str] = []
15
+
16
+ ### --- SPANS --- ###
17
+ self.active_span: Optional[CreateSpan] = None
18
+ self.spans: Dict[str, CreateSpan] = {}
19
+
20
+ def __repr__(self) -> str:
21
+ return f"TracingContext(trace='{self.trace_id}', spans={[f'{span.id} {span.spankind}' for span in self.spans.values()]})"
22
+
23
+ def __str__(self) -> str:
24
+ return self.__repr__()
25
+
26
+
27
+ tracing_context = ContextVar(CURRENT_TRACING_CONTEXT_KEY, default=None)
agenta/sdk/types.py CHANGED
@@ -186,3 +186,15 @@ class FileInputURL(HttpUrl):
186
186
  @classmethod
187
187
  def __schema_type_properties__(cls) -> dict:
188
188
  return {"x-parameter": "file_url", "type": "string"}
189
+
190
+
191
+ class Context(BaseModel):
192
+ model_config = ConfigDict(extra="allow")
193
+
194
+ def to_json(self):
195
+ return self.model_dump()
196
+
197
+ @classmethod
198
+ def from_json(cls, json_str: str):
199
+ data = json.loads(json_str)
200
+ return cls(**data)
agenta/sdk/utils/debug.py CHANGED
@@ -1,7 +1,7 @@
1
1
  from inspect import iscoroutinefunction
2
2
  from functools import wraps
3
3
 
4
- from agenta.sdk.utils.logging import log
4
+ from agenta.sdk.tracing.logger import llm_logger as logging
5
5
 
6
6
  DEBUG = False
7
7
  SHIFT = 7
@@ -14,7 +14,7 @@ def debug(shift=1, req=False, res=False, chars=[">", "<"]):
14
14
  @wraps(f)
15
15
  async def async_log_wrapper(*args, **kwargs):
16
16
  if DEBUG:
17
- log.debug(
17
+ logging.debug(
18
18
  " ".join(
19
19
  [
20
20
  chars[0] * shift + " " * (SHIFT - shift),
@@ -26,7 +26,7 @@ def debug(shift=1, req=False, res=False, chars=[">", "<"]):
26
26
  )
27
27
  result = await f(*args, **kwargs)
28
28
  if DEBUG:
29
- log.debug(
29
+ logging.debug(
30
30
  " ".join(
31
31
  [
32
32
  chars[1] * shift + " " * (SHIFT - shift),
@@ -40,7 +40,7 @@ def debug(shift=1, req=False, res=False, chars=[">", "<"]):
40
40
  @wraps(f)
41
41
  def log_wrapper(*args, **kwargs):
42
42
  if DEBUG:
43
- log.debug(
43
+ logging.debug(
44
44
  " ".join(
45
45
  [
46
46
  chars[0] * shift + " " * (SHIFT - shift),
@@ -52,7 +52,7 @@ def debug(shift=1, req=False, res=False, chars=[">", "<"]):
52
52
  )
53
53
  result = f(*args, **kwargs)
54
54
  if DEBUG:
55
- log.debug(
55
+ logging.debug(
56
56
  " ".join(
57
57
  [
58
58
  chars[1] * shift + " " * (SHIFT - shift),
@@ -1,13 +1,15 @@
1
1
  import agenta
2
2
 
3
3
 
4
- def set_global(config=None, tracing=None):
5
- """Allows usage of agenta.config and agenta.tracing in the user's code.
4
+ def set_global(setup=None, config=None, tracing=None):
5
+ """Allows usage of agenta.config and agenta.setup in the user's code.
6
6
 
7
7
  Args:
8
+ setup: _description_. Defaults to None.
8
9
  config: _description_. Defaults to None.
9
- tracing: _description_. Defaults to None.
10
10
  """
11
+ if setup is not None:
12
+ agenta.setup = setup
11
13
  if config is not None:
12
14
  agenta.config = config
13
15
  if tracing is not None:
@@ -49,9 +49,6 @@ MODEL_COST_PER_1K_TOKENS = {
49
49
  "gpt-35-turbo-16k-completion": 0.004,
50
50
  "gpt-35-turbo-16k-0613-completion": 0.004,
51
51
  # Others
52
- "text-embedding-ada-002": 0.1,
53
- "text-ada-002": 0.1,
54
- "adav2": 0.1,
55
52
  "text-ada-001": 0.0004,
56
53
  "ada": 0.0004,
57
54
  "text-babbage-001": 0.0005,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agenta
3
- Version: 0.25.4a3
3
+ Version: 0.25.4a4
4
4
  Summary: The SDK for agenta is an open-source LLMOps platform.
5
5
  Home-page: https://agenta.ai
6
6
  Keywords: LLMOps,LLM,evaluation,prompt engineering
@@ -23,10 +23,6 @@ Requires-Dist: fastapi (>=0.100.0)
23
23
  Requires-Dist: httpx (>=0.24,<0.28)
24
24
  Requires-Dist: importlib-metadata (>=8.0.0,<9.0)
25
25
  Requires-Dist: ipdb (>=0.13)
26
- Requires-Dist: litellm (>=1.48.0,<2.0.0)
27
- Requires-Dist: opentelemetry-api (>=1.27.0,<2.0.0)
28
- Requires-Dist: opentelemetry-exporter-otlp (>=1.27.0,<2.0.0)
29
- Requires-Dist: opentelemetry-sdk (>=1.27.0,<2.0.0)
30
26
  Requires-Dist: posthog (>=3.1.0,<4.0.0)
31
27
  Requires-Dist: pydantic (>=2)
32
28
  Requires-Dist: pymongo (>=4.6.3,<5.0.0)
@@ -1,4 +1,4 @@
1
- agenta/__init__.py,sha256=cd3c7bpyfZC8ho2Dc299bg8l_BDRQ3TFbd9Tnn2UQTY,923
1
+ agenta/__init__.py,sha256=MCeFBzYtrVNdhElvl1fBjypsqhgEaAMKy6ZR-B3YmJk,993
2
2
  agenta/cli/evaluation_commands.py,sha256=fs6492tprPId9p8eGO02Xy-NCBm2RZNJLZWcUxugwd8,474
3
3
  agenta/cli/helper.py,sha256=vRxHyeNaltzNIGrfU2vO0H28_rXDzx9QqIZ_S-W6zL4,6212
4
4
  agenta/cli/main.py,sha256=Wz0ODhoeKK3Qg_CFUhu6D909szk05tc8ZVBB6H1-w7k,9763
@@ -14,7 +14,7 @@ agenta/client/backend/apps/__init__.py,sha256=9mUnTDeA1TxYvkj1l01A1prqsJV0ERRY2t
14
14
  agenta/client/backend/apps/client.py,sha256=9rWax7LlEIpXdqq4McPAkvwHweSTomnyrFxFo8ehYy0,54136
15
15
  agenta/client/backend/bases/__init__.py,sha256=9mUnTDeA1TxYvkj1l01A1prqsJV0ERRY2tzkY1fA4MQ,64
16
16
  agenta/client/backend/bases/client.py,sha256=BZsz5eXaa2voZdJXqgd5J5hPUuYvWwIcPCWyl49w-oY,6028
17
- agenta/client/backend/client.py,sha256=k262wVUWPYWbZhLiZec7sTLfh8CD7tfCYdFKyLqUMi0,102659
17
+ agenta/client/backend/client.py,sha256=NqKTA7oKQFI4eU0TNfB-SEDILMgVEJSZFodGsl3hWZI,102435
18
18
  agenta/client/backend/configs/__init__.py,sha256=9mUnTDeA1TxYvkj1l01A1prqsJV0ERRY2tzkY1fA4MQ,64
19
19
  agenta/client/backend/configs/client.py,sha256=qtrRdRuNIZBjh9Ykj7eNKhocp7dFdFQoDSbUduVjKJ0,19089
20
20
  agenta/client/backend/containers/__init__.py,sha256=Haw2PwiPhNvM26PLQN57jY0bN-QqPoDG4VA-P_uGL3A,153
@@ -26,9 +26,9 @@ agenta/client/backend/core/api_error.py,sha256=TtMtCdxXjd7Tasc9c8ooFg124nPrb2MXG
26
26
  agenta/client/backend/core/client_wrapper.py,sha256=mU22mZBjz2QXalKJLDGo1qNeAt1awLxRMO8fzbPbnr8,1829
27
27
  agenta/client/backend/core/datetime_utils.py,sha256=BHjt_H3WVslcuPsr6qjJoVif_SsdLvFN0c43ABE5UiQ,1069
28
28
  agenta/client/backend/core/file.py,sha256=vliNmlB7PbDfi4EKiVPNq5QaGXJ4zlDBGupv7Qciy7g,1520
29
- agenta/client/backend/core/http_client.py,sha256=1ORQxbKS0c6nMbeiANucMrlwUImmLXlCfjBbR_W-LSY,20440
29
+ agenta/client/backend/core/http_client.py,sha256=LHzx7H12q9WOUquq8QZYSUPCt4TRdwxcRbwQm2JboeE,20278
30
30
  agenta/client/backend/core/jsonable_encoder.py,sha256=SHXw4G4n-f0IPgNkxj_-Fip3kN8NUAI-YrKxdZw8kl0,3662
31
- agenta/client/backend/core/pydantic_utilities.py,sha256=jKArwRgKxutDYiTxssKykAGFHQM6_m9G-hLFCXVB8yU,7617
31
+ agenta/client/backend/core/pydantic_utilities.py,sha256=sLzQZQLS_y66SZSBMtJE7YrQK8INda-ta1tKwAHabGk,7540
32
32
  agenta/client/backend/core/query_encoder.py,sha256=8qYl5VPl1jU4cDF0X7oSU_DXjlVWY5ayigFBpNTMGOA,2150
33
33
  agenta/client/backend/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
34
34
  agenta/client/backend/core/request_options.py,sha256=5cCGt5AEGgtP5xifDl4oVQUmSjlIA8FmRItAlJawM18,1417
@@ -132,38 +132,28 @@ agenta/docker/docker-assets/entrypoint.sh,sha256=29XK8VQjQsx4hN2j-4JDy-6kQb5y4LC
132
132
  agenta/docker/docker-assets/lambda_function.py,sha256=h4UZSSfqwpfsCgERv6frqwm_4JrYu9rLz3I-LxCfeEg,83
133
133
  agenta/docker/docker-assets/main.py,sha256=7MI-21n81U7N7A0GxebNi0cmGWtJKcR2sPB6FcH2QfA,251
134
134
  agenta/docker/docker_utils.py,sha256=kO1q2_IR0fEAo4M-2Pt_v-zC7GxxnkLogjKFhU869Ps,3555
135
- agenta/sdk/__init__.py,sha256=k6lzJF6gzaFdzq_FJ3chBu6ug8pNCT3_-bfeB1ZqGkg,1165
136
- agenta/sdk/agenta_init.py,sha256=dyUV3vDI55XYQ3hNxkT7ibe-PSPIWz4eO4skTkjxOtk,10603
135
+ agenta/sdk/__init__.py,sha256=XyxMUm8-fCH6G6KAFU0iAfiKTGEzNzBtbAfCp9i1Y7o,831
136
+ agenta/sdk/agenta_init.py,sha256=8MfDuypxohd0qRTdtGjX7L17KW-1UGmzNVdiqF15_ak,9790
137
137
  agenta/sdk/assets.py,sha256=Zv4i8MVUSB3jMODQon1mzJtYxuntmrCNjLGk8f-2fls,2856
138
138
  agenta/sdk/client.py,sha256=trKyBOYFZRk0v5Eptxvh87yPf50Y9CqY6Qgv4Fy-VH4,2142
139
- agenta/sdk/config_manager.py,sha256=HFOJpJKBkhlA0C-KPuxb4-bHNZeZqdpmx_beoX4lQw8,7997
140
- agenta/sdk/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
- agenta/sdk/context/routing.py,sha256=gOoOM88hSjIjzQ3ni68TjUoq7WtwSH3kB07YjCYvW2c,631
142
- agenta/sdk/context/tracing.py,sha256=UmmW15UFFsvxS0myS6aD9wBk5iNepNlQi4tEQ_ejfYM,96
143
- agenta/sdk/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
144
- agenta/sdk/decorators/routing.py,sha256=4vJsFwyXUx1cuzILVOzELDfv17QnYTXpIE2NwFnC__I,35427
145
- agenta/sdk/decorators/tracing.py,sha256=atMLiRpQCFSAVK-rPlN781DUq7gARe0XgJJHBKqBAUc,11657
146
- agenta/sdk/litellm/__init__.py,sha256=Bpz1gfHQc0MN1yolWcjifLWznv6GjHggvRGQSpxpihM,37
147
- agenta/sdk/litellm/litellm.py,sha256=j4WyRTQdxLkvelaPm5BfUbaUxkbQXDhyr3yp9yXo1RQ,8289
148
- agenta/sdk/router.py,sha256=mOguvtOwl2wmyAgOuWTsf98pQwpNiUILKIo67W_hR3A,119
149
- agenta/sdk/tracing/__init__.py,sha256=rQNe5-zT5Kt7_CDhq-lnUIi1EYTBVzVf_MbfcIxVD98,41
150
- agenta/sdk/tracing/attributes.py,sha256=0Ld0A4eL6EAWwbhBY0Qp7MLWXXbBsd8EDtbBuwIy1PI,4775
151
- agenta/sdk/tracing/context.py,sha256=KDQYjRcmbpb6e0xEuX-bAQGhEjwx4H2nwybRPOKCDjo,578
152
- agenta/sdk/tracing/conventions.py,sha256=YFkKPls77sl5YOXrRjfn4erEjczMXThc7b-rRaVVTuo,722
153
- agenta/sdk/tracing/exporters.py,sha256=e-SfpN8dKQ0vuBZQTZ6qgIMBhyriOrVeLYJkv-us0Zs,1328
154
- agenta/sdk/tracing/inline.py,sha256=o-lRHmcIXVrFLWIj-xeY9LNbkuR8G4IUubwlWVfNC30,35769
155
- agenta/sdk/tracing/processors.py,sha256=PRQpj8aOmOjvf71M48AtCurIxVFg2ZZWRtJLtlB4xyE,1974
156
- agenta/sdk/tracing/spans.py,sha256=AnQuuyuCGST6n_He4SF5WdrtMts9JlE8v6rVRdm2rRg,3570
157
- agenta/sdk/tracing/tracing.py,sha256=5r0whzLzF2bwYKZkUN3QDjq8AketEb-9sM4nqnO9zzM,5168
158
- agenta/sdk/types.py,sha256=B7C7Jpeq0CpmLwmN1dmpggJsZX8WpxyyM42PkdSsx3s,5669
139
+ agenta/sdk/config_manager.py,sha256=n3UTpIhiB1J6FIQ5IvlucfGVpxoIIemnmdI68p34Yvw,8003
140
+ agenta/sdk/context.py,sha256=q-PxL05-I84puunUAs9LGsffEXcYhDxhQxjuOz2vK90,901
141
+ agenta/sdk/decorators/base.py,sha256=9aNdX5h8a2mFweuhdO-BQPwXGKY9ONPIdLRhSGAGMfY,217
142
+ agenta/sdk/decorators/llm_entrypoint.py,sha256=jXXTQS-sCwmkKvF0bNYTG9pkK13B2odnHsrYepTU_x8,35572
143
+ agenta/sdk/decorators/tracing.py,sha256=e0olx2EEdjXY0NqpIoDJSVxCnUmv0woewTUuCJXy2tM,4166
144
+ agenta/sdk/router.py,sha256=0sbajvn5C7t18anH6yNo7-oYxldHnYfwcbmQnIXBePw,269
145
+ agenta/sdk/tracing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
146
+ agenta/sdk/tracing/callbacks.py,sha256=ug9xeXLgJEpx4l3x1BrJD2bFrH83I3kajlGsU8WtG4U,7699
147
+ agenta/sdk/tracing/llm_tracing.py,sha256=5EeIuRu2wgGknlsZD-AkuJH_gOBrmsrCrWK0-h0Uov0,17941
148
+ agenta/sdk/tracing/logger.py,sha256=GfH7V-jBHcn7h5dbdrnkDMe_ml3wkXFBeoQiqR4KVRc,474
149
+ agenta/sdk/tracing/tasks_manager.py,sha256=FBSFOWIKBycyA4ShB2ZVMzrzYQ8pWGWWBClFX8nlZFA,3726
150
+ agenta/sdk/tracing/tracing_context.py,sha256=nt3ewa-TK9BRJviGIZYazsAQUiG4daWxjtsbjeaDprs,789
151
+ agenta/sdk/types.py,sha256=1AXUKTURFFgPH5iWeTYcNcg6dxVo1RrD0WuVe9e-NgU,5919
159
152
  agenta/sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
160
- agenta/sdk/utils/costs.py,sha256=i8C7ud__pThLS55XkN4YW8czXtGeXr2mx7jjcOFeiXg,5955
161
- agenta/sdk/utils/debug.py,sha256=DxiCAeXxxrcEZT2CjlNA6BMvujGP4nzQ-rfb-_mLMck,2114
162
- agenta/sdk/utils/exceptions.py,sha256=kzU5bNBMZvVv0xnwvc5osVMsb_Ujm0qqeem9wpNo2z0,500
163
- agenta/sdk/utils/globals.py,sha256=2HhyzWn55BbYNCZ3rT8dAxk1GGXuGQPbtq_THjaHbBw,372
164
- agenta/sdk/utils/logging.py,sha256=FKzAO5eHjR_qvpEnc4tKXUA6WftmwdwYwuJK6CbSc84,379
153
+ agenta/sdk/utils/debug.py,sha256=QyuPsSoN0425UD13x_msPxSF_VT6YwHiQunZUibI-jg,2149
154
+ agenta/sdk/utils/globals.py,sha256=JmhJcCOSbwvjQ6GDyUc2_SYR27DZk7YcrRH80ktHHOM,435
155
+ agenta/sdk/utils/helper/openai_cost.py,sha256=1VkgvucDnNZm1pTfcVLz9icWunntp1d7zwMmnviy3Uw,5877
165
156
  agenta/sdk/utils/preinit.py,sha256=YlJL7RLfel0R7DFp-jK7OV-z4ZIQJM0oupYlk7g8b5o,1278
166
- agenta/sdk/utils/singleton.py,sha256=17Ph7LGnnV8HkPjImruKita2ni03Ari5jr0jqm__4sc,312
167
157
  agenta/templates/compose_email/README.md,sha256=ss7vZPpI1Hg0VmYtFliwq_r5LnqbCy_S5OQDXg8UoIA,308
168
158
  agenta/templates/compose_email/app.py,sha256=SG8QnBkC49MtvWa2z5_YQ2d8wxZxhO_hWs15j3CsWvc,2384
169
159
  agenta/templates/compose_email/env.example,sha256=g9AE5bYcGPpxawXMJ96gh8oenEPCHTabsiOnfQo3c5k,70
@@ -179,7 +169,7 @@ agenta/templates/simple_prompt/app.py,sha256=kODgF6lhzsaJPdgL5b21bUki6jkvqjWZzWR
179
169
  agenta/templates/simple_prompt/env.example,sha256=g9AE5bYcGPpxawXMJ96gh8oenEPCHTabsiOnfQo3c5k,70
180
170
  agenta/templates/simple_prompt/requirements.txt,sha256=ywRglRy7pPkw8bljmMEJJ4aOOQKrt9FGKULZ-DGkoBU,23
181
171
  agenta/templates/simple_prompt/template.toml,sha256=DQBtRrF4GU8LBEXOZ-GGuINXMQDKGTEG5y37tnvIUIE,60
182
- agenta-0.25.4a3.dist-info/METADATA,sha256=Ve2s3ouTz56d41dEWduIVk06vpAUxFxvq_lqU_0OLSs,31738
183
- agenta-0.25.4a3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
184
- agenta-0.25.4a3.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
185
- agenta-0.25.4a3.dist-info/RECORD,,
172
+ agenta-0.25.4a4.dist-info/METADATA,sha256=XSV7qwA3Ym03XcjA8Z-qNNZnnWPiERd2g5okOzxgHUM,31534
173
+ agenta-0.25.4a4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
174
+ agenta-0.25.4a4.dist-info/entry_points.txt,sha256=PDiu8_8AsL7ibU9v4iNoOKR1S7F2rdxjlEprjM9QOgo,46
175
+ agenta-0.25.4a4.dist-info/RECORD,,
File without changes
@@ -1,25 +0,0 @@
1
- from contextlib import contextmanager
2
- from contextvars import ContextVar
3
- from typing import Any, Dict, Optional
4
-
5
- routing_context = ContextVar("routing_context", default={})
6
-
7
-
8
- @contextmanager
9
- def routing_context_manager(
10
- config: Optional[Dict[str, Any]] = None,
11
- environment: Optional[str] = None,
12
- version: Optional[str] = None,
13
- variant: Optional[str] = None,
14
- ):
15
- context = {
16
- "config": config,
17
- "environment": environment,
18
- "version": version,
19
- "variant": variant,
20
- }
21
- token = routing_context.set(context)
22
- try:
23
- yield
24
- finally:
25
- routing_context.reset(token)
@@ -1,3 +0,0 @@
1
- from contextvars import ContextVar
2
-
3
- tracing_context = ContextVar("tracing_context", default={})
File without changes
@@ -1 +0,0 @@
1
- from .litellm import litellm_handler