scale-gp-beta 0.1.0a36__py3-none-any.whl → 0.1.0a37__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/_models.py +8 -3
- scale_gp_beta/_utils/_sync.py +3 -31
- scale_gp_beta/_utils/_utils.py +1 -1
- scale_gp_beta/_version.py +1 -1
- scale_gp_beta/resources/dataset_items.py +28 -2
- scale_gp_beta/resources/datasets.py +8 -0
- scale_gp_beta/resources/evaluations.py +16 -0
- scale_gp_beta/resources/questions.py +107 -1
- scale_gp_beta/types/dataset_create_params.py +3 -0
- scale_gp_beta/types/dataset_item_batch_create_params.py +3 -0
- scale_gp_beta/types/dataset_item_update_params.py +3 -0
- scale_gp_beta/types/evaluation_create_params.py +6 -0
- scale_gp_beta/types/question.py +48 -1
- scale_gp_beta/types/question_create_params.py +38 -1
- {scale_gp_beta-0.1.0a36.dist-info → scale_gp_beta-0.1.0a37.dist-info}/METADATA +4 -5
- {scale_gp_beta-0.1.0a36.dist-info → scale_gp_beta-0.1.0a37.dist-info}/RECORD +18 -18
- {scale_gp_beta-0.1.0a36.dist-info → scale_gp_beta-0.1.0a37.dist-info}/WHEEL +0 -0
- {scale_gp_beta-0.1.0a36.dist-info → scale_gp_beta-0.1.0a37.dist-info}/licenses/LICENSE +0 -0
scale_gp_beta/_models.py
CHANGED
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
import inspect
|
|
5
|
+
import weakref
|
|
5
6
|
from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
|
|
6
7
|
from datetime import date, datetime
|
|
7
8
|
from typing_extensions import (
|
|
@@ -573,6 +574,9 @@ class CachedDiscriminatorType(Protocol):
|
|
|
573
574
|
__discriminator__: DiscriminatorDetails
|
|
574
575
|
|
|
575
576
|
|
|
577
|
+
DISCRIMINATOR_CACHE: weakref.WeakKeyDictionary[type, DiscriminatorDetails] = weakref.WeakKeyDictionary()
|
|
578
|
+
|
|
579
|
+
|
|
576
580
|
class DiscriminatorDetails:
|
|
577
581
|
field_name: str
|
|
578
582
|
"""The name of the discriminator field in the variant class, e.g.
|
|
@@ -615,8 +619,9 @@ class DiscriminatorDetails:
|
|
|
615
619
|
|
|
616
620
|
|
|
617
621
|
def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None:
|
|
618
|
-
|
|
619
|
-
|
|
622
|
+
cached = DISCRIMINATOR_CACHE.get(union)
|
|
623
|
+
if cached is not None:
|
|
624
|
+
return cached
|
|
620
625
|
|
|
621
626
|
discriminator_field_name: str | None = None
|
|
622
627
|
|
|
@@ -669,7 +674,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
|
|
|
669
674
|
discriminator_field=discriminator_field_name,
|
|
670
675
|
discriminator_alias=discriminator_alias,
|
|
671
676
|
)
|
|
672
|
-
|
|
677
|
+
DISCRIMINATOR_CACHE.setdefault(union, details)
|
|
673
678
|
return details
|
|
674
679
|
|
|
675
680
|
|
scale_gp_beta/_utils/_sync.py
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import sys
|
|
4
3
|
import asyncio
|
|
5
4
|
import functools
|
|
6
|
-
import
|
|
7
|
-
from typing import Any, TypeVar, Callable, Awaitable
|
|
5
|
+
from typing import TypeVar, Callable, Awaitable
|
|
8
6
|
from typing_extensions import ParamSpec
|
|
9
7
|
|
|
10
8
|
import anyio
|
|
@@ -15,34 +13,11 @@ T_Retval = TypeVar("T_Retval")
|
|
|
15
13
|
T_ParamSpec = ParamSpec("T_ParamSpec")
|
|
16
14
|
|
|
17
15
|
|
|
18
|
-
if sys.version_info >= (3, 9):
|
|
19
|
-
_asyncio_to_thread = asyncio.to_thread
|
|
20
|
-
else:
|
|
21
|
-
# backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
|
|
22
|
-
# for Python 3.8 support
|
|
23
|
-
async def _asyncio_to_thread(
|
|
24
|
-
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
|
|
25
|
-
) -> Any:
|
|
26
|
-
"""Asynchronously run function *func* in a separate thread.
|
|
27
|
-
|
|
28
|
-
Any *args and **kwargs supplied for this function are directly passed
|
|
29
|
-
to *func*. Also, the current :class:`contextvars.Context` is propagated,
|
|
30
|
-
allowing context variables from the main thread to be accessed in the
|
|
31
|
-
separate thread.
|
|
32
|
-
|
|
33
|
-
Returns a coroutine that can be awaited to get the eventual result of *func*.
|
|
34
|
-
"""
|
|
35
|
-
loop = asyncio.events.get_running_loop()
|
|
36
|
-
ctx = contextvars.copy_context()
|
|
37
|
-
func_call = functools.partial(ctx.run, func, *args, **kwargs)
|
|
38
|
-
return await loop.run_in_executor(None, func_call)
|
|
39
|
-
|
|
40
|
-
|
|
41
16
|
async def to_thread(
|
|
42
17
|
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
|
|
43
18
|
) -> T_Retval:
|
|
44
19
|
if sniffio.current_async_library() == "asyncio":
|
|
45
|
-
return await
|
|
20
|
+
return await asyncio.to_thread(func, *args, **kwargs)
|
|
46
21
|
|
|
47
22
|
return await anyio.to_thread.run_sync(
|
|
48
23
|
functools.partial(func, *args, **kwargs),
|
|
@@ -53,10 +28,7 @@ async def to_thread(
|
|
|
53
28
|
def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
|
|
54
29
|
"""
|
|
55
30
|
Take a blocking function and create an async one that receives the same
|
|
56
|
-
positional and keyword arguments.
|
|
57
|
-
asyncio.to_thread to run the function in a separate thread. For python version
|
|
58
|
-
3.8, it uses locally defined copy of the asyncio.to_thread function which was
|
|
59
|
-
introduced in python 3.9.
|
|
31
|
+
positional and keyword arguments.
|
|
60
32
|
|
|
61
33
|
Usage:
|
|
62
34
|
|
scale_gp_beta/_utils/_utils.py
CHANGED
|
@@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
|
|
|
133
133
|
# Type safe methods for narrowing types with TypeVars.
|
|
134
134
|
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
|
|
135
135
|
# however this cause Pyright to rightfully report errors. As we know we don't
|
|
136
|
-
# care about the contained types we can safely use `object` in
|
|
136
|
+
# care about the contained types we can safely use `object` in its place.
|
|
137
137
|
#
|
|
138
138
|
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
|
|
139
139
|
# `is_*` is for when you're dealing with an unknown input
|
scale_gp_beta/_version.py
CHANGED
|
@@ -98,6 +98,7 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
98
98
|
dataset_item_id: str,
|
|
99
99
|
*,
|
|
100
100
|
data: Dict[str, object],
|
|
101
|
+
files: Dict[str, str] | Omit = omit,
|
|
101
102
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
102
103
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
103
104
|
extra_headers: Headers | None = None,
|
|
@@ -111,6 +112,8 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
111
112
|
Args:
|
|
112
113
|
data: Updated dataset item data
|
|
113
114
|
|
|
115
|
+
files: Files to be associated to the dataset
|
|
116
|
+
|
|
114
117
|
extra_headers: Send extra headers
|
|
115
118
|
|
|
116
119
|
extra_query: Add additional query parameters to the request
|
|
@@ -123,7 +126,13 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
123
126
|
raise ValueError(f"Expected a non-empty value for `dataset_item_id` but received {dataset_item_id!r}")
|
|
124
127
|
return self._patch(
|
|
125
128
|
f"/v5/dataset-items/{dataset_item_id}",
|
|
126
|
-
body=maybe_transform(
|
|
129
|
+
body=maybe_transform(
|
|
130
|
+
{
|
|
131
|
+
"data": data,
|
|
132
|
+
"files": files,
|
|
133
|
+
},
|
|
134
|
+
dataset_item_update_params.DatasetItemUpdateParams,
|
|
135
|
+
),
|
|
127
136
|
options=make_request_options(
|
|
128
137
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
129
138
|
),
|
|
@@ -228,6 +237,7 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
228
237
|
*,
|
|
229
238
|
data: Iterable[Dict[str, object]],
|
|
230
239
|
dataset_id: str,
|
|
240
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
231
241
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
232
242
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
233
243
|
extra_headers: Headers | None = None,
|
|
@@ -243,6 +253,8 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
243
253
|
|
|
244
254
|
dataset_id: Identifier of the target dataset
|
|
245
255
|
|
|
256
|
+
files: Files to be associated to the dataset
|
|
257
|
+
|
|
246
258
|
extra_headers: Send extra headers
|
|
247
259
|
|
|
248
260
|
extra_query: Add additional query parameters to the request
|
|
@@ -257,6 +269,7 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
257
269
|
{
|
|
258
270
|
"data": data,
|
|
259
271
|
"dataset_id": dataset_id,
|
|
272
|
+
"files": files,
|
|
260
273
|
},
|
|
261
274
|
dataset_item_batch_create_params.DatasetItemBatchCreateParams,
|
|
262
275
|
),
|
|
@@ -335,6 +348,7 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
335
348
|
dataset_item_id: str,
|
|
336
349
|
*,
|
|
337
350
|
data: Dict[str, object],
|
|
351
|
+
files: Dict[str, str] | Omit = omit,
|
|
338
352
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
339
353
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
340
354
|
extra_headers: Headers | None = None,
|
|
@@ -348,6 +362,8 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
348
362
|
Args:
|
|
349
363
|
data: Updated dataset item data
|
|
350
364
|
|
|
365
|
+
files: Files to be associated to the dataset
|
|
366
|
+
|
|
351
367
|
extra_headers: Send extra headers
|
|
352
368
|
|
|
353
369
|
extra_query: Add additional query parameters to the request
|
|
@@ -360,7 +376,13 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
360
376
|
raise ValueError(f"Expected a non-empty value for `dataset_item_id` but received {dataset_item_id!r}")
|
|
361
377
|
return await self._patch(
|
|
362
378
|
f"/v5/dataset-items/{dataset_item_id}",
|
|
363
|
-
body=await async_maybe_transform(
|
|
379
|
+
body=await async_maybe_transform(
|
|
380
|
+
{
|
|
381
|
+
"data": data,
|
|
382
|
+
"files": files,
|
|
383
|
+
},
|
|
384
|
+
dataset_item_update_params.DatasetItemUpdateParams,
|
|
385
|
+
),
|
|
364
386
|
options=make_request_options(
|
|
365
387
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
366
388
|
),
|
|
@@ -465,6 +487,7 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
465
487
|
*,
|
|
466
488
|
data: Iterable[Dict[str, object]],
|
|
467
489
|
dataset_id: str,
|
|
490
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
468
491
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
469
492
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
470
493
|
extra_headers: Headers | None = None,
|
|
@@ -480,6 +503,8 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
480
503
|
|
|
481
504
|
dataset_id: Identifier of the target dataset
|
|
482
505
|
|
|
506
|
+
files: Files to be associated to the dataset
|
|
507
|
+
|
|
483
508
|
extra_headers: Send extra headers
|
|
484
509
|
|
|
485
510
|
extra_query: Add additional query parameters to the request
|
|
@@ -494,6 +519,7 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
494
519
|
{
|
|
495
520
|
"data": data,
|
|
496
521
|
"dataset_id": dataset_id,
|
|
522
|
+
"files": files,
|
|
497
523
|
},
|
|
498
524
|
dataset_item_batch_create_params.DatasetItemBatchCreateParams,
|
|
499
525
|
),
|
|
@@ -52,6 +52,7 @@ class DatasetsResource(SyncAPIResource):
|
|
|
52
52
|
data: Iterable[Dict[str, object]],
|
|
53
53
|
name: str,
|
|
54
54
|
description: str | Omit = omit,
|
|
55
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
55
56
|
tags: SequenceNotStr[str] | Omit = omit,
|
|
56
57
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
57
58
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -66,6 +67,8 @@ class DatasetsResource(SyncAPIResource):
|
|
|
66
67
|
Args:
|
|
67
68
|
data: Items to be included in the dataset
|
|
68
69
|
|
|
70
|
+
files: Files to be associated to the dataset
|
|
71
|
+
|
|
69
72
|
tags: The tags associated with the entity
|
|
70
73
|
|
|
71
74
|
extra_headers: Send extra headers
|
|
@@ -83,6 +86,7 @@ class DatasetsResource(SyncAPIResource):
|
|
|
83
86
|
"data": data,
|
|
84
87
|
"name": name,
|
|
85
88
|
"description": description,
|
|
89
|
+
"files": files,
|
|
86
90
|
"tags": tags,
|
|
87
91
|
},
|
|
88
92
|
dataset_create_params.DatasetCreateParams,
|
|
@@ -340,6 +344,7 @@ class AsyncDatasetsResource(AsyncAPIResource):
|
|
|
340
344
|
data: Iterable[Dict[str, object]],
|
|
341
345
|
name: str,
|
|
342
346
|
description: str | Omit = omit,
|
|
347
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
343
348
|
tags: SequenceNotStr[str] | Omit = omit,
|
|
344
349
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
345
350
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -354,6 +359,8 @@ class AsyncDatasetsResource(AsyncAPIResource):
|
|
|
354
359
|
Args:
|
|
355
360
|
data: Items to be included in the dataset
|
|
356
361
|
|
|
362
|
+
files: Files to be associated to the dataset
|
|
363
|
+
|
|
357
364
|
tags: The tags associated with the entity
|
|
358
365
|
|
|
359
366
|
extra_headers: Send extra headers
|
|
@@ -371,6 +378,7 @@ class AsyncDatasetsResource(AsyncAPIResource):
|
|
|
371
378
|
"data": data,
|
|
372
379
|
"name": name,
|
|
373
380
|
"description": description,
|
|
381
|
+
"files": files,
|
|
374
382
|
"tags": tags,
|
|
375
383
|
},
|
|
376
384
|
dataset_create_params.DatasetCreateParams,
|
|
@@ -58,6 +58,7 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
58
58
|
data: Iterable[Dict[str, object]],
|
|
59
59
|
name: str,
|
|
60
60
|
description: str | Omit = omit,
|
|
61
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
61
62
|
metadata: Dict[str, object] | Omit = omit,
|
|
62
63
|
tags: SequenceNotStr[str] | Omit = omit,
|
|
63
64
|
tasks: Iterable[EvaluationTaskParam] | Omit = omit,
|
|
@@ -74,6 +75,8 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
74
75
|
Args:
|
|
75
76
|
data: Items to be evaluated
|
|
76
77
|
|
|
78
|
+
files: Files to be associated to the evaluation
|
|
79
|
+
|
|
77
80
|
metadata: Optional metadata key-value pairs for the evaluation
|
|
78
81
|
|
|
79
82
|
tags: The tags associated with the entity
|
|
@@ -140,6 +143,7 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
140
143
|
dataset: evaluation_create_params.EvaluationWithDatasetCreateRequestDataset,
|
|
141
144
|
name: str,
|
|
142
145
|
description: str | Omit = omit,
|
|
146
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
143
147
|
metadata: Dict[str, object] | Omit = omit,
|
|
144
148
|
tags: SequenceNotStr[str] | Omit = omit,
|
|
145
149
|
tasks: Iterable[EvaluationTaskParam] | Omit = omit,
|
|
@@ -158,6 +162,8 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
158
162
|
|
|
159
163
|
dataset: Create a reusable dataset from items in the `data` field
|
|
160
164
|
|
|
165
|
+
files: Files to be associated to the evaluation
|
|
166
|
+
|
|
161
167
|
metadata: Optional metadata key-value pairs for the evaluation
|
|
162
168
|
|
|
163
169
|
tags: The tags associated with the entity
|
|
@@ -183,6 +189,7 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
183
189
|
| Omit = omit,
|
|
184
190
|
name: str,
|
|
185
191
|
description: str | Omit = omit,
|
|
192
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
186
193
|
metadata: Dict[str, object] | Omit = omit,
|
|
187
194
|
tags: SequenceNotStr[str] | Omit = omit,
|
|
188
195
|
tasks: Iterable[EvaluationTaskParam] | Omit = omit,
|
|
@@ -202,6 +209,7 @@ class EvaluationsResource(SyncAPIResource):
|
|
|
202
209
|
"data": data,
|
|
203
210
|
"name": name,
|
|
204
211
|
"description": description,
|
|
212
|
+
"files": files,
|
|
205
213
|
"metadata": metadata,
|
|
206
214
|
"tags": tags,
|
|
207
215
|
"tasks": tasks,
|
|
@@ -471,6 +479,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
471
479
|
data: Iterable[Dict[str, object]],
|
|
472
480
|
name: str,
|
|
473
481
|
description: str | Omit = omit,
|
|
482
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
474
483
|
metadata: Dict[str, object] | Omit = omit,
|
|
475
484
|
tags: SequenceNotStr[str] | Omit = omit,
|
|
476
485
|
tasks: Iterable[EvaluationTaskParam] | Omit = omit,
|
|
@@ -487,6 +496,8 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
487
496
|
Args:
|
|
488
497
|
data: Items to be evaluated
|
|
489
498
|
|
|
499
|
+
files: Files to be associated to the evaluation
|
|
500
|
+
|
|
490
501
|
metadata: Optional metadata key-value pairs for the evaluation
|
|
491
502
|
|
|
492
503
|
tags: The tags associated with the entity
|
|
@@ -553,6 +564,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
553
564
|
dataset: evaluation_create_params.EvaluationWithDatasetCreateRequestDataset,
|
|
554
565
|
name: str,
|
|
555
566
|
description: str | Omit = omit,
|
|
567
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
556
568
|
metadata: Dict[str, object] | Omit = omit,
|
|
557
569
|
tags: SequenceNotStr[str] | Omit = omit,
|
|
558
570
|
tasks: Iterable[EvaluationTaskParam] | Omit = omit,
|
|
@@ -571,6 +583,8 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
571
583
|
|
|
572
584
|
dataset: Create a reusable dataset from items in the `data` field
|
|
573
585
|
|
|
586
|
+
files: Files to be associated to the evaluation
|
|
587
|
+
|
|
574
588
|
metadata: Optional metadata key-value pairs for the evaluation
|
|
575
589
|
|
|
576
590
|
tags: The tags associated with the entity
|
|
@@ -596,6 +610,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
596
610
|
| Omit = omit,
|
|
597
611
|
name: str,
|
|
598
612
|
description: str | Omit = omit,
|
|
613
|
+
files: Iterable[Dict[str, str]] | Omit = omit,
|
|
599
614
|
metadata: Dict[str, object] | Omit = omit,
|
|
600
615
|
tags: SequenceNotStr[str] | Omit = omit,
|
|
601
616
|
tasks: Iterable[EvaluationTaskParam] | Omit = omit,
|
|
@@ -615,6 +630,7 @@ class AsyncEvaluationsResource(AsyncAPIResource):
|
|
|
615
630
|
"data": data,
|
|
616
631
|
"name": name,
|
|
617
632
|
"description": description,
|
|
633
|
+
"files": files,
|
|
618
634
|
"metadata": metadata,
|
|
619
635
|
"tags": tags,
|
|
620
636
|
"tasks": tasks,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Any, cast
|
|
5
|
+
from typing import Any, Dict, Iterable, cast
|
|
6
6
|
from typing_extensions import Literal, overload
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
@@ -52,6 +52,7 @@ class QuestionsResource(SyncAPIResource):
|
|
|
52
52
|
configuration: question_create_params.CategoricalQuestionRequestConfiguration,
|
|
53
53
|
name: str,
|
|
54
54
|
prompt: str,
|
|
55
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
55
56
|
question_type: Literal["categorical"] | Omit = omit,
|
|
56
57
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
57
58
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -66,6 +67,8 @@ class QuestionsResource(SyncAPIResource):
|
|
|
66
67
|
Args:
|
|
67
68
|
prompt: user-facing question prompt
|
|
68
69
|
|
|
70
|
+
conditions: Conditions for the question to be shown
|
|
71
|
+
|
|
69
72
|
extra_headers: Send extra headers
|
|
70
73
|
|
|
71
74
|
extra_query: Add additional query parameters to the request
|
|
@@ -83,6 +86,7 @@ class QuestionsResource(SyncAPIResource):
|
|
|
83
86
|
configuration: question_create_params.RatingQuestionRequestConfiguration,
|
|
84
87
|
name: str,
|
|
85
88
|
prompt: str,
|
|
89
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
86
90
|
question_type: Literal["rating"] | Omit = omit,
|
|
87
91
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
88
92
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -97,6 +101,8 @@ class QuestionsResource(SyncAPIResource):
|
|
|
97
101
|
Args:
|
|
98
102
|
prompt: user-facing question prompt
|
|
99
103
|
|
|
104
|
+
conditions: Conditions for the question to be shown
|
|
105
|
+
|
|
100
106
|
extra_headers: Send extra headers
|
|
101
107
|
|
|
102
108
|
extra_query: Add additional query parameters to the request
|
|
@@ -113,6 +119,7 @@ class QuestionsResource(SyncAPIResource):
|
|
|
113
119
|
*,
|
|
114
120
|
name: str,
|
|
115
121
|
prompt: str,
|
|
122
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
116
123
|
configuration: question_create_params.NumberQuestionRequestConfiguration | Omit = omit,
|
|
117
124
|
question_type: Literal["number"] | Omit = omit,
|
|
118
125
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -128,6 +135,8 @@ class QuestionsResource(SyncAPIResource):
|
|
|
128
135
|
Args:
|
|
129
136
|
prompt: user-facing question prompt
|
|
130
137
|
|
|
138
|
+
conditions: Conditions for the question to be shown
|
|
139
|
+
|
|
131
140
|
extra_headers: Send extra headers
|
|
132
141
|
|
|
133
142
|
extra_query: Add additional query parameters to the request
|
|
@@ -144,6 +153,7 @@ class QuestionsResource(SyncAPIResource):
|
|
|
144
153
|
*,
|
|
145
154
|
name: str,
|
|
146
155
|
prompt: str,
|
|
156
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
147
157
|
configuration: question_create_params.FreeTextQuestionRequestConfiguration | Omit = omit,
|
|
148
158
|
question_type: Literal["free_text"] | Omit = omit,
|
|
149
159
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -159,6 +169,8 @@ class QuestionsResource(SyncAPIResource):
|
|
|
159
169
|
Args:
|
|
160
170
|
prompt: user-facing question prompt
|
|
161
171
|
|
|
172
|
+
conditions: Conditions for the question to be shown
|
|
173
|
+
|
|
162
174
|
extra_headers: Send extra headers
|
|
163
175
|
|
|
164
176
|
extra_query: Add additional query parameters to the request
|
|
@@ -176,6 +188,7 @@ class QuestionsResource(SyncAPIResource):
|
|
|
176
188
|
configuration: question_create_params.FormQuestionRequestConfiguration,
|
|
177
189
|
name: str,
|
|
178
190
|
prompt: str,
|
|
191
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
179
192
|
question_type: Literal["form"] | Omit = omit,
|
|
180
193
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
181
194
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -190,6 +203,42 @@ class QuestionsResource(SyncAPIResource):
|
|
|
190
203
|
Args:
|
|
191
204
|
prompt: user-facing question prompt
|
|
192
205
|
|
|
206
|
+
conditions: Conditions for the question to be shown
|
|
207
|
+
|
|
208
|
+
extra_headers: Send extra headers
|
|
209
|
+
|
|
210
|
+
extra_query: Add additional query parameters to the request
|
|
211
|
+
|
|
212
|
+
extra_body: Add additional JSON properties to the request
|
|
213
|
+
|
|
214
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
215
|
+
"""
|
|
216
|
+
...
|
|
217
|
+
|
|
218
|
+
@overload
|
|
219
|
+
def create(
|
|
220
|
+
self,
|
|
221
|
+
*,
|
|
222
|
+
name: str,
|
|
223
|
+
prompt: str,
|
|
224
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
225
|
+
configuration: question_create_params.TimestampQuestionRequestConfiguration | Omit = omit,
|
|
226
|
+
question_type: Literal["timestamp"] | Omit = omit,
|
|
227
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
228
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
229
|
+
extra_headers: Headers | None = None,
|
|
230
|
+
extra_query: Query | None = None,
|
|
231
|
+
extra_body: Body | None = None,
|
|
232
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
233
|
+
) -> Question:
|
|
234
|
+
"""
|
|
235
|
+
Create Question
|
|
236
|
+
|
|
237
|
+
Args:
|
|
238
|
+
prompt: user-facing question prompt
|
|
239
|
+
|
|
240
|
+
conditions: Conditions for the question to be shown
|
|
241
|
+
|
|
193
242
|
extra_headers: Send extra headers
|
|
194
243
|
|
|
195
244
|
extra_query: Add additional query parameters to the request
|
|
@@ -209,14 +258,17 @@ class QuestionsResource(SyncAPIResource):
|
|
|
209
258
|
| question_create_params.NumberQuestionRequestConfiguration
|
|
210
259
|
| question_create_params.FreeTextQuestionRequestConfiguration
|
|
211
260
|
| question_create_params.FormQuestionRequestConfiguration
|
|
261
|
+
| question_create_params.TimestampQuestionRequestConfiguration
|
|
212
262
|
| Omit = omit,
|
|
213
263
|
name: str,
|
|
214
264
|
prompt: str,
|
|
265
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
215
266
|
question_type: Literal["categorical"]
|
|
216
267
|
| Literal["rating"]
|
|
217
268
|
| Literal["number"]
|
|
218
269
|
| Literal["free_text"]
|
|
219
270
|
| Literal["form"]
|
|
271
|
+
| Literal["timestamp"]
|
|
220
272
|
| Omit = omit,
|
|
221
273
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
222
274
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -234,6 +286,7 @@ class QuestionsResource(SyncAPIResource):
|
|
|
234
286
|
"configuration": configuration,
|
|
235
287
|
"name": name,
|
|
236
288
|
"prompt": prompt,
|
|
289
|
+
"conditions": conditions,
|
|
237
290
|
"question_type": question_type,
|
|
238
291
|
},
|
|
239
292
|
question_create_params.QuestionCreateParams,
|
|
@@ -356,6 +409,7 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
356
409
|
configuration: question_create_params.CategoricalQuestionRequestConfiguration,
|
|
357
410
|
name: str,
|
|
358
411
|
prompt: str,
|
|
412
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
359
413
|
question_type: Literal["categorical"] | Omit = omit,
|
|
360
414
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
361
415
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -370,6 +424,8 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
370
424
|
Args:
|
|
371
425
|
prompt: user-facing question prompt
|
|
372
426
|
|
|
427
|
+
conditions: Conditions for the question to be shown
|
|
428
|
+
|
|
373
429
|
extra_headers: Send extra headers
|
|
374
430
|
|
|
375
431
|
extra_query: Add additional query parameters to the request
|
|
@@ -387,6 +443,7 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
387
443
|
configuration: question_create_params.RatingQuestionRequestConfiguration,
|
|
388
444
|
name: str,
|
|
389
445
|
prompt: str,
|
|
446
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
390
447
|
question_type: Literal["rating"] | Omit = omit,
|
|
391
448
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
392
449
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -401,6 +458,8 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
401
458
|
Args:
|
|
402
459
|
prompt: user-facing question prompt
|
|
403
460
|
|
|
461
|
+
conditions: Conditions for the question to be shown
|
|
462
|
+
|
|
404
463
|
extra_headers: Send extra headers
|
|
405
464
|
|
|
406
465
|
extra_query: Add additional query parameters to the request
|
|
@@ -417,6 +476,7 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
417
476
|
*,
|
|
418
477
|
name: str,
|
|
419
478
|
prompt: str,
|
|
479
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
420
480
|
configuration: question_create_params.NumberQuestionRequestConfiguration | Omit = omit,
|
|
421
481
|
question_type: Literal["number"] | Omit = omit,
|
|
422
482
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -432,6 +492,8 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
432
492
|
Args:
|
|
433
493
|
prompt: user-facing question prompt
|
|
434
494
|
|
|
495
|
+
conditions: Conditions for the question to be shown
|
|
496
|
+
|
|
435
497
|
extra_headers: Send extra headers
|
|
436
498
|
|
|
437
499
|
extra_query: Add additional query parameters to the request
|
|
@@ -448,6 +510,7 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
448
510
|
*,
|
|
449
511
|
name: str,
|
|
450
512
|
prompt: str,
|
|
513
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
451
514
|
configuration: question_create_params.FreeTextQuestionRequestConfiguration | Omit = omit,
|
|
452
515
|
question_type: Literal["free_text"] | Omit = omit,
|
|
453
516
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -463,6 +526,8 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
463
526
|
Args:
|
|
464
527
|
prompt: user-facing question prompt
|
|
465
528
|
|
|
529
|
+
conditions: Conditions for the question to be shown
|
|
530
|
+
|
|
466
531
|
extra_headers: Send extra headers
|
|
467
532
|
|
|
468
533
|
extra_query: Add additional query parameters to the request
|
|
@@ -480,6 +545,7 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
480
545
|
configuration: question_create_params.FormQuestionRequestConfiguration,
|
|
481
546
|
name: str,
|
|
482
547
|
prompt: str,
|
|
548
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
483
549
|
question_type: Literal["form"] | Omit = omit,
|
|
484
550
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
485
551
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -494,6 +560,42 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
494
560
|
Args:
|
|
495
561
|
prompt: user-facing question prompt
|
|
496
562
|
|
|
563
|
+
conditions: Conditions for the question to be shown
|
|
564
|
+
|
|
565
|
+
extra_headers: Send extra headers
|
|
566
|
+
|
|
567
|
+
extra_query: Add additional query parameters to the request
|
|
568
|
+
|
|
569
|
+
extra_body: Add additional JSON properties to the request
|
|
570
|
+
|
|
571
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
572
|
+
"""
|
|
573
|
+
...
|
|
574
|
+
|
|
575
|
+
@overload
|
|
576
|
+
async def create(
|
|
577
|
+
self,
|
|
578
|
+
*,
|
|
579
|
+
name: str,
|
|
580
|
+
prompt: str,
|
|
581
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
582
|
+
configuration: question_create_params.TimestampQuestionRequestConfiguration | Omit = omit,
|
|
583
|
+
question_type: Literal["timestamp"] | Omit = omit,
|
|
584
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
585
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
586
|
+
extra_headers: Headers | None = None,
|
|
587
|
+
extra_query: Query | None = None,
|
|
588
|
+
extra_body: Body | None = None,
|
|
589
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
590
|
+
) -> Question:
|
|
591
|
+
"""
|
|
592
|
+
Create Question
|
|
593
|
+
|
|
594
|
+
Args:
|
|
595
|
+
prompt: user-facing question prompt
|
|
596
|
+
|
|
597
|
+
conditions: Conditions for the question to be shown
|
|
598
|
+
|
|
497
599
|
extra_headers: Send extra headers
|
|
498
600
|
|
|
499
601
|
extra_query: Add additional query parameters to the request
|
|
@@ -513,14 +615,17 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
513
615
|
| question_create_params.NumberQuestionRequestConfiguration
|
|
514
616
|
| question_create_params.FreeTextQuestionRequestConfiguration
|
|
515
617
|
| question_create_params.FormQuestionRequestConfiguration
|
|
618
|
+
| question_create_params.TimestampQuestionRequestConfiguration
|
|
516
619
|
| Omit = omit,
|
|
517
620
|
name: str,
|
|
518
621
|
prompt: str,
|
|
622
|
+
conditions: Iterable[Dict[str, object]] | Omit = omit,
|
|
519
623
|
question_type: Literal["categorical"]
|
|
520
624
|
| Literal["rating"]
|
|
521
625
|
| Literal["number"]
|
|
522
626
|
| Literal["free_text"]
|
|
523
627
|
| Literal["form"]
|
|
628
|
+
| Literal["timestamp"]
|
|
524
629
|
| Omit = omit,
|
|
525
630
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
526
631
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -538,6 +643,7 @@ class AsyncQuestionsResource(AsyncAPIResource):
|
|
|
538
643
|
"configuration": configuration,
|
|
539
644
|
"name": name,
|
|
540
645
|
"prompt": prompt,
|
|
646
|
+
"conditions": conditions,
|
|
541
647
|
"question_type": question_type,
|
|
542
648
|
},
|
|
543
649
|
question_create_params.QuestionCreateParams,
|
|
@@ -25,6 +25,9 @@ class EvaluationStandaloneCreateRequest(TypedDict, total=False):
|
|
|
25
25
|
|
|
26
26
|
description: str
|
|
27
27
|
|
|
28
|
+
files: Iterable[Dict[str, str]]
|
|
29
|
+
"""Files to be associated to the evaluation"""
|
|
30
|
+
|
|
28
31
|
metadata: Dict[str, object]
|
|
29
32
|
"""Optional metadata key-value pairs for the evaluation"""
|
|
30
33
|
|
|
@@ -76,6 +79,9 @@ class EvaluationWithDatasetCreateRequest(TypedDict, total=False):
|
|
|
76
79
|
|
|
77
80
|
description: str
|
|
78
81
|
|
|
82
|
+
files: Iterable[Dict[str, str]]
|
|
83
|
+
"""Files to be associated to the evaluation"""
|
|
84
|
+
|
|
79
85
|
metadata: Dict[str, object]
|
|
80
86
|
"""Optional metadata key-value pairs for the evaluation"""
|
|
81
87
|
|
scale_gp_beta/types/question.py
CHANGED
|
@@ -20,6 +20,8 @@ __all__ = [
|
|
|
20
20
|
"FreeTextQuestionConfiguration",
|
|
21
21
|
"FormQuestion",
|
|
22
22
|
"FormQuestionConfiguration",
|
|
23
|
+
"TimestampQuestion",
|
|
24
|
+
"TimestampQuestionConfiguration",
|
|
23
25
|
]
|
|
24
26
|
|
|
25
27
|
|
|
@@ -51,6 +53,9 @@ class CategoricalQuestion(BaseModel):
|
|
|
51
53
|
prompt: str
|
|
52
54
|
"""user-facing question prompt"""
|
|
53
55
|
|
|
56
|
+
conditions: Optional[List[Dict[str, object]]] = None
|
|
57
|
+
"""Conditions for the question to be shown"""
|
|
58
|
+
|
|
54
59
|
object: Optional[Literal["question"]] = None
|
|
55
60
|
|
|
56
61
|
question_type: Optional[Literal["categorical"]] = None
|
|
@@ -84,6 +89,9 @@ class RatingQuestion(BaseModel):
|
|
|
84
89
|
prompt: str
|
|
85
90
|
"""user-facing question prompt"""
|
|
86
91
|
|
|
92
|
+
conditions: Optional[List[Dict[str, object]]] = None
|
|
93
|
+
"""Conditions for the question to be shown"""
|
|
94
|
+
|
|
87
95
|
object: Optional[Literal["question"]] = None
|
|
88
96
|
|
|
89
97
|
question_type: Optional[Literal["rating"]] = None
|
|
@@ -112,6 +120,9 @@ class NumberQuestion(BaseModel):
|
|
|
112
120
|
prompt: str
|
|
113
121
|
"""user-facing question prompt"""
|
|
114
122
|
|
|
123
|
+
conditions: Optional[List[Dict[str, object]]] = None
|
|
124
|
+
"""Conditions for the question to be shown"""
|
|
125
|
+
|
|
115
126
|
configuration: Optional[NumberQuestionConfiguration] = None
|
|
116
127
|
|
|
117
128
|
object: Optional[Literal["question"]] = None
|
|
@@ -142,6 +153,9 @@ class FreeTextQuestion(BaseModel):
|
|
|
142
153
|
prompt: str
|
|
143
154
|
"""user-facing question prompt"""
|
|
144
155
|
|
|
156
|
+
conditions: Optional[List[Dict[str, object]]] = None
|
|
157
|
+
"""Conditions for the question to be shown"""
|
|
158
|
+
|
|
145
159
|
configuration: Optional[FreeTextQuestionConfiguration] = None
|
|
146
160
|
|
|
147
161
|
object: Optional[Literal["question"]] = None
|
|
@@ -171,12 +185,45 @@ class FormQuestion(BaseModel):
|
|
|
171
185
|
prompt: str
|
|
172
186
|
"""user-facing question prompt"""
|
|
173
187
|
|
|
188
|
+
conditions: Optional[List[Dict[str, object]]] = None
|
|
189
|
+
"""Conditions for the question to be shown"""
|
|
190
|
+
|
|
174
191
|
object: Optional[Literal["question"]] = None
|
|
175
192
|
|
|
176
193
|
question_type: Optional[Literal["form"]] = None
|
|
177
194
|
|
|
178
195
|
|
|
196
|
+
class TimestampQuestionConfiguration(BaseModel):
|
|
197
|
+
allow_multi_timestamps: Optional[bool] = None
|
|
198
|
+
"""Whether to allow multiple media timestamps"""
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
class TimestampQuestion(BaseModel):
|
|
202
|
+
id: str
|
|
203
|
+
"""Unique identifier of the entity"""
|
|
204
|
+
|
|
205
|
+
created_at: datetime
|
|
206
|
+
"""ISO-timestamp when the entity was created"""
|
|
207
|
+
|
|
208
|
+
created_by: Identity
|
|
209
|
+
"""The identity that created the entity."""
|
|
210
|
+
|
|
211
|
+
name: str
|
|
212
|
+
|
|
213
|
+
prompt: str
|
|
214
|
+
"""user-facing question prompt"""
|
|
215
|
+
|
|
216
|
+
conditions: Optional[List[Dict[str, object]]] = None
|
|
217
|
+
"""Conditions for the question to be shown"""
|
|
218
|
+
|
|
219
|
+
configuration: Optional[TimestampQuestionConfiguration] = None
|
|
220
|
+
|
|
221
|
+
object: Optional[Literal["question"]] = None
|
|
222
|
+
|
|
223
|
+
question_type: Optional[Literal["timestamp"]] = None
|
|
224
|
+
|
|
225
|
+
|
|
179
226
|
Question: TypeAlias = Annotated[
|
|
180
|
-
Union[CategoricalQuestion, RatingQuestion, NumberQuestion, FreeTextQuestion, FormQuestion],
|
|
227
|
+
Union[CategoricalQuestion, RatingQuestion, NumberQuestion, FreeTextQuestion, FormQuestion, TimestampQuestion],
|
|
181
228
|
PropertyInfo(discriminator="question_type"),
|
|
182
229
|
]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Dict, Union
|
|
5
|
+
from typing import Dict, Union, Iterable
|
|
6
6
|
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
|
7
7
|
|
|
8
8
|
from .._types import SequenceNotStr
|
|
@@ -19,6 +19,8 @@ __all__ = [
|
|
|
19
19
|
"FreeTextQuestionRequestConfiguration",
|
|
20
20
|
"FormQuestionRequest",
|
|
21
21
|
"FormQuestionRequestConfiguration",
|
|
22
|
+
"TimestampQuestionRequest",
|
|
23
|
+
"TimestampQuestionRequestConfiguration",
|
|
22
24
|
]
|
|
23
25
|
|
|
24
26
|
|
|
@@ -30,6 +32,9 @@ class CategoricalQuestionRequest(TypedDict, total=False):
|
|
|
30
32
|
prompt: Required[str]
|
|
31
33
|
"""user-facing question prompt"""
|
|
32
34
|
|
|
35
|
+
conditions: Iterable[Dict[str, object]]
|
|
36
|
+
"""Conditions for the question to be shown"""
|
|
37
|
+
|
|
33
38
|
question_type: Literal["categorical"]
|
|
34
39
|
|
|
35
40
|
|
|
@@ -52,6 +57,9 @@ class RatingQuestionRequest(TypedDict, total=False):
|
|
|
52
57
|
prompt: Required[str]
|
|
53
58
|
"""user-facing question prompt"""
|
|
54
59
|
|
|
60
|
+
conditions: Iterable[Dict[str, object]]
|
|
61
|
+
"""Conditions for the question to be shown"""
|
|
62
|
+
|
|
55
63
|
question_type: Literal["rating"]
|
|
56
64
|
|
|
57
65
|
|
|
@@ -72,6 +80,9 @@ class NumberQuestionRequest(TypedDict, total=False):
|
|
|
72
80
|
prompt: Required[str]
|
|
73
81
|
"""user-facing question prompt"""
|
|
74
82
|
|
|
83
|
+
conditions: Iterable[Dict[str, object]]
|
|
84
|
+
"""Conditions for the question to be shown"""
|
|
85
|
+
|
|
75
86
|
configuration: NumberQuestionRequestConfiguration
|
|
76
87
|
|
|
77
88
|
question_type: Literal["number"]
|
|
@@ -91,6 +102,9 @@ class FreeTextQuestionRequest(TypedDict, total=False):
|
|
|
91
102
|
prompt: Required[str]
|
|
92
103
|
"""user-facing question prompt"""
|
|
93
104
|
|
|
105
|
+
conditions: Iterable[Dict[str, object]]
|
|
106
|
+
"""Conditions for the question to be shown"""
|
|
107
|
+
|
|
94
108
|
configuration: FreeTextQuestionRequestConfiguration
|
|
95
109
|
|
|
96
110
|
question_type: Literal["free_text"]
|
|
@@ -112,6 +126,9 @@ class FormQuestionRequest(TypedDict, total=False):
|
|
|
112
126
|
prompt: Required[str]
|
|
113
127
|
"""user-facing question prompt"""
|
|
114
128
|
|
|
129
|
+
conditions: Iterable[Dict[str, object]]
|
|
130
|
+
"""Conditions for the question to be shown"""
|
|
131
|
+
|
|
115
132
|
question_type: Literal["form"]
|
|
116
133
|
|
|
117
134
|
|
|
@@ -120,10 +137,30 @@ class FormQuestionRequestConfiguration(TypedDict, total=False):
|
|
|
120
137
|
"""The JSON schema of the desired form object"""
|
|
121
138
|
|
|
122
139
|
|
|
140
|
+
class TimestampQuestionRequest(TypedDict, total=False):
|
|
141
|
+
name: Required[str]
|
|
142
|
+
|
|
143
|
+
prompt: Required[str]
|
|
144
|
+
"""user-facing question prompt"""
|
|
145
|
+
|
|
146
|
+
conditions: Iterable[Dict[str, object]]
|
|
147
|
+
"""Conditions for the question to be shown"""
|
|
148
|
+
|
|
149
|
+
configuration: TimestampQuestionRequestConfiguration
|
|
150
|
+
|
|
151
|
+
question_type: Literal["timestamp"]
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class TimestampQuestionRequestConfiguration(TypedDict, total=False):
|
|
155
|
+
allow_multi_timestamps: bool
|
|
156
|
+
"""Whether to allow multiple media timestamps"""
|
|
157
|
+
|
|
158
|
+
|
|
123
159
|
QuestionCreateParams: TypeAlias = Union[
|
|
124
160
|
CategoricalQuestionRequest,
|
|
125
161
|
RatingQuestionRequest,
|
|
126
162
|
NumberQuestionRequest,
|
|
127
163
|
FreeTextQuestionRequest,
|
|
128
164
|
FormQuestionRequest,
|
|
165
|
+
TimestampQuestionRequest,
|
|
129
166
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: scale-gp-beta
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a37
|
|
4
4
|
Summary: The official Python library for the Scale GP API
|
|
5
5
|
Project-URL: Homepage, https://github.com/scaleapi/sgp-python-beta
|
|
6
6
|
Project-URL: Repository, https://github.com/scaleapi/sgp-python-beta
|
|
@@ -13,7 +13,6 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Operating System :: POSIX
|
|
15
15
|
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -21,7 +20,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
22
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
22
|
Classifier: Typing :: Typed
|
|
24
|
-
Requires-Python: >=3.
|
|
23
|
+
Requires-Python: >=3.9
|
|
25
24
|
Requires-Dist: anyio<5,>=3.5.0
|
|
26
25
|
Requires-Dist: distro<2,>=1.7.0
|
|
27
26
|
Requires-Dist: httpx<1,>=0.23.0
|
|
@@ -38,7 +37,7 @@ Description-Content-Type: text/markdown
|
|
|
38
37
|
<!-- prettier-ignore -->
|
|
39
38
|
[)](https://pypi.org/project/scale-gp-beta/)
|
|
40
39
|
|
|
41
|
-
The Scale GP Python library provides convenient access to the Scale GP REST API from any Python 3.
|
|
40
|
+
The Scale GP Python library provides convenient access to the Scale GP REST API from any Python 3.9+
|
|
42
41
|
application. The library includes type definitions for all request params and response fields,
|
|
43
42
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
44
43
|
|
|
@@ -822,7 +821,7 @@ print(scale_gp_beta.__version__)
|
|
|
822
821
|
|
|
823
822
|
## Requirements
|
|
824
823
|
|
|
825
|
-
Python 3.
|
|
824
|
+
Python 3.9 or higher.
|
|
826
825
|
|
|
827
826
|
## Contributing
|
|
828
827
|
|
|
@@ -5,13 +5,13 @@ scale_gp_beta/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
|
|
|
5
5
|
scale_gp_beta/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
|
6
6
|
scale_gp_beta/_exceptions.py,sha256=95GM5CLFtP-QMjjmzsr5ajjZOyEZvyaETfGmqNPR8YM,3226
|
|
7
7
|
scale_gp_beta/_files.py,sha256=HOCL7NYupx5rmxPWzvzifOW_LkRj0zBssmxqLFtYURI,3616
|
|
8
|
-
scale_gp_beta/_models.py,sha256=
|
|
8
|
+
scale_gp_beta/_models.py,sha256=_jpXNYoIJGzLCqeD4LcmiD4UgZKYMLg4cZ8TcWUn94I,30559
|
|
9
9
|
scale_gp_beta/_qs.py,sha256=craIKyvPktJ94cvf9zn8j8ekG9dWJzhWv0ob34lIOv4,4828
|
|
10
10
|
scale_gp_beta/_resource.py,sha256=siZly_U6D0AOVLAzaOsqUdEFFzVMbWRj-ml30nvRp7E,1118
|
|
11
11
|
scale_gp_beta/_response.py,sha256=GemuybPk0uemovTlGHyHkj-ScYTTDJA0jqH5FQqIPwQ,28852
|
|
12
12
|
scale_gp_beta/_streaming.py,sha256=KHa_-WJgY6cCYhvrYLLc1oqUre23iUGidYXefuyNOrw,10161
|
|
13
13
|
scale_gp_beta/_types.py,sha256=3-dTgyCs1Fep_LgdDCs7B_SYv9He9BYHJYJunweFT9U,7243
|
|
14
|
-
scale_gp_beta/_version.py,sha256=
|
|
14
|
+
scale_gp_beta/_version.py,sha256=Gsl_hFtQYt2vcWicCgFxVTSg2ORWfnjPN5un6zLEEp8,174
|
|
15
15
|
scale_gp_beta/pagination.py,sha256=t-U86PYxl20VRsz8VXOMJJDe7HxkX7ISFMvRNbBNy9s,4054
|
|
16
16
|
scale_gp_beta/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
scale_gp_beta/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
@@ -22,10 +22,10 @@ scale_gp_beta/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XE
|
|
|
22
22
|
scale_gp_beta/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
|
|
23
23
|
scale_gp_beta/_utils/_resources_proxy.py,sha256=WaUZOpuuisv9lUR-7qJEbeHhftBmlvziX-7iEcrjbmc,624
|
|
24
24
|
scale_gp_beta/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
|
|
25
|
-
scale_gp_beta/_utils/_sync.py,sha256=
|
|
25
|
+
scale_gp_beta/_utils/_sync.py,sha256=HBnZkkBnzxtwOZe0212C4EyoRvxhTVtTrLFDz2_xVCg,1589
|
|
26
26
|
scale_gp_beta/_utils/_transform.py,sha256=NjCzmnfqYrsAikUHQig6N9QfuTVbKipuP3ur9mcNF-E,15951
|
|
27
27
|
scale_gp_beta/_utils/_typing.py,sha256=N_5PPuFNsaygbtA_npZd98SVN1LQQvFTKL6bkWPBZGU,4786
|
|
28
|
-
scale_gp_beta/_utils/_utils.py,sha256=
|
|
28
|
+
scale_gp_beta/_utils/_utils.py,sha256=ugfUaneOK7I8h9b3656flwf5u_kthY0gvNuqvgOLoSU,12252
|
|
29
29
|
scale_gp_beta/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
|
30
30
|
scale_gp_beta/lib/CONTRIBUTING.MD,sha256=Fv8H-hZi86n7Vsi2JyeoHi7JzKZGRiNZKO5EqG63IKM,2495
|
|
31
31
|
scale_gp_beta/lib/tracing/__init__.py,sha256=UgyExbqAA2ljDEF4X4YFhtbBZuoQJ2IF4hkGs_xQEc0,226
|
|
@@ -46,13 +46,13 @@ scale_gp_beta/lib/tracing/integrations/openai/utils.py,sha256=s6tbNFJ3N7GjqXDM9f
|
|
|
46
46
|
scale_gp_beta/resources/__init__.py,sha256=93-Ld9MSd_dX_jld0IQD_Ckm4n5NvoR2dy0AiNUYDrg,7003
|
|
47
47
|
scale_gp_beta/resources/completions.py,sha256=wtVhUh5LMwXolICQhpeCZUlzRM-ChLSvLiQm92sO-EQ,30934
|
|
48
48
|
scale_gp_beta/resources/credentials.py,sha256=BDhz10_4Ag5bM_iZLGSCWzvdycxM4U3bAYATVml9JYQ,32743
|
|
49
|
-
scale_gp_beta/resources/dataset_items.py,sha256=
|
|
50
|
-
scale_gp_beta/resources/datasets.py,sha256=
|
|
49
|
+
scale_gp_beta/resources/dataset_items.py,sha256=yQvv5-njB0MVds7tt6bYB4AHU3pVNIo5CbJFcH8VQ4Y,23118
|
|
50
|
+
scale_gp_beta/resources/datasets.py,sha256=x2m3Aua452kqVFI2gF_wjHAcupcS_EeaXoQuyZhObwA,25483
|
|
51
51
|
scale_gp_beta/resources/evaluation_items.py,sha256=tR8FtxCnxVdQzpAnPg9dYQkDZKXyCFe9zEXgk3cbrgw,11517
|
|
52
|
-
scale_gp_beta/resources/evaluations.py,sha256=
|
|
52
|
+
scale_gp_beta/resources/evaluations.py,sha256=4i12A5WfHrS-iclGQHL7pzkO0x2moluijJZo8xf-5IQ,36080
|
|
53
53
|
scale_gp_beta/resources/inference.py,sha256=Gwi7yt8BK47LFRbx9X4Ei4HLh3keZ5a37dHd2eONf4g,7539
|
|
54
54
|
scale_gp_beta/resources/models.py,sha256=obGc4jz3k8Cxl7t218GPmq8HvODX911vc6-wGJ-cXSA,32247
|
|
55
|
-
scale_gp_beta/resources/questions.py,sha256=
|
|
55
|
+
scale_gp_beta/resources/questions.py,sha256=wNd4H3F0uk09shhdg6yZQN1DedjwKGvhZQQN1j53Oiw,30006
|
|
56
56
|
scale_gp_beta/resources/responses.py,sha256=ha6JeU1vCoxC4Z00jsbS1D7jEpxy-xlCiEkx5-RqrX0,11755
|
|
57
57
|
scale_gp_beta/resources/span_assessments.py,sha256=HOJ6qKtwXVPkgRLO8VmcfEoFWTAlAHl-SrjCpIDj7Ck,25560
|
|
58
58
|
scale_gp_beta/resources/spans.py,sha256=ootzSRVA_1hYXOjADrKJ8uO7CwhwZsfYLVJHE83CnIE,32080
|
|
@@ -78,20 +78,20 @@ scale_gp_beta/types/credential_list_params.py,sha256=3yh0VLCaD3PlON_zlddB7rnJsUG
|
|
|
78
78
|
scale_gp_beta/types/credential_secret.py,sha256=xC-_rE4b-s2QJbduvE6DtVPXXI9yWzJ3IGjZB0IM4t4,267
|
|
79
79
|
scale_gp_beta/types/credential_update_params.py,sha256=kZKaZVgBShHxoYVNqWAUo2ZWKN7bcau4Ym3ckYs9_VU,615
|
|
80
80
|
scale_gp_beta/types/dataset.py,sha256=wts1ygPfzuh5pyYZ12YxuJMxVd-yM5hF_ZNUYxpfbho,667
|
|
81
|
-
scale_gp_beta/types/dataset_create_params.py,sha256=
|
|
81
|
+
scale_gp_beta/types/dataset_create_params.py,sha256=KEKL0BZI_i5ZfRp36dOL8vhUAsIBIzqEkfm4MABHE8s,635
|
|
82
82
|
scale_gp_beta/types/dataset_delete_response.py,sha256=OKLcQBastV6fhdKw4kNX1HNn_IczD6OCpHDbkAyg3mM,246
|
|
83
83
|
scale_gp_beta/types/dataset_item.py,sha256=6ScqXWMP7D9IXW3xjOw04AE0CaSYNMHB2JCApKs--ow,678
|
|
84
|
-
scale_gp_beta/types/dataset_item_batch_create_params.py,sha256=
|
|
84
|
+
scale_gp_beta/types/dataset_item_batch_create_params.py,sha256=ZdcL_57X7IDwzaA7hFkYKuLleT_IToWlSJ6q6G27a04,563
|
|
85
85
|
scale_gp_beta/types/dataset_item_batch_create_response.py,sha256=tUVLQ7igWxp4Dn0pvi1K6YEf7m8XnsrlyHbBkVq9i6k,402
|
|
86
86
|
scale_gp_beta/types/dataset_item_delete_response.py,sha256=uwOgD05XLn1xQixILGwOb3EcDK9ov8fuJkyfsg1pjug,254
|
|
87
87
|
scale_gp_beta/types/dataset_item_list_params.py,sha256=CEB161IozqL-n7YC54g76nFqK0sp7l-A0QB9ET0L86M,661
|
|
88
88
|
scale_gp_beta/types/dataset_item_retrieve_params.py,sha256=f0kJg0btCGITamo949F7trvR0no7lOuVfoKTpFLJ5Gw,356
|
|
89
|
-
scale_gp_beta/types/dataset_item_update_params.py,sha256=
|
|
89
|
+
scale_gp_beta/types/dataset_item_update_params.py,sha256=URTsZxwUcXrh_WMTKS3rW7XRozTz2FmqmhrDh6uyPTc,442
|
|
90
90
|
scale_gp_beta/types/dataset_list_params.py,sha256=C-NCvkrOv5n43NSe2AiR225zDT0MOEjtEW6qQJSm9zk,471
|
|
91
91
|
scale_gp_beta/types/dataset_retrieve_params.py,sha256=5tpzuzX6y1WKKxP2AbjYwwcATpB1eZCv4wZABG3baIQ,282
|
|
92
92
|
scale_gp_beta/types/dataset_update_params.py,sha256=gc3pPByWNRkh17CyPsEySIQj01Oy3UT7SJCbSB2Dg5w,741
|
|
93
93
|
scale_gp_beta/types/evaluation.py,sha256=ACWbBpcfqi4ZFlKuUoVz5zY7Fkb7OECsqCzTZfQf4Vg,1875
|
|
94
|
-
scale_gp_beta/types/evaluation_create_params.py,sha256=
|
|
94
|
+
scale_gp_beta/types/evaluation_create_params.py,sha256=YlfRv_mAbMgEtFp_mj7QrgNCkoghfJHNKLpKZehbb28,3244
|
|
95
95
|
scale_gp_beta/types/evaluation_item.py,sha256=rymtxIsG5m7x1ux-gB9YXQNNdRvE7FyAVpJBquLV0uI,730
|
|
96
96
|
scale_gp_beta/types/evaluation_item_list_params.py,sha256=7sQVVKB87uO45lYuMUhGR6125a6rG19gYx6gckR7sxU,426
|
|
97
97
|
scale_gp_beta/types/evaluation_item_retrieve_params.py,sha256=UYEKIAQ4dy92ZOSV1tWDZcvXG7_0BSpOND5Ehzs7QM4,296
|
|
@@ -116,8 +116,8 @@ scale_gp_beta/types/model_create_params.py,sha256=kdmA0Hp7if0Y4niLCxfxJF8R7l2YTE
|
|
|
116
116
|
scale_gp_beta/types/model_delete_response.py,sha256=qFOwFx8kjinPSF6oTA347I0fq5x8qBvsrVMG-lxf8V4,242
|
|
117
117
|
scale_gp_beta/types/model_list_params.py,sha256=UJkBX6LCoK4mVUe6LJx_qD1dZLFypPeXof1YBTXURS8,636
|
|
118
118
|
scale_gp_beta/types/model_update_params.py,sha256=HwanIDr9Gwp-c9zdJWJx-JQPFP3MhdBX7mEQL-mlayA,3762
|
|
119
|
-
scale_gp_beta/types/question.py,sha256=
|
|
120
|
-
scale_gp_beta/types/question_create_params.py,sha256=
|
|
119
|
+
scale_gp_beta/types/question.py,sha256=_6U_wU3HhmgVxQKHVnSe4UETjdwhMHFNWsKHmaJrzRc,5719
|
|
120
|
+
scale_gp_beta/types/question_create_params.py,sha256=tNAnEyuX4kIbgFpU-TyU5YlbScH7Cz9h2PyhOI1dViw,4371
|
|
121
121
|
scale_gp_beta/types/question_list_params.py,sha256=2x9Ww7wPAhc0hr6WpcqydLuB-mECpMK-MG7jbmtfKJM,362
|
|
122
122
|
scale_gp_beta/types/response.py,sha256=urf4oYc5fUDQkiY6Xqrn9yInsdsBe_8UTRQhzEtGLkI,143236
|
|
123
123
|
scale_gp_beta/types/response_create_params.py,sha256=J1NmJi9BwkHAV2Ui1z5_YzrC54fZI8kShT5mWmOmcF0,28272
|
|
@@ -148,7 +148,7 @@ scale_gp_beta/types/chat/model_definition.py,sha256=OWcZ4StZ4K2wfL7FqHNK-HqxLjy9
|
|
|
148
148
|
scale_gp_beta/types/files/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
|
|
149
149
|
scale_gp_beta/types/shared/__init__.py,sha256=6-walu4YgOTaOj7wsidywTj67PyBJaNYFqasfiTP9-4,130
|
|
150
150
|
scale_gp_beta/types/shared/identity.py,sha256=4XDoJjsPI4lkwyaYyNstw7OunIzJjVWujPoZPrNdoQA,348
|
|
151
|
-
scale_gp_beta-0.1.
|
|
152
|
-
scale_gp_beta-0.1.
|
|
153
|
-
scale_gp_beta-0.1.
|
|
154
|
-
scale_gp_beta-0.1.
|
|
151
|
+
scale_gp_beta-0.1.0a37.dist-info/METADATA,sha256=kQuM2PQmgSBv8uO0PjvRvqJyebnQoMcb1zF3bQA5XzE,28569
|
|
152
|
+
scale_gp_beta-0.1.0a37.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
153
|
+
scale_gp_beta-0.1.0a37.dist-info/licenses/LICENSE,sha256=x49Bj8r_ZpqfzThbmfHyZ_bE88XvHdIMI_ANyLHFFRE,11338
|
|
154
|
+
scale_gp_beta-0.1.0a37.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|