scale-gp-beta 0.1.0a4__py3-none-any.whl → 0.1.0a5__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 (30) hide show
  1. scale_gp_beta/_client.py +17 -17
  2. scale_gp_beta/_version.py +1 -1
  3. scale_gp_beta/resources/__init__.py +27 -27
  4. scale_gp_beta/resources/datasets.py +569 -0
  5. scale_gp_beta/resources/{question_sets.py → evaluations.py} +259 -273
  6. scale_gp_beta/types/__init__.py +11 -11
  7. scale_gp_beta/types/dataset.py +27 -0
  8. scale_gp_beta/types/dataset_create_params.py +17 -0
  9. scale_gp_beta/types/{question_set_delete_response.py → dataset_delete_response.py} +3 -3
  10. scale_gp_beta/types/{question_list_params.py → dataset_list_params.py} +4 -2
  11. scale_gp_beta/types/dataset_retrieve_params.py +11 -0
  12. scale_gp_beta/types/dataset_update_params.py +13 -0
  13. scale_gp_beta/types/evaluation.py +30 -0
  14. scale_gp_beta/types/evaluation_archive_response.py +16 -0
  15. scale_gp_beta/types/evaluation_create_params.py +734 -0
  16. scale_gp_beta/types/{question_set_list_params.py → evaluation_list_params.py} +4 -6
  17. scale_gp_beta/types/evaluation_retrieve_params.py +11 -0
  18. {scale_gp_beta-0.1.0a4.dist-info → scale_gp_beta-0.1.0a5.dist-info}/METADATA +1 -1
  19. {scale_gp_beta-0.1.0a4.dist-info → scale_gp_beta-0.1.0a5.dist-info}/RECORD +21 -21
  20. scale_gp_beta/resources/questions.py +0 -396
  21. scale_gp_beta/types/question.py +0 -68
  22. scale_gp_beta/types/question_create_params.py +0 -59
  23. scale_gp_beta/types/question_list.py +0 -27
  24. scale_gp_beta/types/question_set.py +0 -106
  25. scale_gp_beta/types/question_set_create_params.py +0 -115
  26. scale_gp_beta/types/question_set_list.py +0 -27
  27. scale_gp_beta/types/question_set_retrieve_params.py +0 -12
  28. scale_gp_beta/types/question_set_update_params.py +0 -23
  29. {scale_gp_beta-0.1.0a4.dist-info → scale_gp_beta-0.1.0a5.dist-info}/WHEEL +0 -0
  30. {scale_gp_beta-0.1.0a4.dist-info → scale_gp_beta-0.1.0a5.dist-info}/licenses/LICENSE +0 -0
@@ -2,13 +2,13 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import List, Optional
6
- from typing_extensions import Literal, TypedDict
5
+ from typing import Optional
6
+ from typing_extensions import TypedDict
7
7
 
8
- __all__ = ["QuestionSetListParams"]
8
+ __all__ = ["EvaluationListParams"]
9
9
 
10
10
 
11
- class QuestionSetListParams(TypedDict, total=False):
11
+ class EvaluationListParams(TypedDict, total=False):
12
12
  ending_before: Optional[str]
13
13
 
14
14
  include_archived: bool
@@ -16,5 +16,3 @@ class QuestionSetListParams(TypedDict, total=False):
16
16
  limit: int
17
17
 
18
18
  starting_after: Optional[str]
19
-
20
- views: List[Literal["questions"]]
@@ -0,0 +1,11 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ __all__ = ["EvaluationRetrieveParams"]
8
+
9
+
10
+ class EvaluationRetrieveParams(TypedDict, total=False):
11
+ include_archived: bool
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: scale-gp-beta
3
- Version: 0.1.0a4
3
+ Version: 0.1.0a5
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
@@ -1,6 +1,6 @@
1
1
  scale_gp_beta/__init__.py,sha256=XmzYbUteZA7f7EPIFNKcPSnSgFpK6ovSlHY57Xk-WGo,2535
2
2
  scale_gp_beta/_base_client.py,sha256=gMRzeMNQ9Z7kaex2ofZ7U0pd-E-7M754bDa7cVhQXvo,64964
3
- scale_gp_beta/_client.py,sha256=rinNhn5BrX9jC9AGxAs24SzyiwABd6sxoeRZGjONB6E,22601
3
+ scale_gp_beta/_client.py,sha256=6asGfvGJmCgTz9HEECs5pZoufPGvSmqB50D0Mvnk7QQ,22522
4
4
  scale_gp_beta/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
5
  scale_gp_beta/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
6
  scale_gp_beta/_exceptions.py,sha256=95GM5CLFtP-QMjjmzsr5ajjZOyEZvyaETfGmqNPR8YM,3226
@@ -11,7 +11,7 @@ scale_gp_beta/_resource.py,sha256=siZly_U6D0AOVLAzaOsqUdEFFzVMbWRj-ml30nvRp7E,11
11
11
  scale_gp_beta/_response.py,sha256=ATtij8CjXVjmhdOWozU9Y0SP4Q_uxCYGFUHroxFnSc4,28853
12
12
  scale_gp_beta/_streaming.py,sha256=fcCSGXslmi2SmmkM05g2SACXHk2Mj7k1X5uMBu6U5s8,10112
13
13
  scale_gp_beta/_types.py,sha256=ScQhVBaKbtJrER3NkXbjokWE9DqSqREMIw9LE0NrFfA,6150
14
- scale_gp_beta/_version.py,sha256=ptRARaMd1ajeCOLZQptI91L1KNLiCskNz_887Pb7pH4,173
14
+ scale_gp_beta/_version.py,sha256=LsIGgvN7B9kghhD-GMMkkGdleY9x2u2i-hCcZVdxIwc,173
15
15
  scale_gp_beta/pagination.py,sha256=6AAa8_V0wARlMd1MIXijugYbG1mILGc2tHVKbUQbZyQ,2595
16
16
  scale_gp_beta/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  scale_gp_beta/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
@@ -24,21 +24,32 @@ scale_gp_beta/_utils/_transform.py,sha256=tsSFOIZ7iczaUsMSGBD_iSFOOdUyT2xtkcq1xy
24
24
  scale_gp_beta/_utils/_typing.py,sha256=nTJz0jcrQbEgxwy4TtAkNxuU0QHHlmc6mQtA6vIR8tg,4501
25
25
  scale_gp_beta/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
26
26
  scale_gp_beta/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
27
- scale_gp_beta/resources/__init__.py,sha256=CLsKitqMWj9CtyeCVAgOBuguN9NpztGeICZbOYO1qlg,3435
27
+ scale_gp_beta/resources/__init__.py,sha256=Aox7fBbozdmVvq6gu4pTSCcr5E7hg_yPthF1a7xLa34,3408
28
28
  scale_gp_beta/resources/completions.py,sha256=dk7Uvl8dnnieRWTJr2fhzJMZwOzGIjsYSw2GjaMWlCs,31653
29
+ scale_gp_beta/resources/datasets.py,sha256=tE2JKxlHc48Sm-SpySH4f265CxCBlaHWT68jKiJKJc8,20717
30
+ scale_gp_beta/resources/evaluations.py,sha256=61sMyGqrH-gztzhY82UmXyV0Ip-s9LQvBiuFEzQgHsQ,25855
29
31
  scale_gp_beta/resources/inference.py,sha256=_20eN0x0PZBPNLx2VrozQrJgRVjtlXPjeTpTcnuP0bU,7576
30
32
  scale_gp_beta/resources/models.py,sha256=85F8qPJN9lBPbfNm9F8bHpdJSsyekS9B3GDPJtCXaMA,32658
31
- scale_gp_beta/resources/question_sets.py,sha256=X9eGII0Nh2jP7PTU86wLB6Blj0QIvYMJWUJm0D76QIU,25923
32
- scale_gp_beta/resources/questions.py,sha256=XP-PJoGyGTIlNkCMhmBAUbHp2m4yT81ofBnVds4o0Jg,14835
33
33
  scale_gp_beta/resources/chat/__init__.py,sha256=BVAfz9TM3DT5W9f_mt0P9YRxL_MsUxKCWAH6u1iogmA,1041
34
34
  scale_gp_beta/resources/chat/chat.py,sha256=4OG_TrwVqYvV-7Ha8Nbc6iuXQuys9wKXgkxYmE6p6jk,3672
35
35
  scale_gp_beta/resources/chat/completions.py,sha256=ZPa4-9RNKTXldq2VjWahNrlXeO_jYGswyPzgWlPuAVQ,46581
36
36
  scale_gp_beta/resources/files/__init__.py,sha256=VgAtqUimN5Kf_-lmEaNBnu_ApGegKsJQ1zNf-42MXFA,1002
37
37
  scale_gp_beta/resources/files/content.py,sha256=oJxb-28ZOUBgzE_MiAaJOcKFmtlB-N5APdhfZBNJna8,5762
38
38
  scale_gp_beta/resources/files/files.py,sha256=M8OdZoIi3fFjJL7oIn8w9TD6TVcASCMy1Ze1YZRbPMo,20530
39
- scale_gp_beta/types/__init__.py,sha256=0AA_yRFLEjX9VKsjiY3lEGjDweKuydLZnJxNoE2NXjQ,2202
39
+ scale_gp_beta/types/__init__.py,sha256=5KRwCU53Hx-wFv78yza-DCfdWyD8kKclXoE5AJNmrpE,2209
40
40
  scale_gp_beta/types/completion.py,sha256=5eewo25sdqL4vutqvE8wmugE0Cw6YLzZ0_AD6yjP9NM,3259
41
41
  scale_gp_beta/types/completion_create_params.py,sha256=LE9vna29Kbh7E8qUq7EhQbcu7YuCF_h663maKtzOnhk,3063
42
+ scale_gp_beta/types/dataset.py,sha256=uTlOPgxkzpiAFOr_NOOYqhTsrqOKkOyXvxzczIe9gaE,511
43
+ scale_gp_beta/types/dataset_create_params.py,sha256=k-JIiwO_4rSM3jzOpgq5d_7i7VSt3tik-kvAt1PXzfI,436
44
+ scale_gp_beta/types/dataset_delete_response.py,sha256=Lc4K761LM__hosWI3gYjYnEl5JXL-cg4DU3lXKhtQoo,345
45
+ scale_gp_beta/types/dataset_list_params.py,sha256=4rITQ1avOcQObS17cT0NDikOmF7Fd_rxkSlRIfzzfF4,387
46
+ scale_gp_beta/types/dataset_retrieve_params.py,sha256=5tpzuzX6y1WKKxP2AbjYwwcATpB1eZCv4wZABG3baIQ,282
47
+ scale_gp_beta/types/dataset_update_params.py,sha256=Aw7m-jat5P82qJGJgsuz6xx6nu96jYdfJnM_TR94PAE,287
48
+ scale_gp_beta/types/evaluation.py,sha256=U8m8P0dX290Pv-jG2ZiiV9djQ1dUkyLI1tv0SGgIH8c,609
49
+ scale_gp_beta/types/evaluation_archive_response.py,sha256=SkGy3GourPaQRPt84smBd1XhwZqeDTDINK7PtyEEpSY,356
50
+ scale_gp_beta/types/evaluation_create_params.py,sha256=nmbi633xCnOY28cnvH595s2hlk7xKU0surVyYAbeSlQ,25504
51
+ scale_gp_beta/types/evaluation_list_params.py,sha256=3e8fR1LCDhODoRrvgriRvgLhpIp0HXEZdjQ6P9p-eD4,393
52
+ scale_gp_beta/types/evaluation_retrieve_params.py,sha256=tqzzbcD-hEcUcGFrfIhH3fG1cXuLvQGHZlyS-e3Zsx4,288
42
53
  scale_gp_beta/types/file.py,sha256=Xkha0eSr1q6hkwjE9e2XNgk8kuHNoTEe1LXNhz6o-1k,528
43
54
  scale_gp_beta/types/file_create_params.py,sha256=KpXv6JCbd8BlgceTmBTewxOky2JTJaTW3mcGiVVU7wE,317
44
55
  scale_gp_beta/types/file_delete_response.py,sha256=lOsiaw8qrUOnH7smxb27-n7M4D1chfXlAUaMTRmdldY,336
@@ -55,24 +66,13 @@ scale_gp_beta/types/model_create_params.py,sha256=K04FNqloYYTwffMHnNLRnrPNOKPgG7
55
66
  scale_gp_beta/types/model_delete_response.py,sha256=fSpTChRLHPOoc9SJbkS4wcLxVOc3kKBOya8wkGow5pY,339
56
67
  scale_gp_beta/types/model_list_params.py,sha256=617LRolXLNCV8kadHK7XRGN-0woh0mvj88ZSbPLdGDg,702
57
68
  scale_gp_beta/types/model_update_params.py,sha256=RFXvs-EIDHmNO-fnPB8H6B9DlK6bYVsiwFDMPPFHGII,3701
58
- scale_gp_beta/types/question.py,sha256=aETwjezMGu6hxG9wCa9uBM2H0d9xKRIWu1t2S01bfdw,1597
59
- scale_gp_beta/types/question_create_params.py,sha256=EqXkbj9zx5M8GPpGVv0XChE-jaxSUHR_UwiyCwsOVZ8,1517
60
- scale_gp_beta/types/question_list.py,sha256=lk4GWhnnThcqnwmbxUNq07vqyXS8ToUYRp4nf7YctGs,657
61
- scale_gp_beta/types/question_list_params.py,sha256=vf0ADgkIyuYiye4ySEvJSwj4wkwfPJUPHh0lIE77s_k,361
62
- scale_gp_beta/types/question_set.py,sha256=QMhZ9mIzkzkzITTHFgWlWgHPP4CWTt0v3M9TZc2_VFY,2525
63
- scale_gp_beta/types/question_set_create_params.py,sha256=fb_DmwtOj4q61cbP-0v5Ckq76tT-cbQEyRKj8TkHf7c,3785
64
- scale_gp_beta/types/question_set_delete_response.py,sha256=WfKpVppIGoBG96_CxFmD01QLsj7iAOuG1DJug3l4eF4,358
65
- scale_gp_beta/types/question_set_list.py,sha256=GDZWcjbLARtLSHZiCGbwdcXQe4inaSfddxu8mgSnAzQ,673
66
- scale_gp_beta/types/question_set_list_params.py,sha256=omaQ4bD-Zh_CvMvul9O0-tPU18C888QTC6Q9v5tlJkU,449
67
- scale_gp_beta/types/question_set_retrieve_params.py,sha256=NUXBXehGZDxkaqYHke-aJRXp_YITeN6Hr3cjv95ssDM,334
68
- scale_gp_beta/types/question_set_update_params.py,sha256=znfOyD45Fhsu6oCw1IrjSSvcYrRLXI6WbWVxnulSSlc,691
69
69
  scale_gp_beta/types/chat/__init__.py,sha256=DA0PFPt0oaPb25RI7Cs3RQEJfDLg5-qBiU8l0S_3nnw,443
70
70
  scale_gp_beta/types/chat/chat_completion.py,sha256=MswoiGtEb_ik1OHkk6k4jrpcH4lqmOdnIXLnGZJy7wM,7314
71
71
  scale_gp_beta/types/chat/chat_completion_chunk.py,sha256=6anUxR5cLdhEhhSgjh3tFbH_7crpD9dktsAnrBLxykQ,7047
72
72
  scale_gp_beta/types/chat/completion_create_params.py,sha256=Y7vJNvNM4Sov77l55aS5YtyRnrf7isediu3nKr6YE-A,4505
73
73
  scale_gp_beta/types/chat/completion_create_response.py,sha256=0OhfoJW8azVRrZdXRRMuiJ7kEEeMDnKScxrr3sayzDo,374
74
74
  scale_gp_beta/types/files/__init__.py,sha256=OKfJYcKb4NObdiRObqJV_dOyDQ8feXekDUge2o_4pXQ,122
75
- scale_gp_beta-0.1.0a4.dist-info/METADATA,sha256=CC8vZUT2AtJZP0nv8HAoSXnQQ8QSMP2SkWcm01WcnRQ,16938
76
- scale_gp_beta-0.1.0a4.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
77
- scale_gp_beta-0.1.0a4.dist-info/licenses/LICENSE,sha256=x49Bj8r_ZpqfzThbmfHyZ_bE88XvHdIMI_ANyLHFFRE,11338
78
- scale_gp_beta-0.1.0a4.dist-info/RECORD,,
75
+ scale_gp_beta-0.1.0a5.dist-info/METADATA,sha256=hlWX2f9t_Y4QL_5txpmQJOKTCuW-cWkqackYx6deku0,16938
76
+ scale_gp_beta-0.1.0a5.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
77
+ scale_gp_beta-0.1.0a5.dist-info/licenses/LICENSE,sha256=x49Bj8r_ZpqfzThbmfHyZ_bE88XvHdIMI_ANyLHFFRE,11338
78
+ scale_gp_beta-0.1.0a5.dist-info/RECORD,,
@@ -1,396 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Dict, Iterable, Optional
6
- from typing_extensions import Literal
7
-
8
- import httpx
9
-
10
- from ..types import question_list_params, question_create_params
11
- from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
- from .._utils import (
13
- maybe_transform,
14
- async_maybe_transform,
15
- )
16
- from .._compat import cached_property
17
- from .._resource import SyncAPIResource, AsyncAPIResource
18
- from .._response import (
19
- to_raw_response_wrapper,
20
- to_streamed_response_wrapper,
21
- async_to_raw_response_wrapper,
22
- async_to_streamed_response_wrapper,
23
- )
24
- from ..pagination import SyncCursorPage, AsyncCursorPage
25
- from .._base_client import AsyncPaginator, make_request_options
26
- from ..types.question import Question
27
-
28
- __all__ = ["QuestionsResource", "AsyncQuestionsResource"]
29
-
30
-
31
- class QuestionsResource(SyncAPIResource):
32
- @cached_property
33
- def with_raw_response(self) -> QuestionsResourceWithRawResponse:
34
- """
35
- This property can be used as a prefix for any HTTP method call to return
36
- the raw response object instead of the parsed content.
37
-
38
- For more information, see https://www.github.com/scaleapi/sgp-python-beta#accessing-raw-response-data-eg-headers
39
- """
40
- return QuestionsResourceWithRawResponse(self)
41
-
42
- @cached_property
43
- def with_streaming_response(self) -> QuestionsResourceWithStreamingResponse:
44
- """
45
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
46
-
47
- For more information, see https://www.github.com/scaleapi/sgp-python-beta#with_streaming_response
48
- """
49
- return QuestionsResourceWithStreamingResponse(self)
50
-
51
- def create(
52
- self,
53
- *,
54
- prompt: str,
55
- title: str,
56
- type: Literal["categorical", "free_text", "rating", "number"],
57
- choices: Iterable[question_create_params.Choice] | NotGiven = NOT_GIVEN,
58
- conditions: Iterable[Dict[str, object]] | NotGiven = NOT_GIVEN,
59
- dropdown: bool | NotGiven = NOT_GIVEN,
60
- multi: bool | NotGiven = NOT_GIVEN,
61
- number_options: question_create_params.NumberOptions | NotGiven = NOT_GIVEN,
62
- rating_options: question_create_params.RatingOptions | NotGiven = NOT_GIVEN,
63
- required: bool | NotGiven = NOT_GIVEN,
64
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
65
- # The extra values given here take precedence over values defined on the client or passed to this method.
66
- extra_headers: Headers | None = None,
67
- extra_query: Query | None = None,
68
- extra_body: Body | None = None,
69
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
70
- ) -> Question:
71
- """
72
- Create Question
73
-
74
- Args:
75
- extra_headers: Send extra headers
76
-
77
- extra_query: Add additional query parameters to the request
78
-
79
- extra_body: Add additional JSON properties to the request
80
-
81
- timeout: Override the client-level default timeout for this request, in seconds
82
- """
83
- return self._post(
84
- "/v5/questions",
85
- body=maybe_transform(
86
- {
87
- "prompt": prompt,
88
- "title": title,
89
- "type": type,
90
- "choices": choices,
91
- "conditions": conditions,
92
- "dropdown": dropdown,
93
- "multi": multi,
94
- "number_options": number_options,
95
- "rating_options": rating_options,
96
- "required": required,
97
- },
98
- question_create_params.QuestionCreateParams,
99
- ),
100
- options=make_request_options(
101
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
102
- ),
103
- cast_to=Question,
104
- )
105
-
106
- def retrieve(
107
- self,
108
- question_id: str,
109
- *,
110
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
111
- # The extra values given here take precedence over values defined on the client or passed to this method.
112
- extra_headers: Headers | None = None,
113
- extra_query: Query | None = None,
114
- extra_body: Body | None = None,
115
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
116
- ) -> Question:
117
- """
118
- Get Question
119
-
120
- Args:
121
- extra_headers: Send extra headers
122
-
123
- extra_query: Add additional query parameters to the request
124
-
125
- extra_body: Add additional JSON properties to the request
126
-
127
- timeout: Override the client-level default timeout for this request, in seconds
128
- """
129
- if not question_id:
130
- raise ValueError(f"Expected a non-empty value for `question_id` but received {question_id!r}")
131
- return self._get(
132
- f"/v5/questions/{question_id}",
133
- options=make_request_options(
134
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
135
- ),
136
- cast_to=Question,
137
- )
138
-
139
- def list(
140
- self,
141
- *,
142
- ending_before: Optional[str] | NotGiven = NOT_GIVEN,
143
- limit: int | NotGiven = NOT_GIVEN,
144
- starting_after: Optional[str] | NotGiven = NOT_GIVEN,
145
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
146
- # The extra values given here take precedence over values defined on the client or passed to this method.
147
- extra_headers: Headers | None = None,
148
- extra_query: Query | None = None,
149
- extra_body: Body | None = None,
150
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
151
- ) -> SyncCursorPage[Question]:
152
- """
153
- List Questions
154
-
155
- Args:
156
- extra_headers: Send extra headers
157
-
158
- extra_query: Add additional query parameters to the request
159
-
160
- extra_body: Add additional JSON properties to the request
161
-
162
- timeout: Override the client-level default timeout for this request, in seconds
163
- """
164
- return self._get_api_list(
165
- "/v5/questions",
166
- page=SyncCursorPage[Question],
167
- options=make_request_options(
168
- extra_headers=extra_headers,
169
- extra_query=extra_query,
170
- extra_body=extra_body,
171
- timeout=timeout,
172
- query=maybe_transform(
173
- {
174
- "ending_before": ending_before,
175
- "limit": limit,
176
- "starting_after": starting_after,
177
- },
178
- question_list_params.QuestionListParams,
179
- ),
180
- ),
181
- model=Question,
182
- )
183
-
184
-
185
- class AsyncQuestionsResource(AsyncAPIResource):
186
- @cached_property
187
- def with_raw_response(self) -> AsyncQuestionsResourceWithRawResponse:
188
- """
189
- This property can be used as a prefix for any HTTP method call to return
190
- the raw response object instead of the parsed content.
191
-
192
- For more information, see https://www.github.com/scaleapi/sgp-python-beta#accessing-raw-response-data-eg-headers
193
- """
194
- return AsyncQuestionsResourceWithRawResponse(self)
195
-
196
- @cached_property
197
- def with_streaming_response(self) -> AsyncQuestionsResourceWithStreamingResponse:
198
- """
199
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
200
-
201
- For more information, see https://www.github.com/scaleapi/sgp-python-beta#with_streaming_response
202
- """
203
- return AsyncQuestionsResourceWithStreamingResponse(self)
204
-
205
- async def create(
206
- self,
207
- *,
208
- prompt: str,
209
- title: str,
210
- type: Literal["categorical", "free_text", "rating", "number"],
211
- choices: Iterable[question_create_params.Choice] | NotGiven = NOT_GIVEN,
212
- conditions: Iterable[Dict[str, object]] | NotGiven = NOT_GIVEN,
213
- dropdown: bool | NotGiven = NOT_GIVEN,
214
- multi: bool | NotGiven = NOT_GIVEN,
215
- number_options: question_create_params.NumberOptions | NotGiven = NOT_GIVEN,
216
- rating_options: question_create_params.RatingOptions | NotGiven = NOT_GIVEN,
217
- required: bool | NotGiven = NOT_GIVEN,
218
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
219
- # The extra values given here take precedence over values defined on the client or passed to this method.
220
- extra_headers: Headers | None = None,
221
- extra_query: Query | None = None,
222
- extra_body: Body | None = None,
223
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
224
- ) -> Question:
225
- """
226
- Create Question
227
-
228
- Args:
229
- extra_headers: Send extra headers
230
-
231
- extra_query: Add additional query parameters to the request
232
-
233
- extra_body: Add additional JSON properties to the request
234
-
235
- timeout: Override the client-level default timeout for this request, in seconds
236
- """
237
- return await self._post(
238
- "/v5/questions",
239
- body=await async_maybe_transform(
240
- {
241
- "prompt": prompt,
242
- "title": title,
243
- "type": type,
244
- "choices": choices,
245
- "conditions": conditions,
246
- "dropdown": dropdown,
247
- "multi": multi,
248
- "number_options": number_options,
249
- "rating_options": rating_options,
250
- "required": required,
251
- },
252
- question_create_params.QuestionCreateParams,
253
- ),
254
- options=make_request_options(
255
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
256
- ),
257
- cast_to=Question,
258
- )
259
-
260
- async def retrieve(
261
- self,
262
- question_id: str,
263
- *,
264
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
265
- # The extra values given here take precedence over values defined on the client or passed to this method.
266
- extra_headers: Headers | None = None,
267
- extra_query: Query | None = None,
268
- extra_body: Body | None = None,
269
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
270
- ) -> Question:
271
- """
272
- Get Question
273
-
274
- Args:
275
- extra_headers: Send extra headers
276
-
277
- extra_query: Add additional query parameters to the request
278
-
279
- extra_body: Add additional JSON properties to the request
280
-
281
- timeout: Override the client-level default timeout for this request, in seconds
282
- """
283
- if not question_id:
284
- raise ValueError(f"Expected a non-empty value for `question_id` but received {question_id!r}")
285
- return await self._get(
286
- f"/v5/questions/{question_id}",
287
- options=make_request_options(
288
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
289
- ),
290
- cast_to=Question,
291
- )
292
-
293
- def list(
294
- self,
295
- *,
296
- ending_before: Optional[str] | NotGiven = NOT_GIVEN,
297
- limit: int | NotGiven = NOT_GIVEN,
298
- starting_after: Optional[str] | NotGiven = NOT_GIVEN,
299
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
300
- # The extra values given here take precedence over values defined on the client or passed to this method.
301
- extra_headers: Headers | None = None,
302
- extra_query: Query | None = None,
303
- extra_body: Body | None = None,
304
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
305
- ) -> AsyncPaginator[Question, AsyncCursorPage[Question]]:
306
- """
307
- List Questions
308
-
309
- Args:
310
- extra_headers: Send extra headers
311
-
312
- extra_query: Add additional query parameters to the request
313
-
314
- extra_body: Add additional JSON properties to the request
315
-
316
- timeout: Override the client-level default timeout for this request, in seconds
317
- """
318
- return self._get_api_list(
319
- "/v5/questions",
320
- page=AsyncCursorPage[Question],
321
- options=make_request_options(
322
- extra_headers=extra_headers,
323
- extra_query=extra_query,
324
- extra_body=extra_body,
325
- timeout=timeout,
326
- query=maybe_transform(
327
- {
328
- "ending_before": ending_before,
329
- "limit": limit,
330
- "starting_after": starting_after,
331
- },
332
- question_list_params.QuestionListParams,
333
- ),
334
- ),
335
- model=Question,
336
- )
337
-
338
-
339
- class QuestionsResourceWithRawResponse:
340
- def __init__(self, questions: QuestionsResource) -> None:
341
- self._questions = questions
342
-
343
- self.create = to_raw_response_wrapper(
344
- questions.create,
345
- )
346
- self.retrieve = to_raw_response_wrapper(
347
- questions.retrieve,
348
- )
349
- self.list = to_raw_response_wrapper(
350
- questions.list,
351
- )
352
-
353
-
354
- class AsyncQuestionsResourceWithRawResponse:
355
- def __init__(self, questions: AsyncQuestionsResource) -> None:
356
- self._questions = questions
357
-
358
- self.create = async_to_raw_response_wrapper(
359
- questions.create,
360
- )
361
- self.retrieve = async_to_raw_response_wrapper(
362
- questions.retrieve,
363
- )
364
- self.list = async_to_raw_response_wrapper(
365
- questions.list,
366
- )
367
-
368
-
369
- class QuestionsResourceWithStreamingResponse:
370
- def __init__(self, questions: QuestionsResource) -> None:
371
- self._questions = questions
372
-
373
- self.create = to_streamed_response_wrapper(
374
- questions.create,
375
- )
376
- self.retrieve = to_streamed_response_wrapper(
377
- questions.retrieve,
378
- )
379
- self.list = to_streamed_response_wrapper(
380
- questions.list,
381
- )
382
-
383
-
384
- class AsyncQuestionsResourceWithStreamingResponse:
385
- def __init__(self, questions: AsyncQuestionsResource) -> None:
386
- self._questions = questions
387
-
388
- self.create = async_to_streamed_response_wrapper(
389
- questions.create,
390
- )
391
- self.retrieve = async_to_streamed_response_wrapper(
392
- questions.retrieve,
393
- )
394
- self.list = async_to_streamed_response_wrapper(
395
- questions.list,
396
- )
@@ -1,68 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from typing import Dict, List, Union, Optional
4
- from datetime import datetime
5
- from typing_extensions import Literal
6
-
7
- from pydantic import Field as FieldInfo
8
-
9
- from .._models import BaseModel
10
-
11
- __all__ = ["Question", "Choice", "NumberOptions", "RatingOptions"]
12
-
13
-
14
- class Choice(BaseModel):
15
- label: str
16
-
17
- value: Union[str, bool, float]
18
-
19
- audit_required: Optional[bool] = None
20
-
21
-
22
- class NumberOptions(BaseModel):
23
- max: Optional[float] = None
24
- """Maximum value for the number"""
25
-
26
- min: Optional[float] = None
27
- """Minimum value for the number"""
28
-
29
-
30
- class RatingOptions(BaseModel):
31
- max_label: str = FieldInfo(alias="maxLabel")
32
- """Maximum value for the rating"""
33
-
34
- min_label: str = FieldInfo(alias="minLabel")
35
- """Minimum value for the rating"""
36
-
37
- scale_steps: int = FieldInfo(alias="scaleSteps")
38
- """Number of steps in the rating scale"""
39
-
40
-
41
- class Question(BaseModel):
42
- id: str
43
-
44
- created_at: datetime
45
-
46
- created_by_user_id: str
47
-
48
- prompt: str
49
-
50
- title: str
51
-
52
- type: Literal["categorical", "free_text", "rating", "number"]
53
-
54
- choices: Optional[List[Choice]] = None
55
-
56
- conditions: Optional[List[Dict[str, object]]] = None
57
-
58
- dropdown: Optional[bool] = None
59
-
60
- multi: Optional[bool] = None
61
-
62
- number_options: Optional[NumberOptions] = FieldInfo(alias="numberOptions", default=None)
63
-
64
- object: Optional[Literal["question"]] = None
65
-
66
- rating_options: Optional[RatingOptions] = FieldInfo(alias="ratingOptions", default=None)
67
-
68
- required: Optional[bool] = None
@@ -1,59 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Dict, Union, Iterable
6
- from typing_extensions import Literal, Required, Annotated, TypedDict
7
-
8
- from .._utils import PropertyInfo
9
-
10
- __all__ = ["QuestionCreateParams", "Choice", "NumberOptions", "RatingOptions"]
11
-
12
-
13
- class QuestionCreateParams(TypedDict, total=False):
14
- prompt: Required[str]
15
-
16
- title: Required[str]
17
-
18
- type: Required[Literal["categorical", "free_text", "rating", "number"]]
19
-
20
- choices: Iterable[Choice]
21
-
22
- conditions: Iterable[Dict[str, object]]
23
-
24
- dropdown: bool
25
-
26
- multi: bool
27
-
28
- number_options: Annotated[NumberOptions, PropertyInfo(alias="numberOptions")]
29
-
30
- rating_options: Annotated[RatingOptions, PropertyInfo(alias="ratingOptions")]
31
-
32
- required: bool
33
-
34
-
35
- class Choice(TypedDict, total=False):
36
- label: Required[str]
37
-
38
- value: Required[Union[str, bool, float]]
39
-
40
- audit_required: bool
41
-
42
-
43
- class NumberOptions(TypedDict, total=False):
44
- max: float
45
- """Maximum value for the number"""
46
-
47
- min: float
48
- """Minimum value for the number"""
49
-
50
-
51
- class RatingOptions(TypedDict, total=False):
52
- max_label: Required[Annotated[str, PropertyInfo(alias="maxLabel")]]
53
- """Maximum value for the rating"""
54
-
55
- min_label: Required[Annotated[str, PropertyInfo(alias="minLabel")]]
56
- """Minimum value for the rating"""
57
-
58
- scale_steps: Required[Annotated[int, PropertyInfo(alias="scaleSteps")]]
59
- """Number of steps in the rating scale"""
@@ -1,27 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from typing import List, Optional
4
- from typing_extensions import Literal
5
-
6
- from .._models import BaseModel
7
- from .question import Question
8
-
9
- __all__ = ["QuestionList"]
10
-
11
-
12
- class QuestionList(BaseModel):
13
- has_more: bool
14
- """Whether there are more items left to be fetched."""
15
-
16
- items: List[Question]
17
-
18
- total: int
19
- """The total of items that match the query.
20
-
21
- This is greater than or equal to the number of items returned.
22
- """
23
-
24
- limit: Optional[int] = None
25
- """The maximum number of items to return."""
26
-
27
- object: Optional[Literal["list"]] = None