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