scale-gp-beta 0.1.0a30__py3-none-any.whl → 0.1.0a32__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/__init__.py +3 -1
- scale_gp_beta/_base_client.py +12 -12
- scale_gp_beta/_client.py +20 -20
- scale_gp_beta/_compat.py +48 -48
- scale_gp_beta/_models.py +51 -45
- scale_gp_beta/_qs.py +7 -7
- scale_gp_beta/_types.py +53 -12
- 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 +13 -3
- scale_gp_beta/_utils/_typing.py +6 -1
- scale_gp_beta/_utils/_utils.py +4 -5
- scale_gp_beta/_version.py +1 -1
- scale_gp_beta/resources/__init__.py +6 -6
- scale_gp_beta/resources/chat/completions.py +236 -236
- scale_gp_beta/resources/completions.py +142 -142
- scale_gp_beta/resources/dataset_items.py +27 -27
- scale_gp_beta/resources/datasets.py +38 -38
- scale_gp_beta/resources/evaluation_items.py +19 -19
- scale_gp_beta/resources/evaluations.py +97 -75
- scale_gp_beta/resources/files/content.py +3 -3
- scale_gp_beta/resources/files/files.py +21 -21
- scale_gp_beta/resources/inference.py +7 -7
- scale_gp_beta/resources/models.py +71 -73
- scale_gp_beta/resources/questions.py +43 -43
- scale_gp_beta/resources/responses.py +34 -34
- scale_gp_beta/resources/spans.py +81 -81
- scale_gp_beta/types/__init__.py +4 -4
- scale_gp_beta/types/chat/chat_completion.py +114 -19
- scale_gp_beta/types/chat/chat_completion_chunk.py +84 -14
- scale_gp_beta/types/chat/completion_create_params.py +5 -3
- scale_gp_beta/types/completion.py +36 -6
- 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 +7 -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.py +6 -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 +10 -1
- 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.py +852 -142
- scale_gp_beta/types/response_create_params.py +7 -5
- scale_gp_beta/types/response_create_response.py +6072 -1012
- scale_gp_beta/types/span_search_params.py +8 -7
- {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a32.dist-info}/METADATA +1 -1
- {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a32.dist-info}/RECORD +57 -55
- {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a32.dist-info}/WHEEL +0 -0
- {scale_gp_beta-0.1.0a30.dist-info → scale_gp_beta-0.1.0a32.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,13 +2,13 @@
|
|
|
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, overload
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
10
|
from ..types import completion_create_params
|
|
11
|
-
from .._types import
|
|
11
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
12
12
|
from .._utils import required_args, maybe_transform, async_maybe_transform
|
|
13
13
|
from .._compat import cached_property
|
|
14
14
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -50,29 +50,29 @@ class CompletionsResource(SyncAPIResource):
|
|
|
50
50
|
self,
|
|
51
51
|
*,
|
|
52
52
|
model: str,
|
|
53
|
-
prompt: Union[str,
|
|
54
|
-
best_of: int |
|
|
55
|
-
echo: bool |
|
|
56
|
-
frequency_penalty: float |
|
|
57
|
-
logit_bias: Dict[str, int] |
|
|
58
|
-
logprobs: int |
|
|
59
|
-
max_tokens: int |
|
|
60
|
-
n: int |
|
|
61
|
-
presence_penalty: float |
|
|
62
|
-
seed: int |
|
|
63
|
-
stop: Union[str,
|
|
64
|
-
stream: Literal[False] |
|
|
65
|
-
stream_options: Dict[str, object] |
|
|
66
|
-
suffix: str |
|
|
67
|
-
temperature: float |
|
|
68
|
-
top_p: float |
|
|
69
|
-
user: str |
|
|
53
|
+
prompt: Union[str, SequenceNotStr[str]],
|
|
54
|
+
best_of: int | Omit = omit,
|
|
55
|
+
echo: bool | Omit = omit,
|
|
56
|
+
frequency_penalty: float | Omit = omit,
|
|
57
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
58
|
+
logprobs: int | Omit = omit,
|
|
59
|
+
max_tokens: int | Omit = omit,
|
|
60
|
+
n: int | Omit = omit,
|
|
61
|
+
presence_penalty: float | Omit = omit,
|
|
62
|
+
seed: int | Omit = omit,
|
|
63
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
64
|
+
stream: Literal[False] | Omit = omit,
|
|
65
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
66
|
+
suffix: str | Omit = omit,
|
|
67
|
+
temperature: float | Omit = omit,
|
|
68
|
+
top_p: float | Omit = omit,
|
|
69
|
+
user: str | Omit = omit,
|
|
70
70
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
71
71
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
72
72
|
extra_headers: Headers | None = None,
|
|
73
73
|
extra_query: Query | None = None,
|
|
74
74
|
extra_body: Body | None = None,
|
|
75
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
75
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
76
76
|
) -> Completion:
|
|
77
77
|
"""
|
|
78
78
|
Completions
|
|
@@ -139,29 +139,29 @@ class CompletionsResource(SyncAPIResource):
|
|
|
139
139
|
self,
|
|
140
140
|
*,
|
|
141
141
|
model: str,
|
|
142
|
-
prompt: Union[str,
|
|
142
|
+
prompt: Union[str, SequenceNotStr[str]],
|
|
143
143
|
stream: Literal[True],
|
|
144
|
-
best_of: int |
|
|
145
|
-
echo: bool |
|
|
146
|
-
frequency_penalty: float |
|
|
147
|
-
logit_bias: Dict[str, int] |
|
|
148
|
-
logprobs: int |
|
|
149
|
-
max_tokens: int |
|
|
150
|
-
n: int |
|
|
151
|
-
presence_penalty: float |
|
|
152
|
-
seed: int |
|
|
153
|
-
stop: Union[str,
|
|
154
|
-
stream_options: Dict[str, object] |
|
|
155
|
-
suffix: str |
|
|
156
|
-
temperature: float |
|
|
157
|
-
top_p: float |
|
|
158
|
-
user: str |
|
|
144
|
+
best_of: int | Omit = omit,
|
|
145
|
+
echo: bool | Omit = omit,
|
|
146
|
+
frequency_penalty: float | Omit = omit,
|
|
147
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
148
|
+
logprobs: int | Omit = omit,
|
|
149
|
+
max_tokens: int | Omit = omit,
|
|
150
|
+
n: int | Omit = omit,
|
|
151
|
+
presence_penalty: float | Omit = omit,
|
|
152
|
+
seed: int | Omit = omit,
|
|
153
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
154
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
155
|
+
suffix: str | Omit = omit,
|
|
156
|
+
temperature: float | Omit = omit,
|
|
157
|
+
top_p: float | Omit = omit,
|
|
158
|
+
user: str | Omit = omit,
|
|
159
159
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
160
160
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
161
161
|
extra_headers: Headers | None = None,
|
|
162
162
|
extra_query: Query | None = None,
|
|
163
163
|
extra_body: Body | None = None,
|
|
164
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
164
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
165
165
|
) -> Stream[Completion]:
|
|
166
166
|
"""
|
|
167
167
|
Completions
|
|
@@ -228,29 +228,29 @@ class CompletionsResource(SyncAPIResource):
|
|
|
228
228
|
self,
|
|
229
229
|
*,
|
|
230
230
|
model: str,
|
|
231
|
-
prompt: Union[str,
|
|
231
|
+
prompt: Union[str, SequenceNotStr[str]],
|
|
232
232
|
stream: bool,
|
|
233
|
-
best_of: int |
|
|
234
|
-
echo: bool |
|
|
235
|
-
frequency_penalty: float |
|
|
236
|
-
logit_bias: Dict[str, int] |
|
|
237
|
-
logprobs: int |
|
|
238
|
-
max_tokens: int |
|
|
239
|
-
n: int |
|
|
240
|
-
presence_penalty: float |
|
|
241
|
-
seed: int |
|
|
242
|
-
stop: Union[str,
|
|
243
|
-
stream_options: Dict[str, object] |
|
|
244
|
-
suffix: str |
|
|
245
|
-
temperature: float |
|
|
246
|
-
top_p: float |
|
|
247
|
-
user: str |
|
|
233
|
+
best_of: int | Omit = omit,
|
|
234
|
+
echo: bool | Omit = omit,
|
|
235
|
+
frequency_penalty: float | Omit = omit,
|
|
236
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
237
|
+
logprobs: int | Omit = omit,
|
|
238
|
+
max_tokens: int | Omit = omit,
|
|
239
|
+
n: int | Omit = omit,
|
|
240
|
+
presence_penalty: float | Omit = omit,
|
|
241
|
+
seed: int | Omit = omit,
|
|
242
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
243
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
244
|
+
suffix: str | Omit = omit,
|
|
245
|
+
temperature: float | Omit = omit,
|
|
246
|
+
top_p: float | Omit = omit,
|
|
247
|
+
user: str | Omit = omit,
|
|
248
248
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
249
249
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
250
250
|
extra_headers: Headers | None = None,
|
|
251
251
|
extra_query: Query | None = None,
|
|
252
252
|
extra_body: Body | None = None,
|
|
253
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
253
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
254
254
|
) -> Completion | Stream[Completion]:
|
|
255
255
|
"""
|
|
256
256
|
Completions
|
|
@@ -317,29 +317,29 @@ class CompletionsResource(SyncAPIResource):
|
|
|
317
317
|
self,
|
|
318
318
|
*,
|
|
319
319
|
model: str,
|
|
320
|
-
prompt: Union[str,
|
|
321
|
-
best_of: int |
|
|
322
|
-
echo: bool |
|
|
323
|
-
frequency_penalty: float |
|
|
324
|
-
logit_bias: Dict[str, int] |
|
|
325
|
-
logprobs: int |
|
|
326
|
-
max_tokens: int |
|
|
327
|
-
n: int |
|
|
328
|
-
presence_penalty: float |
|
|
329
|
-
seed: int |
|
|
330
|
-
stop: Union[str,
|
|
331
|
-
stream: Literal[False] | Literal[True] |
|
|
332
|
-
stream_options: Dict[str, object] |
|
|
333
|
-
suffix: str |
|
|
334
|
-
temperature: float |
|
|
335
|
-
top_p: float |
|
|
336
|
-
user: str |
|
|
320
|
+
prompt: Union[str, SequenceNotStr[str]],
|
|
321
|
+
best_of: int | Omit = omit,
|
|
322
|
+
echo: bool | Omit = omit,
|
|
323
|
+
frequency_penalty: float | Omit = omit,
|
|
324
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
325
|
+
logprobs: int | Omit = omit,
|
|
326
|
+
max_tokens: int | Omit = omit,
|
|
327
|
+
n: int | Omit = omit,
|
|
328
|
+
presence_penalty: float | Omit = omit,
|
|
329
|
+
seed: int | Omit = omit,
|
|
330
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
331
|
+
stream: Literal[False] | Literal[True] | Omit = omit,
|
|
332
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
333
|
+
suffix: str | Omit = omit,
|
|
334
|
+
temperature: float | Omit = omit,
|
|
335
|
+
top_p: float | Omit = omit,
|
|
336
|
+
user: str | Omit = omit,
|
|
337
337
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
338
338
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
339
339
|
extra_headers: Headers | None = None,
|
|
340
340
|
extra_query: Query | None = None,
|
|
341
341
|
extra_body: Body | None = None,
|
|
342
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
342
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
343
343
|
) -> Completion | Stream[Completion]:
|
|
344
344
|
return self._post(
|
|
345
345
|
"/v5/completions",
|
|
@@ -402,29 +402,29 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
402
402
|
self,
|
|
403
403
|
*,
|
|
404
404
|
model: str,
|
|
405
|
-
prompt: Union[str,
|
|
406
|
-
best_of: int |
|
|
407
|
-
echo: bool |
|
|
408
|
-
frequency_penalty: float |
|
|
409
|
-
logit_bias: Dict[str, int] |
|
|
410
|
-
logprobs: int |
|
|
411
|
-
max_tokens: int |
|
|
412
|
-
n: int |
|
|
413
|
-
presence_penalty: float |
|
|
414
|
-
seed: int |
|
|
415
|
-
stop: Union[str,
|
|
416
|
-
stream: Literal[False] |
|
|
417
|
-
stream_options: Dict[str, object] |
|
|
418
|
-
suffix: str |
|
|
419
|
-
temperature: float |
|
|
420
|
-
top_p: float |
|
|
421
|
-
user: str |
|
|
405
|
+
prompt: Union[str, SequenceNotStr[str]],
|
|
406
|
+
best_of: int | Omit = omit,
|
|
407
|
+
echo: bool | Omit = omit,
|
|
408
|
+
frequency_penalty: float | Omit = omit,
|
|
409
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
410
|
+
logprobs: int | Omit = omit,
|
|
411
|
+
max_tokens: int | Omit = omit,
|
|
412
|
+
n: int | Omit = omit,
|
|
413
|
+
presence_penalty: float | Omit = omit,
|
|
414
|
+
seed: int | Omit = omit,
|
|
415
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
416
|
+
stream: Literal[False] | Omit = omit,
|
|
417
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
418
|
+
suffix: str | Omit = omit,
|
|
419
|
+
temperature: float | Omit = omit,
|
|
420
|
+
top_p: float | Omit = omit,
|
|
421
|
+
user: str | Omit = omit,
|
|
422
422
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
423
423
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
424
424
|
extra_headers: Headers | None = None,
|
|
425
425
|
extra_query: Query | None = None,
|
|
426
426
|
extra_body: Body | None = None,
|
|
427
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
427
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
428
428
|
) -> Completion:
|
|
429
429
|
"""
|
|
430
430
|
Completions
|
|
@@ -491,29 +491,29 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
491
491
|
self,
|
|
492
492
|
*,
|
|
493
493
|
model: str,
|
|
494
|
-
prompt: Union[str,
|
|
494
|
+
prompt: Union[str, SequenceNotStr[str]],
|
|
495
495
|
stream: Literal[True],
|
|
496
|
-
best_of: int |
|
|
497
|
-
echo: bool |
|
|
498
|
-
frequency_penalty: float |
|
|
499
|
-
logit_bias: Dict[str, int] |
|
|
500
|
-
logprobs: int |
|
|
501
|
-
max_tokens: int |
|
|
502
|
-
n: int |
|
|
503
|
-
presence_penalty: float |
|
|
504
|
-
seed: int |
|
|
505
|
-
stop: Union[str,
|
|
506
|
-
stream_options: Dict[str, object] |
|
|
507
|
-
suffix: str |
|
|
508
|
-
temperature: float |
|
|
509
|
-
top_p: float |
|
|
510
|
-
user: str |
|
|
496
|
+
best_of: int | Omit = omit,
|
|
497
|
+
echo: bool | Omit = omit,
|
|
498
|
+
frequency_penalty: float | Omit = omit,
|
|
499
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
500
|
+
logprobs: int | Omit = omit,
|
|
501
|
+
max_tokens: int | Omit = omit,
|
|
502
|
+
n: int | Omit = omit,
|
|
503
|
+
presence_penalty: float | Omit = omit,
|
|
504
|
+
seed: int | Omit = omit,
|
|
505
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
506
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
507
|
+
suffix: str | Omit = omit,
|
|
508
|
+
temperature: float | Omit = omit,
|
|
509
|
+
top_p: float | Omit = omit,
|
|
510
|
+
user: str | Omit = omit,
|
|
511
511
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
512
512
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
513
513
|
extra_headers: Headers | None = None,
|
|
514
514
|
extra_query: Query | None = None,
|
|
515
515
|
extra_body: Body | None = None,
|
|
516
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
516
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
517
517
|
) -> AsyncStream[Completion]:
|
|
518
518
|
"""
|
|
519
519
|
Completions
|
|
@@ -580,29 +580,29 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
580
580
|
self,
|
|
581
581
|
*,
|
|
582
582
|
model: str,
|
|
583
|
-
prompt: Union[str,
|
|
583
|
+
prompt: Union[str, SequenceNotStr[str]],
|
|
584
584
|
stream: bool,
|
|
585
|
-
best_of: int |
|
|
586
|
-
echo: bool |
|
|
587
|
-
frequency_penalty: float |
|
|
588
|
-
logit_bias: Dict[str, int] |
|
|
589
|
-
logprobs: int |
|
|
590
|
-
max_tokens: int |
|
|
591
|
-
n: int |
|
|
592
|
-
presence_penalty: float |
|
|
593
|
-
seed: int |
|
|
594
|
-
stop: Union[str,
|
|
595
|
-
stream_options: Dict[str, object] |
|
|
596
|
-
suffix: str |
|
|
597
|
-
temperature: float |
|
|
598
|
-
top_p: float |
|
|
599
|
-
user: str |
|
|
585
|
+
best_of: int | Omit = omit,
|
|
586
|
+
echo: bool | Omit = omit,
|
|
587
|
+
frequency_penalty: float | Omit = omit,
|
|
588
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
589
|
+
logprobs: int | Omit = omit,
|
|
590
|
+
max_tokens: int | Omit = omit,
|
|
591
|
+
n: int | Omit = omit,
|
|
592
|
+
presence_penalty: float | Omit = omit,
|
|
593
|
+
seed: int | Omit = omit,
|
|
594
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
595
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
596
|
+
suffix: str | Omit = omit,
|
|
597
|
+
temperature: float | Omit = omit,
|
|
598
|
+
top_p: float | Omit = omit,
|
|
599
|
+
user: str | Omit = omit,
|
|
600
600
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
601
601
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
602
602
|
extra_headers: Headers | None = None,
|
|
603
603
|
extra_query: Query | None = None,
|
|
604
604
|
extra_body: Body | None = None,
|
|
605
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
605
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
606
606
|
) -> Completion | AsyncStream[Completion]:
|
|
607
607
|
"""
|
|
608
608
|
Completions
|
|
@@ -669,29 +669,29 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
669
669
|
self,
|
|
670
670
|
*,
|
|
671
671
|
model: str,
|
|
672
|
-
prompt: Union[str,
|
|
673
|
-
best_of: int |
|
|
674
|
-
echo: bool |
|
|
675
|
-
frequency_penalty: float |
|
|
676
|
-
logit_bias: Dict[str, int] |
|
|
677
|
-
logprobs: int |
|
|
678
|
-
max_tokens: int |
|
|
679
|
-
n: int |
|
|
680
|
-
presence_penalty: float |
|
|
681
|
-
seed: int |
|
|
682
|
-
stop: Union[str,
|
|
683
|
-
stream: Literal[False] | Literal[True] |
|
|
684
|
-
stream_options: Dict[str, object] |
|
|
685
|
-
suffix: str |
|
|
686
|
-
temperature: float |
|
|
687
|
-
top_p: float |
|
|
688
|
-
user: str |
|
|
672
|
+
prompt: Union[str, SequenceNotStr[str]],
|
|
673
|
+
best_of: int | Omit = omit,
|
|
674
|
+
echo: bool | Omit = omit,
|
|
675
|
+
frequency_penalty: float | Omit = omit,
|
|
676
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
677
|
+
logprobs: int | Omit = omit,
|
|
678
|
+
max_tokens: int | Omit = omit,
|
|
679
|
+
n: int | Omit = omit,
|
|
680
|
+
presence_penalty: float | Omit = omit,
|
|
681
|
+
seed: int | Omit = omit,
|
|
682
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
683
|
+
stream: Literal[False] | Literal[True] | Omit = omit,
|
|
684
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
685
|
+
suffix: str | Omit = omit,
|
|
686
|
+
temperature: float | Omit = omit,
|
|
687
|
+
top_p: float | Omit = omit,
|
|
688
|
+
user: str | Omit = omit,
|
|
689
689
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
690
690
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
691
691
|
extra_headers: Headers | None = None,
|
|
692
692
|
extra_query: Query | None = None,
|
|
693
693
|
extra_body: Body | None = None,
|
|
694
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
694
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
695
695
|
) -> Completion | AsyncStream[Completion]:
|
|
696
696
|
return await self._post(
|
|
697
697
|
"/v5/completions",
|
|
@@ -13,7 +13,7 @@ from ..types import (
|
|
|
13
13
|
dataset_item_retrieve_params,
|
|
14
14
|
dataset_item_batch_create_params,
|
|
15
15
|
)
|
|
16
|
-
from .._types import
|
|
16
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
17
17
|
from .._utils import maybe_transform, async_maybe_transform
|
|
18
18
|
from .._compat import cached_property
|
|
19
19
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -56,13 +56,13 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
56
56
|
self,
|
|
57
57
|
dataset_item_id: str,
|
|
58
58
|
*,
|
|
59
|
-
version: int |
|
|
59
|
+
version: int | Omit = omit,
|
|
60
60
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
61
61
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
62
62
|
extra_headers: Headers | None = None,
|
|
63
63
|
extra_query: Query | None = None,
|
|
64
64
|
extra_body: Body | None = None,
|
|
65
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
65
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
66
66
|
) -> DatasetItem:
|
|
67
67
|
"""Get Dataset Item
|
|
68
68
|
|
|
@@ -103,7 +103,7 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
103
103
|
extra_headers: Headers | None = None,
|
|
104
104
|
extra_query: Query | None = None,
|
|
105
105
|
extra_body: Body | None = None,
|
|
106
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
106
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
107
107
|
) -> DatasetItem:
|
|
108
108
|
"""
|
|
109
109
|
Update Dataset Item
|
|
@@ -133,19 +133,19 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
133
133
|
def list(
|
|
134
134
|
self,
|
|
135
135
|
*,
|
|
136
|
-
dataset_id: str |
|
|
137
|
-
ending_before: str |
|
|
138
|
-
include_archived: bool |
|
|
139
|
-
limit: int |
|
|
140
|
-
sort_order: Literal["asc", "desc"] |
|
|
141
|
-
starting_after: str |
|
|
142
|
-
version: int |
|
|
136
|
+
dataset_id: str | Omit = omit,
|
|
137
|
+
ending_before: str | Omit = omit,
|
|
138
|
+
include_archived: bool | Omit = omit,
|
|
139
|
+
limit: int | Omit = omit,
|
|
140
|
+
sort_order: Literal["asc", "desc"] | Omit = omit,
|
|
141
|
+
starting_after: str | Omit = omit,
|
|
142
|
+
version: int | Omit = omit,
|
|
143
143
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
144
144
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
145
145
|
extra_headers: Headers | None = None,
|
|
146
146
|
extra_query: Query | None = None,
|
|
147
147
|
extra_body: Body | None = None,
|
|
148
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
148
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
149
149
|
) -> SyncCursorPage[DatasetItem]:
|
|
150
150
|
"""List Dataset Items
|
|
151
151
|
|
|
@@ -199,7 +199,7 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
199
199
|
extra_headers: Headers | None = None,
|
|
200
200
|
extra_query: Query | None = None,
|
|
201
201
|
extra_body: Body | None = None,
|
|
202
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
202
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
203
203
|
) -> DatasetItemDeleteResponse:
|
|
204
204
|
"""
|
|
205
205
|
Delete Dataset Item
|
|
@@ -233,7 +233,7 @@ class DatasetItemsResource(SyncAPIResource):
|
|
|
233
233
|
extra_headers: Headers | None = None,
|
|
234
234
|
extra_query: Query | None = None,
|
|
235
235
|
extra_body: Body | None = None,
|
|
236
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
236
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
237
237
|
) -> DatasetItemBatchCreateResponse:
|
|
238
238
|
"""
|
|
239
239
|
Batch Create Dataset Items
|
|
@@ -291,13 +291,13 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
291
291
|
self,
|
|
292
292
|
dataset_item_id: str,
|
|
293
293
|
*,
|
|
294
|
-
version: int |
|
|
294
|
+
version: int | Omit = omit,
|
|
295
295
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
296
296
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
297
297
|
extra_headers: Headers | None = None,
|
|
298
298
|
extra_query: Query | None = None,
|
|
299
299
|
extra_body: Body | None = None,
|
|
300
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
300
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
301
301
|
) -> DatasetItem:
|
|
302
302
|
"""Get Dataset Item
|
|
303
303
|
|
|
@@ -340,7 +340,7 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
340
340
|
extra_headers: Headers | None = None,
|
|
341
341
|
extra_query: Query | None = None,
|
|
342
342
|
extra_body: Body | None = None,
|
|
343
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
343
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
344
344
|
) -> DatasetItem:
|
|
345
345
|
"""
|
|
346
346
|
Update Dataset Item
|
|
@@ -370,19 +370,19 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
370
370
|
def list(
|
|
371
371
|
self,
|
|
372
372
|
*,
|
|
373
|
-
dataset_id: str |
|
|
374
|
-
ending_before: str |
|
|
375
|
-
include_archived: bool |
|
|
376
|
-
limit: int |
|
|
377
|
-
sort_order: Literal["asc", "desc"] |
|
|
378
|
-
starting_after: str |
|
|
379
|
-
version: int |
|
|
373
|
+
dataset_id: str | Omit = omit,
|
|
374
|
+
ending_before: str | Omit = omit,
|
|
375
|
+
include_archived: bool | Omit = omit,
|
|
376
|
+
limit: int | Omit = omit,
|
|
377
|
+
sort_order: Literal["asc", "desc"] | Omit = omit,
|
|
378
|
+
starting_after: str | Omit = omit,
|
|
379
|
+
version: int | Omit = omit,
|
|
380
380
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
381
381
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
382
382
|
extra_headers: Headers | None = None,
|
|
383
383
|
extra_query: Query | None = None,
|
|
384
384
|
extra_body: Body | None = None,
|
|
385
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
385
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
386
386
|
) -> AsyncPaginator[DatasetItem, AsyncCursorPage[DatasetItem]]:
|
|
387
387
|
"""List Dataset Items
|
|
388
388
|
|
|
@@ -436,7 +436,7 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
436
436
|
extra_headers: Headers | None = None,
|
|
437
437
|
extra_query: Query | None = None,
|
|
438
438
|
extra_body: Body | None = None,
|
|
439
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
439
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
440
440
|
) -> DatasetItemDeleteResponse:
|
|
441
441
|
"""
|
|
442
442
|
Delete Dataset Item
|
|
@@ -470,7 +470,7 @@ class AsyncDatasetItemsResource(AsyncAPIResource):
|
|
|
470
470
|
extra_headers: Headers | None = None,
|
|
471
471
|
extra_query: Query | None = None,
|
|
472
472
|
extra_body: Body | None = None,
|
|
473
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
473
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
474
474
|
) -> DatasetItemBatchCreateResponse:
|
|
475
475
|
"""
|
|
476
476
|
Batch Create Dataset Items
|