agenta 0.13.0a0__py3-none-any.whl → 0.13.0a1__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/__init__.py +1 -0
- agenta/client/backend/client.py +169 -50
- agenta/client/backend/core/api_error.py +3 -1
- agenta/client/backend/core/datetime_utils.py +3 -1
- agenta/client/backend/core/jsonable_encoder.py +9 -3
- agenta/client/backend/resources/__init__.py +12 -1
- agenta/client/backend/resources/apps/__init__.py +0 -1
- agenta/client/backend/resources/apps/client.py +88 -26
- agenta/client/backend/resources/bases/__init__.py +0 -1
- agenta/client/backend/resources/bases/client.py +8 -2
- agenta/client/backend/resources/configs/__init__.py +0 -1
- agenta/client/backend/resources/configs/client.py +58 -14
- agenta/client/backend/resources/containers/client.py +46 -14
- agenta/client/backend/resources/environments/__init__.py +0 -1
- agenta/client/backend/resources/environments/client.py +18 -6
- agenta/client/backend/resources/evaluations/__init__.py +0 -1
- agenta/client/backend/resources/evaluations/client.py +86 -26
- agenta/client/backend/resources/evaluators/__init__.py +0 -1
- agenta/client/backend/resources/evaluators/client.py +57 -17
- agenta/client/backend/resources/observability/__init__.py +0 -1
- agenta/client/backend/resources/observability/client.py +100 -30
- agenta/client/backend/resources/testsets/__init__.py +0 -1
- agenta/client/backend/resources/testsets/client.py +56 -16
- agenta/client/backend/resources/variants/client.py +92 -26
- agenta/client/backend/resources/variants/types/__init__.py +3 -1
- agenta/client/backend/types/aggregated_result.py +10 -2
- agenta/client/backend/types/aggregated_result_evaluator_config.py +3 -1
- agenta/client/backend/types/app.py +10 -2
- agenta/client/backend/types/app_variant_response.py +10 -2
- agenta/client/backend/types/app_variant_revision.py +10 -2
- agenta/client/backend/types/base_output.py +10 -2
- agenta/client/backend/types/body_import_testset.py +10 -2
- agenta/client/backend/types/config_db.py +10 -2
- agenta/client/backend/types/create_app_output.py +10 -2
- agenta/client/backend/types/create_span.py +10 -2
- agenta/client/backend/types/create_trace_response.py +10 -2
- agenta/client/backend/types/docker_env_vars.py +10 -2
- agenta/client/backend/types/environment_output.py +10 -2
- agenta/client/backend/types/environment_output_extended.py +10 -2
- agenta/client/backend/types/environment_revision.py +10 -2
- agenta/client/backend/types/error.py +10 -2
- agenta/client/backend/types/evaluation.py +10 -2
- agenta/client/backend/types/evaluation_scenario.py +10 -2
- agenta/client/backend/types/evaluation_scenario_input.py +10 -2
- agenta/client/backend/types/evaluation_scenario_output.py +10 -2
- agenta/client/backend/types/evaluation_scenario_result.py +10 -2
- agenta/client/backend/types/evaluation_scenario_score_update.py +10 -2
- agenta/client/backend/types/evaluation_type.py +3 -1
- agenta/client/backend/types/evaluation_webhook.py +10 -2
- agenta/client/backend/types/evaluator.py +10 -2
- agenta/client/backend/types/evaluator_config.py +10 -2
- agenta/client/backend/types/feedback.py +10 -2
- agenta/client/backend/types/get_config_response.py +10 -2
- agenta/client/backend/types/http_validation_error.py +10 -2
- agenta/client/backend/types/human_evaluation.py +10 -2
- agenta/client/backend/types/human_evaluation_scenario.py +10 -2
- agenta/client/backend/types/human_evaluation_scenario_input.py +10 -2
- agenta/client/backend/types/human_evaluation_scenario_output.py +10 -2
- agenta/client/backend/types/human_evaluation_scenario_update.py +10 -2
- agenta/client/backend/types/human_evaluation_update.py +10 -2
- agenta/client/backend/types/image.py +10 -2
- agenta/client/backend/types/invite_request.py +10 -2
- agenta/client/backend/types/list_api_keys_response.py +10 -2
- agenta/client/backend/types/llm_run_rate_limit.py +10 -2
- agenta/client/backend/types/llm_tokens.py +10 -2
- agenta/client/backend/types/new_human_evaluation.py +10 -2
- agenta/client/backend/types/new_testset.py +10 -2
- agenta/client/backend/types/organization.py +10 -2
- agenta/client/backend/types/organization_output.py +10 -2
- agenta/client/backend/types/result.py +10 -2
- agenta/client/backend/types/simple_evaluation_output.py +10 -2
- agenta/client/backend/types/span.py +10 -2
- agenta/client/backend/types/span_detail.py +10 -2
- agenta/client/backend/types/span_variant.py +10 -2
- agenta/client/backend/types/template.py +10 -2
- agenta/client/backend/types/template_image_info.py +10 -2
- agenta/client/backend/types/test_set_output_response.py +10 -2
- agenta/client/backend/types/test_set_simple_response.py +10 -2
- agenta/client/backend/types/trace_detail.py +10 -2
- agenta/client/backend/types/uri.py +10 -2
- agenta/client/backend/types/validation_error.py +10 -2
- agenta/client/backend/types/variant_action.py +10 -2
- agenta/client/backend/types/variant_action_enum.py +3 -1
- agenta/client/backend/types/with_pagination.py +10 -2
- agenta/client/backend/types/workspace_member_response.py +10 -2
- agenta/client/backend/types/workspace_permission.py +10 -2
- agenta/client/backend/types/workspace_response.py +10 -2
- agenta/client/backend/types/workspace_role_response.py +10 -2
- agenta/sdk/__init__.py +1 -0
- agenta/sdk/agenta_decorator.py +11 -3
- agenta/sdk/tracing/llm_tracing.py +31 -18
- agenta/sdk/types.py +38 -0
- {agenta-0.13.0a0.dist-info → agenta-0.13.0a1.dist-info}/METADATA +46 -96
- agenta-0.13.0a1.dist-info/RECORD +161 -0
- agenta-0.13.0a0.dist-info/RECORD +0 -161
- {agenta-0.13.0a0.dist-info → agenta-0.13.0a1.dist-info}/WHEEL +0 -0
- {agenta-0.13.0a0.dist-info → agenta-0.13.0a1.dist-info}/entry_points.txt +0 -0
|
@@ -60,9 +60,16 @@ class ObservabilityClient:
|
|
|
60
60
|
"""
|
|
61
61
|
_response = self._client_wrapper.httpx_client.request(
|
|
62
62
|
"GET",
|
|
63
|
-
urllib.parse.urljoin(
|
|
63
|
+
urllib.parse.urljoin(
|
|
64
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/dashboard"
|
|
65
|
+
),
|
|
64
66
|
params=remove_none_from_dict(
|
|
65
|
-
{
|
|
67
|
+
{
|
|
68
|
+
"app_id": app_id,
|
|
69
|
+
"timeRange": time_range,
|
|
70
|
+
"environment": environment,
|
|
71
|
+
"variant": variant,
|
|
72
|
+
}
|
|
66
73
|
),
|
|
67
74
|
headers=self._client_wrapper.get_headers(),
|
|
68
75
|
timeout=60,
|
|
@@ -119,7 +126,9 @@ class ObservabilityClient:
|
|
|
119
126
|
"""
|
|
120
127
|
_response = self._client_wrapper.httpx_client.request(
|
|
121
128
|
"GET",
|
|
122
|
-
urllib.parse.urljoin(
|
|
129
|
+
urllib.parse.urljoin(
|
|
130
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/traces"
|
|
131
|
+
),
|
|
123
132
|
params=remove_none_from_dict(
|
|
124
133
|
{
|
|
125
134
|
"app_id": app_id,
|
|
@@ -145,7 +154,9 @@ class ObservabilityClient:
|
|
|
145
154
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
146
155
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
147
156
|
|
|
148
|
-
def create_traces(
|
|
157
|
+
def create_traces(
|
|
158
|
+
self, *, trace: str, spans: typing.List[CreateSpan]
|
|
159
|
+
) -> CreateTraceResponse:
|
|
149
160
|
"""
|
|
150
161
|
Parameters:
|
|
151
162
|
- trace: str.
|
|
@@ -181,7 +192,9 @@ class ObservabilityClient:
|
|
|
181
192
|
"""
|
|
182
193
|
_response = self._client_wrapper.httpx_client.request(
|
|
183
194
|
"POST",
|
|
184
|
-
urllib.parse.urljoin(
|
|
195
|
+
urllib.parse.urljoin(
|
|
196
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/trace/"
|
|
197
|
+
),
|
|
185
198
|
json=jsonable_encoder({"trace": trace, "spans": spans}),
|
|
186
199
|
headers=self._client_wrapper.get_headers(),
|
|
187
200
|
timeout=60,
|
|
@@ -213,7 +226,9 @@ class ObservabilityClient:
|
|
|
213
226
|
"""
|
|
214
227
|
_response = self._client_wrapper.httpx_client.request(
|
|
215
228
|
"DELETE",
|
|
216
|
-
urllib.parse.urljoin(
|
|
229
|
+
urllib.parse.urljoin(
|
|
230
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/traces"
|
|
231
|
+
),
|
|
217
232
|
json=jsonable_encoder(request),
|
|
218
233
|
headers=self._client_wrapper.get_headers(),
|
|
219
234
|
timeout=60,
|
|
@@ -245,7 +260,10 @@ class ObservabilityClient:
|
|
|
245
260
|
"""
|
|
246
261
|
_response = self._client_wrapper.httpx_client.request(
|
|
247
262
|
"GET",
|
|
248
|
-
urllib.parse.urljoin(
|
|
263
|
+
urllib.parse.urljoin(
|
|
264
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
265
|
+
f"observability/traces/{trace_id}",
|
|
266
|
+
),
|
|
249
267
|
headers=self._client_wrapper.get_headers(),
|
|
250
268
|
timeout=60,
|
|
251
269
|
)
|
|
@@ -301,7 +319,9 @@ class ObservabilityClient:
|
|
|
301
319
|
"""
|
|
302
320
|
_response = self._client_wrapper.httpx_client.request(
|
|
303
321
|
"GET",
|
|
304
|
-
urllib.parse.urljoin(
|
|
322
|
+
urllib.parse.urljoin(
|
|
323
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/spans"
|
|
324
|
+
),
|
|
305
325
|
params=remove_none_from_dict(
|
|
306
326
|
{
|
|
307
327
|
"app_id": app_id,
|
|
@@ -344,7 +364,9 @@ class ObservabilityClient:
|
|
|
344
364
|
"""
|
|
345
365
|
_response = self._client_wrapper.httpx_client.request(
|
|
346
366
|
"DELETE",
|
|
347
|
-
urllib.parse.urljoin(
|
|
367
|
+
urllib.parse.urljoin(
|
|
368
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/spans"
|
|
369
|
+
),
|
|
348
370
|
json=jsonable_encoder(request),
|
|
349
371
|
headers=self._client_wrapper.get_headers(),
|
|
350
372
|
timeout=60,
|
|
@@ -359,7 +381,9 @@ class ObservabilityClient:
|
|
|
359
381
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
360
382
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
361
383
|
|
|
362
|
-
def get_span_of_generation(
|
|
384
|
+
def get_span_of_generation(
|
|
385
|
+
self, span_id: str, *, type: typing.Optional[str] = None
|
|
386
|
+
) -> SpanDetail:
|
|
363
387
|
"""
|
|
364
388
|
Parameters:
|
|
365
389
|
- span_id: str.
|
|
@@ -378,7 +402,10 @@ class ObservabilityClient:
|
|
|
378
402
|
"""
|
|
379
403
|
_response = self._client_wrapper.httpx_client.request(
|
|
380
404
|
"GET",
|
|
381
|
-
urllib.parse.urljoin(
|
|
405
|
+
urllib.parse.urljoin(
|
|
406
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
407
|
+
f"observability/spans/{span_id}",
|
|
408
|
+
),
|
|
382
409
|
params=remove_none_from_dict({"type": type}),
|
|
383
410
|
headers=self._client_wrapper.get_headers(),
|
|
384
411
|
timeout=60,
|
|
@@ -410,7 +437,10 @@ class ObservabilityClient:
|
|
|
410
437
|
"""
|
|
411
438
|
_response = self._client_wrapper.httpx_client.request(
|
|
412
439
|
"GET",
|
|
413
|
-
urllib.parse.urljoin(
|
|
440
|
+
urllib.parse.urljoin(
|
|
441
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
442
|
+
f"observability/feedbacks/{trace_id}",
|
|
443
|
+
),
|
|
414
444
|
headers=self._client_wrapper.get_headers(),
|
|
415
445
|
timeout=60,
|
|
416
446
|
)
|
|
@@ -461,7 +491,10 @@ class ObservabilityClient:
|
|
|
461
491
|
_request["meta"] = meta
|
|
462
492
|
_response = self._client_wrapper.httpx_client.request(
|
|
463
493
|
"POST",
|
|
464
|
-
urllib.parse.urljoin(
|
|
494
|
+
urllib.parse.urljoin(
|
|
495
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
496
|
+
f"observability/feedbacks/{trace_id}",
|
|
497
|
+
),
|
|
465
498
|
json=jsonable_encoder(_request),
|
|
466
499
|
headers=self._client_wrapper.get_headers(),
|
|
467
500
|
timeout=60,
|
|
@@ -497,7 +530,8 @@ class ObservabilityClient:
|
|
|
497
530
|
_response = self._client_wrapper.httpx_client.request(
|
|
498
531
|
"GET",
|
|
499
532
|
urllib.parse.urljoin(
|
|
500
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
533
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
534
|
+
f"observability/feedbacks/{trace_id}/{feedback_id}",
|
|
501
535
|
),
|
|
502
536
|
headers=self._client_wrapper.get_headers(),
|
|
503
537
|
timeout=60,
|
|
@@ -553,7 +587,8 @@ class ObservabilityClient:
|
|
|
553
587
|
_response = self._client_wrapper.httpx_client.request(
|
|
554
588
|
"PUT",
|
|
555
589
|
urllib.parse.urljoin(
|
|
556
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
590
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
591
|
+
f"observability/feedbacks/{trace_id}/{feedback_id}",
|
|
557
592
|
),
|
|
558
593
|
json=jsonable_encoder(_request),
|
|
559
594
|
headers=self._client_wrapper.get_headers(),
|
|
@@ -604,9 +639,16 @@ class AsyncObservabilityClient:
|
|
|
604
639
|
"""
|
|
605
640
|
_response = await self._client_wrapper.httpx_client.request(
|
|
606
641
|
"GET",
|
|
607
|
-
urllib.parse.urljoin(
|
|
642
|
+
urllib.parse.urljoin(
|
|
643
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/dashboard"
|
|
644
|
+
),
|
|
608
645
|
params=remove_none_from_dict(
|
|
609
|
-
{
|
|
646
|
+
{
|
|
647
|
+
"app_id": app_id,
|
|
648
|
+
"timeRange": time_range,
|
|
649
|
+
"environment": environment,
|
|
650
|
+
"variant": variant,
|
|
651
|
+
}
|
|
610
652
|
),
|
|
611
653
|
headers=self._client_wrapper.get_headers(),
|
|
612
654
|
timeout=60,
|
|
@@ -663,7 +705,9 @@ class AsyncObservabilityClient:
|
|
|
663
705
|
"""
|
|
664
706
|
_response = await self._client_wrapper.httpx_client.request(
|
|
665
707
|
"GET",
|
|
666
|
-
urllib.parse.urljoin(
|
|
708
|
+
urllib.parse.urljoin(
|
|
709
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/traces"
|
|
710
|
+
),
|
|
667
711
|
params=remove_none_from_dict(
|
|
668
712
|
{
|
|
669
713
|
"app_id": app_id,
|
|
@@ -689,7 +733,9 @@ class AsyncObservabilityClient:
|
|
|
689
733
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
690
734
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
691
735
|
|
|
692
|
-
async def create_traces(
|
|
736
|
+
async def create_traces(
|
|
737
|
+
self, *, trace: str, spans: typing.List[CreateSpan]
|
|
738
|
+
) -> CreateTraceResponse:
|
|
693
739
|
"""
|
|
694
740
|
Parameters:
|
|
695
741
|
- trace: str.
|
|
@@ -725,7 +771,9 @@ class AsyncObservabilityClient:
|
|
|
725
771
|
"""
|
|
726
772
|
_response = await self._client_wrapper.httpx_client.request(
|
|
727
773
|
"POST",
|
|
728
|
-
urllib.parse.urljoin(
|
|
774
|
+
urllib.parse.urljoin(
|
|
775
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/trace/"
|
|
776
|
+
),
|
|
729
777
|
json=jsonable_encoder({"trace": trace, "spans": spans}),
|
|
730
778
|
headers=self._client_wrapper.get_headers(),
|
|
731
779
|
timeout=60,
|
|
@@ -757,7 +805,9 @@ class AsyncObservabilityClient:
|
|
|
757
805
|
"""
|
|
758
806
|
_response = await self._client_wrapper.httpx_client.request(
|
|
759
807
|
"DELETE",
|
|
760
|
-
urllib.parse.urljoin(
|
|
808
|
+
urllib.parse.urljoin(
|
|
809
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/traces"
|
|
810
|
+
),
|
|
761
811
|
json=jsonable_encoder(request),
|
|
762
812
|
headers=self._client_wrapper.get_headers(),
|
|
763
813
|
timeout=60,
|
|
@@ -789,7 +839,10 @@ class AsyncObservabilityClient:
|
|
|
789
839
|
"""
|
|
790
840
|
_response = await self._client_wrapper.httpx_client.request(
|
|
791
841
|
"GET",
|
|
792
|
-
urllib.parse.urljoin(
|
|
842
|
+
urllib.parse.urljoin(
|
|
843
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
844
|
+
f"observability/traces/{trace_id}",
|
|
845
|
+
),
|
|
793
846
|
headers=self._client_wrapper.get_headers(),
|
|
794
847
|
timeout=60,
|
|
795
848
|
)
|
|
@@ -845,7 +898,9 @@ class AsyncObservabilityClient:
|
|
|
845
898
|
"""
|
|
846
899
|
_response = await self._client_wrapper.httpx_client.request(
|
|
847
900
|
"GET",
|
|
848
|
-
urllib.parse.urljoin(
|
|
901
|
+
urllib.parse.urljoin(
|
|
902
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/spans"
|
|
903
|
+
),
|
|
849
904
|
params=remove_none_from_dict(
|
|
850
905
|
{
|
|
851
906
|
"app_id": app_id,
|
|
@@ -888,7 +943,9 @@ class AsyncObservabilityClient:
|
|
|
888
943
|
"""
|
|
889
944
|
_response = await self._client_wrapper.httpx_client.request(
|
|
890
945
|
"DELETE",
|
|
891
|
-
urllib.parse.urljoin(
|
|
946
|
+
urllib.parse.urljoin(
|
|
947
|
+
f"{self._client_wrapper.get_base_url()}/", "observability/spans"
|
|
948
|
+
),
|
|
892
949
|
json=jsonable_encoder(request),
|
|
893
950
|
headers=self._client_wrapper.get_headers(),
|
|
894
951
|
timeout=60,
|
|
@@ -903,7 +960,9 @@ class AsyncObservabilityClient:
|
|
|
903
960
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
904
961
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
905
962
|
|
|
906
|
-
async def get_span_of_generation(
|
|
963
|
+
async def get_span_of_generation(
|
|
964
|
+
self, span_id: str, *, type: typing.Optional[str] = None
|
|
965
|
+
) -> SpanDetail:
|
|
907
966
|
"""
|
|
908
967
|
Parameters:
|
|
909
968
|
- span_id: str.
|
|
@@ -922,7 +981,10 @@ class AsyncObservabilityClient:
|
|
|
922
981
|
"""
|
|
923
982
|
_response = await self._client_wrapper.httpx_client.request(
|
|
924
983
|
"GET",
|
|
925
|
-
urllib.parse.urljoin(
|
|
984
|
+
urllib.parse.urljoin(
|
|
985
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
986
|
+
f"observability/spans/{span_id}",
|
|
987
|
+
),
|
|
926
988
|
params=remove_none_from_dict({"type": type}),
|
|
927
989
|
headers=self._client_wrapper.get_headers(),
|
|
928
990
|
timeout=60,
|
|
@@ -954,7 +1016,10 @@ class AsyncObservabilityClient:
|
|
|
954
1016
|
"""
|
|
955
1017
|
_response = await self._client_wrapper.httpx_client.request(
|
|
956
1018
|
"GET",
|
|
957
|
-
urllib.parse.urljoin(
|
|
1019
|
+
urllib.parse.urljoin(
|
|
1020
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1021
|
+
f"observability/feedbacks/{trace_id}",
|
|
1022
|
+
),
|
|
958
1023
|
headers=self._client_wrapper.get_headers(),
|
|
959
1024
|
timeout=60,
|
|
960
1025
|
)
|
|
@@ -1005,7 +1070,10 @@ class AsyncObservabilityClient:
|
|
|
1005
1070
|
_request["meta"] = meta
|
|
1006
1071
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1007
1072
|
"POST",
|
|
1008
|
-
urllib.parse.urljoin(
|
|
1073
|
+
urllib.parse.urljoin(
|
|
1074
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1075
|
+
f"observability/feedbacks/{trace_id}",
|
|
1076
|
+
),
|
|
1009
1077
|
json=jsonable_encoder(_request),
|
|
1010
1078
|
headers=self._client_wrapper.get_headers(),
|
|
1011
1079
|
timeout=60,
|
|
@@ -1041,7 +1109,8 @@ class AsyncObservabilityClient:
|
|
|
1041
1109
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1042
1110
|
"GET",
|
|
1043
1111
|
urllib.parse.urljoin(
|
|
1044
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
1112
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1113
|
+
f"observability/feedbacks/{trace_id}/{feedback_id}",
|
|
1045
1114
|
),
|
|
1046
1115
|
headers=self._client_wrapper.get_headers(),
|
|
1047
1116
|
timeout=60,
|
|
@@ -1097,7 +1166,8 @@ class AsyncObservabilityClient:
|
|
|
1097
1166
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1098
1167
|
"PUT",
|
|
1099
1168
|
urllib.parse.urljoin(
|
|
1100
|
-
f"{self._client_wrapper.get_base_url()}/",
|
|
1169
|
+
f"{self._client_wrapper.get_base_url()}/",
|
|
1170
|
+
f"observability/feedbacks/{trace_id}/{feedback_id}",
|
|
1101
1171
|
),
|
|
1102
1172
|
json=jsonable_encoder(_request),
|
|
1103
1173
|
headers=self._client_wrapper.get_headers(),
|
|
@@ -65,8 +65,16 @@ class TestsetsClient:
|
|
|
65
65
|
"""
|
|
66
66
|
_response = self._client_wrapper.httpx_client.request(
|
|
67
67
|
"POST",
|
|
68
|
-
urllib.parse.urljoin(
|
|
69
|
-
|
|
68
|
+
urllib.parse.urljoin(
|
|
69
|
+
f"{self._client_wrapper.get_base_url()}/", "testsets/upload"
|
|
70
|
+
),
|
|
71
|
+
data=jsonable_encoder(
|
|
72
|
+
{
|
|
73
|
+
"upload_type": upload_type,
|
|
74
|
+
"testset_name": testset_name,
|
|
75
|
+
"app_id": app_id,
|
|
76
|
+
}
|
|
77
|
+
),
|
|
70
78
|
files={"file": file},
|
|
71
79
|
headers=self._client_wrapper.get_headers(),
|
|
72
80
|
timeout=60,
|
|
@@ -103,7 +111,9 @@ class TestsetsClient:
|
|
|
103
111
|
"""
|
|
104
112
|
_response = self._client_wrapper.httpx_client.request(
|
|
105
113
|
"POST",
|
|
106
|
-
urllib.parse.urljoin(
|
|
114
|
+
urllib.parse.urljoin(
|
|
115
|
+
f"{self._client_wrapper.get_base_url()}/", "testsets/endpoint"
|
|
116
|
+
),
|
|
107
117
|
headers=self._client_wrapper.get_headers(),
|
|
108
118
|
timeout=60,
|
|
109
119
|
)
|
|
@@ -117,7 +127,9 @@ class TestsetsClient:
|
|
|
117
127
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
118
128
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
119
129
|
|
|
120
|
-
def create_testset(
|
|
130
|
+
def create_testset(
|
|
131
|
+
self, app_id: str, *, request: NewTestset
|
|
132
|
+
) -> TestSetSimpleResponse:
|
|
121
133
|
"""
|
|
122
134
|
Create a testset with given name and app_name, save the testset to MongoDB.
|
|
123
135
|
|
|
@@ -151,7 +163,9 @@ class TestsetsClient:
|
|
|
151
163
|
"""
|
|
152
164
|
_response = self._client_wrapper.httpx_client.request(
|
|
153
165
|
"POST",
|
|
154
|
-
urllib.parse.urljoin(
|
|
166
|
+
urllib.parse.urljoin(
|
|
167
|
+
f"{self._client_wrapper.get_base_url()}/", f"testsets/{app_id}"
|
|
168
|
+
),
|
|
155
169
|
json=jsonable_encoder(request),
|
|
156
170
|
headers=self._client_wrapper.get_headers(),
|
|
157
171
|
timeout=60,
|
|
@@ -191,7 +205,9 @@ class TestsetsClient:
|
|
|
191
205
|
"""
|
|
192
206
|
_response = self._client_wrapper.httpx_client.request(
|
|
193
207
|
"GET",
|
|
194
|
-
urllib.parse.urljoin(
|
|
208
|
+
urllib.parse.urljoin(
|
|
209
|
+
f"{self._client_wrapper.get_base_url()}/", f"testsets/{testset_id}"
|
|
210
|
+
),
|
|
195
211
|
headers=self._client_wrapper.get_headers(),
|
|
196
212
|
timeout=60,
|
|
197
213
|
)
|
|
@@ -238,7 +254,9 @@ class TestsetsClient:
|
|
|
238
254
|
"""
|
|
239
255
|
_response = self._client_wrapper.httpx_client.request(
|
|
240
256
|
"PUT",
|
|
241
|
-
urllib.parse.urljoin(
|
|
257
|
+
urllib.parse.urljoin(
|
|
258
|
+
f"{self._client_wrapper.get_base_url()}/", f"testsets/{testset_id}"
|
|
259
|
+
),
|
|
242
260
|
json=jsonable_encoder(request),
|
|
243
261
|
headers=self._client_wrapper.get_headers(),
|
|
244
262
|
timeout=60,
|
|
@@ -378,8 +396,16 @@ class AsyncTestsetsClient:
|
|
|
378
396
|
"""
|
|
379
397
|
_response = await self._client_wrapper.httpx_client.request(
|
|
380
398
|
"POST",
|
|
381
|
-
urllib.parse.urljoin(
|
|
382
|
-
|
|
399
|
+
urllib.parse.urljoin(
|
|
400
|
+
f"{self._client_wrapper.get_base_url()}/", "testsets/upload"
|
|
401
|
+
),
|
|
402
|
+
data=jsonable_encoder(
|
|
403
|
+
{
|
|
404
|
+
"upload_type": upload_type,
|
|
405
|
+
"testset_name": testset_name,
|
|
406
|
+
"app_id": app_id,
|
|
407
|
+
}
|
|
408
|
+
),
|
|
383
409
|
files={"file": file},
|
|
384
410
|
headers=self._client_wrapper.get_headers(),
|
|
385
411
|
timeout=60,
|
|
@@ -416,7 +442,9 @@ class AsyncTestsetsClient:
|
|
|
416
442
|
"""
|
|
417
443
|
_response = await self._client_wrapper.httpx_client.request(
|
|
418
444
|
"POST",
|
|
419
|
-
urllib.parse.urljoin(
|
|
445
|
+
urllib.parse.urljoin(
|
|
446
|
+
f"{self._client_wrapper.get_base_url()}/", "testsets/endpoint"
|
|
447
|
+
),
|
|
420
448
|
headers=self._client_wrapper.get_headers(),
|
|
421
449
|
timeout=60,
|
|
422
450
|
)
|
|
@@ -430,7 +458,9 @@ class AsyncTestsetsClient:
|
|
|
430
458
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
431
459
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
432
460
|
|
|
433
|
-
async def create_testset(
|
|
461
|
+
async def create_testset(
|
|
462
|
+
self, app_id: str, *, request: NewTestset
|
|
463
|
+
) -> TestSetSimpleResponse:
|
|
434
464
|
"""
|
|
435
465
|
Create a testset with given name and app_name, save the testset to MongoDB.
|
|
436
466
|
|
|
@@ -464,7 +494,9 @@ class AsyncTestsetsClient:
|
|
|
464
494
|
"""
|
|
465
495
|
_response = await self._client_wrapper.httpx_client.request(
|
|
466
496
|
"POST",
|
|
467
|
-
urllib.parse.urljoin(
|
|
497
|
+
urllib.parse.urljoin(
|
|
498
|
+
f"{self._client_wrapper.get_base_url()}/", f"testsets/{app_id}"
|
|
499
|
+
),
|
|
468
500
|
json=jsonable_encoder(request),
|
|
469
501
|
headers=self._client_wrapper.get_headers(),
|
|
470
502
|
timeout=60,
|
|
@@ -504,7 +536,9 @@ class AsyncTestsetsClient:
|
|
|
504
536
|
"""
|
|
505
537
|
_response = await self._client_wrapper.httpx_client.request(
|
|
506
538
|
"GET",
|
|
507
|
-
urllib.parse.urljoin(
|
|
539
|
+
urllib.parse.urljoin(
|
|
540
|
+
f"{self._client_wrapper.get_base_url()}/", f"testsets/{testset_id}"
|
|
541
|
+
),
|
|
508
542
|
headers=self._client_wrapper.get_headers(),
|
|
509
543
|
timeout=60,
|
|
510
544
|
)
|
|
@@ -518,7 +552,9 @@ class AsyncTestsetsClient:
|
|
|
518
552
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
519
553
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
520
554
|
|
|
521
|
-
async def update_testset(
|
|
555
|
+
async def update_testset(
|
|
556
|
+
self, testset_id: str, *, request: NewTestset
|
|
557
|
+
) -> typing.Any:
|
|
522
558
|
"""
|
|
523
559
|
Update a testset with given id, update the testset in MongoDB.
|
|
524
560
|
|
|
@@ -551,7 +587,9 @@ class AsyncTestsetsClient:
|
|
|
551
587
|
"""
|
|
552
588
|
_response = await self._client_wrapper.httpx_client.request(
|
|
553
589
|
"PUT",
|
|
554
|
-
urllib.parse.urljoin(
|
|
590
|
+
urllib.parse.urljoin(
|
|
591
|
+
f"{self._client_wrapper.get_base_url()}/", f"testsets/{testset_id}"
|
|
592
|
+
),
|
|
555
593
|
json=jsonable_encoder(request),
|
|
556
594
|
headers=self._client_wrapper.get_headers(),
|
|
557
595
|
timeout=60,
|
|
@@ -608,7 +646,9 @@ class AsyncTestsetsClient:
|
|
|
608
646
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
609
647
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
610
648
|
|
|
611
|
-
async def delete_testsets(
|
|
649
|
+
async def delete_testsets(
|
|
650
|
+
self, *, testset_ids: typing.List[str]
|
|
651
|
+
) -> typing.List[str]:
|
|
612
652
|
"""
|
|
613
653
|
Delete specific testsets based on their unique IDs.
|
|
614
654
|
|