scale-gp-beta 0.1.0a30__py3-none-any.whl → 0.1.0a31__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.
- scale_gp_beta/_base_client.py +3 -3
- scale_gp_beta/_client.py +8 -8
- scale_gp_beta/_compat.py +48 -48
- scale_gp_beta/_models.py +41 -41
- scale_gp_beta/_types.py +35 -1
- scale_gp_beta/_utils/__init__.py +9 -2
- scale_gp_beta/_utils/_compat.py +45 -0
- scale_gp_beta/_utils/_datetime_parse.py +136 -0
- scale_gp_beta/_utils/_transform.py +11 -1
- scale_gp_beta/_utils/_typing.py +6 -1
- scale_gp_beta/_utils/_utils.py +0 -1
- scale_gp_beta/_version.py +1 -1
- scale_gp_beta/resources/__init__.py +6 -6
- scale_gp_beta/resources/chat/completions.py +18 -18
- scale_gp_beta/resources/completions.py +18 -18
- scale_gp_beta/resources/datasets.py +8 -8
- scale_gp_beta/resources/evaluations.py +35 -13
- scale_gp_beta/resources/responses.py +4 -4
- scale_gp_beta/resources/spans.py +15 -15
- scale_gp_beta/types/__init__.py +4 -4
- scale_gp_beta/types/chat/completion_create_params.py +5 -3
- scale_gp_beta/types/completion_create_params.py +5 -3
- scale_gp_beta/types/container.py +2 -2
- scale_gp_beta/types/container_param.py +2 -2
- scale_gp_beta/types/dataset_create_params.py +4 -2
- scale_gp_beta/types/dataset_list_params.py +3 -2
- scale_gp_beta/types/dataset_update_params.py +3 -2
- scale_gp_beta/types/evaluation.py +4 -1
- scale_gp_beta/types/evaluation_create_params.py +17 -6
- scale_gp_beta/types/evaluation_list_params.py +3 -1
- scale_gp_beta/types/evaluation_task_param.py +4 -3
- scale_gp_beta/types/evaluation_update_params.py +3 -2
- scale_gp_beta/types/inference_model.py +4 -0
- scale_gp_beta/types/model_create_params.py +6 -4
- scale_gp_beta/types/model_update_params.py +6 -4
- scale_gp_beta/types/question_create_params.py +4 -2
- scale_gp_beta/types/response_create_params.py +7 -5
- scale_gp_beta/types/span_search_params.py +8 -7
- {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a31.dist-info}/METADATA +1 -1
- {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a31.dist-info}/RECORD +42 -40
- {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a31.dist-info}/WHEEL +0 -0
- {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a31.dist-info}/licenses/LICENSE +0 -0
|
@@ -13,7 +13,7 @@ from ..types import (
|
|
|
13
13
|
evaluation_update_params,
|
|
14
14
|
evaluation_retrieve_params,
|
|
15
15
|
)
|
|
16
|
-
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
16
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
17
17
|
from .._utils import required_args, maybe_transform, async_maybe_transform
|
|
18
18
|
from .._compat import cached_property
|
|
19
19
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -59,7 +59,8 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
59
59
|
data: Iterable[Dict[str, object]],
|
|
60
60
|
name: str,
|
|
61
61
|
description: str | NotGiven = NOT_GIVEN,
|
|
62
|
-
|
|
62
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
63
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
63
64
|
tasks: Iterable[EvaluationTaskParam] | NotGiven = NOT_GIVEN,
|
|
64
65
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
65
66
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -74,6 +75,8 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
74
75
|
Args:
|
|
75
76
|
data: Items to be evaluated
|
|
76
77
|
|
|
78
|
+
metadata: Optional metadata key-value pairs for the evaluation
|
|
79
|
+
|
|
77
80
|
tags: The tags associated with the entity
|
|
78
81
|
|
|
79
82
|
tasks: Tasks allow you to augment and evaluate your data
|
|
@@ -96,7 +99,8 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
96
99
|
name: str,
|
|
97
100
|
data: Iterable[evaluation_create_params.EvaluationFromDatasetCreateRequestData] | NotGiven = NOT_GIVEN,
|
|
98
101
|
description: str | NotGiven = NOT_GIVEN,
|
|
99
|
-
|
|
102
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
103
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
100
104
|
tasks: Iterable[EvaluationTaskParam] | NotGiven = NOT_GIVEN,
|
|
101
105
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
102
106
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -113,6 +117,8 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
113
117
|
|
|
114
118
|
data: Items to be evaluated, including references to the input dataset items
|
|
115
119
|
|
|
120
|
+
metadata: Optional metadata key-value pairs for the evaluation
|
|
121
|
+
|
|
116
122
|
tags: The tags associated with the entity
|
|
117
123
|
|
|
118
124
|
tasks: Tasks allow you to augment and evaluate your data
|
|
@@ -135,7 +141,8 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
135
141
|
dataset: evaluation_create_params.EvaluationWithDatasetCreateRequestDataset,
|
|
136
142
|
name: str,
|
|
137
143
|
description: str | NotGiven = NOT_GIVEN,
|
|
138
|
-
|
|
144
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
145
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
139
146
|
tasks: Iterable[EvaluationTaskParam] | NotGiven = NOT_GIVEN,
|
|
140
147
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
141
148
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -152,6 +159,8 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
152
159
|
|
|
153
160
|
dataset: Create a reusable dataset from items in the `data` field
|
|
154
161
|
|
|
162
|
+
metadata: Optional metadata key-value pairs for the evaluation
|
|
163
|
+
|
|
155
164
|
tags: The tags associated with the entity
|
|
156
165
|
|
|
157
166
|
tasks: Tasks allow you to augment and evaluate your data
|
|
@@ -175,7 +184,8 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
175
184
|
| NotGiven = NOT_GIVEN,
|
|
176
185
|
name: str,
|
|
177
186
|
description: str | NotGiven = NOT_GIVEN,
|
|
178
|
-
|
|
187
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
188
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
179
189
|
tasks: Iterable[EvaluationTaskParam] | NotGiven = NOT_GIVEN,
|
|
180
190
|
dataset_id: str | NotGiven = NOT_GIVEN,
|
|
181
191
|
dataset: evaluation_create_params.EvaluationWithDatasetCreateRequestDataset | NotGiven = NOT_GIVEN,
|
|
@@ -193,6 +203,7 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
193
203
|
"data": data,
|
|
194
204
|
"name": name,
|
|
195
205
|
"description": description,
|
|
206
|
+
"metadata": metadata,
|
|
196
207
|
"tags": tags,
|
|
197
208
|
"tasks": tasks,
|
|
198
209
|
"dataset_id": dataset_id,
|
|
@@ -257,7 +268,7 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
257
268
|
*,
|
|
258
269
|
description: str | NotGiven = NOT_GIVEN,
|
|
259
270
|
name: str | NotGiven = NOT_GIVEN,
|
|
260
|
-
tags:
|
|
271
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
261
272
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
262
273
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
263
274
|
extra_headers: Headers | None = None,
|
|
@@ -306,7 +317,7 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
306
317
|
name: str | NotGiven = NOT_GIVEN,
|
|
307
318
|
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
308
319
|
starting_after: str | NotGiven = NOT_GIVEN,
|
|
309
|
-
tags:
|
|
320
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
310
321
|
views: List[Literal["tasks"]] | NotGiven = NOT_GIVEN,
|
|
311
322
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
312
323
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -413,7 +424,8 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
413
424
|
data: Iterable[Dict[str, object]],
|
|
414
425
|
name: str,
|
|
415
426
|
description: str | NotGiven = NOT_GIVEN,
|
|
416
|
-
|
|
427
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
428
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
417
429
|
tasks: Iterable[EvaluationTaskParam] | NotGiven = NOT_GIVEN,
|
|
418
430
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
419
431
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -428,6 +440,8 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
428
440
|
Args:
|
|
429
441
|
data: Items to be evaluated
|
|
430
442
|
|
|
443
|
+
metadata: Optional metadata key-value pairs for the evaluation
|
|
444
|
+
|
|
431
445
|
tags: The tags associated with the entity
|
|
432
446
|
|
|
433
447
|
tasks: Tasks allow you to augment and evaluate your data
|
|
@@ -450,7 +464,8 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
450
464
|
name: str,
|
|
451
465
|
data: Iterable[evaluation_create_params.EvaluationFromDatasetCreateRequestData] | NotGiven = NOT_GIVEN,
|
|
452
466
|
description: str | NotGiven = NOT_GIVEN,
|
|
453
|
-
|
|
467
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
468
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
454
469
|
tasks: Iterable[EvaluationTaskParam] | NotGiven = NOT_GIVEN,
|
|
455
470
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
456
471
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -467,6 +482,8 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
467
482
|
|
|
468
483
|
data: Items to be evaluated, including references to the input dataset items
|
|
469
484
|
|
|
485
|
+
metadata: Optional metadata key-value pairs for the evaluation
|
|
486
|
+
|
|
470
487
|
tags: The tags associated with the entity
|
|
471
488
|
|
|
472
489
|
tasks: Tasks allow you to augment and evaluate your data
|
|
@@ -489,7 +506,8 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
489
506
|
dataset: evaluation_create_params.EvaluationWithDatasetCreateRequestDataset,
|
|
490
507
|
name: str,
|
|
491
508
|
description: str | NotGiven = NOT_GIVEN,
|
|
492
|
-
|
|
509
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
510
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
493
511
|
tasks: Iterable[EvaluationTaskParam] | NotGiven = NOT_GIVEN,
|
|
494
512
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
495
513
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -506,6 +524,8 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
506
524
|
|
|
507
525
|
dataset: Create a reusable dataset from items in the `data` field
|
|
508
526
|
|
|
527
|
+
metadata: Optional metadata key-value pairs for the evaluation
|
|
528
|
+
|
|
509
529
|
tags: The tags associated with the entity
|
|
510
530
|
|
|
511
531
|
tasks: Tasks allow you to augment and evaluate your data
|
|
@@ -529,7 +549,8 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
529
549
|
| NotGiven = NOT_GIVEN,
|
|
530
550
|
name: str,
|
|
531
551
|
description: str | NotGiven = NOT_GIVEN,
|
|
532
|
-
|
|
552
|
+
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
553
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
533
554
|
tasks: Iterable[EvaluationTaskParam] | NotGiven = NOT_GIVEN,
|
|
534
555
|
dataset_id: str | NotGiven = NOT_GIVEN,
|
|
535
556
|
dataset: evaluation_create_params.EvaluationWithDatasetCreateRequestDataset | NotGiven = NOT_GIVEN,
|
|
@@ -547,6 +568,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
547
568
|
"data": data,
|
|
548
569
|
"name": name,
|
|
549
570
|
"description": description,
|
|
571
|
+
"metadata": metadata,
|
|
550
572
|
"tags": tags,
|
|
551
573
|
"tasks": tasks,
|
|
552
574
|
"dataset_id": dataset_id,
|
|
@@ -611,7 +633,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
611
633
|
*,
|
|
612
634
|
description: str | NotGiven = NOT_GIVEN,
|
|
613
635
|
name: str | NotGiven = NOT_GIVEN,
|
|
614
|
-
tags:
|
|
636
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
615
637
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
616
638
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
617
639
|
extra_headers: Headers | None = None,
|
|
@@ -660,7 +682,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
660
682
|
name: str | NotGiven = NOT_GIVEN,
|
|
661
683
|
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
662
684
|
starting_after: str | NotGiven = NOT_GIVEN,
|
|
663
|
-
tags:
|
|
685
|
+
tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
664
686
|
views: List[Literal["tasks"]] | NotGiven = NOT_GIVEN,
|
|
665
687
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
666
688
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any, Dict,
|
|
5
|
+
from typing import Any, Dict, Union, Iterable, cast
|
|
6
6
|
from typing_extensions import Literal
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
10
|
from ..types import response_create_params
|
|
11
|
-
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
12
12
|
from .._utils import maybe_transform, async_maybe_transform
|
|
13
13
|
from .._compat import cached_property
|
|
14
14
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -49,7 +49,7 @@ class ResponsesResource(SyncAPIResource):
|
|
|
49
49
|
*,
|
|
50
50
|
input: Union[str, Iterable[response_create_params.InputUnionMember1]],
|
|
51
51
|
model: str,
|
|
52
|
-
include:
|
|
52
|
+
include: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
53
53
|
instructions: str | NotGiven = NOT_GIVEN,
|
|
54
54
|
max_output_tokens: int | NotGiven = NOT_GIVEN,
|
|
55
55
|
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
@@ -176,7 +176,7 @@ class AsyncResponsesResource(AsyncAPIResource):
|
|
|
176
176
|
*,
|
|
177
177
|
input: Union[str, Iterable[response_create_params.InputUnionMember1]],
|
|
178
178
|
model: str,
|
|
179
|
-
include:
|
|
179
|
+
include: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
180
180
|
instructions: str | NotGiven = NOT_GIVEN,
|
|
181
181
|
max_output_tokens: int | NotGiven = NOT_GIVEN,
|
|
182
182
|
metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
scale_gp_beta/resources/spans.py
CHANGED
|
@@ -17,7 +17,7 @@ from ..types import (
|
|
|
17
17
|
span_update_params,
|
|
18
18
|
span_upsert_batch_params,
|
|
19
19
|
)
|
|
20
|
-
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
20
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
|
|
21
21
|
from .._utils import maybe_transform, async_maybe_transform
|
|
22
22
|
from .._compat import cached_property
|
|
23
23
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -255,17 +255,17 @@ class SpansResource(SyncAPIResource):
|
|
|
255
255
|
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
256
256
|
starting_after: str | NotGiven = NOT_GIVEN,
|
|
257
257
|
to_ts: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
258
|
-
application_variant_ids:
|
|
259
|
-
excluded_span_ids:
|
|
260
|
-
excluded_trace_ids:
|
|
258
|
+
application_variant_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
259
|
+
excluded_span_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
260
|
+
excluded_trace_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
261
261
|
extra_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
262
262
|
group_id: str | NotGiven = NOT_GIVEN,
|
|
263
|
-
names:
|
|
263
|
+
names: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
264
264
|
parents_only: bool | NotGiven = NOT_GIVEN,
|
|
265
|
-
search_texts:
|
|
266
|
-
span_ids:
|
|
265
|
+
search_texts: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
266
|
+
span_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
267
267
|
statuses: List[SpanStatus] | NotGiven = NOT_GIVEN,
|
|
268
|
-
trace_ids:
|
|
268
|
+
trace_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
269
269
|
types: List[SpanType] | NotGiven = NOT_GIVEN,
|
|
270
270
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
271
271
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -603,17 +603,17 @@ class AsyncSpansResource(AsyncAPIResource):
|
|
|
603
603
|
sort_order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
604
604
|
starting_after: str | NotGiven = NOT_GIVEN,
|
|
605
605
|
to_ts: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
606
|
-
application_variant_ids:
|
|
607
|
-
excluded_span_ids:
|
|
608
|
-
excluded_trace_ids:
|
|
606
|
+
application_variant_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
607
|
+
excluded_span_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
608
|
+
excluded_trace_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
609
609
|
extra_metadata: Dict[str, object] | NotGiven = NOT_GIVEN,
|
|
610
610
|
group_id: str | NotGiven = NOT_GIVEN,
|
|
611
|
-
names:
|
|
611
|
+
names: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
612
612
|
parents_only: bool | NotGiven = NOT_GIVEN,
|
|
613
|
-
search_texts:
|
|
614
|
-
span_ids:
|
|
613
|
+
search_texts: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
614
|
+
span_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
615
615
|
statuses: List[SpanStatus] | NotGiven = NOT_GIVEN,
|
|
616
|
-
trace_ids:
|
|
616
|
+
trace_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN,
|
|
617
617
|
types: List[SpanType] | NotGiven = NOT_GIVEN,
|
|
618
618
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
619
619
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
scale_gp_beta/types/__init__.py
CHANGED
|
@@ -75,9 +75,9 @@ from .dataset_item_batch_create_response import DatasetItemBatchCreateResponse a
|
|
|
75
75
|
# This ensures that, when building the deferred (due to cyclical references) model schema,
|
|
76
76
|
# Pydantic can resolve the necessary references.
|
|
77
77
|
# See: https://github.com/pydantic/pydantic/issues/11250 for more context.
|
|
78
|
-
if _compat.
|
|
79
|
-
evaluation.Evaluation.model_rebuild(_parent_namespace_depth=0)
|
|
80
|
-
container.Container.model_rebuild(_parent_namespace_depth=0)
|
|
81
|
-
else:
|
|
78
|
+
if _compat.PYDANTIC_V1:
|
|
82
79
|
evaluation.Evaluation.update_forward_refs() # type: ignore
|
|
83
80
|
container.Container.update_forward_refs() # type: ignore
|
|
81
|
+
else:
|
|
82
|
+
evaluation.Evaluation.model_rebuild(_parent_namespace_depth=0)
|
|
83
|
+
container.Container.model_rebuild(_parent_namespace_depth=0)
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Union, Iterable
|
|
6
6
|
from typing_extensions import Literal, Required, TypedDict
|
|
7
7
|
|
|
8
|
+
from ..._types import SequenceNotStr
|
|
9
|
+
|
|
8
10
|
__all__ = ["CompletionCreateParamsBase", "CompletionCreateParamsNonStreaming", "CompletionCreateParamsStreaming"]
|
|
9
11
|
|
|
10
12
|
|
|
@@ -67,7 +69,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
|
|
|
67
69
|
dashboard.
|
|
68
70
|
"""
|
|
69
71
|
|
|
70
|
-
modalities:
|
|
72
|
+
modalities: SequenceNotStr[str]
|
|
71
73
|
"""Output types that you would like the model to generate for this request."""
|
|
72
74
|
|
|
73
75
|
n: int
|
|
@@ -100,7 +102,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
|
|
|
100
102
|
requests with same seed.
|
|
101
103
|
"""
|
|
102
104
|
|
|
103
|
-
stop: Union[str,
|
|
105
|
+
stop: Union[str, SequenceNotStr[str]]
|
|
104
106
|
"""Up to 4 sequences where the API will stop generating further tokens."""
|
|
105
107
|
|
|
106
108
|
store: bool
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Union
|
|
6
6
|
from typing_extensions import Literal, Required, TypedDict
|
|
7
7
|
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
|
|
8
10
|
__all__ = ["CompletionCreateParamsBase", "CompletionCreateParamsNonStreaming", "CompletionCreateParamsStreaming"]
|
|
9
11
|
|
|
10
12
|
|
|
@@ -12,7 +14,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
|
|
|
12
14
|
model: Required[str]
|
|
13
15
|
"""model specified as `model_vendor/model`, for example `openai/gpt-4o`"""
|
|
14
16
|
|
|
15
|
-
prompt: Required[Union[str,
|
|
17
|
+
prompt: Required[Union[str, SequenceNotStr[str]]]
|
|
16
18
|
"""The prompt to generate completions for, encoded as a string"""
|
|
17
19
|
|
|
18
20
|
best_of: int
|
|
@@ -58,7 +60,7 @@ class CompletionCreateParamsBase(TypedDict, total=False):
|
|
|
58
60
|
Determinism is not guaranteed.
|
|
59
61
|
"""
|
|
60
62
|
|
|
61
|
-
stop: Union[str,
|
|
63
|
+
stop: Union[str, SequenceNotStr[str]]
|
|
62
64
|
"""Up to 4 sequences where the API will stop generating further tokens."""
|
|
63
65
|
|
|
64
66
|
stream_options: Dict[str, object]
|
scale_gp_beta/types/container.py
CHANGED
|
@@ -5,13 +5,13 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import TYPE_CHECKING, List, Union, Optional
|
|
6
6
|
from typing_extensions import Literal, TypeAlias, TypeAliasType
|
|
7
7
|
|
|
8
|
-
from .._compat import
|
|
8
|
+
from .._compat import PYDANTIC_V1
|
|
9
9
|
from .._models import BaseModel
|
|
10
10
|
from .component import Component
|
|
11
11
|
|
|
12
12
|
__all__ = ["Container", "Child"]
|
|
13
13
|
|
|
14
|
-
if TYPE_CHECKING or
|
|
14
|
+
if TYPE_CHECKING or not PYDANTIC_V1:
|
|
15
15
|
Child = TypeAliasType("Child", Union["Container", Component])
|
|
16
16
|
else:
|
|
17
17
|
Child: TypeAlias = Union["Container", Component]
|
|
@@ -5,12 +5,12 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import TYPE_CHECKING, Union, Iterable
|
|
6
6
|
from typing_extensions import Literal, Required, TypeAlias, TypedDict, TypeAliasType
|
|
7
7
|
|
|
8
|
-
from .._compat import
|
|
8
|
+
from .._compat import PYDANTIC_V1
|
|
9
9
|
from .component_param import ComponentParam
|
|
10
10
|
|
|
11
11
|
__all__ = ["ContainerParam", "Child"]
|
|
12
12
|
|
|
13
|
-
if TYPE_CHECKING or
|
|
13
|
+
if TYPE_CHECKING or not PYDANTIC_V1:
|
|
14
14
|
Child = TypeAliasType("Child", Union["ContainerParam", ComponentParam])
|
|
15
15
|
else:
|
|
16
16
|
Child: TypeAlias = Union["ContainerParam", ComponentParam]
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Iterable
|
|
6
6
|
from typing_extensions import Required, TypedDict
|
|
7
7
|
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
|
|
8
10
|
__all__ = ["DatasetCreateParams"]
|
|
9
11
|
|
|
10
12
|
|
|
@@ -16,5 +18,5 @@ class DatasetCreateParams(TypedDict, total=False):
|
|
|
16
18
|
|
|
17
19
|
description: str
|
|
18
20
|
|
|
19
|
-
tags:
|
|
21
|
+
tags: SequenceNotStr[str]
|
|
20
22
|
"""The tags associated with the entity"""
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List
|
|
6
5
|
from typing_extensions import Literal, TypedDict
|
|
7
6
|
|
|
7
|
+
from .._types import SequenceNotStr
|
|
8
|
+
|
|
8
9
|
__all__ = ["DatasetListParams"]
|
|
9
10
|
|
|
10
11
|
|
|
@@ -21,4 +22,4 @@ class DatasetListParams(TypedDict, total=False):
|
|
|
21
22
|
|
|
22
23
|
starting_after: str
|
|
23
24
|
|
|
24
|
-
tags:
|
|
25
|
+
tags: SequenceNotStr[str]
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List
|
|
6
5
|
from typing_extensions import TypedDict
|
|
7
6
|
|
|
7
|
+
from .._types import SequenceNotStr
|
|
8
|
+
|
|
8
9
|
__all__ = ["DatasetUpdateParams"]
|
|
9
10
|
|
|
10
11
|
|
|
@@ -13,5 +14,5 @@ class DatasetUpdateParams(TypedDict, total=False):
|
|
|
13
14
|
|
|
14
15
|
name: str
|
|
15
16
|
|
|
16
|
-
tags:
|
|
17
|
+
tags: SequenceNotStr[str]
|
|
17
18
|
"""The tags associated with the entity"""
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List, Optional
|
|
5
|
+
from typing import Dict, List, Optional
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
from typing_extensions import Literal
|
|
8
8
|
|
|
@@ -34,6 +34,9 @@ class Evaluation(BaseModel):
|
|
|
34
34
|
|
|
35
35
|
description: Optional[str] = None
|
|
36
36
|
|
|
37
|
+
metadata: Optional[Dict[str, object]] = None
|
|
38
|
+
"""Metadata key-value pairs for the evaluation"""
|
|
39
|
+
|
|
37
40
|
object: Optional[Literal["evaluation"]] = None
|
|
38
41
|
|
|
39
42
|
tasks: Optional[List["EvaluationTask"]] = None
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Union, Iterable
|
|
6
6
|
from typing_extensions import Required, TypeAlias, TypedDict
|
|
7
7
|
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
|
|
8
10
|
__all__ = [
|
|
9
11
|
"EvaluationCreateParams",
|
|
10
12
|
"EvaluationStandaloneCreateRequest",
|
|
@@ -23,7 +25,10 @@ class EvaluationStandaloneCreateRequest(TypedDict, total=False):
|
|
|
23
25
|
|
|
24
26
|
description: str
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
metadata: Dict[str, object]
|
|
29
|
+
"""Optional metadata key-value pairs for the evaluation"""
|
|
30
|
+
|
|
31
|
+
tags: SequenceNotStr[str]
|
|
27
32
|
"""The tags associated with the entity"""
|
|
28
33
|
|
|
29
34
|
tasks: Iterable["EvaluationTaskParam"]
|
|
@@ -41,7 +46,10 @@ class EvaluationFromDatasetCreateRequest(TypedDict, total=False):
|
|
|
41
46
|
|
|
42
47
|
description: str
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
metadata: Dict[str, object]
|
|
50
|
+
"""Optional metadata key-value pairs for the evaluation"""
|
|
51
|
+
|
|
52
|
+
tags: SequenceNotStr[str]
|
|
45
53
|
"""The tags associated with the entity"""
|
|
46
54
|
|
|
47
55
|
tasks: Iterable["EvaluationTaskParam"]
|
|
@@ -68,7 +76,10 @@ class EvaluationWithDatasetCreateRequest(TypedDict, total=False):
|
|
|
68
76
|
|
|
69
77
|
description: str
|
|
70
78
|
|
|
71
|
-
|
|
79
|
+
metadata: Dict[str, object]
|
|
80
|
+
"""Optional metadata key-value pairs for the evaluation"""
|
|
81
|
+
|
|
82
|
+
tags: SequenceNotStr[str]
|
|
72
83
|
"""The tags associated with the entity"""
|
|
73
84
|
|
|
74
85
|
tasks: Iterable["EvaluationTaskParam"]
|
|
@@ -80,13 +91,13 @@ class EvaluationWithDatasetCreateRequestDataset(TypedDict, total=False):
|
|
|
80
91
|
|
|
81
92
|
description: str
|
|
82
93
|
|
|
83
|
-
keys:
|
|
94
|
+
keys: SequenceNotStr[str]
|
|
84
95
|
"""Keys from items in the `data` field that should be included in the dataset.
|
|
85
96
|
|
|
86
97
|
If not provided, all keys will be included.
|
|
87
98
|
"""
|
|
88
99
|
|
|
89
|
-
tags:
|
|
100
|
+
tags: SequenceNotStr[str]
|
|
90
101
|
"""The tags associated with the entity"""
|
|
91
102
|
|
|
92
103
|
|
|
@@ -5,6 +5,8 @@ from __future__ import annotations
|
|
|
5
5
|
from typing import List
|
|
6
6
|
from typing_extensions import Literal, TypedDict
|
|
7
7
|
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
|
|
8
10
|
__all__ = ["EvaluationListParams"]
|
|
9
11
|
|
|
10
12
|
|
|
@@ -21,6 +23,6 @@ class EvaluationListParams(TypedDict, total=False):
|
|
|
21
23
|
|
|
22
24
|
starting_after: str
|
|
23
25
|
|
|
24
|
-
tags:
|
|
26
|
+
tags: SequenceNotStr[str]
|
|
25
27
|
|
|
26
28
|
views: List[Literal["tasks"]]
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Union, Iterable
|
|
6
6
|
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
|
7
7
|
|
|
8
|
+
from .._types import SequenceNotStr
|
|
8
9
|
from .item_locator import ItemLocator
|
|
9
10
|
|
|
10
11
|
__all__ = [
|
|
@@ -65,7 +66,7 @@ class ChatCompletionEvaluationTaskConfigurationTyped(TypedDict, total=False):
|
|
|
65
66
|
|
|
66
67
|
metadata: Union[Dict[str, str], ItemLocator]
|
|
67
68
|
|
|
68
|
-
modalities: Union[
|
|
69
|
+
modalities: Union[SequenceNotStr[str], ItemLocator]
|
|
69
70
|
|
|
70
71
|
n: Union[int, ItemLocator]
|
|
71
72
|
|
|
@@ -342,7 +343,7 @@ class AutoEvaluationGuidedDecodingEvaluationTaskConfigurationAutoEvaluationStruc
|
|
|
342
343
|
class AutoEvaluationGuidedDecodingEvaluationTaskConfigurationAutoEvaluationGuidedDecodingTaskRequestWithItemLocator(
|
|
343
344
|
TypedDict, total=False
|
|
344
345
|
):
|
|
345
|
-
choices: Required[
|
|
346
|
+
choices: Required[SequenceNotStr[str]]
|
|
346
347
|
"""Choices array cannot be empty"""
|
|
347
348
|
|
|
348
349
|
model: Required[str]
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List
|
|
6
5
|
from typing_extensions import TypedDict
|
|
7
6
|
|
|
7
|
+
from .._types import SequenceNotStr
|
|
8
|
+
|
|
8
9
|
__all__ = ["EvaluationUpdateParams"]
|
|
9
10
|
|
|
10
11
|
|
|
@@ -13,5 +14,5 @@ class EvaluationUpdateParams(TypedDict, total=False):
|
|
|
13
14
|
|
|
14
15
|
name: str
|
|
15
16
|
|
|
16
|
-
tags:
|
|
17
|
+
tags: SequenceNotStr[str]
|
|
17
18
|
"""The tags associated with the entity"""
|
|
@@ -174,6 +174,10 @@ class InferenceModel(BaseModel):
|
|
|
174
174
|
|
|
175
175
|
status: Literal["failed", "ready", "deploying"]
|
|
176
176
|
|
|
177
|
+
availability: Optional[Literal["unknown", "available", "unavailable"]] = FieldInfo(
|
|
178
|
+
alias="model_availability", default=None
|
|
179
|
+
)
|
|
180
|
+
|
|
177
181
|
metadata: Optional[Dict[str, object]] = FieldInfo(alias="model_metadata", default=None)
|
|
178
182
|
|
|
179
183
|
object: Optional[Literal["model"]] = None
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, Union
|
|
6
6
|
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
|
7
7
|
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
|
|
8
10
|
__all__ = [
|
|
9
11
|
"ModelCreateParams",
|
|
10
12
|
"LaunchModelCreateRequest",
|
|
@@ -32,7 +34,7 @@ class LaunchModelCreateRequest(TypedDict, total=False):
|
|
|
32
34
|
|
|
33
35
|
|
|
34
36
|
class LaunchModelCreateRequestVendorConfigurationModelImage(TypedDict, total=False):
|
|
35
|
-
command: Required[
|
|
37
|
+
command: Required[SequenceNotStr[str]]
|
|
36
38
|
|
|
37
39
|
registry: Required[str]
|
|
38
40
|
|
|
@@ -52,7 +54,7 @@ class LaunchModelCreateRequestVendorConfigurationModelImage(TypedDict, total=Fal
|
|
|
52
54
|
|
|
53
55
|
response_schema: Dict[str, object]
|
|
54
56
|
|
|
55
|
-
streaming_command:
|
|
57
|
+
streaming_command: SequenceNotStr[str]
|
|
56
58
|
|
|
57
59
|
streaming_predict_route: str
|
|
58
60
|
|
|
@@ -147,7 +149,7 @@ class LlmEngineModelCreateRequestVendorConfigurationTyped(TypedDict, total=False
|
|
|
147
149
|
|
|
148
150
|
per_worker: int
|
|
149
151
|
|
|
150
|
-
post_inference_hooks:
|
|
152
|
+
post_inference_hooks: SequenceNotStr[str]
|
|
151
153
|
|
|
152
154
|
public_inference: bool
|
|
153
155
|
|