agenta 0.27.7a1__py3-none-any.whl → 0.27.8a2__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/client/backend/__init__.py +63 -0
- agenta/client/backend/client.py +22 -22
- agenta/client/backend/core/http_client.py +15 -7
- agenta/client/backend/evaluations/client.py +0 -11
- agenta/client/backend/observability/client.py +4 -4
- agenta/client/backend/observability_v_1/__init__.py +5 -0
- agenta/client/backend/observability_v_1/client.py +560 -0
- agenta/client/backend/observability_v_1/types/__init__.py +6 -0
- agenta/client/backend/observability_v_1/types/format.py +5 -0
- agenta/client/backend/observability_v_1/types/query_traces_response.py +11 -0
- agenta/client/backend/testsets/client.py +8 -40
- agenta/client/backend/types/__init__.py +58 -0
- agenta/client/backend/types/agenta_node_dto.py +48 -0
- agenta/client/backend/types/agenta_node_dto_nodes_value.py +6 -0
- agenta/client/backend/types/agenta_nodes_response.py +30 -0
- agenta/client/backend/types/agenta_root_dto.py +30 -0
- agenta/client/backend/types/agenta_roots_response.py +30 -0
- agenta/client/backend/types/agenta_tree_dto.py +30 -0
- agenta/client/backend/types/agenta_trees_response.py +30 -0
- agenta/client/backend/types/collect_status_response.py +22 -0
- agenta/client/backend/types/exception_dto.py +26 -0
- agenta/client/backend/types/link_dto.py +24 -0
- agenta/client/backend/types/node_dto.py +24 -0
- agenta/client/backend/types/node_type.py +19 -0
- agenta/client/backend/types/o_tel_context_dto.py +22 -0
- agenta/client/backend/types/o_tel_event_dto.py +23 -0
- agenta/client/backend/types/o_tel_extra_dto.py +26 -0
- agenta/client/backend/types/o_tel_link_dto.py +23 -0
- agenta/client/backend/types/o_tel_span_dto.py +37 -0
- agenta/client/backend/types/o_tel_span_kind.py +15 -0
- agenta/client/backend/types/o_tel_spans_response.py +24 -0
- agenta/client/backend/types/o_tel_status_code.py +8 -0
- agenta/client/backend/types/parent_dto.py +21 -0
- agenta/client/backend/types/root_dto.py +21 -0
- agenta/client/backend/types/span_dto.py +54 -0
- agenta/client/backend/types/span_dto_nodes_value.py +9 -0
- agenta/client/backend/types/status_code.py +5 -0
- agenta/client/backend/types/status_dto.py +23 -0
- agenta/client/backend/types/time_dto.py +23 -0
- agenta/client/backend/types/tree_dto.py +23 -0
- agenta/client/backend/types/tree_type.py +5 -0
- agenta/client/backend/variants/client.py +24 -16
- agenta/sdk/__init__.py +2 -0
- agenta/sdk/agenta_init.py +4 -9
- agenta/sdk/decorators/routing.py +23 -41
- agenta/sdk/litellm/litellm.py +30 -75
- agenta/sdk/middleware/auth.py +5 -5
- agenta/sdk/tracing/context.py +6 -6
- agenta/sdk/tracing/inline.py +41 -147
- agenta/sdk/tracing/processors.py +1 -3
- agenta/sdk/tracing/tracing.py +1 -5
- agenta/sdk/types.py +5 -2
- agenta/sdk/utils/exceptions.py +15 -9
- agenta/sdk/utils/logging.py +5 -1
- {agenta-0.27.7a1.dist-info → agenta-0.27.8a2.dist-info}/METADATA +1 -1
- {agenta-0.27.7a1.dist-info → agenta-0.27.8a2.dist-info}/RECORD +58 -25
- agenta/sdk/utils/debug.py +0 -68
- {agenta-0.27.7a1.dist-info → agenta-0.27.8a2.dist-info}/WHEEL +0 -0
- {agenta-0.27.7a1.dist-info → agenta-0.27.8a2.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
NodeType = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"agent",
|
|
8
|
+
"workflow",
|
|
9
|
+
"chain",
|
|
10
|
+
"task",
|
|
11
|
+
"tool",
|
|
12
|
+
"embedding",
|
|
13
|
+
"query",
|
|
14
|
+
"completion",
|
|
15
|
+
"chat",
|
|
16
|
+
"rerank",
|
|
17
|
+
],
|
|
18
|
+
typing.Any,
|
|
19
|
+
]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
|
+
import typing
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class OTelContextDto(UniversalBaseModel):
|
|
10
|
+
trace_id: str
|
|
11
|
+
span_id: str
|
|
12
|
+
|
|
13
|
+
if IS_PYDANTIC_V2:
|
|
14
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
15
|
+
extra="allow", frozen=True
|
|
16
|
+
) # type: ignore # Pydantic v2
|
|
17
|
+
else:
|
|
18
|
+
|
|
19
|
+
class Config:
|
|
20
|
+
frozen = True
|
|
21
|
+
smart_union = True
|
|
22
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class OTelEventDto(UniversalBaseModel):
|
|
10
|
+
name: str
|
|
11
|
+
timestamp: str
|
|
12
|
+
attributes: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
13
|
+
|
|
14
|
+
if IS_PYDANTIC_V2:
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
16
|
+
extra="allow", frozen=True
|
|
17
|
+
) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from .o_tel_event_dto import OTelEventDto
|
|
6
|
+
from .o_tel_link_dto import OTelLinkDto
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
|
+
import pydantic
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class OTelExtraDto(UniversalBaseModel):
|
|
12
|
+
kind: typing.Optional[str] = None
|
|
13
|
+
attributes: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
14
|
+
events: typing.Optional[typing.List[OTelEventDto]] = None
|
|
15
|
+
links: typing.Optional[typing.List[OTelLinkDto]] = None
|
|
16
|
+
|
|
17
|
+
if IS_PYDANTIC_V2:
|
|
18
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
19
|
+
extra="allow", frozen=True
|
|
20
|
+
) # type: ignore # Pydantic v2
|
|
21
|
+
else:
|
|
22
|
+
|
|
23
|
+
class Config:
|
|
24
|
+
frozen = True
|
|
25
|
+
smart_union = True
|
|
26
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
from .o_tel_context_dto import OTelContextDto
|
|
5
|
+
import typing
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import pydantic
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class OTelLinkDto(UniversalBaseModel):
|
|
11
|
+
context: OTelContextDto
|
|
12
|
+
attributes: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
13
|
+
|
|
14
|
+
if IS_PYDANTIC_V2:
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
16
|
+
extra="allow", frozen=True
|
|
17
|
+
) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
from .o_tel_context_dto import OTelContextDto
|
|
5
|
+
import typing
|
|
6
|
+
from .o_tel_span_kind import OTelSpanKind
|
|
7
|
+
import datetime as dt
|
|
8
|
+
from .o_tel_status_code import OTelStatusCode
|
|
9
|
+
from .o_tel_event_dto import OTelEventDto
|
|
10
|
+
from .o_tel_link_dto import OTelLinkDto
|
|
11
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
12
|
+
import pydantic
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class OTelSpanDto(UniversalBaseModel):
|
|
16
|
+
context: OTelContextDto
|
|
17
|
+
name: str
|
|
18
|
+
kind: typing.Optional[OTelSpanKind] = None
|
|
19
|
+
start_time: dt.datetime
|
|
20
|
+
end_time: dt.datetime
|
|
21
|
+
status_code: typing.Optional[OTelStatusCode] = None
|
|
22
|
+
status_message: typing.Optional[str] = None
|
|
23
|
+
attributes: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
24
|
+
events: typing.Optional[typing.List[OTelEventDto]] = None
|
|
25
|
+
parent: typing.Optional[OTelContextDto] = None
|
|
26
|
+
links: typing.Optional[typing.List[OTelLinkDto]] = None
|
|
27
|
+
|
|
28
|
+
if IS_PYDANTIC_V2:
|
|
29
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
30
|
+
extra="allow", frozen=True
|
|
31
|
+
) # type: ignore # Pydantic v2
|
|
32
|
+
else:
|
|
33
|
+
|
|
34
|
+
class Config:
|
|
35
|
+
frozen = True
|
|
36
|
+
smart_union = True
|
|
37
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
OTelSpanKind = typing.Union[
|
|
6
|
+
typing.Literal[
|
|
7
|
+
"SPAN_KIND_UNSPECIFIED",
|
|
8
|
+
"SPAN_KIND_INTERNAL",
|
|
9
|
+
"SPAN_KIND_SERVER",
|
|
10
|
+
"SPAN_KIND_CLIENT",
|
|
11
|
+
"SPAN_KIND_PRODUCER",
|
|
12
|
+
"SPAN_KIND_CONSUMER",
|
|
13
|
+
],
|
|
14
|
+
typing.Any,
|
|
15
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from .o_tel_span_dto import OTelSpanDto
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import pydantic
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class OTelSpansResponse(UniversalBaseModel):
|
|
11
|
+
version: str
|
|
12
|
+
count: typing.Optional[int] = None
|
|
13
|
+
spans: typing.List[OTelSpanDto]
|
|
14
|
+
|
|
15
|
+
if IS_PYDANTIC_V2:
|
|
16
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
17
|
+
extra="allow", frozen=True
|
|
18
|
+
) # type: ignore # Pydantic v2
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class Config:
|
|
22
|
+
frozen = True
|
|
23
|
+
smart_union = True
|
|
24
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
|
+
import typing
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ParentDto(UniversalBaseModel):
|
|
10
|
+
id: str
|
|
11
|
+
|
|
12
|
+
if IS_PYDANTIC_V2:
|
|
13
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
14
|
+
extra="allow", frozen=True
|
|
15
|
+
) # type: ignore # Pydantic v2
|
|
16
|
+
else:
|
|
17
|
+
|
|
18
|
+
class Config:
|
|
19
|
+
frozen = True
|
|
20
|
+
smart_union = True
|
|
21
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
5
|
+
import typing
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RootDto(UniversalBaseModel):
|
|
10
|
+
id: str
|
|
11
|
+
|
|
12
|
+
if IS_PYDANTIC_V2:
|
|
13
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
14
|
+
extra="allow", frozen=True
|
|
15
|
+
) # type: ignore # Pydantic v2
|
|
16
|
+
else:
|
|
17
|
+
|
|
18
|
+
class Config:
|
|
19
|
+
frozen = True
|
|
20
|
+
smart_union = True
|
|
21
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
5
|
+
import typing
|
|
6
|
+
from .lifecycle_dto import LifecycleDto
|
|
7
|
+
from .root_dto import RootDto
|
|
8
|
+
from .tree_dto import TreeDto
|
|
9
|
+
from .node_dto import NodeDto
|
|
10
|
+
from .parent_dto import ParentDto
|
|
11
|
+
from .time_dto import TimeDto
|
|
12
|
+
from .status_dto import StatusDto
|
|
13
|
+
from .exception_dto import ExceptionDto
|
|
14
|
+
from .link_dto import LinkDto
|
|
15
|
+
from .o_tel_extra_dto import OTelExtraDto
|
|
16
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
17
|
+
import pydantic
|
|
18
|
+
from ..core.pydantic_utilities import update_forward_refs
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SpanDto(UniversalBaseModel):
|
|
22
|
+
lifecycle: typing.Optional[LifecycleDto] = None
|
|
23
|
+
root: RootDto
|
|
24
|
+
tree: TreeDto
|
|
25
|
+
node: NodeDto
|
|
26
|
+
parent: typing.Optional[ParentDto] = None
|
|
27
|
+
time: TimeDto
|
|
28
|
+
status: StatusDto
|
|
29
|
+
exception: typing.Optional[ExceptionDto] = None
|
|
30
|
+
data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
31
|
+
metrics: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
32
|
+
meta: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
33
|
+
refs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
|
34
|
+
links: typing.Optional[typing.List[LinkDto]] = None
|
|
35
|
+
otel: typing.Optional[OTelExtraDto] = None
|
|
36
|
+
nodes: typing.Optional[
|
|
37
|
+
typing.Dict[str, typing.Optional["SpanDtoNodesValue"]]
|
|
38
|
+
] = None
|
|
39
|
+
|
|
40
|
+
if IS_PYDANTIC_V2:
|
|
41
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
42
|
+
extra="allow", frozen=True
|
|
43
|
+
) # type: ignore # Pydantic v2
|
|
44
|
+
else:
|
|
45
|
+
|
|
46
|
+
class Config:
|
|
47
|
+
frozen = True
|
|
48
|
+
smart_union = True
|
|
49
|
+
extra = pydantic.Extra.allow
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
from .span_dto_nodes_value import SpanDtoNodesValue # noqa: E402
|
|
53
|
+
|
|
54
|
+
update_forward_refs(SpanDto)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
import typing
|
|
5
|
+
import typing
|
|
6
|
+
|
|
7
|
+
if typing.TYPE_CHECKING:
|
|
8
|
+
from .span_dto import SpanDto
|
|
9
|
+
SpanDtoNodesValue = typing.Union["SpanDto", typing.List["SpanDto"]]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
from .status_code import StatusCode
|
|
5
|
+
import typing
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import pydantic
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class StatusDto(UniversalBaseModel):
|
|
11
|
+
code: StatusCode
|
|
12
|
+
message: typing.Optional[str] = None
|
|
13
|
+
|
|
14
|
+
if IS_PYDANTIC_V2:
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
16
|
+
extra="allow", frozen=True
|
|
17
|
+
) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import datetime as dt
|
|
5
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
|
+
import typing
|
|
7
|
+
import pydantic
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TimeDto(UniversalBaseModel):
|
|
11
|
+
start: dt.datetime
|
|
12
|
+
end: dt.datetime
|
|
13
|
+
|
|
14
|
+
if IS_PYDANTIC_V2:
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
16
|
+
extra="allow", frozen=True
|
|
17
|
+
) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from ..core.pydantic_utilities import UniversalBaseModel
|
|
4
|
+
import typing
|
|
5
|
+
from .tree_type import TreeType
|
|
6
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
|
+
import pydantic
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TreeDto(UniversalBaseModel):
|
|
11
|
+
id: str
|
|
12
|
+
type: typing.Optional[TreeType] = None
|
|
13
|
+
|
|
14
|
+
if IS_PYDANTIC_V2:
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
|
|
16
|
+
extra="allow", frozen=True
|
|
17
|
+
) # type: ignore # Pydantic v2
|
|
18
|
+
else:
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
frozen = True
|
|
22
|
+
smart_union = True
|
|
23
|
+
extra = pydantic.Extra.allow
|
|
@@ -1104,14 +1104,14 @@ class VariantsClient:
|
|
|
1104
1104
|
def configs_delete(
|
|
1105
1105
|
self,
|
|
1106
1106
|
*,
|
|
1107
|
-
variant_ref:
|
|
1107
|
+
variant_ref: ReferenceRequestModel,
|
|
1108
1108
|
application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
1109
1109
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1110
1110
|
) -> int:
|
|
1111
1111
|
"""
|
|
1112
1112
|
Parameters
|
|
1113
1113
|
----------
|
|
1114
|
-
variant_ref :
|
|
1114
|
+
variant_ref : ReferenceRequestModel
|
|
1115
1115
|
|
|
1116
1116
|
application_ref : typing.Optional[ReferenceRequestModel]
|
|
1117
1117
|
|
|
@@ -1125,13 +1125,15 @@ class VariantsClient:
|
|
|
1125
1125
|
|
|
1126
1126
|
Examples
|
|
1127
1127
|
--------
|
|
1128
|
-
from agenta import AgentaApi
|
|
1128
|
+
from agenta import AgentaApi, ReferenceRequestModel
|
|
1129
1129
|
|
|
1130
1130
|
client = AgentaApi(
|
|
1131
1131
|
api_key="YOUR_API_KEY",
|
|
1132
1132
|
base_url="https://yourhost.com/path/to/api",
|
|
1133
1133
|
)
|
|
1134
|
-
client.variants.configs_delete(
|
|
1134
|
+
client.variants.configs_delete(
|
|
1135
|
+
variant_ref=ReferenceRequestModel(),
|
|
1136
|
+
)
|
|
1135
1137
|
"""
|
|
1136
1138
|
_response = self._client_wrapper.httpx_client.request(
|
|
1137
1139
|
"variants/configs/delete",
|
|
@@ -1244,14 +1246,14 @@ class VariantsClient:
|
|
|
1244
1246
|
def configs_history(
|
|
1245
1247
|
self,
|
|
1246
1248
|
*,
|
|
1247
|
-
variant_ref:
|
|
1249
|
+
variant_ref: ReferenceRequestModel,
|
|
1248
1250
|
application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
1249
1251
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1250
1252
|
) -> typing.List[ConfigResponseModel]:
|
|
1251
1253
|
"""
|
|
1252
1254
|
Parameters
|
|
1253
1255
|
----------
|
|
1254
|
-
variant_ref :
|
|
1256
|
+
variant_ref : ReferenceRequestModel
|
|
1255
1257
|
|
|
1256
1258
|
application_ref : typing.Optional[ReferenceRequestModel]
|
|
1257
1259
|
|
|
@@ -1265,13 +1267,15 @@ class VariantsClient:
|
|
|
1265
1267
|
|
|
1266
1268
|
Examples
|
|
1267
1269
|
--------
|
|
1268
|
-
from agenta import AgentaApi
|
|
1270
|
+
from agenta import AgentaApi, ReferenceRequestModel
|
|
1269
1271
|
|
|
1270
1272
|
client = AgentaApi(
|
|
1271
1273
|
api_key="YOUR_API_KEY",
|
|
1272
1274
|
base_url="https://yourhost.com/path/to/api",
|
|
1273
1275
|
)
|
|
1274
|
-
client.variants.configs_history(
|
|
1276
|
+
client.variants.configs_history(
|
|
1277
|
+
variant_ref=ReferenceRequestModel(),
|
|
1278
|
+
)
|
|
1275
1279
|
"""
|
|
1276
1280
|
_response = self._client_wrapper.httpx_client.request(
|
|
1277
1281
|
"variants/configs/history",
|
|
@@ -2504,14 +2508,14 @@ class AsyncVariantsClient:
|
|
|
2504
2508
|
async def configs_delete(
|
|
2505
2509
|
self,
|
|
2506
2510
|
*,
|
|
2507
|
-
variant_ref:
|
|
2511
|
+
variant_ref: ReferenceRequestModel,
|
|
2508
2512
|
application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
2509
2513
|
request_options: typing.Optional[RequestOptions] = None,
|
|
2510
2514
|
) -> int:
|
|
2511
2515
|
"""
|
|
2512
2516
|
Parameters
|
|
2513
2517
|
----------
|
|
2514
|
-
variant_ref :
|
|
2518
|
+
variant_ref : ReferenceRequestModel
|
|
2515
2519
|
|
|
2516
2520
|
application_ref : typing.Optional[ReferenceRequestModel]
|
|
2517
2521
|
|
|
@@ -2527,7 +2531,7 @@ class AsyncVariantsClient:
|
|
|
2527
2531
|
--------
|
|
2528
2532
|
import asyncio
|
|
2529
2533
|
|
|
2530
|
-
from agenta import AsyncAgentaApi
|
|
2534
|
+
from agenta import AsyncAgentaApi, ReferenceRequestModel
|
|
2531
2535
|
|
|
2532
2536
|
client = AsyncAgentaApi(
|
|
2533
2537
|
api_key="YOUR_API_KEY",
|
|
@@ -2536,7 +2540,9 @@ class AsyncVariantsClient:
|
|
|
2536
2540
|
|
|
2537
2541
|
|
|
2538
2542
|
async def main() -> None:
|
|
2539
|
-
await client.variants.configs_delete(
|
|
2543
|
+
await client.variants.configs_delete(
|
|
2544
|
+
variant_ref=ReferenceRequestModel(),
|
|
2545
|
+
)
|
|
2540
2546
|
|
|
2541
2547
|
|
|
2542
2548
|
asyncio.run(main())
|
|
@@ -2660,14 +2666,14 @@ class AsyncVariantsClient:
|
|
|
2660
2666
|
async def configs_history(
|
|
2661
2667
|
self,
|
|
2662
2668
|
*,
|
|
2663
|
-
variant_ref:
|
|
2669
|
+
variant_ref: ReferenceRequestModel,
|
|
2664
2670
|
application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
2665
2671
|
request_options: typing.Optional[RequestOptions] = None,
|
|
2666
2672
|
) -> typing.List[ConfigResponseModel]:
|
|
2667
2673
|
"""
|
|
2668
2674
|
Parameters
|
|
2669
2675
|
----------
|
|
2670
|
-
variant_ref :
|
|
2676
|
+
variant_ref : ReferenceRequestModel
|
|
2671
2677
|
|
|
2672
2678
|
application_ref : typing.Optional[ReferenceRequestModel]
|
|
2673
2679
|
|
|
@@ -2683,7 +2689,7 @@ class AsyncVariantsClient:
|
|
|
2683
2689
|
--------
|
|
2684
2690
|
import asyncio
|
|
2685
2691
|
|
|
2686
|
-
from agenta import AsyncAgentaApi
|
|
2692
|
+
from agenta import AsyncAgentaApi, ReferenceRequestModel
|
|
2687
2693
|
|
|
2688
2694
|
client = AsyncAgentaApi(
|
|
2689
2695
|
api_key="YOUR_API_KEY",
|
|
@@ -2692,7 +2698,9 @@ class AsyncVariantsClient:
|
|
|
2692
2698
|
|
|
2693
2699
|
|
|
2694
2700
|
async def main() -> None:
|
|
2695
|
-
await client.variants.configs_history(
|
|
2701
|
+
await client.variants.configs_history(
|
|
2702
|
+
variant_ref=ReferenceRequestModel(),
|
|
2703
|
+
)
|
|
2696
2704
|
|
|
2697
2705
|
|
|
2698
2706
|
asyncio.run(main())
|
agenta/sdk/__init__.py
CHANGED
agenta/sdk/agenta_init.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
import toml
|
|
3
2
|
from os import getenv
|
|
4
3
|
from typing import Optional, Callable, Any
|
|
@@ -11,10 +10,6 @@ from agenta.sdk.tracing import Tracing
|
|
|
11
10
|
from agenta.client.exceptions import APIRequestError
|
|
12
11
|
|
|
13
12
|
|
|
14
|
-
logger = logging.getLogger(__name__)
|
|
15
|
-
logger.setLevel(logging.DEBUG)
|
|
16
|
-
|
|
17
|
-
|
|
18
13
|
class AgentaSingleton:
|
|
19
14
|
"""Singleton class to save all the "global variables" for the sdk."""
|
|
20
15
|
|
|
@@ -164,7 +159,7 @@ class Config:
|
|
|
164
159
|
try:
|
|
165
160
|
self.push(config_name="default", overwrite=overwrite, **kwargs)
|
|
166
161
|
except Exception as ex:
|
|
167
|
-
|
|
162
|
+
log.warning(
|
|
168
163
|
"Unable to push the default configuration to the server. %s", str(ex)
|
|
169
164
|
)
|
|
170
165
|
|
|
@@ -185,7 +180,7 @@ class Config:
|
|
|
185
180
|
overwrite=overwrite,
|
|
186
181
|
)
|
|
187
182
|
except Exception as ex:
|
|
188
|
-
|
|
183
|
+
log.warning(
|
|
189
184
|
"Failed to push the configuration to the server with error: %s", ex
|
|
190
185
|
)
|
|
191
186
|
|
|
@@ -212,14 +207,14 @@ class Config:
|
|
|
212
207
|
config_name=config_name,
|
|
213
208
|
)
|
|
214
209
|
except Exception as ex:
|
|
215
|
-
|
|
210
|
+
log.warning(
|
|
216
211
|
"Failed to pull the configuration from the server with error: %s",
|
|
217
212
|
str(ex),
|
|
218
213
|
)
|
|
219
214
|
try:
|
|
220
215
|
self.set(**{"current_version": config.current_version, **config.parameters})
|
|
221
216
|
except Exception as ex:
|
|
222
|
-
|
|
217
|
+
log.warning("Failed to set the configuration with error: %s", str(ex))
|
|
223
218
|
|
|
224
219
|
def all(self):
|
|
225
220
|
"""Returns all the parameters for the app variant"""
|