agenta 0.70.1__py3-none-any.whl → 0.72.4__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.
- agenta/sdk/assets.py +57 -0
- agenta/sdk/decorators/serving.py +29 -31
- agenta/sdk/decorators/tracing.py +51 -30
- agenta/sdk/engines/tracing/processors.py +23 -12
- agenta/sdk/middleware/config.py +3 -1
- agenta/sdk/middleware/otel.py +3 -1
- agenta/sdk/middlewares/routing/otel.py +1 -1
- agenta/sdk/tracing/processors.py +8 -3
- agenta/sdk/tracing/propagation.py +9 -12
- agenta/sdk/types.py +6 -2
- {agenta-0.70.1.dist-info → agenta-0.72.4.dist-info}/METADATA +1 -1
- {agenta-0.70.1.dist-info → agenta-0.72.4.dist-info}/RECORD +13 -13
- {agenta-0.70.1.dist-info → agenta-0.72.4.dist-info}/WHEEL +0 -0
agenta/sdk/assets.py
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
from typing import Dict, Optional, Tuple
|
|
2
|
+
|
|
3
|
+
from litellm import cost_calculator
|
|
4
|
+
|
|
5
|
+
|
|
1
6
|
supported_llm_models = {
|
|
2
7
|
"anthropic": [
|
|
3
8
|
"anthropic/claude-sonnet-4-5",
|
|
@@ -206,6 +211,58 @@ supported_llm_models = {
|
|
|
206
211
|
|
|
207
212
|
providers_list = list(supported_llm_models.keys())
|
|
208
213
|
|
|
214
|
+
|
|
215
|
+
def _get_model_costs(model: str) -> Optional[Tuple[float, float]]:
|
|
216
|
+
"""
|
|
217
|
+
Get the input and output costs per 1M tokens for a model.
|
|
218
|
+
|
|
219
|
+
Uses litellm's cost_calculator (same as tracing/inline.py) for consistency.
|
|
220
|
+
|
|
221
|
+
Args:
|
|
222
|
+
model: The model name (e.g., "gpt-4o" or "anthropic/claude-3-opus-20240229")
|
|
223
|
+
|
|
224
|
+
Returns:
|
|
225
|
+
Tuple of (input_cost, output_cost) per 1M tokens, or None if not found.
|
|
226
|
+
"""
|
|
227
|
+
try:
|
|
228
|
+
costs = cost_calculator.cost_per_token(
|
|
229
|
+
model=model,
|
|
230
|
+
prompt_tokens=1_000_000,
|
|
231
|
+
completion_tokens=1_000_000,
|
|
232
|
+
)
|
|
233
|
+
if costs:
|
|
234
|
+
input_cost, output_cost = costs
|
|
235
|
+
if input_cost > 0 or output_cost > 0:
|
|
236
|
+
return (input_cost, output_cost)
|
|
237
|
+
except Exception:
|
|
238
|
+
pass
|
|
239
|
+
return None
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
def _build_model_metadata() -> Dict[str, Dict[str, Dict[str, float]]]:
|
|
243
|
+
"""
|
|
244
|
+
Build metadata dictionary with costs for all supported models.
|
|
245
|
+
|
|
246
|
+
Returns:
|
|
247
|
+
Nested dict: {provider: {model: {"input": cost, "output": cost}}}
|
|
248
|
+
"""
|
|
249
|
+
metadata: Dict[str, Dict[str, Dict[str, float]]] = {}
|
|
250
|
+
|
|
251
|
+
for provider, models in supported_llm_models.items():
|
|
252
|
+
metadata[provider] = {}
|
|
253
|
+
for model in models:
|
|
254
|
+
costs = _get_model_costs(model)
|
|
255
|
+
if costs:
|
|
256
|
+
metadata[provider][model] = {
|
|
257
|
+
"input": costs[0],
|
|
258
|
+
"output": costs[1],
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return metadata
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
model_metadata = _build_model_metadata()
|
|
265
|
+
|
|
209
266
|
model_to_provider_mapping = {
|
|
210
267
|
model: provider
|
|
211
268
|
for provider, models in supported_llm_models.items()
|
agenta/sdk/decorators/serving.py
CHANGED
|
@@ -1,53 +1,51 @@
|
|
|
1
|
-
from
|
|
1
|
+
from asyncio import sleep
|
|
2
|
+
from functools import wraps
|
|
2
3
|
from inspect import (
|
|
4
|
+
Parameter,
|
|
5
|
+
Signature,
|
|
6
|
+
isasyncgen,
|
|
3
7
|
iscoroutinefunction,
|
|
4
8
|
isgenerator,
|
|
5
|
-
isasyncgen,
|
|
6
9
|
signature,
|
|
7
|
-
Signature,
|
|
8
|
-
Parameter,
|
|
9
10
|
)
|
|
10
|
-
from
|
|
11
|
+
from os import environ
|
|
11
12
|
from traceback import format_exception
|
|
12
|
-
from
|
|
13
|
+
from typing import Any, Callable, Dict, List, Optional, Tuple, Type
|
|
13
14
|
from uuid import UUID
|
|
14
|
-
from pydantic import BaseModel, HttpUrl, ValidationError
|
|
15
|
-
from os import environ
|
|
16
|
-
|
|
17
|
-
from starlette.responses import (
|
|
18
|
-
Response as StarletteResponse,
|
|
19
|
-
StreamingResponse,
|
|
20
|
-
)
|
|
21
|
-
from fastapi import Body, FastAPI, HTTPException, Request
|
|
22
|
-
|
|
23
|
-
from agenta.sdk.middleware.mock import MockMiddleware
|
|
24
|
-
from agenta.sdk.middleware.inline import InlineMiddleware
|
|
25
|
-
from agenta.sdk.middleware.vault import VaultMiddleware
|
|
26
|
-
from agenta.sdk.middleware.config import ConfigMiddleware
|
|
27
|
-
from agenta.sdk.middleware.otel import OTelMiddleware
|
|
28
|
-
from agenta.sdk.middleware.auth import AuthHTTPMiddleware
|
|
29
|
-
from agenta.sdk.middleware.cors import CORSMiddleware
|
|
30
15
|
|
|
16
|
+
import agenta as ag
|
|
31
17
|
from agenta.sdk.contexts.routing import (
|
|
32
|
-
routing_context_manager,
|
|
33
18
|
RoutingContext,
|
|
19
|
+
routing_context_manager,
|
|
34
20
|
)
|
|
35
21
|
from agenta.sdk.contexts.tracing import (
|
|
36
|
-
tracing_context_manager,
|
|
37
22
|
TracingContext,
|
|
23
|
+
tracing_context_manager,
|
|
38
24
|
)
|
|
25
|
+
from agenta.sdk.middleware.auth import AuthHTTPMiddleware
|
|
26
|
+
from agenta.sdk.middleware.config import ConfigMiddleware
|
|
27
|
+
from agenta.sdk.middleware.cors import CORSMiddleware
|
|
28
|
+
from agenta.sdk.middleware.inline import InlineMiddleware
|
|
29
|
+
from agenta.sdk.middleware.mock import MockMiddleware
|
|
30
|
+
from agenta.sdk.middleware.otel import OTelMiddleware
|
|
31
|
+
from agenta.sdk.middleware.vault import VaultMiddleware
|
|
39
32
|
from agenta.sdk.router import router
|
|
40
|
-
from agenta.sdk.utils.exceptions import suppress, display_exception
|
|
41
|
-
from agenta.sdk.utils.logging import get_module_logger
|
|
42
|
-
from agenta.sdk.utils.helpers import get_current_version
|
|
43
33
|
from agenta.sdk.types import (
|
|
44
|
-
MultipleChoice,
|
|
45
34
|
BaseResponse,
|
|
35
|
+
MultipleChoice,
|
|
46
36
|
StreamResponse,
|
|
47
|
-
MCField,
|
|
48
37
|
)
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
from agenta.sdk.utils.exceptions import display_exception, suppress
|
|
39
|
+
from agenta.sdk.utils.helpers import get_current_version
|
|
40
|
+
from agenta.sdk.utils.logging import get_module_logger
|
|
41
|
+
from fastapi import Body, FastAPI, HTTPException, Request
|
|
42
|
+
from pydantic import BaseModel, HttpUrl, ValidationError
|
|
43
|
+
from starlette.responses import (
|
|
44
|
+
Response as StarletteResponse,
|
|
45
|
+
)
|
|
46
|
+
from starlette.responses import (
|
|
47
|
+
StreamingResponse,
|
|
48
|
+
)
|
|
51
49
|
|
|
52
50
|
log = get_module_logger(__name__)
|
|
53
51
|
|
agenta/sdk/decorators/tracing.py
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
1
|
# /agenta/sdk/decorators/tracing.py
|
|
2
2
|
|
|
3
|
-
from typing import Callable, Optional, Any, Dict, List, Union
|
|
4
|
-
|
|
5
|
-
from opentelemetry import context as otel_context
|
|
6
|
-
from opentelemetry.context import attach, detach
|
|
7
|
-
|
|
8
|
-
|
|
9
3
|
from functools import wraps
|
|
10
|
-
from itertools import chain
|
|
11
4
|
from inspect import (
|
|
12
5
|
getfullargspec,
|
|
6
|
+
isasyncgenfunction,
|
|
13
7
|
iscoroutinefunction,
|
|
14
8
|
isgeneratorfunction,
|
|
15
|
-
isasyncgenfunction,
|
|
16
9
|
)
|
|
10
|
+
from itertools import chain
|
|
11
|
+
from typing import Any, Callable, Dict, List, Optional, Union
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
from opentelemetry import baggage
|
|
21
|
-
from opentelemetry.context import attach, detach, get_current
|
|
22
|
-
from opentelemetry.baggage import set_baggage, get_all
|
|
23
|
-
|
|
24
|
-
from agenta.sdk.utils.logging import get_module_logger
|
|
25
|
-
from agenta.sdk.utils.exceptions import suppress
|
|
13
|
+
import agenta as ag
|
|
26
14
|
from agenta.sdk.contexts.tracing import (
|
|
27
15
|
TracingContext,
|
|
28
16
|
tracing_context_manager,
|
|
29
17
|
)
|
|
30
18
|
from agenta.sdk.tracing.conventions import parse_span_kind
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
from agenta.sdk.utils.exceptions import suppress
|
|
20
|
+
from agenta.sdk.utils.logging import get_module_logger
|
|
21
|
+
from opentelemetry import context as otel_context
|
|
22
|
+
from opentelemetry.baggage import get_all, set_baggage
|
|
23
|
+
from opentelemetry.context import attach, detach, get_current
|
|
24
|
+
from pydantic import BaseModel
|
|
34
25
|
|
|
35
26
|
log = get_module_logger(__name__)
|
|
36
27
|
|
|
@@ -88,11 +79,12 @@ class instrument: # pylint: disable=invalid-name
|
|
|
88
79
|
with tracing_context_manager(context=TracingContext.get()):
|
|
89
80
|
# debug_otel_context("[BEFORE STREAM] [BEFORE SETUP]")
|
|
90
81
|
|
|
91
|
-
captured_ctx = otel_context.get_current()
|
|
92
|
-
|
|
93
82
|
self._parse_type_and_kind()
|
|
94
83
|
|
|
95
|
-
self._attach_baggage()
|
|
84
|
+
baggage_token = self._attach_baggage()
|
|
85
|
+
|
|
86
|
+
# Capture AFTER baggage attach so we do not wipe it later.
|
|
87
|
+
captured_ctx = otel_context.get_current()
|
|
96
88
|
|
|
97
89
|
ctx = self._get_traceparent()
|
|
98
90
|
|
|
@@ -141,6 +133,7 @@ class instrument: # pylint: disable=invalid-name
|
|
|
141
133
|
otel_context.detach(otel_token)
|
|
142
134
|
|
|
143
135
|
# debug_otel_context("[WITHIN STREAM] [AFTER DETACH]")
|
|
136
|
+
self._detach_baggage(baggage_token)
|
|
144
137
|
|
|
145
138
|
return wrapped_generator()
|
|
146
139
|
|
|
@@ -311,15 +304,43 @@ class instrument: # pylint: disable=invalid-name
|
|
|
311
304
|
|
|
312
305
|
def _attach_baggage(self):
|
|
313
306
|
context = TracingContext.get()
|
|
307
|
+
otel_ctx = get_current()
|
|
308
|
+
|
|
309
|
+
# 1. Propagate any incoming `ag.*` baggage as-is (for example
|
|
310
|
+
# `ag.meta.session_id`) so all nested spans inherit it.
|
|
311
|
+
if context.baggage:
|
|
312
|
+
for k, v in context.baggage.items():
|
|
313
|
+
if not isinstance(k, str) or not k.startswith("ag."):
|
|
314
|
+
continue
|
|
315
|
+
if v is None:
|
|
316
|
+
continue
|
|
317
|
+
otel_ctx = set_baggage(name=k, value=str(v), context=otel_ctx)
|
|
318
|
+
|
|
319
|
+
# 2. Propagate Agenta references in baggage (used for linking traces to
|
|
320
|
+
# application/variant/environment).
|
|
321
|
+
if context.references:
|
|
322
|
+
for k, v in context.references.items():
|
|
323
|
+
if v is None:
|
|
324
|
+
continue
|
|
325
|
+
if isinstance(v, BaseModel):
|
|
326
|
+
try:
|
|
327
|
+
v = v.model_dump(mode="json", exclude_none=True)
|
|
328
|
+
except Exception: # pylint: disable=bare-except
|
|
329
|
+
pass
|
|
330
|
+
if isinstance(v, dict):
|
|
331
|
+
for field, value in v.items():
|
|
332
|
+
otel_ctx = set_baggage(
|
|
333
|
+
name=f"ag.refs.{k}.{field}",
|
|
334
|
+
value=str(value),
|
|
335
|
+
context=otel_ctx,
|
|
336
|
+
)
|
|
337
|
+
continue
|
|
338
|
+
otel_ctx = set_baggage(
|
|
339
|
+
name=f"ag.refs.{k}", value=str(v), context=otel_ctx
|
|
340
|
+
)
|
|
314
341
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
token = None
|
|
318
|
-
if references:
|
|
319
|
-
for k, v in references.items():
|
|
320
|
-
token = attach(baggage.set_baggage(f"ag.refs.{k}", v))
|
|
321
|
-
|
|
322
|
-
return token
|
|
342
|
+
# Attach once so we can reliably detach later.
|
|
343
|
+
return attach(otel_ctx)
|
|
323
344
|
|
|
324
345
|
def _detach_baggage(
|
|
325
346
|
self,
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
from typing import Optional, Dict, List
|
|
2
1
|
from threading import Lock
|
|
2
|
+
from typing import Dict, List, Optional
|
|
3
3
|
|
|
4
|
+
from agenta.sdk.models.tracing import BaseModel
|
|
5
|
+
from agenta.sdk.utils.logging import get_module_logger
|
|
4
6
|
from opentelemetry.baggage import get_all as get_baggage
|
|
5
7
|
from opentelemetry.context import Context
|
|
6
8
|
from opentelemetry.sdk.trace import Span, SpanProcessor
|
|
7
9
|
from opentelemetry.sdk.trace.export import (
|
|
8
|
-
SpanExporter,
|
|
9
|
-
ReadableSpan,
|
|
10
10
|
BatchSpanProcessor,
|
|
11
|
+
ReadableSpan,
|
|
12
|
+
SpanExporter,
|
|
11
13
|
)
|
|
12
14
|
|
|
13
|
-
from agenta.sdk.utils.logging import get_module_logger
|
|
14
|
-
from agenta.sdk.engines.tracing.conventions import Reference
|
|
15
|
-
|
|
16
15
|
log = get_module_logger(__name__)
|
|
17
16
|
|
|
18
17
|
|
|
@@ -51,15 +50,27 @@ class TraceProcessor(SpanProcessor):
|
|
|
51
50
|
parent_context: Optional[Context] = None,
|
|
52
51
|
) -> None:
|
|
53
52
|
for key in self.references.keys():
|
|
54
|
-
|
|
53
|
+
ref = self.references[key]
|
|
54
|
+
if ref is None:
|
|
55
|
+
continue
|
|
56
|
+
if isinstance(ref, BaseModel):
|
|
57
|
+
try:
|
|
58
|
+
ref = ref.model_dump(mode="json", exclude_none=True)
|
|
59
|
+
except Exception: # pylint: disable=bare-except
|
|
60
|
+
pass
|
|
61
|
+
if isinstance(ref, dict):
|
|
62
|
+
for field, value in ref.items():
|
|
63
|
+
span.set_attribute(f"ag.refs.{key}.{field}", str(value))
|
|
64
|
+
else:
|
|
65
|
+
span.set_attribute(f"ag.refs.{key}", str(ref))
|
|
55
66
|
|
|
56
67
|
baggage = get_baggage(parent_context)
|
|
57
68
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
# Copy any `ag.*` baggage entries onto the span attributes so they can be
|
|
70
|
+
# used for filtering and grouping (for example `ag.meta.session_id`).
|
|
71
|
+
for key, value in baggage.items():
|
|
72
|
+
if key.startswith("ag."):
|
|
73
|
+
span.set_attribute(key, value)
|
|
63
74
|
|
|
64
75
|
trace_id = span.context.trace_id
|
|
65
76
|
span_id = span.context.span_id
|
agenta/sdk/middleware/config.py
CHANGED
|
@@ -224,6 +224,7 @@ class ConfigMiddleware(BaseHTTPMiddleware):
|
|
|
224
224
|
baggage.get("ag.refs.variant.slug")
|
|
225
225
|
# ALTERNATIVE
|
|
226
226
|
or request.query_params.get("variant_slug")
|
|
227
|
+
or body.get("variant_slug")
|
|
227
228
|
# LEGACY
|
|
228
229
|
or baggage.get("variant_slug")
|
|
229
230
|
or request.query_params.get("config")
|
|
@@ -234,6 +235,7 @@ class ConfigMiddleware(BaseHTTPMiddleware):
|
|
|
234
235
|
baggage.get("ag.refs.variant.version")
|
|
235
236
|
# ALTERNATIVE
|
|
236
237
|
or request.query_params.get("variant_version")
|
|
238
|
+
or body.get("variant_version")
|
|
237
239
|
# LEGACY
|
|
238
240
|
or baggage.get("variant_version")
|
|
239
241
|
)
|
|
@@ -244,7 +246,7 @@ class ConfigMiddleware(BaseHTTPMiddleware):
|
|
|
244
246
|
return Reference(
|
|
245
247
|
id=variant_id,
|
|
246
248
|
slug=variant_slug,
|
|
247
|
-
version=variant_version,
|
|
249
|
+
version=str(variant_version) if variant_version is not None else None,
|
|
248
250
|
)
|
|
249
251
|
|
|
250
252
|
async def _parse_environment_ref(
|
agenta/sdk/middleware/otel.py
CHANGED
|
@@ -5,8 +5,10 @@ from fastapi import Request, FastAPI
|
|
|
5
5
|
|
|
6
6
|
from agenta.sdk.utils.exceptions import suppress
|
|
7
7
|
from agenta.sdk.tracing.propagation import extract
|
|
8
|
-
|
|
8
|
+
from agenta.sdk.utils.exceptions import suppress
|
|
9
9
|
from agenta.sdk.utils.logging import get_module_logger
|
|
10
|
+
from fastapi import FastAPI, Request
|
|
11
|
+
from starlette.middleware.base import BaseHTTPMiddleware
|
|
10
12
|
|
|
11
13
|
log = get_module_logger(__name__)
|
|
12
14
|
|
|
@@ -6,7 +6,7 @@ from fastapi import Request
|
|
|
6
6
|
|
|
7
7
|
from agenta.sdk.utils.logging import get_module_logger
|
|
8
8
|
from agenta.sdk.utils.exceptions import suppress
|
|
9
|
-
from agenta.sdk.
|
|
9
|
+
from agenta.sdk.tracing.propagation import extract
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
log = get_module_logger(__name__)
|
agenta/sdk/tracing/processors.py
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
from typing import Optional, Dict, List
|
|
2
1
|
from threading import Lock
|
|
2
|
+
from typing import Dict, List, Optional
|
|
3
3
|
|
|
4
|
+
|
|
5
|
+
from agenta.sdk.contexts.tracing import TracingContext
|
|
6
|
+
from agenta.sdk.utils.logging import get_module_logger
|
|
4
7
|
from opentelemetry.baggage import get_all as get_baggage
|
|
5
8
|
from opentelemetry.context import Context
|
|
6
9
|
from opentelemetry.sdk.trace import Span, SpanProcessor
|
|
7
10
|
from opentelemetry.sdk.trace.export import (
|
|
8
|
-
SpanExporter,
|
|
9
|
-
ReadableSpan,
|
|
10
11
|
BatchSpanProcessor,
|
|
12
|
+
ReadableSpan,
|
|
13
|
+
SpanExporter,
|
|
11
14
|
)
|
|
12
15
|
from opentelemetry.trace import SpanContext
|
|
13
16
|
|
|
@@ -88,6 +91,8 @@ class TraceProcessor(SpanProcessor):
|
|
|
88
91
|
if isinstance(ref, dict):
|
|
89
92
|
for field, val in ref.items():
|
|
90
93
|
span.set_attribute(f"{key}.{field}", str(val))
|
|
94
|
+
elif isinstance(ref, (str, bool, int, float, bytes)):
|
|
95
|
+
span.set_attribute(key, ref)
|
|
91
96
|
else:
|
|
92
97
|
# Not a reference - only set if it's a valid attribute type
|
|
93
98
|
if isinstance(value, (str, bool, int, float, bytes)):
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
from typing import
|
|
1
|
+
from typing import Any, Dict, Optional, Tuple
|
|
2
2
|
|
|
3
|
-
from
|
|
4
|
-
from opentelemetry.baggage.propagation import W3CBaggagePropagator
|
|
5
|
-
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
|
|
3
|
+
from agenta.sdk.contexts.tracing import TracingContext
|
|
6
4
|
from opentelemetry.baggage import set_baggage
|
|
5
|
+
from opentelemetry.baggage.propagation import W3CBaggagePropagator
|
|
7
6
|
from opentelemetry.context import get_current
|
|
8
|
-
|
|
9
|
-
from agenta.sdk.contexts.tracing import TracingContext
|
|
10
|
-
|
|
11
|
-
import agenta as ag
|
|
7
|
+
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
|
|
12
8
|
|
|
13
9
|
|
|
14
10
|
def extract(
|
|
@@ -47,11 +43,12 @@ def extract(
|
|
|
47
43
|
baggage = {}
|
|
48
44
|
|
|
49
45
|
try:
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
raw_baggage = (
|
|
47
|
+
headers.get("Baggage") # Uppercase
|
|
52
48
|
or headers.get("baggage") # Lowercase
|
|
53
|
-
or ""
|
|
54
|
-
|
|
49
|
+
or ""
|
|
50
|
+
)
|
|
51
|
+
_carrier = {"baggage": raw_baggage}
|
|
55
52
|
|
|
56
53
|
_context = W3CBaggagePropagator().extract(_carrier)
|
|
57
54
|
|
agenta/sdk/types.py
CHANGED
|
@@ -8,7 +8,7 @@ from pydantic import BaseModel, Field, model_validator, AliasChoices
|
|
|
8
8
|
from starlette.responses import StreamingResponse
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
from agenta.sdk.assets import supported_llm_models
|
|
11
|
+
from agenta.sdk.assets import supported_llm_models, model_metadata
|
|
12
12
|
from agenta.client.backend.types import AgentaNodesResponse, AgentaNodeDto
|
|
13
13
|
|
|
14
14
|
|
|
@@ -23,7 +23,11 @@ def MCField( # pylint: disable=invalid-name
|
|
|
23
23
|
) -> Field:
|
|
24
24
|
# Pydantic 2.12+ no longer allows post-creation mutation of field properties
|
|
25
25
|
if isinstance(choices, dict):
|
|
26
|
-
json_extra = {
|
|
26
|
+
json_extra = {
|
|
27
|
+
"choices": choices,
|
|
28
|
+
"x-parameter": "grouped_choice",
|
|
29
|
+
"x-model-metadata": model_metadata,
|
|
30
|
+
}
|
|
27
31
|
elif isinstance(choices, list):
|
|
28
32
|
json_extra = {"choices": choices, "x-parameter": "choice"}
|
|
29
33
|
else:
|
|
@@ -307,7 +307,7 @@ agenta/config.py,sha256=0VrTqduB4g8Mt_Ll7ffFcEjKF5qjTUIxmUtTPW2ygWw,653
|
|
|
307
307
|
agenta/config.toml,sha256=sIORbhnyct2R9lJrquxhNL4pHul3O0R7iaipCoja5MY,193
|
|
308
308
|
agenta/sdk/__init__.py,sha256=7QUpZ409HcLB22A80qaZydzhs6afPnCvG0Tfq6PE4fk,3011
|
|
309
309
|
agenta/sdk/agenta_init.py,sha256=KiZpk0cfzvKNUtO5S0I_FQghcy8AKRkSxDtVjlZaNkw,9950
|
|
310
|
-
agenta/sdk/assets.py,sha256=
|
|
310
|
+
agenta/sdk/assets.py,sha256=ny67XRbWrV6-bwvavuivz79ootUmpzBvISvA_oIKKDg,10440
|
|
311
311
|
agenta/sdk/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
312
312
|
agenta/sdk/context/running.py,sha256=3gEuUdQrJwcuN93MlXFZ6aHXNxUW6dUk_EudgaxOkCU,907
|
|
313
313
|
agenta/sdk/context/serving.py,sha256=jGRd6v4wWNNoDFM7PJ4ct0MXcMDAVY6puPuseSeIL60,960
|
|
@@ -319,8 +319,8 @@ agenta/sdk/contexts/tracing.py,sha256=gUqhKC5YtDxY3m_fjPQYV7tFjIBF0cuecnoGXEVCWk
|
|
|
319
319
|
agenta/sdk/decorators/__init__.py,sha256=5NtKxiVmUmjfqOFdKqxolpoQWM8QamMLA6u7noCBPHs,44
|
|
320
320
|
agenta/sdk/decorators/routing.py,sha256=tyAGdVOb34mWpyxtauEUsbd0c1wb4q_KVnyBQuzXTNs,8175
|
|
321
321
|
agenta/sdk/decorators/running.py,sha256=W_Aajs1HOtgGWcE2euW5gfCjIhhUEp2CMvv4ez0KTF8,22506
|
|
322
|
-
agenta/sdk/decorators/serving.py,sha256=
|
|
323
|
-
agenta/sdk/decorators/tracing.py,sha256=
|
|
322
|
+
agenta/sdk/decorators/serving.py,sha256=GyNINE4TKrcJ7p4q8npIY1RREYjUiAw2nuxQLIu4tXY,27442
|
|
323
|
+
agenta/sdk/decorators/tracing.py,sha256=HJgDJCLPl5j78KsDGaWZBiSxfXvptBr89HuC9N-6YDk,18717
|
|
324
324
|
agenta/sdk/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
325
325
|
agenta/sdk/engines/running/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
326
326
|
agenta/sdk/engines/running/registry.py,sha256=4FRSeU4njMmP6xFCIteF5f_W6NVlqFTx1AM7hsaGAQk,975
|
|
@@ -330,7 +330,7 @@ agenta/sdk/engines/tracing/attributes.py,sha256=DwjjOk3mGOvz0jYu8EYr3hhItvawK5GX
|
|
|
330
330
|
agenta/sdk/engines/tracing/conventions.py,sha256=JBtznBXZ3aRkGKkLl7cPwdMNh3w1G-H2Ta2YrAxbr38,950
|
|
331
331
|
agenta/sdk/engines/tracing/exporters.py,sha256=2H6tQvFDfE2j_yOvNRZImjeUT6CwOkbfhdA2bxS0IeM,3417
|
|
332
332
|
agenta/sdk/engines/tracing/inline.py,sha256=y2S_MGGqmXgyUgbkNNyrb8_X-QtGuDy8JwxlwWibIx8,31507
|
|
333
|
-
agenta/sdk/engines/tracing/processors.py,sha256=
|
|
333
|
+
agenta/sdk/engines/tracing/processors.py,sha256=5rx6eoH0LzyVo9jttK89xWCMnTLhyHNCX_IfAYgUHrc,5651
|
|
334
334
|
agenta/sdk/engines/tracing/propagation.py,sha256=Zu_z5In8eOhy0tkYzQOI09T4OwdjGMP74nhzvElvyFE,2593
|
|
335
335
|
agenta/sdk/engines/tracing/spans.py,sha256=luZ6lB1mBqrilm2hXZx2ELx6sBQmZM9wThdr8G-yeyM,3715
|
|
336
336
|
agenta/sdk/engines/tracing/tracing.py,sha256=pt40BWz_GA6ycogPrqNhddpvrufB-vAVClIBGI9ON_s,9284
|
|
@@ -360,17 +360,17 @@ agenta/sdk/managers/variant.py,sha256=A5ga3mq3b0weUTXa9HO72MGaspthGcu1uK9K5OnP73
|
|
|
360
360
|
agenta/sdk/managers/vault.py,sha256=wqDVFPuUi-Zida9zVhuHeW6y63K2kez1-4Kk5U0dY48,334
|
|
361
361
|
agenta/sdk/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
362
362
|
agenta/sdk/middleware/auth.py,sha256=UUwqEfsrNt49U1hs-Qfjsjkl5t7-I25VWhS7dsrHqJs,10528
|
|
363
|
-
agenta/sdk/middleware/config.py,sha256=
|
|
363
|
+
agenta/sdk/middleware/config.py,sha256=4CuzD-IzzmYszN6tTqLJaWxPn5SIiHjDE42ZA80M3nk,8852
|
|
364
364
|
agenta/sdk/middleware/cors.py,sha256=q3r7lGkrIdMcT_vuhsburMcjG7pyl7w0ycxrIrGJ2e8,921
|
|
365
365
|
agenta/sdk/middleware/inline.py,sha256=ee8E4XBGcRSrHTvblqX1yRXuTN_sxLm7lY1jnywrBG8,901
|
|
366
366
|
agenta/sdk/middleware/mock.py,sha256=bCUN9iJBxePyN9MBwBpJs-_iCNkUQeUjIIu3WElS1oQ,759
|
|
367
|
-
agenta/sdk/middleware/otel.py,sha256=
|
|
367
|
+
agenta/sdk/middleware/otel.py,sha256=B2_aG72xA0Yy4n27pBQgu86GSYBbM1PguHK9WKrBx14,1028
|
|
368
368
|
agenta/sdk/middleware/vault.py,sha256=xPrR8XUAMG7pgJ4SKMJxAlrfQGgeeIHFoJ-gYfqVWj0,12471
|
|
369
369
|
agenta/sdk/middlewares/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
370
370
|
agenta/sdk/middlewares/routing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
371
371
|
agenta/sdk/middlewares/routing/auth.py,sha256=WmZLxSu4lj9ltI-SpF31MAfAp7uJh3-E9T-U2L4Y58g,10476
|
|
372
372
|
agenta/sdk/middlewares/routing/cors.py,sha256=HvNkusyuTzdT4Cgf-1BO_dAgScUci6RI3rGNKzG-ML8,916
|
|
373
|
-
agenta/sdk/middlewares/routing/otel.py,sha256=
|
|
373
|
+
agenta/sdk/middlewares/routing/otel.py,sha256=HtqCqQEpocSMToiJY1KE-mcitJIheNlOAxWSmjH9hag,850
|
|
374
374
|
agenta/sdk/middlewares/running/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
375
375
|
agenta/sdk/middlewares/running/normalizer.py,sha256=8D7iJkYDbqWiQEGISZOInZCyEjqyOlXETTq3dvDWFac,11384
|
|
376
376
|
agenta/sdk/middlewares/running/resolver.py,sha256=I4nX7jpsq7oKSwQnlsoLm9kh94G2qxBdablJob1l_fs,5013
|
|
@@ -389,11 +389,11 @@ agenta/sdk/tracing/attributes.py,sha256=Brqle9hGV3DaEJjeYCBq7MDlbvHMAIwmkUj2Lni8
|
|
|
389
389
|
agenta/sdk/tracing/conventions.py,sha256=JBtznBXZ3aRkGKkLl7cPwdMNh3w1G-H2Ta2YrAxbr38,950
|
|
390
390
|
agenta/sdk/tracing/exporters.py,sha256=6KEI3ESEJaMqktnq0DyTljWRXSVNBv6qcHezfVI9apA,5178
|
|
391
391
|
agenta/sdk/tracing/inline.py,sha256=UKt10JGKdS6gVDIpExng3UC8vegAcuA2KxlzyvSdUZ0,31886
|
|
392
|
-
agenta/sdk/tracing/processors.py,sha256=
|
|
393
|
-
agenta/sdk/tracing/propagation.py,sha256=
|
|
392
|
+
agenta/sdk/tracing/processors.py,sha256=10r0RARAHsLmkS9Wpg7CK0A1o2kxX-cwCCS0SUtJmgc,9257
|
|
393
|
+
agenta/sdk/tracing/propagation.py,sha256=qQSTtvk3tywpNpgoo_hbmw0o7zA3a4p9HLooMTvXXzA,2530
|
|
394
394
|
agenta/sdk/tracing/spans.py,sha256=r-R68d12BjvilHgbqN-1xp26qxdVRzxRcFUO-IB_u94,3780
|
|
395
395
|
agenta/sdk/tracing/tracing.py,sha256=dP2LShcNBtWqGQKQBAGA52dDqNN15IcKcvXz_EwHigI,12200
|
|
396
|
-
agenta/sdk/types.py,sha256=
|
|
396
|
+
agenta/sdk/types.py,sha256=huOX6Ygqmpu_V-g_bysnDdQf0iIzQ2CFMJyq60sqFko,28568
|
|
397
397
|
agenta/sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
398
398
|
agenta/sdk/utils/cache.py,sha256=Er1Hvu1QVLGl99HkUHZ2lKBg3f6PnpkD1uZRvK9r3u4,1429
|
|
399
399
|
agenta/sdk/utils/client.py,sha256=zq1NJax3zefoqaCAEC4oEBcqZyg92NuSNcr6f0x7n7Y,1009
|
|
@@ -421,6 +421,6 @@ agenta/sdk/workflows/runners/local.py,sha256=SJ1msO35mQ4XzlqZi9fE25QJu-PDnYru8a6
|
|
|
421
421
|
agenta/sdk/workflows/runners/registry.py,sha256=QKU_6IXMcbdq_kxoQlOhjVBJ9nBq07QqHIBxFqSI7Uk,1556
|
|
422
422
|
agenta/sdk/workflows/sandbox.py,sha256=O1Opeg4hc9jygAzyF5cCsStmMjYgrahA_aF0JdGbBO0,1734
|
|
423
423
|
agenta/sdk/workflows/utils.py,sha256=UDG5or8qqiSCpqi0Fphjxkkhu4MdbiCkHn_yIQcTd0c,11664
|
|
424
|
-
agenta-0.
|
|
425
|
-
agenta-0.
|
|
426
|
-
agenta-0.
|
|
424
|
+
agenta-0.72.4.dist-info/METADATA,sha256=DsXJ6CEPcIfs0r5qU32MjWsKK23x9A1KemZj6q3FMnw,31596
|
|
425
|
+
agenta-0.72.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
426
|
+
agenta-0.72.4.dist-info/RECORD,,
|
|
File without changes
|