scale-gp-beta 0.1.0a12__py3-none-any.whl → 0.1.0a14__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.
Files changed (48) hide show
  1. scale_gp_beta/__init__.py +5 -0
  2. scale_gp_beta/_utils/_proxy.py +4 -1
  3. scale_gp_beta/_utils/_resources_proxy.py +24 -0
  4. scale_gp_beta/_version.py +1 -1
  5. scale_gp_beta/pagination.py +39 -1
  6. scale_gp_beta/resources/chat/completions.py +136 -1
  7. scale_gp_beta/resources/dataset_items.py +29 -21
  8. scale_gp_beta/resources/datasets.py +18 -5
  9. scale_gp_beta/resources/evaluation_items.py +11 -7
  10. scale_gp_beta/resources/evaluations.py +142 -21
  11. scale_gp_beta/resources/files/files.py +10 -5
  12. scale_gp_beta/resources/models.py +35 -35
  13. scale_gp_beta/resources/spans.py +312 -24
  14. scale_gp_beta/types/__init__.py +9 -2
  15. scale_gp_beta/types/chat/__init__.py +3 -0
  16. scale_gp_beta/types/chat/completion_models_params.py +31 -0
  17. scale_gp_beta/types/{dataset_item_batch_create_response.py → chat/completion_models_response.py} +5 -5
  18. scale_gp_beta/types/chat/model_definition.py +32 -0
  19. scale_gp_beta/types/component.py +18 -0
  20. scale_gp_beta/types/component_param.py +19 -0
  21. scale_gp_beta/types/container.py +35 -0
  22. scale_gp_beta/types/container_param.py +28 -0
  23. scale_gp_beta/types/dataset_item.py +2 -0
  24. scale_gp_beta/types/dataset_item_list_params.py +7 -6
  25. scale_gp_beta/types/dataset_item_retrieve_params.py +1 -2
  26. scale_gp_beta/types/dataset_list_params.py +10 -4
  27. scale_gp_beta/types/evaluation.py +12 -2
  28. scale_gp_beta/types/evaluation_create_params.py +5 -5
  29. scale_gp_beta/types/{evaluation_archive_response.py → evaluation_delete_response.py} +2 -2
  30. scale_gp_beta/types/evaluation_item_list_params.py +6 -5
  31. scale_gp_beta/types/evaluation_list_params.py +9 -3
  32. scale_gp_beta/types/evaluation_task.py +139 -33
  33. scale_gp_beta/types/evaluation_task_param.py +88 -33
  34. scale_gp_beta/types/evaluation_update_params.py +17 -0
  35. scale_gp_beta/types/file_list_params.py +5 -4
  36. scale_gp_beta/types/inference_model.py +0 -4
  37. scale_gp_beta/types/item_locator.py +7 -0
  38. scale_gp_beta/types/item_locator_template.py +7 -0
  39. scale_gp_beta/types/model_list_params.py +17 -18
  40. scale_gp_beta/types/span.py +40 -1
  41. scale_gp_beta/types/span_batch_params.py +130 -0
  42. scale_gp_beta/types/span_create_params.py +71 -3
  43. scale_gp_beta/types/span_list_params.py +7 -6
  44. scale_gp_beta/types/span_update_params.py +5 -3
  45. {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/METADATA +1 -1
  46. {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/RECORD +48 -37
  47. {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/WHEEL +0 -0
  48. {scale_gp_beta-0.1.0a12.dist-info → scale_gp_beta-0.1.0a14.dist-info}/licenses/LICENSE +0 -0
@@ -2,12 +2,17 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, List, Iterable, Optional
5
+ from typing import Dict, List, Iterable
6
6
  from typing_extensions import Literal, overload
7
7
 
8
8
  import httpx
9
9
 
10
- from ..types import evaluation_list_params, evaluation_create_params, evaluation_retrieve_params
10
+ from ..types import (
11
+ evaluation_list_params,
12
+ evaluation_create_params,
13
+ evaluation_update_params,
14
+ evaluation_retrieve_params,
15
+ )
11
16
  from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
17
  from .._utils import required_args, maybe_transform, async_maybe_transform
13
18
  from .._compat import cached_property
@@ -22,7 +27,7 @@ from ..pagination import SyncCursorPage, AsyncCursorPage
22
27
  from .._base_client import AsyncPaginator, make_request_options
23
28
  from ..types.evaluation import Evaluation
24
29
  from ..types.evaluation_task_param import EvaluationTaskParam
25
- from ..types.evaluation_archive_response import EvaluationArchiveResponse
30
+ from ..types.evaluation_delete_response import EvaluationDeleteResponse
26
31
 
27
32
  __all__ = ["EvaluationsResource", "AsyncEvaluationsResource"]
28
33
 
@@ -246,13 +251,62 @@ class EvaluationsResource(SyncAPIResource):
246
251
  cast_to=Evaluation,
247
252
  )
248
253
 
254
+ def update(
255
+ self,
256
+ evaluation_id: str,
257
+ *,
258
+ description: str | NotGiven = NOT_GIVEN,
259
+ name: str | NotGiven = NOT_GIVEN,
260
+ tags: List[str] | NotGiven = NOT_GIVEN,
261
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
262
+ # The extra values given here take precedence over values defined on the client or passed to this method.
263
+ extra_headers: Headers | None = None,
264
+ extra_query: Query | None = None,
265
+ extra_body: Body | None = None,
266
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
267
+ ) -> Evaluation:
268
+ """
269
+ Update Evaluation
270
+
271
+ Args:
272
+ tags: The tags associated with the entity
273
+
274
+ extra_headers: Send extra headers
275
+
276
+ extra_query: Add additional query parameters to the request
277
+
278
+ extra_body: Add additional JSON properties to the request
279
+
280
+ timeout: Override the client-level default timeout for this request, in seconds
281
+ """
282
+ if not evaluation_id:
283
+ raise ValueError(f"Expected a non-empty value for `evaluation_id` but received {evaluation_id!r}")
284
+ return self._patch(
285
+ f"/v5/evaluations/{evaluation_id}",
286
+ body=maybe_transform(
287
+ {
288
+ "description": description,
289
+ "name": name,
290
+ "tags": tags,
291
+ },
292
+ evaluation_update_params.EvaluationUpdateParams,
293
+ ),
294
+ options=make_request_options(
295
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
296
+ ),
297
+ cast_to=Evaluation,
298
+ )
299
+
249
300
  def list(
250
301
  self,
251
302
  *,
252
- ending_before: Optional[str] | NotGiven = NOT_GIVEN,
303
+ ending_before: str | NotGiven = NOT_GIVEN,
253
304
  include_archived: bool | NotGiven = NOT_GIVEN,
254
305
  limit: int | NotGiven = NOT_GIVEN,
255
- starting_after: Optional[str] | NotGiven = NOT_GIVEN,
306
+ name: str | NotGiven = NOT_GIVEN,
307
+ sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
308
+ starting_after: str | NotGiven = NOT_GIVEN,
309
+ tags: List[str] | NotGiven = NOT_GIVEN,
256
310
  views: List[Literal["tasks"]] | NotGiven = NOT_GIVEN,
257
311
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
258
312
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -286,7 +340,10 @@ class EvaluationsResource(SyncAPIResource):
286
340
  "ending_before": ending_before,
287
341
  "include_archived": include_archived,
288
342
  "limit": limit,
343
+ "name": name,
344
+ "sort_order": sort_order,
289
345
  "starting_after": starting_after,
346
+ "tags": tags,
290
347
  "views": views,
291
348
  },
292
349
  evaluation_list_params.EvaluationListParams,
@@ -295,7 +352,7 @@ class EvaluationsResource(SyncAPIResource):
295
352
  model=Evaluation,
296
353
  )
297
354
 
298
- def archive(
355
+ def delete(
299
356
  self,
300
357
  evaluation_id: str,
301
358
  *,
@@ -305,7 +362,7 @@ class EvaluationsResource(SyncAPIResource):
305
362
  extra_query: Query | None = None,
306
363
  extra_body: Body | None = None,
307
364
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
308
- ) -> EvaluationArchiveResponse:
365
+ ) -> EvaluationDeleteResponse:
309
366
  """
310
367
  Archive Evaluation
311
368
 
@@ -325,7 +382,7 @@ class EvaluationsResource(SyncAPIResource):
325
382
  options=make_request_options(
326
383
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
327
384
  ),
328
- cast_to=EvaluationArchiveResponse,
385
+ cast_to=EvaluationDeleteResponse,
329
386
  )
330
387
 
331
388
 
@@ -548,13 +605,62 @@ class AsyncEvaluationsResource(AsyncAPIResource):
548
605
  cast_to=Evaluation,
549
606
  )
550
607
 
608
+ async def update(
609
+ self,
610
+ evaluation_id: str,
611
+ *,
612
+ description: str | NotGiven = NOT_GIVEN,
613
+ name: str | NotGiven = NOT_GIVEN,
614
+ tags: List[str] | NotGiven = NOT_GIVEN,
615
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
616
+ # The extra values given here take precedence over values defined on the client or passed to this method.
617
+ extra_headers: Headers | None = None,
618
+ extra_query: Query | None = None,
619
+ extra_body: Body | None = None,
620
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
621
+ ) -> Evaluation:
622
+ """
623
+ Update Evaluation
624
+
625
+ Args:
626
+ tags: The tags associated with the entity
627
+
628
+ extra_headers: Send extra headers
629
+
630
+ extra_query: Add additional query parameters to the request
631
+
632
+ extra_body: Add additional JSON properties to the request
633
+
634
+ timeout: Override the client-level default timeout for this request, in seconds
635
+ """
636
+ if not evaluation_id:
637
+ raise ValueError(f"Expected a non-empty value for `evaluation_id` but received {evaluation_id!r}")
638
+ return await self._patch(
639
+ f"/v5/evaluations/{evaluation_id}",
640
+ body=await async_maybe_transform(
641
+ {
642
+ "description": description,
643
+ "name": name,
644
+ "tags": tags,
645
+ },
646
+ evaluation_update_params.EvaluationUpdateParams,
647
+ ),
648
+ options=make_request_options(
649
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
650
+ ),
651
+ cast_to=Evaluation,
652
+ )
653
+
551
654
  def list(
552
655
  self,
553
656
  *,
554
- ending_before: Optional[str] | NotGiven = NOT_GIVEN,
657
+ ending_before: str | NotGiven = NOT_GIVEN,
555
658
  include_archived: bool | NotGiven = NOT_GIVEN,
556
659
  limit: int | NotGiven = NOT_GIVEN,
557
- starting_after: Optional[str] | NotGiven = NOT_GIVEN,
660
+ name: str | NotGiven = NOT_GIVEN,
661
+ sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
662
+ starting_after: str | NotGiven = NOT_GIVEN,
663
+ tags: List[str] | NotGiven = NOT_GIVEN,
558
664
  views: List[Literal["tasks"]] | NotGiven = NOT_GIVEN,
559
665
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
560
666
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -588,7 +694,10 @@ class AsyncEvaluationsResource(AsyncAPIResource):
588
694
  "ending_before": ending_before,
589
695
  "include_archived": include_archived,
590
696
  "limit": limit,
697
+ "name": name,
698
+ "sort_order": sort_order,
591
699
  "starting_after": starting_after,
700
+ "tags": tags,
592
701
  "views": views,
593
702
  },
594
703
  evaluation_list_params.EvaluationListParams,
@@ -597,7 +706,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
597
706
  model=Evaluation,
598
707
  )
599
708
 
600
- async def archive(
709
+ async def delete(
601
710
  self,
602
711
  evaluation_id: str,
603
712
  *,
@@ -607,7 +716,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
607
716
  extra_query: Query | None = None,
608
717
  extra_body: Body | None = None,
609
718
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
610
- ) -> EvaluationArchiveResponse:
719
+ ) -> EvaluationDeleteResponse:
611
720
  """
612
721
  Archive Evaluation
613
722
 
@@ -627,7 +736,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
627
736
  options=make_request_options(
628
737
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
629
738
  ),
630
- cast_to=EvaluationArchiveResponse,
739
+ cast_to=EvaluationDeleteResponse,
631
740
  )
632
741
 
633
742
 
@@ -641,11 +750,14 @@ class EvaluationsResourceWithRawResponse:
641
750
  self.retrieve = to_raw_response_wrapper(
642
751
  evaluations.retrieve,
643
752
  )
753
+ self.update = to_raw_response_wrapper(
754
+ evaluations.update,
755
+ )
644
756
  self.list = to_raw_response_wrapper(
645
757
  evaluations.list,
646
758
  )
647
- self.archive = to_raw_response_wrapper(
648
- evaluations.archive,
759
+ self.delete = to_raw_response_wrapper(
760
+ evaluations.delete,
649
761
  )
650
762
 
651
763
 
@@ -659,11 +771,14 @@ class AsyncEvaluationsResourceWithRawResponse:
659
771
  self.retrieve = async_to_raw_response_wrapper(
660
772
  evaluations.retrieve,
661
773
  )
774
+ self.update = async_to_raw_response_wrapper(
775
+ evaluations.update,
776
+ )
662
777
  self.list = async_to_raw_response_wrapper(
663
778
  evaluations.list,
664
779
  )
665
- self.archive = async_to_raw_response_wrapper(
666
- evaluations.archive,
780
+ self.delete = async_to_raw_response_wrapper(
781
+ evaluations.delete,
667
782
  )
668
783
 
669
784
 
@@ -677,11 +792,14 @@ class EvaluationsResourceWithStreamingResponse:
677
792
  self.retrieve = to_streamed_response_wrapper(
678
793
  evaluations.retrieve,
679
794
  )
795
+ self.update = to_streamed_response_wrapper(
796
+ evaluations.update,
797
+ )
680
798
  self.list = to_streamed_response_wrapper(
681
799
  evaluations.list,
682
800
  )
683
- self.archive = to_streamed_response_wrapper(
684
- evaluations.archive,
801
+ self.delete = to_streamed_response_wrapper(
802
+ evaluations.delete,
685
803
  )
686
804
 
687
805
 
@@ -695,9 +813,12 @@ class AsyncEvaluationsResourceWithStreamingResponse:
695
813
  self.retrieve = async_to_streamed_response_wrapper(
696
814
  evaluations.retrieve,
697
815
  )
816
+ self.update = async_to_streamed_response_wrapper(
817
+ evaluations.update,
818
+ )
698
819
  self.list = async_to_streamed_response_wrapper(
699
820
  evaluations.list,
700
821
  )
701
- self.archive = async_to_streamed_response_wrapper(
702
- evaluations.archive,
822
+ self.delete = async_to_streamed_response_wrapper(
823
+ evaluations.delete,
703
824
  )
@@ -2,7 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, Mapping, Optional, cast
5
+ from typing import Dict, Mapping, cast
6
+ from typing_extensions import Literal
6
7
 
7
8
  import httpx
8
9
 
@@ -167,9 +168,10 @@ class FilesResource(SyncAPIResource):
167
168
  def list(
168
169
  self,
169
170
  *,
170
- ending_before: Optional[str] | NotGiven = NOT_GIVEN,
171
+ ending_before: str | NotGiven = NOT_GIVEN,
171
172
  limit: int | NotGiven = NOT_GIVEN,
172
- starting_after: Optional[str] | NotGiven = NOT_GIVEN,
173
+ sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
174
+ starting_after: str | NotGiven = NOT_GIVEN,
173
175
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
174
176
  # The extra values given here take precedence over values defined on the client or passed to this method.
175
177
  extra_headers: Headers | None = None,
@@ -201,6 +203,7 @@ class FilesResource(SyncAPIResource):
201
203
  {
202
204
  "ending_before": ending_before,
203
205
  "limit": limit,
206
+ "sort_order": sort_order,
204
207
  "starting_after": starting_after,
205
208
  },
206
209
  file_list_params.FileListParams,
@@ -377,9 +380,10 @@ class AsyncFilesResource(AsyncAPIResource):
377
380
  def list(
378
381
  self,
379
382
  *,
380
- ending_before: Optional[str] | NotGiven = NOT_GIVEN,
383
+ ending_before: str | NotGiven = NOT_GIVEN,
381
384
  limit: int | NotGiven = NOT_GIVEN,
382
- starting_after: Optional[str] | NotGiven = NOT_GIVEN,
385
+ sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
386
+ starting_after: str | NotGiven = NOT_GIVEN,
383
387
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
384
388
  # The extra values given here take precedence over values defined on the client or passed to this method.
385
389
  extra_headers: Headers | None = None,
@@ -411,6 +415,7 @@ class AsyncFilesResource(AsyncAPIResource):
411
415
  {
412
416
  "ending_before": ending_before,
413
417
  "limit": limit,
418
+ "sort_order": sort_order,
414
419
  "starting_after": starting_after,
415
420
  },
416
421
  file_list_params.FileListParams,
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Dict, Optional
5
+ from typing import Dict
6
6
  from typing_extensions import Literal, overload
7
7
 
8
8
  import httpx
@@ -303,26 +303,25 @@ class ModelsResource(SyncAPIResource):
303
303
  def list(
304
304
  self,
305
305
  *,
306
- ending_before: Optional[str] | NotGiven = NOT_GIVEN,
306
+ ending_before: str | NotGiven = NOT_GIVEN,
307
307
  limit: int | NotGiven = NOT_GIVEN,
308
- model_vendor: Optional[
309
- Literal[
310
- "openai",
311
- "cohere",
312
- "vertex_ai",
313
- "anthropic",
314
- "azure",
315
- "gemini",
316
- "launch",
317
- "llmengine",
318
- "model_zoo",
319
- "bedrock",
320
- "xai",
321
- ]
308
+ model_vendor: Literal[
309
+ "openai",
310
+ "cohere",
311
+ "vertex_ai",
312
+ "anthropic",
313
+ "azure",
314
+ "gemini",
315
+ "launch",
316
+ "llmengine",
317
+ "model_zoo",
318
+ "bedrock",
319
+ "xai",
322
320
  ]
323
321
  | NotGiven = NOT_GIVEN,
324
- name: Optional[str] | NotGiven = NOT_GIVEN,
325
- starting_after: Optional[str] | NotGiven = NOT_GIVEN,
322
+ name: str | NotGiven = NOT_GIVEN,
323
+ sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
324
+ starting_after: str | NotGiven = NOT_GIVEN,
326
325
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
327
326
  # The extra values given here take precedence over values defined on the client or passed to this method.
328
327
  extra_headers: Headers | None = None,
@@ -356,6 +355,7 @@ class ModelsResource(SyncAPIResource):
356
355
  "limit": limit,
357
356
  "model_vendor": model_vendor,
358
357
  "name": name,
358
+ "sort_order": sort_order,
359
359
  "starting_after": starting_after,
360
360
  },
361
361
  model_list_params.ModelListParams,
@@ -675,26 +675,25 @@ class AsyncModelsResource(AsyncAPIResource):
675
675
  def list(
676
676
  self,
677
677
  *,
678
- ending_before: Optional[str] | NotGiven = NOT_GIVEN,
678
+ ending_before: str | NotGiven = NOT_GIVEN,
679
679
  limit: int | NotGiven = NOT_GIVEN,
680
- model_vendor: Optional[
681
- Literal[
682
- "openai",
683
- "cohere",
684
- "vertex_ai",
685
- "anthropic",
686
- "azure",
687
- "gemini",
688
- "launch",
689
- "llmengine",
690
- "model_zoo",
691
- "bedrock",
692
- "xai",
693
- ]
680
+ model_vendor: Literal[
681
+ "openai",
682
+ "cohere",
683
+ "vertex_ai",
684
+ "anthropic",
685
+ "azure",
686
+ "gemini",
687
+ "launch",
688
+ "llmengine",
689
+ "model_zoo",
690
+ "bedrock",
691
+ "xai",
694
692
  ]
695
693
  | NotGiven = NOT_GIVEN,
696
- name: Optional[str] | NotGiven = NOT_GIVEN,
697
- starting_after: Optional[str] | NotGiven = NOT_GIVEN,
694
+ name: str | NotGiven = NOT_GIVEN,
695
+ sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
696
+ starting_after: str | NotGiven = NOT_GIVEN,
698
697
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
699
698
  # The extra values given here take precedence over values defined on the client or passed to this method.
700
699
  extra_headers: Headers | None = None,
@@ -728,6 +727,7 @@ class AsyncModelsResource(AsyncAPIResource):
728
727
  "limit": limit,
729
728
  "model_vendor": model_vendor,
730
729
  "name": name,
730
+ "sort_order": sort_order,
731
731
  "starting_after": starting_after,
732
732
  },
733
733
  model_list_params.ModelListParams,