agenta 0.27.7__py3-none-any.whl → 0.27.7a0__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 +51 -4
- agenta/client/backend/__init__.py +0 -63
- agenta/client/backend/apps/client.py +58 -12
- agenta/client/backend/client.py +22 -22
- agenta/client/backend/core/http_client.py +7 -15
- agenta/client/backend/evaluations/client.py +11 -0
- agenta/client/backend/observability/client.py +4 -4
- agenta/client/backend/testsets/client.py +40 -8
- agenta/client/backend/types/__init__.py +0 -58
- agenta/client/backend/variants/client.py +16 -24
- agenta/sdk/__init__.py +0 -2
- agenta/sdk/agenta_init.py +9 -4
- agenta/sdk/decorators/routing.py +42 -24
- agenta/sdk/litellm/litellm.py +75 -30
- agenta/sdk/middleware/auth.py +6 -9
- agenta/sdk/tracing/context.py +6 -6
- agenta/sdk/tracing/inline.py +151 -48
- agenta/sdk/tracing/processors.py +3 -1
- agenta/sdk/tracing/tracing.py +5 -1
- agenta/sdk/types.py +2 -5
- agenta/sdk/utils/debug.py +68 -0
- agenta/sdk/utils/exceptions.py +9 -15
- agenta/sdk/utils/logging.py +1 -5
- {agenta-0.27.7.dist-info → agenta-0.27.7a0.dist-info}/METADATA +1 -1
- {agenta-0.27.7.dist-info → agenta-0.27.7a0.dist-info}/RECORD +27 -60
- agenta/client/backend/observability_v_1/__init__.py +0 -5
- agenta/client/backend/observability_v_1/client.py +0 -560
- agenta/client/backend/observability_v_1/types/__init__.py +0 -6
- agenta/client/backend/observability_v_1/types/format.py +0 -5
- agenta/client/backend/observability_v_1/types/query_traces_response.py +0 -11
- agenta/client/backend/types/agenta_node_dto.py +0 -48
- agenta/client/backend/types/agenta_node_dto_nodes_value.py +0 -6
- agenta/client/backend/types/agenta_nodes_response.py +0 -30
- agenta/client/backend/types/agenta_root_dto.py +0 -30
- agenta/client/backend/types/agenta_roots_response.py +0 -30
- agenta/client/backend/types/agenta_tree_dto.py +0 -30
- agenta/client/backend/types/agenta_trees_response.py +0 -30
- agenta/client/backend/types/collect_status_response.py +0 -22
- agenta/client/backend/types/exception_dto.py +0 -26
- agenta/client/backend/types/link_dto.py +0 -24
- agenta/client/backend/types/node_dto.py +0 -24
- agenta/client/backend/types/node_type.py +0 -19
- agenta/client/backend/types/o_tel_context_dto.py +0 -22
- agenta/client/backend/types/o_tel_event_dto.py +0 -23
- agenta/client/backend/types/o_tel_extra_dto.py +0 -26
- agenta/client/backend/types/o_tel_link_dto.py +0 -23
- agenta/client/backend/types/o_tel_span_dto.py +0 -37
- agenta/client/backend/types/o_tel_span_kind.py +0 -15
- agenta/client/backend/types/o_tel_spans_response.py +0 -24
- agenta/client/backend/types/o_tel_status_code.py +0 -8
- agenta/client/backend/types/parent_dto.py +0 -21
- agenta/client/backend/types/root_dto.py +0 -21
- agenta/client/backend/types/span_dto.py +0 -54
- agenta/client/backend/types/span_dto_nodes_value.py +0 -9
- agenta/client/backend/types/status_code.py +0 -5
- agenta/client/backend/types/status_dto.py +0 -23
- agenta/client/backend/types/time_dto.py +0 -23
- agenta/client/backend/types/tree_dto.py +0 -23
- agenta/client/backend/types/tree_type.py +0 -5
- {agenta-0.27.7.dist-info → agenta-0.27.7a0.dist-info}/WHEEL +0 -0
- {agenta-0.27.7.dist-info → agenta-0.27.7a0.dist-info}/entry_points.txt +0 -0
|
@@ -26,6 +26,7 @@ class EvaluationsClient:
|
|
|
26
26
|
def fetch_evaluation_ids(
|
|
27
27
|
self,
|
|
28
28
|
*,
|
|
29
|
+
app_id: str,
|
|
29
30
|
resource_type: str,
|
|
30
31
|
resource_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
31
32
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -34,6 +35,7 @@ class EvaluationsClient:
|
|
|
34
35
|
Fetches evaluation ids for a given resource type and id.
|
|
35
36
|
|
|
36
37
|
Arguments:
|
|
38
|
+
app_id (str): The ID of the app for which to fetch evaluations.
|
|
37
39
|
resource_type (str): The type of resource for which to fetch evaluations.
|
|
38
40
|
resource_ids List[ObjectId]: The IDs of resource for which to fetch evaluations.
|
|
39
41
|
|
|
@@ -45,6 +47,8 @@ class EvaluationsClient:
|
|
|
45
47
|
|
|
46
48
|
Parameters
|
|
47
49
|
----------
|
|
50
|
+
app_id : str
|
|
51
|
+
|
|
48
52
|
resource_type : str
|
|
49
53
|
|
|
50
54
|
resource_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
@@ -66,6 +70,7 @@ class EvaluationsClient:
|
|
|
66
70
|
base_url="https://yourhost.com/path/to/api",
|
|
67
71
|
)
|
|
68
72
|
client.evaluations.fetch_evaluation_ids(
|
|
73
|
+
app_id="app_id",
|
|
69
74
|
resource_type="resource_type",
|
|
70
75
|
)
|
|
71
76
|
"""
|
|
@@ -73,6 +78,7 @@ class EvaluationsClient:
|
|
|
73
78
|
"evaluations/by_resource",
|
|
74
79
|
method="GET",
|
|
75
80
|
params={
|
|
81
|
+
"app_id": app_id,
|
|
76
82
|
"resource_type": resource_type,
|
|
77
83
|
"resource_ids": resource_ids,
|
|
78
84
|
},
|
|
@@ -708,6 +714,7 @@ class AsyncEvaluationsClient:
|
|
|
708
714
|
async def fetch_evaluation_ids(
|
|
709
715
|
self,
|
|
710
716
|
*,
|
|
717
|
+
app_id: str,
|
|
711
718
|
resource_type: str,
|
|
712
719
|
resource_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
713
720
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -716,6 +723,7 @@ class AsyncEvaluationsClient:
|
|
|
716
723
|
Fetches evaluation ids for a given resource type and id.
|
|
717
724
|
|
|
718
725
|
Arguments:
|
|
726
|
+
app_id (str): The ID of the app for which to fetch evaluations.
|
|
719
727
|
resource_type (str): The type of resource for which to fetch evaluations.
|
|
720
728
|
resource_ids List[ObjectId]: The IDs of resource for which to fetch evaluations.
|
|
721
729
|
|
|
@@ -727,6 +735,7 @@ class AsyncEvaluationsClient:
|
|
|
727
735
|
|
|
728
736
|
Parameters
|
|
729
737
|
----------
|
|
738
|
+
app_id : str
|
|
730
739
|
|
|
731
740
|
resource_type : str
|
|
732
741
|
|
|
@@ -754,6 +763,7 @@ class AsyncEvaluationsClient:
|
|
|
754
763
|
|
|
755
764
|
async def main() -> None:
|
|
756
765
|
await client.evaluations.fetch_evaluation_ids(
|
|
766
|
+
app_id="app_id",
|
|
757
767
|
resource_type="resource_type",
|
|
758
768
|
)
|
|
759
769
|
|
|
@@ -764,6 +774,7 @@ class AsyncEvaluationsClient:
|
|
|
764
774
|
"evaluations/by_resource",
|
|
765
775
|
method="GET",
|
|
766
776
|
params={
|
|
777
|
+
"app_id": app_id,
|
|
767
778
|
"resource_type": resource_type,
|
|
768
779
|
"resource_ids": resource_ids,
|
|
769
780
|
},
|
|
@@ -280,7 +280,7 @@ class ObservabilityClient:
|
|
|
280
280
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
281
281
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
282
282
|
|
|
283
|
-
def
|
|
283
|
+
def delete_traces(
|
|
284
284
|
self,
|
|
285
285
|
*,
|
|
286
286
|
request: typing.Sequence[str],
|
|
@@ -307,7 +307,7 @@ class ObservabilityClient:
|
|
|
307
307
|
api_key="YOUR_API_KEY",
|
|
308
308
|
base_url="https://yourhost.com/path/to/api",
|
|
309
309
|
)
|
|
310
|
-
client.observability.
|
|
310
|
+
client.observability.delete_traces(
|
|
311
311
|
request=["string"],
|
|
312
312
|
)
|
|
313
313
|
"""
|
|
@@ -901,7 +901,7 @@ class AsyncObservabilityClient:
|
|
|
901
901
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
902
902
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
903
903
|
|
|
904
|
-
async def
|
|
904
|
+
async def delete_traces(
|
|
905
905
|
self,
|
|
906
906
|
*,
|
|
907
907
|
request: typing.Sequence[str],
|
|
@@ -933,7 +933,7 @@ class AsyncObservabilityClient:
|
|
|
933
933
|
|
|
934
934
|
|
|
935
935
|
async def main() -> None:
|
|
936
|
-
await client.observability.
|
|
936
|
+
await client.observability.delete_traces(
|
|
937
937
|
request=["string"],
|
|
938
938
|
)
|
|
939
939
|
|
|
@@ -28,6 +28,7 @@ class TestsetsClient:
|
|
|
28
28
|
file: core.File,
|
|
29
29
|
upload_type: typing.Optional[str] = OMIT,
|
|
30
30
|
testset_name: typing.Optional[str] = OMIT,
|
|
31
|
+
app_id: typing.Optional[str] = OMIT,
|
|
31
32
|
request_options: typing.Optional[RequestOptions] = None,
|
|
32
33
|
) -> TestSetSimpleResponse:
|
|
33
34
|
"""
|
|
@@ -50,6 +51,8 @@ class TestsetsClient:
|
|
|
50
51
|
|
|
51
52
|
testset_name : typing.Optional[str]
|
|
52
53
|
|
|
54
|
+
app_id : typing.Optional[str]
|
|
55
|
+
|
|
53
56
|
request_options : typing.Optional[RequestOptions]
|
|
54
57
|
Request-specific configuration.
|
|
55
58
|
|
|
@@ -74,6 +77,7 @@ class TestsetsClient:
|
|
|
74
77
|
data={
|
|
75
78
|
"upload_type": upload_type,
|
|
76
79
|
"testset_name": testset_name,
|
|
80
|
+
"app_id": app_id,
|
|
77
81
|
},
|
|
78
82
|
files={
|
|
79
83
|
"file": file,
|
|
@@ -169,16 +173,18 @@ class TestsetsClient:
|
|
|
169
173
|
|
|
170
174
|
def create_testset(
|
|
171
175
|
self,
|
|
176
|
+
app_id: str,
|
|
172
177
|
*,
|
|
173
178
|
name: str,
|
|
174
179
|
csvdata: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
|
175
180
|
request_options: typing.Optional[RequestOptions] = None,
|
|
176
181
|
) -> TestSetSimpleResponse:
|
|
177
182
|
"""
|
|
178
|
-
Create a testset with given name, save the testset to MongoDB.
|
|
183
|
+
Create a testset with given name and app_name, save the testset to MongoDB.
|
|
179
184
|
|
|
180
185
|
Args:
|
|
181
186
|
name (str): name of the test set.
|
|
187
|
+
app_name (str): name of the application.
|
|
182
188
|
testset (Dict[str, str]): test set data.
|
|
183
189
|
|
|
184
190
|
Returns:
|
|
@@ -186,6 +192,8 @@ class TestsetsClient:
|
|
|
186
192
|
|
|
187
193
|
Parameters
|
|
188
194
|
----------
|
|
195
|
+
app_id : str
|
|
196
|
+
|
|
189
197
|
name : str
|
|
190
198
|
|
|
191
199
|
csvdata : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
@@ -207,12 +215,13 @@ class TestsetsClient:
|
|
|
207
215
|
base_url="https://yourhost.com/path/to/api",
|
|
208
216
|
)
|
|
209
217
|
client.testsets.create_testset(
|
|
218
|
+
app_id="app_id",
|
|
210
219
|
name="name",
|
|
211
220
|
csvdata=[{"key": "value"}],
|
|
212
221
|
)
|
|
213
222
|
"""
|
|
214
223
|
_response = self._client_wrapper.httpx_client.request(
|
|
215
|
-
"testsets",
|
|
224
|
+
f"testsets/{jsonable_encoder(app_id)}",
|
|
216
225
|
method="POST",
|
|
217
226
|
json={
|
|
218
227
|
"name": name,
|
|
@@ -396,7 +405,7 @@ class TestsetsClient:
|
|
|
396
405
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
397
406
|
|
|
398
407
|
def get_testsets(
|
|
399
|
-
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
408
|
+
self, *, app_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
400
409
|
) -> typing.List[TestSetOutputResponse]:
|
|
401
410
|
"""
|
|
402
411
|
Get all testsets.
|
|
@@ -411,6 +420,8 @@ class TestsetsClient:
|
|
|
411
420
|
|
|
412
421
|
Parameters
|
|
413
422
|
----------
|
|
423
|
+
app_id : str
|
|
424
|
+
|
|
414
425
|
request_options : typing.Optional[RequestOptions]
|
|
415
426
|
Request-specific configuration.
|
|
416
427
|
|
|
@@ -427,11 +438,16 @@ class TestsetsClient:
|
|
|
427
438
|
api_key="YOUR_API_KEY",
|
|
428
439
|
base_url="https://yourhost.com/path/to/api",
|
|
429
440
|
)
|
|
430
|
-
client.testsets.get_testsets(
|
|
441
|
+
client.testsets.get_testsets(
|
|
442
|
+
app_id="app_id",
|
|
443
|
+
)
|
|
431
444
|
"""
|
|
432
445
|
_response = self._client_wrapper.httpx_client.request(
|
|
433
446
|
"testsets",
|
|
434
447
|
method="GET",
|
|
448
|
+
params={
|
|
449
|
+
"app_id": app_id,
|
|
450
|
+
},
|
|
435
451
|
request_options=request_options,
|
|
436
452
|
)
|
|
437
453
|
try:
|
|
@@ -541,6 +557,7 @@ class AsyncTestsetsClient:
|
|
|
541
557
|
file: core.File,
|
|
542
558
|
upload_type: typing.Optional[str] = OMIT,
|
|
543
559
|
testset_name: typing.Optional[str] = OMIT,
|
|
560
|
+
app_id: typing.Optional[str] = OMIT,
|
|
544
561
|
request_options: typing.Optional[RequestOptions] = None,
|
|
545
562
|
) -> TestSetSimpleResponse:
|
|
546
563
|
"""
|
|
@@ -563,6 +580,8 @@ class AsyncTestsetsClient:
|
|
|
563
580
|
|
|
564
581
|
testset_name : typing.Optional[str]
|
|
565
582
|
|
|
583
|
+
app_id : typing.Optional[str]
|
|
584
|
+
|
|
566
585
|
request_options : typing.Optional[RequestOptions]
|
|
567
586
|
Request-specific configuration.
|
|
568
587
|
|
|
@@ -595,6 +614,7 @@ class AsyncTestsetsClient:
|
|
|
595
614
|
data={
|
|
596
615
|
"upload_type": upload_type,
|
|
597
616
|
"testset_name": testset_name,
|
|
617
|
+
"app_id": app_id,
|
|
598
618
|
},
|
|
599
619
|
files={
|
|
600
620
|
"file": file,
|
|
@@ -698,16 +718,18 @@ class AsyncTestsetsClient:
|
|
|
698
718
|
|
|
699
719
|
async def create_testset(
|
|
700
720
|
self,
|
|
721
|
+
app_id: str,
|
|
701
722
|
*,
|
|
702
723
|
name: str,
|
|
703
724
|
csvdata: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
|
704
725
|
request_options: typing.Optional[RequestOptions] = None,
|
|
705
726
|
) -> TestSetSimpleResponse:
|
|
706
727
|
"""
|
|
707
|
-
Create a testset with given name, save the testset to MongoDB.
|
|
728
|
+
Create a testset with given name and app_name, save the testset to MongoDB.
|
|
708
729
|
|
|
709
730
|
Args:
|
|
710
731
|
name (str): name of the test set.
|
|
732
|
+
app_name (str): name of the application.
|
|
711
733
|
testset (Dict[str, str]): test set data.
|
|
712
734
|
|
|
713
735
|
Returns:
|
|
@@ -715,6 +737,8 @@ class AsyncTestsetsClient:
|
|
|
715
737
|
|
|
716
738
|
Parameters
|
|
717
739
|
----------
|
|
740
|
+
app_id : str
|
|
741
|
+
|
|
718
742
|
name : str
|
|
719
743
|
|
|
720
744
|
csvdata : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
@@ -741,6 +765,7 @@ class AsyncTestsetsClient:
|
|
|
741
765
|
|
|
742
766
|
async def main() -> None:
|
|
743
767
|
await client.testsets.create_testset(
|
|
768
|
+
app_id="app_id",
|
|
744
769
|
name="name",
|
|
745
770
|
csvdata=[{"key": "value"}],
|
|
746
771
|
)
|
|
@@ -749,7 +774,7 @@ class AsyncTestsetsClient:
|
|
|
749
774
|
asyncio.run(main())
|
|
750
775
|
"""
|
|
751
776
|
_response = await self._client_wrapper.httpx_client.request(
|
|
752
|
-
"testsets",
|
|
777
|
+
f"testsets/{jsonable_encoder(app_id)}",
|
|
753
778
|
method="POST",
|
|
754
779
|
json={
|
|
755
780
|
"name": name,
|
|
@@ -949,7 +974,7 @@ class AsyncTestsetsClient:
|
|
|
949
974
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
950
975
|
|
|
951
976
|
async def get_testsets(
|
|
952
|
-
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
977
|
+
self, *, app_id: str, request_options: typing.Optional[RequestOptions] = None
|
|
953
978
|
) -> typing.List[TestSetOutputResponse]:
|
|
954
979
|
"""
|
|
955
980
|
Get all testsets.
|
|
@@ -964,6 +989,8 @@ class AsyncTestsetsClient:
|
|
|
964
989
|
|
|
965
990
|
Parameters
|
|
966
991
|
----------
|
|
992
|
+
app_id : str
|
|
993
|
+
|
|
967
994
|
request_options : typing.Optional[RequestOptions]
|
|
968
995
|
Request-specific configuration.
|
|
969
996
|
|
|
@@ -985,7 +1012,9 @@ class AsyncTestsetsClient:
|
|
|
985
1012
|
|
|
986
1013
|
|
|
987
1014
|
async def main() -> None:
|
|
988
|
-
await client.testsets.get_testsets(
|
|
1015
|
+
await client.testsets.get_testsets(
|
|
1016
|
+
app_id="app_id",
|
|
1017
|
+
)
|
|
989
1018
|
|
|
990
1019
|
|
|
991
1020
|
asyncio.run(main())
|
|
@@ -993,6 +1022,9 @@ class AsyncTestsetsClient:
|
|
|
993
1022
|
_response = await self._client_wrapper.httpx_client.request(
|
|
994
1023
|
"testsets",
|
|
995
1024
|
method="GET",
|
|
1025
|
+
params={
|
|
1026
|
+
"app_id": app_id,
|
|
1027
|
+
},
|
|
996
1028
|
request_options=request_options,
|
|
997
1029
|
)
|
|
998
1030
|
try:
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
|
2
2
|
|
|
3
|
-
from .agenta_node_dto import AgentaNodeDto
|
|
4
|
-
from .agenta_node_dto_nodes_value import AgentaNodeDtoNodesValue
|
|
5
|
-
from .agenta_nodes_response import AgentaNodesResponse
|
|
6
|
-
from .agenta_root_dto import AgentaRootDto
|
|
7
|
-
from .agenta_roots_response import AgentaRootsResponse
|
|
8
|
-
from .agenta_tree_dto import AgentaTreeDto
|
|
9
|
-
from .agenta_trees_response import AgentaTreesResponse
|
|
10
3
|
from .aggregated_result import AggregatedResult
|
|
11
4
|
from .aggregated_result_evaluator_config import AggregatedResultEvaluatorConfig
|
|
12
5
|
from .app import App
|
|
@@ -14,7 +7,6 @@ from .app_variant_response import AppVariantResponse
|
|
|
14
7
|
from .app_variant_revision import AppVariantRevision
|
|
15
8
|
from .base_output import BaseOutput
|
|
16
9
|
from .body_import_testset import BodyImportTestset
|
|
17
|
-
from .collect_status_response import CollectStatusResponse
|
|
18
10
|
from .config_db import ConfigDb
|
|
19
11
|
from .config_dto import ConfigDto
|
|
20
12
|
from .config_response_model import ConfigResponseModel
|
|
@@ -39,7 +31,6 @@ from .evaluator import Evaluator
|
|
|
39
31
|
from .evaluator_config import EvaluatorConfig
|
|
40
32
|
from .evaluator_mapping_output_interface import EvaluatorMappingOutputInterface
|
|
41
33
|
from .evaluator_output_interface import EvaluatorOutputInterface
|
|
42
|
-
from .exception_dto import ExceptionDto
|
|
43
34
|
from .get_config_response import GetConfigResponse
|
|
44
35
|
from .http_validation_error import HttpValidationError
|
|
45
36
|
from .human_evaluation import HumanEvaluation
|
|
@@ -51,50 +42,30 @@ from .human_evaluation_update import HumanEvaluationUpdate
|
|
|
51
42
|
from .image import Image
|
|
52
43
|
from .invite_request import InviteRequest
|
|
53
44
|
from .lifecycle_dto import LifecycleDto
|
|
54
|
-
from .link_dto import LinkDto
|
|
55
45
|
from .list_api_keys_response import ListApiKeysResponse
|
|
56
46
|
from .llm_run_rate_limit import LlmRunRateLimit
|
|
57
47
|
from .llm_tokens import LlmTokens
|
|
58
48
|
from .lm_providers_enum import LmProvidersEnum
|
|
59
49
|
from .new_human_evaluation import NewHumanEvaluation
|
|
60
50
|
from .new_testset import NewTestset
|
|
61
|
-
from .node_dto import NodeDto
|
|
62
|
-
from .node_type import NodeType
|
|
63
|
-
from .o_tel_context_dto import OTelContextDto
|
|
64
|
-
from .o_tel_event_dto import OTelEventDto
|
|
65
|
-
from .o_tel_extra_dto import OTelExtraDto
|
|
66
|
-
from .o_tel_link_dto import OTelLinkDto
|
|
67
|
-
from .o_tel_span_dto import OTelSpanDto
|
|
68
|
-
from .o_tel_span_kind import OTelSpanKind
|
|
69
|
-
from .o_tel_spans_response import OTelSpansResponse
|
|
70
|
-
from .o_tel_status_code import OTelStatusCode
|
|
71
51
|
from .organization import Organization
|
|
72
52
|
from .organization_output import OrganizationOutput
|
|
73
53
|
from .outputs import Outputs
|
|
74
|
-
from .parent_dto import ParentDto
|
|
75
54
|
from .permission import Permission
|
|
76
55
|
from .reference_dto import ReferenceDto
|
|
77
56
|
from .reference_request_model import ReferenceRequestModel
|
|
78
57
|
from .result import Result
|
|
79
|
-
from .root_dto import RootDto
|
|
80
58
|
from .score import Score
|
|
81
59
|
from .simple_evaluation_output import SimpleEvaluationOutput
|
|
82
60
|
from .span import Span
|
|
83
61
|
from .span_detail import SpanDetail
|
|
84
|
-
from .span_dto import SpanDto
|
|
85
|
-
from .span_dto_nodes_value import SpanDtoNodesValue
|
|
86
62
|
from .span_status_code import SpanStatusCode
|
|
87
63
|
from .span_variant import SpanVariant
|
|
88
|
-
from .status_code import StatusCode
|
|
89
|
-
from .status_dto import StatusDto
|
|
90
64
|
from .template import Template
|
|
91
65
|
from .template_image_info import TemplateImageInfo
|
|
92
66
|
from .test_set_output_response import TestSetOutputResponse
|
|
93
67
|
from .test_set_simple_response import TestSetSimpleResponse
|
|
94
|
-
from .time_dto import TimeDto
|
|
95
68
|
from .trace_detail import TraceDetail
|
|
96
|
-
from .tree_dto import TreeDto
|
|
97
|
-
from .tree_type import TreeType
|
|
98
69
|
from .update_app_output import UpdateAppOutput
|
|
99
70
|
from .uri import Uri
|
|
100
71
|
from .validation_error import ValidationError
|
|
@@ -109,13 +80,6 @@ from .workspace_role import WorkspaceRole
|
|
|
109
80
|
from .workspace_role_response import WorkspaceRoleResponse
|
|
110
81
|
|
|
111
82
|
__all__ = [
|
|
112
|
-
"AgentaNodeDto",
|
|
113
|
-
"AgentaNodeDtoNodesValue",
|
|
114
|
-
"AgentaNodesResponse",
|
|
115
|
-
"AgentaRootDto",
|
|
116
|
-
"AgentaRootsResponse",
|
|
117
|
-
"AgentaTreeDto",
|
|
118
|
-
"AgentaTreesResponse",
|
|
119
83
|
"AggregatedResult",
|
|
120
84
|
"AggregatedResultEvaluatorConfig",
|
|
121
85
|
"App",
|
|
@@ -123,7 +87,6 @@ __all__ = [
|
|
|
123
87
|
"AppVariantRevision",
|
|
124
88
|
"BaseOutput",
|
|
125
89
|
"BodyImportTestset",
|
|
126
|
-
"CollectStatusResponse",
|
|
127
90
|
"ConfigDb",
|
|
128
91
|
"ConfigDto",
|
|
129
92
|
"ConfigResponseModel",
|
|
@@ -148,7 +111,6 @@ __all__ = [
|
|
|
148
111
|
"EvaluatorConfig",
|
|
149
112
|
"EvaluatorMappingOutputInterface",
|
|
150
113
|
"EvaluatorOutputInterface",
|
|
151
|
-
"ExceptionDto",
|
|
152
114
|
"GetConfigResponse",
|
|
153
115
|
"HttpValidationError",
|
|
154
116
|
"HumanEvaluation",
|
|
@@ -160,50 +122,30 @@ __all__ = [
|
|
|
160
122
|
"Image",
|
|
161
123
|
"InviteRequest",
|
|
162
124
|
"LifecycleDto",
|
|
163
|
-
"LinkDto",
|
|
164
125
|
"ListApiKeysResponse",
|
|
165
126
|
"LlmRunRateLimit",
|
|
166
127
|
"LlmTokens",
|
|
167
128
|
"LmProvidersEnum",
|
|
168
129
|
"NewHumanEvaluation",
|
|
169
130
|
"NewTestset",
|
|
170
|
-
"NodeDto",
|
|
171
|
-
"NodeType",
|
|
172
|
-
"OTelContextDto",
|
|
173
|
-
"OTelEventDto",
|
|
174
|
-
"OTelExtraDto",
|
|
175
|
-
"OTelLinkDto",
|
|
176
|
-
"OTelSpanDto",
|
|
177
|
-
"OTelSpanKind",
|
|
178
|
-
"OTelSpansResponse",
|
|
179
|
-
"OTelStatusCode",
|
|
180
131
|
"Organization",
|
|
181
132
|
"OrganizationOutput",
|
|
182
133
|
"Outputs",
|
|
183
|
-
"ParentDto",
|
|
184
134
|
"Permission",
|
|
185
135
|
"ReferenceDto",
|
|
186
136
|
"ReferenceRequestModel",
|
|
187
137
|
"Result",
|
|
188
|
-
"RootDto",
|
|
189
138
|
"Score",
|
|
190
139
|
"SimpleEvaluationOutput",
|
|
191
140
|
"Span",
|
|
192
141
|
"SpanDetail",
|
|
193
|
-
"SpanDto",
|
|
194
|
-
"SpanDtoNodesValue",
|
|
195
142
|
"SpanStatusCode",
|
|
196
143
|
"SpanVariant",
|
|
197
|
-
"StatusCode",
|
|
198
|
-
"StatusDto",
|
|
199
144
|
"Template",
|
|
200
145
|
"TemplateImageInfo",
|
|
201
146
|
"TestSetOutputResponse",
|
|
202
147
|
"TestSetSimpleResponse",
|
|
203
|
-
"TimeDto",
|
|
204
148
|
"TraceDetail",
|
|
205
|
-
"TreeDto",
|
|
206
|
-
"TreeType",
|
|
207
149
|
"UpdateAppOutput",
|
|
208
150
|
"Uri",
|
|
209
151
|
"ValidationError",
|
|
@@ -1104,14 +1104,14 @@ class VariantsClient:
|
|
|
1104
1104
|
def configs_delete(
|
|
1105
1105
|
self,
|
|
1106
1106
|
*,
|
|
1107
|
-
variant_ref: ReferenceRequestModel,
|
|
1107
|
+
variant_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
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 : ReferenceRequestModel
|
|
1114
|
+
variant_ref : typing.Optional[ReferenceRequestModel]
|
|
1115
1115
|
|
|
1116
1116
|
application_ref : typing.Optional[ReferenceRequestModel]
|
|
1117
1117
|
|
|
@@ -1125,15 +1125,13 @@ class VariantsClient:
|
|
|
1125
1125
|
|
|
1126
1126
|
Examples
|
|
1127
1127
|
--------
|
|
1128
|
-
from agenta import AgentaApi
|
|
1128
|
+
from agenta import AgentaApi
|
|
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(
|
|
1135
|
-
variant_ref=ReferenceRequestModel(),
|
|
1136
|
-
)
|
|
1134
|
+
client.variants.configs_delete()
|
|
1137
1135
|
"""
|
|
1138
1136
|
_response = self._client_wrapper.httpx_client.request(
|
|
1139
1137
|
"variants/configs/delete",
|
|
@@ -1246,14 +1244,14 @@ class VariantsClient:
|
|
|
1246
1244
|
def configs_history(
|
|
1247
1245
|
self,
|
|
1248
1246
|
*,
|
|
1249
|
-
variant_ref: ReferenceRequestModel,
|
|
1247
|
+
variant_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
1250
1248
|
application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
1251
1249
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1252
1250
|
) -> typing.List[ConfigResponseModel]:
|
|
1253
1251
|
"""
|
|
1254
1252
|
Parameters
|
|
1255
1253
|
----------
|
|
1256
|
-
variant_ref : ReferenceRequestModel
|
|
1254
|
+
variant_ref : typing.Optional[ReferenceRequestModel]
|
|
1257
1255
|
|
|
1258
1256
|
application_ref : typing.Optional[ReferenceRequestModel]
|
|
1259
1257
|
|
|
@@ -1267,15 +1265,13 @@ class VariantsClient:
|
|
|
1267
1265
|
|
|
1268
1266
|
Examples
|
|
1269
1267
|
--------
|
|
1270
|
-
from agenta import AgentaApi
|
|
1268
|
+
from agenta import AgentaApi
|
|
1271
1269
|
|
|
1272
1270
|
client = AgentaApi(
|
|
1273
1271
|
api_key="YOUR_API_KEY",
|
|
1274
1272
|
base_url="https://yourhost.com/path/to/api",
|
|
1275
1273
|
)
|
|
1276
|
-
client.variants.configs_history(
|
|
1277
|
-
variant_ref=ReferenceRequestModel(),
|
|
1278
|
-
)
|
|
1274
|
+
client.variants.configs_history()
|
|
1279
1275
|
"""
|
|
1280
1276
|
_response = self._client_wrapper.httpx_client.request(
|
|
1281
1277
|
"variants/configs/history",
|
|
@@ -2508,14 +2504,14 @@ class AsyncVariantsClient:
|
|
|
2508
2504
|
async def configs_delete(
|
|
2509
2505
|
self,
|
|
2510
2506
|
*,
|
|
2511
|
-
variant_ref: ReferenceRequestModel,
|
|
2507
|
+
variant_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
2512
2508
|
application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
2513
2509
|
request_options: typing.Optional[RequestOptions] = None,
|
|
2514
2510
|
) -> int:
|
|
2515
2511
|
"""
|
|
2516
2512
|
Parameters
|
|
2517
2513
|
----------
|
|
2518
|
-
variant_ref : ReferenceRequestModel
|
|
2514
|
+
variant_ref : typing.Optional[ReferenceRequestModel]
|
|
2519
2515
|
|
|
2520
2516
|
application_ref : typing.Optional[ReferenceRequestModel]
|
|
2521
2517
|
|
|
@@ -2531,7 +2527,7 @@ class AsyncVariantsClient:
|
|
|
2531
2527
|
--------
|
|
2532
2528
|
import asyncio
|
|
2533
2529
|
|
|
2534
|
-
from agenta import AsyncAgentaApi
|
|
2530
|
+
from agenta import AsyncAgentaApi
|
|
2535
2531
|
|
|
2536
2532
|
client = AsyncAgentaApi(
|
|
2537
2533
|
api_key="YOUR_API_KEY",
|
|
@@ -2540,9 +2536,7 @@ class AsyncVariantsClient:
|
|
|
2540
2536
|
|
|
2541
2537
|
|
|
2542
2538
|
async def main() -> None:
|
|
2543
|
-
await client.variants.configs_delete(
|
|
2544
|
-
variant_ref=ReferenceRequestModel(),
|
|
2545
|
-
)
|
|
2539
|
+
await client.variants.configs_delete()
|
|
2546
2540
|
|
|
2547
2541
|
|
|
2548
2542
|
asyncio.run(main())
|
|
@@ -2666,14 +2660,14 @@ class AsyncVariantsClient:
|
|
|
2666
2660
|
async def configs_history(
|
|
2667
2661
|
self,
|
|
2668
2662
|
*,
|
|
2669
|
-
variant_ref: ReferenceRequestModel,
|
|
2663
|
+
variant_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
2670
2664
|
application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
|
|
2671
2665
|
request_options: typing.Optional[RequestOptions] = None,
|
|
2672
2666
|
) -> typing.List[ConfigResponseModel]:
|
|
2673
2667
|
"""
|
|
2674
2668
|
Parameters
|
|
2675
2669
|
----------
|
|
2676
|
-
variant_ref : ReferenceRequestModel
|
|
2670
|
+
variant_ref : typing.Optional[ReferenceRequestModel]
|
|
2677
2671
|
|
|
2678
2672
|
application_ref : typing.Optional[ReferenceRequestModel]
|
|
2679
2673
|
|
|
@@ -2689,7 +2683,7 @@ class AsyncVariantsClient:
|
|
|
2689
2683
|
--------
|
|
2690
2684
|
import asyncio
|
|
2691
2685
|
|
|
2692
|
-
from agenta import AsyncAgentaApi
|
|
2686
|
+
from agenta import AsyncAgentaApi
|
|
2693
2687
|
|
|
2694
2688
|
client = AsyncAgentaApi(
|
|
2695
2689
|
api_key="YOUR_API_KEY",
|
|
@@ -2698,9 +2692,7 @@ class AsyncVariantsClient:
|
|
|
2698
2692
|
|
|
2699
2693
|
|
|
2700
2694
|
async def main() -> None:
|
|
2701
|
-
await client.variants.configs_history(
|
|
2702
|
-
variant_ref=ReferenceRequestModel(),
|
|
2703
|
-
)
|
|
2695
|
+
await client.variants.configs_history()
|
|
2704
2696
|
|
|
2705
2697
|
|
|
2706
2698
|
asyncio.run(main())
|
agenta/sdk/__init__.py
CHANGED
agenta/sdk/agenta_init.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
import toml
|
|
2
3
|
from os import getenv
|
|
3
4
|
from typing import Optional, Callable, Any
|
|
@@ -10,6 +11,10 @@ from agenta.sdk.tracing import Tracing
|
|
|
10
11
|
from agenta.client.exceptions import APIRequestError
|
|
11
12
|
|
|
12
13
|
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
logger.setLevel(logging.DEBUG)
|
|
16
|
+
|
|
17
|
+
|
|
13
18
|
class AgentaSingleton:
|
|
14
19
|
"""Singleton class to save all the "global variables" for the sdk."""
|
|
15
20
|
|
|
@@ -159,7 +164,7 @@ class Config:
|
|
|
159
164
|
try:
|
|
160
165
|
self.push(config_name="default", overwrite=overwrite, **kwargs)
|
|
161
166
|
except Exception as ex:
|
|
162
|
-
|
|
167
|
+
logger.warning(
|
|
163
168
|
"Unable to push the default configuration to the server. %s", str(ex)
|
|
164
169
|
)
|
|
165
170
|
|
|
@@ -180,7 +185,7 @@ class Config:
|
|
|
180
185
|
overwrite=overwrite,
|
|
181
186
|
)
|
|
182
187
|
except Exception as ex:
|
|
183
|
-
|
|
188
|
+
logger.warning(
|
|
184
189
|
"Failed to push the configuration to the server with error: %s", ex
|
|
185
190
|
)
|
|
186
191
|
|
|
@@ -207,14 +212,14 @@ class Config:
|
|
|
207
212
|
config_name=config_name,
|
|
208
213
|
)
|
|
209
214
|
except Exception as ex:
|
|
210
|
-
|
|
215
|
+
logger.warning(
|
|
211
216
|
"Failed to pull the configuration from the server with error: %s",
|
|
212
217
|
str(ex),
|
|
213
218
|
)
|
|
214
219
|
try:
|
|
215
220
|
self.set(**{"current_version": config.current_version, **config.parameters})
|
|
216
221
|
except Exception as ex:
|
|
217
|
-
|
|
222
|
+
logger.warning("Failed to set the configuration with error: %s", str(ex))
|
|
218
223
|
|
|
219
224
|
def all(self):
|
|
220
225
|
"""Returns all the parameters for the app variant"""
|