scale-gp-beta 0.1.0a31__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 +9 -9
- scale_gp_beta/_client.py +12 -12
- scale_gp_beta/_models.py +10 -4
- scale_gp_beta/_qs.py +7 -7
- scale_gp_beta/_types.py +18 -11
- scale_gp_beta/_utils/_transform.py +2 -2
- scale_gp_beta/_utils/_utils.py +4 -4
- scale_gp_beta/_version.py +1 -1
- scale_gp_beta/resources/chat/completions.py +235 -235
- scale_gp_beta/resources/completions.py +133 -133
- scale_gp_beta/resources/dataset_items.py +27 -27
- scale_gp_beta/resources/datasets.py +37 -37
- scale_gp_beta/resources/evaluation_items.py +19 -19
- scale_gp_beta/resources/evaluations.py +83 -83
- 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 +33 -33
- scale_gp_beta/resources/spans.py +81 -81
- 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/completion.py +36 -6
- scale_gp_beta/types/evaluation.py +3 -0
- scale_gp_beta/types/evaluation_task.py +6 -1
- scale_gp_beta/types/inference_model.py +6 -1
- scale_gp_beta/types/response.py +852 -142
- scale_gp_beta/types/response_create_response.py +6072 -1012
- {scale_gp_beta-0.1.0a31.dist-info → scale_gp_beta-0.1.0a32.dist-info}/METADATA +1 -1
- {scale_gp_beta-0.1.0a31.dist-info → scale_gp_beta-0.1.0a32.dist-info}/RECORD +34 -34
- {scale_gp_beta-0.1.0a31.dist-info → scale_gp_beta-0.1.0a32.dist-info}/WHEEL +0 -0
- {scale_gp_beta-0.1.0a31.dist-info → scale_gp_beta-0.1.0a32.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,7 +7,7 @@ from typing_extensions import Literal, overload
|
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
|
-
from ..._types import
|
|
10
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
11
11
|
from ..._utils import required_args, maybe_transform, async_maybe_transform
|
|
12
12
|
from ..._compat import cached_property
|
|
13
13
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -53,39 +53,39 @@ class CompletionsResource(SyncAPIResource):
|
|
|
53
53
|
*,
|
|
54
54
|
messages: Iterable[Dict[str, object]],
|
|
55
55
|
model: str,
|
|
56
|
-
audio: Dict[str, object] |
|
|
57
|
-
frequency_penalty: float |
|
|
58
|
-
function_call: Dict[str, object] |
|
|
59
|
-
functions: Iterable[Dict[str, object]] |
|
|
60
|
-
logit_bias: Dict[str, int] |
|
|
61
|
-
logprobs: bool |
|
|
62
|
-
max_completion_tokens: int |
|
|
63
|
-
max_tokens: int |
|
|
64
|
-
metadata: Dict[str, str] |
|
|
65
|
-
modalities: SequenceNotStr[str] |
|
|
66
|
-
n: int |
|
|
67
|
-
parallel_tool_calls: bool |
|
|
68
|
-
prediction: Dict[str, object] |
|
|
69
|
-
presence_penalty: float |
|
|
70
|
-
reasoning_effort: str |
|
|
71
|
-
response_format: Dict[str, object] |
|
|
72
|
-
seed: int |
|
|
73
|
-
stop: Union[str, SequenceNotStr[str]] |
|
|
74
|
-
store: bool |
|
|
75
|
-
stream: Literal[False] |
|
|
76
|
-
stream_options: Dict[str, object] |
|
|
77
|
-
temperature: float |
|
|
78
|
-
tool_choice: Union[str, Dict[str, object]] |
|
|
79
|
-
tools: Iterable[Dict[str, object]] |
|
|
80
|
-
top_k: int |
|
|
81
|
-
top_logprobs: int |
|
|
82
|
-
top_p: float |
|
|
56
|
+
audio: Dict[str, object] | Omit = omit,
|
|
57
|
+
frequency_penalty: float | Omit = omit,
|
|
58
|
+
function_call: Dict[str, object] | Omit = omit,
|
|
59
|
+
functions: Iterable[Dict[str, object]] | Omit = omit,
|
|
60
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
61
|
+
logprobs: bool | Omit = omit,
|
|
62
|
+
max_completion_tokens: int | Omit = omit,
|
|
63
|
+
max_tokens: int | Omit = omit,
|
|
64
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
65
|
+
modalities: SequenceNotStr[str] | Omit = omit,
|
|
66
|
+
n: int | Omit = omit,
|
|
67
|
+
parallel_tool_calls: bool | Omit = omit,
|
|
68
|
+
prediction: Dict[str, object] | Omit = omit,
|
|
69
|
+
presence_penalty: float | Omit = omit,
|
|
70
|
+
reasoning_effort: str | Omit = omit,
|
|
71
|
+
response_format: Dict[str, object] | Omit = omit,
|
|
72
|
+
seed: int | Omit = omit,
|
|
73
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
74
|
+
store: bool | Omit = omit,
|
|
75
|
+
stream: Literal[False] | Omit = omit,
|
|
76
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
77
|
+
temperature: float | Omit = omit,
|
|
78
|
+
tool_choice: Union[str, Dict[str, object]] | Omit = omit,
|
|
79
|
+
tools: Iterable[Dict[str, object]] | Omit = omit,
|
|
80
|
+
top_k: int | Omit = omit,
|
|
81
|
+
top_logprobs: int | Omit = omit,
|
|
82
|
+
top_p: float | Omit = omit,
|
|
83
83
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
84
84
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
85
85
|
extra_headers: Headers | None = None,
|
|
86
86
|
extra_query: Query | None = None,
|
|
87
87
|
extra_body: Body | None = None,
|
|
88
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
88
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
89
89
|
) -> CompletionCreateResponse:
|
|
90
90
|
"""
|
|
91
91
|
Chat Completions
|
|
@@ -182,38 +182,38 @@ class CompletionsResource(SyncAPIResource):
|
|
|
182
182
|
messages: Iterable[Dict[str, object]],
|
|
183
183
|
model: str,
|
|
184
184
|
stream: Literal[True],
|
|
185
|
-
audio: Dict[str, object] |
|
|
186
|
-
frequency_penalty: float |
|
|
187
|
-
function_call: Dict[str, object] |
|
|
188
|
-
functions: Iterable[Dict[str, object]] |
|
|
189
|
-
logit_bias: Dict[str, int] |
|
|
190
|
-
logprobs: bool |
|
|
191
|
-
max_completion_tokens: int |
|
|
192
|
-
max_tokens: int |
|
|
193
|
-
metadata: Dict[str, str] |
|
|
194
|
-
modalities: SequenceNotStr[str] |
|
|
195
|
-
n: int |
|
|
196
|
-
parallel_tool_calls: bool |
|
|
197
|
-
prediction: Dict[str, object] |
|
|
198
|
-
presence_penalty: float |
|
|
199
|
-
reasoning_effort: str |
|
|
200
|
-
response_format: Dict[str, object] |
|
|
201
|
-
seed: int |
|
|
202
|
-
stop: Union[str, SequenceNotStr[str]] |
|
|
203
|
-
store: bool |
|
|
204
|
-
stream_options: Dict[str, object] |
|
|
205
|
-
temperature: float |
|
|
206
|
-
tool_choice: Union[str, Dict[str, object]] |
|
|
207
|
-
tools: Iterable[Dict[str, object]] |
|
|
208
|
-
top_k: int |
|
|
209
|
-
top_logprobs: int |
|
|
210
|
-
top_p: float |
|
|
185
|
+
audio: Dict[str, object] | Omit = omit,
|
|
186
|
+
frequency_penalty: float | Omit = omit,
|
|
187
|
+
function_call: Dict[str, object] | Omit = omit,
|
|
188
|
+
functions: Iterable[Dict[str, object]] | Omit = omit,
|
|
189
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
190
|
+
logprobs: bool | Omit = omit,
|
|
191
|
+
max_completion_tokens: int | Omit = omit,
|
|
192
|
+
max_tokens: int | Omit = omit,
|
|
193
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
194
|
+
modalities: SequenceNotStr[str] | Omit = omit,
|
|
195
|
+
n: int | Omit = omit,
|
|
196
|
+
parallel_tool_calls: bool | Omit = omit,
|
|
197
|
+
prediction: Dict[str, object] | Omit = omit,
|
|
198
|
+
presence_penalty: float | Omit = omit,
|
|
199
|
+
reasoning_effort: str | Omit = omit,
|
|
200
|
+
response_format: Dict[str, object] | Omit = omit,
|
|
201
|
+
seed: int | Omit = omit,
|
|
202
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
203
|
+
store: bool | Omit = omit,
|
|
204
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
205
|
+
temperature: float | Omit = omit,
|
|
206
|
+
tool_choice: Union[str, Dict[str, object]] | Omit = omit,
|
|
207
|
+
tools: Iterable[Dict[str, object]] | Omit = omit,
|
|
208
|
+
top_k: int | Omit = omit,
|
|
209
|
+
top_logprobs: int | Omit = omit,
|
|
210
|
+
top_p: float | Omit = omit,
|
|
211
211
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
212
212
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
213
213
|
extra_headers: Headers | None = None,
|
|
214
214
|
extra_query: Query | None = None,
|
|
215
215
|
extra_body: Body | None = None,
|
|
216
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
216
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
217
217
|
) -> Stream[ChatCompletionChunk]:
|
|
218
218
|
"""
|
|
219
219
|
Chat Completions
|
|
@@ -310,38 +310,38 @@ class CompletionsResource(SyncAPIResource):
|
|
|
310
310
|
messages: Iterable[Dict[str, object]],
|
|
311
311
|
model: str,
|
|
312
312
|
stream: bool,
|
|
313
|
-
audio: Dict[str, object] |
|
|
314
|
-
frequency_penalty: float |
|
|
315
|
-
function_call: Dict[str, object] |
|
|
316
|
-
functions: Iterable[Dict[str, object]] |
|
|
317
|
-
logit_bias: Dict[str, int] |
|
|
318
|
-
logprobs: bool |
|
|
319
|
-
max_completion_tokens: int |
|
|
320
|
-
max_tokens: int |
|
|
321
|
-
metadata: Dict[str, str] |
|
|
322
|
-
modalities: SequenceNotStr[str] |
|
|
323
|
-
n: int |
|
|
324
|
-
parallel_tool_calls: bool |
|
|
325
|
-
prediction: Dict[str, object] |
|
|
326
|
-
presence_penalty: float |
|
|
327
|
-
reasoning_effort: str |
|
|
328
|
-
response_format: Dict[str, object] |
|
|
329
|
-
seed: int |
|
|
330
|
-
stop: Union[str, SequenceNotStr[str]] |
|
|
331
|
-
store: bool |
|
|
332
|
-
stream_options: Dict[str, object] |
|
|
333
|
-
temperature: float |
|
|
334
|
-
tool_choice: Union[str, Dict[str, object]] |
|
|
335
|
-
tools: Iterable[Dict[str, object]] |
|
|
336
|
-
top_k: int |
|
|
337
|
-
top_logprobs: int |
|
|
338
|
-
top_p: float |
|
|
313
|
+
audio: Dict[str, object] | Omit = omit,
|
|
314
|
+
frequency_penalty: float | Omit = omit,
|
|
315
|
+
function_call: Dict[str, object] | Omit = omit,
|
|
316
|
+
functions: Iterable[Dict[str, object]] | Omit = omit,
|
|
317
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
318
|
+
logprobs: bool | Omit = omit,
|
|
319
|
+
max_completion_tokens: int | Omit = omit,
|
|
320
|
+
max_tokens: int | Omit = omit,
|
|
321
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
322
|
+
modalities: SequenceNotStr[str] | Omit = omit,
|
|
323
|
+
n: int | Omit = omit,
|
|
324
|
+
parallel_tool_calls: bool | Omit = omit,
|
|
325
|
+
prediction: Dict[str, object] | Omit = omit,
|
|
326
|
+
presence_penalty: float | Omit = omit,
|
|
327
|
+
reasoning_effort: str | Omit = omit,
|
|
328
|
+
response_format: Dict[str, object] | Omit = omit,
|
|
329
|
+
seed: int | Omit = omit,
|
|
330
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
331
|
+
store: bool | Omit = omit,
|
|
332
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
333
|
+
temperature: float | Omit = omit,
|
|
334
|
+
tool_choice: Union[str, Dict[str, object]] | Omit = omit,
|
|
335
|
+
tools: Iterable[Dict[str, object]] | Omit = omit,
|
|
336
|
+
top_k: int | Omit = omit,
|
|
337
|
+
top_logprobs: int | Omit = omit,
|
|
338
|
+
top_p: float | Omit = omit,
|
|
339
339
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
340
340
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
341
341
|
extra_headers: Headers | None = None,
|
|
342
342
|
extra_query: Query | None = None,
|
|
343
343
|
extra_body: Body | None = None,
|
|
344
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
344
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
345
345
|
) -> CompletionCreateResponse | Stream[ChatCompletionChunk]:
|
|
346
346
|
"""
|
|
347
347
|
Chat Completions
|
|
@@ -437,39 +437,39 @@ class CompletionsResource(SyncAPIResource):
|
|
|
437
437
|
*,
|
|
438
438
|
messages: Iterable[Dict[str, object]],
|
|
439
439
|
model: str,
|
|
440
|
-
audio: Dict[str, object] |
|
|
441
|
-
frequency_penalty: float |
|
|
442
|
-
function_call: Dict[str, object] |
|
|
443
|
-
functions: Iterable[Dict[str, object]] |
|
|
444
|
-
logit_bias: Dict[str, int] |
|
|
445
|
-
logprobs: bool |
|
|
446
|
-
max_completion_tokens: int |
|
|
447
|
-
max_tokens: int |
|
|
448
|
-
metadata: Dict[str, str] |
|
|
449
|
-
modalities: SequenceNotStr[str] |
|
|
450
|
-
n: int |
|
|
451
|
-
parallel_tool_calls: bool |
|
|
452
|
-
prediction: Dict[str, object] |
|
|
453
|
-
presence_penalty: float |
|
|
454
|
-
reasoning_effort: str |
|
|
455
|
-
response_format: Dict[str, object] |
|
|
456
|
-
seed: int |
|
|
457
|
-
stop: Union[str, SequenceNotStr[str]] |
|
|
458
|
-
store: bool |
|
|
459
|
-
stream: Literal[False] | Literal[True] |
|
|
460
|
-
stream_options: Dict[str, object] |
|
|
461
|
-
temperature: float |
|
|
462
|
-
tool_choice: Union[str, Dict[str, object]] |
|
|
463
|
-
tools: Iterable[Dict[str, object]] |
|
|
464
|
-
top_k: int |
|
|
465
|
-
top_logprobs: int |
|
|
466
|
-
top_p: float |
|
|
440
|
+
audio: Dict[str, object] | Omit = omit,
|
|
441
|
+
frequency_penalty: float | Omit = omit,
|
|
442
|
+
function_call: Dict[str, object] | Omit = omit,
|
|
443
|
+
functions: Iterable[Dict[str, object]] | Omit = omit,
|
|
444
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
445
|
+
logprobs: bool | Omit = omit,
|
|
446
|
+
max_completion_tokens: int | Omit = omit,
|
|
447
|
+
max_tokens: int | Omit = omit,
|
|
448
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
449
|
+
modalities: SequenceNotStr[str] | Omit = omit,
|
|
450
|
+
n: int | Omit = omit,
|
|
451
|
+
parallel_tool_calls: bool | Omit = omit,
|
|
452
|
+
prediction: Dict[str, object] | Omit = omit,
|
|
453
|
+
presence_penalty: float | Omit = omit,
|
|
454
|
+
reasoning_effort: str | Omit = omit,
|
|
455
|
+
response_format: Dict[str, object] | Omit = omit,
|
|
456
|
+
seed: int | Omit = omit,
|
|
457
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
458
|
+
store: bool | Omit = omit,
|
|
459
|
+
stream: Literal[False] | Literal[True] | Omit = omit,
|
|
460
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
461
|
+
temperature: float | Omit = omit,
|
|
462
|
+
tool_choice: Union[str, Dict[str, object]] | Omit = omit,
|
|
463
|
+
tools: Iterable[Dict[str, object]] | Omit = omit,
|
|
464
|
+
top_k: int | Omit = omit,
|
|
465
|
+
top_logprobs: int | Omit = omit,
|
|
466
|
+
top_p: float | Omit = omit,
|
|
467
467
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
468
468
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
469
469
|
extra_headers: Headers | None = None,
|
|
470
470
|
extra_query: Query | None = None,
|
|
471
471
|
extra_body: Body | None = None,
|
|
472
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
472
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
473
473
|
) -> CompletionCreateResponse | Stream[ChatCompletionChunk]:
|
|
474
474
|
return self._post(
|
|
475
475
|
"/v5/chat/completions",
|
|
@@ -522,9 +522,9 @@ class CompletionsResource(SyncAPIResource):
|
|
|
522
522
|
def models(
|
|
523
523
|
self,
|
|
524
524
|
*,
|
|
525
|
-
check_availability: bool |
|
|
526
|
-
ending_before: str |
|
|
527
|
-
limit: int |
|
|
525
|
+
check_availability: bool | Omit = omit,
|
|
526
|
+
ending_before: str | Omit = omit,
|
|
527
|
+
limit: int | Omit = omit,
|
|
528
528
|
model_vendor: Literal[
|
|
529
529
|
"openai",
|
|
530
530
|
"cohere",
|
|
@@ -539,15 +539,15 @@ class CompletionsResource(SyncAPIResource):
|
|
|
539
539
|
"xai",
|
|
540
540
|
"fireworks_ai",
|
|
541
541
|
]
|
|
542
|
-
|
|
|
543
|
-
sort_order: Literal["asc", "desc"] |
|
|
544
|
-
starting_after: str |
|
|
542
|
+
| Omit = omit,
|
|
543
|
+
sort_order: Literal["asc", "desc"] | Omit = omit,
|
|
544
|
+
starting_after: str | Omit = omit,
|
|
545
545
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
546
546
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
547
547
|
extra_headers: Headers | None = None,
|
|
548
548
|
extra_query: Query | None = None,
|
|
549
549
|
extra_body: Body | None = None,
|
|
550
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
550
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
551
551
|
) -> CompletionModelsResponse:
|
|
552
552
|
"""
|
|
553
553
|
List Chat Completion Models
|
|
@@ -610,39 +610,39 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
610
610
|
*,
|
|
611
611
|
messages: Iterable[Dict[str, object]],
|
|
612
612
|
model: str,
|
|
613
|
-
audio: Dict[str, object] |
|
|
614
|
-
frequency_penalty: float |
|
|
615
|
-
function_call: Dict[str, object] |
|
|
616
|
-
functions: Iterable[Dict[str, object]] |
|
|
617
|
-
logit_bias: Dict[str, int] |
|
|
618
|
-
logprobs: bool |
|
|
619
|
-
max_completion_tokens: int |
|
|
620
|
-
max_tokens: int |
|
|
621
|
-
metadata: Dict[str, str] |
|
|
622
|
-
modalities: SequenceNotStr[str] |
|
|
623
|
-
n: int |
|
|
624
|
-
parallel_tool_calls: bool |
|
|
625
|
-
prediction: Dict[str, object] |
|
|
626
|
-
presence_penalty: float |
|
|
627
|
-
reasoning_effort: str |
|
|
628
|
-
response_format: Dict[str, object] |
|
|
629
|
-
seed: int |
|
|
630
|
-
stop: Union[str, SequenceNotStr[str]] |
|
|
631
|
-
store: bool |
|
|
632
|
-
stream: Literal[False] |
|
|
633
|
-
stream_options: Dict[str, object] |
|
|
634
|
-
temperature: float |
|
|
635
|
-
tool_choice: Union[str, Dict[str, object]] |
|
|
636
|
-
tools: Iterable[Dict[str, object]] |
|
|
637
|
-
top_k: int |
|
|
638
|
-
top_logprobs: int |
|
|
639
|
-
top_p: float |
|
|
613
|
+
audio: Dict[str, object] | Omit = omit,
|
|
614
|
+
frequency_penalty: float | Omit = omit,
|
|
615
|
+
function_call: Dict[str, object] | Omit = omit,
|
|
616
|
+
functions: Iterable[Dict[str, object]] | Omit = omit,
|
|
617
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
618
|
+
logprobs: bool | Omit = omit,
|
|
619
|
+
max_completion_tokens: int | Omit = omit,
|
|
620
|
+
max_tokens: int | Omit = omit,
|
|
621
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
622
|
+
modalities: SequenceNotStr[str] | Omit = omit,
|
|
623
|
+
n: int | Omit = omit,
|
|
624
|
+
parallel_tool_calls: bool | Omit = omit,
|
|
625
|
+
prediction: Dict[str, object] | Omit = omit,
|
|
626
|
+
presence_penalty: float | Omit = omit,
|
|
627
|
+
reasoning_effort: str | Omit = omit,
|
|
628
|
+
response_format: Dict[str, object] | Omit = omit,
|
|
629
|
+
seed: int | Omit = omit,
|
|
630
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
631
|
+
store: bool | Omit = omit,
|
|
632
|
+
stream: Literal[False] | Omit = omit,
|
|
633
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
634
|
+
temperature: float | Omit = omit,
|
|
635
|
+
tool_choice: Union[str, Dict[str, object]] | Omit = omit,
|
|
636
|
+
tools: Iterable[Dict[str, object]] | Omit = omit,
|
|
637
|
+
top_k: int | Omit = omit,
|
|
638
|
+
top_logprobs: int | Omit = omit,
|
|
639
|
+
top_p: float | Omit = omit,
|
|
640
640
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
641
641
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
642
642
|
extra_headers: Headers | None = None,
|
|
643
643
|
extra_query: Query | None = None,
|
|
644
644
|
extra_body: Body | None = None,
|
|
645
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
645
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
646
646
|
) -> CompletionCreateResponse:
|
|
647
647
|
"""
|
|
648
648
|
Chat Completions
|
|
@@ -739,38 +739,38 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
739
739
|
messages: Iterable[Dict[str, object]],
|
|
740
740
|
model: str,
|
|
741
741
|
stream: Literal[True],
|
|
742
|
-
audio: Dict[str, object] |
|
|
743
|
-
frequency_penalty: float |
|
|
744
|
-
function_call: Dict[str, object] |
|
|
745
|
-
functions: Iterable[Dict[str, object]] |
|
|
746
|
-
logit_bias: Dict[str, int] |
|
|
747
|
-
logprobs: bool |
|
|
748
|
-
max_completion_tokens: int |
|
|
749
|
-
max_tokens: int |
|
|
750
|
-
metadata: Dict[str, str] |
|
|
751
|
-
modalities: SequenceNotStr[str] |
|
|
752
|
-
n: int |
|
|
753
|
-
parallel_tool_calls: bool |
|
|
754
|
-
prediction: Dict[str, object] |
|
|
755
|
-
presence_penalty: float |
|
|
756
|
-
reasoning_effort: str |
|
|
757
|
-
response_format: Dict[str, object] |
|
|
758
|
-
seed: int |
|
|
759
|
-
stop: Union[str, SequenceNotStr[str]] |
|
|
760
|
-
store: bool |
|
|
761
|
-
stream_options: Dict[str, object] |
|
|
762
|
-
temperature: float |
|
|
763
|
-
tool_choice: Union[str, Dict[str, object]] |
|
|
764
|
-
tools: Iterable[Dict[str, object]] |
|
|
765
|
-
top_k: int |
|
|
766
|
-
top_logprobs: int |
|
|
767
|
-
top_p: float |
|
|
742
|
+
audio: Dict[str, object] | Omit = omit,
|
|
743
|
+
frequency_penalty: float | Omit = omit,
|
|
744
|
+
function_call: Dict[str, object] | Omit = omit,
|
|
745
|
+
functions: Iterable[Dict[str, object]] | Omit = omit,
|
|
746
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
747
|
+
logprobs: bool | Omit = omit,
|
|
748
|
+
max_completion_tokens: int | Omit = omit,
|
|
749
|
+
max_tokens: int | Omit = omit,
|
|
750
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
751
|
+
modalities: SequenceNotStr[str] | Omit = omit,
|
|
752
|
+
n: int | Omit = omit,
|
|
753
|
+
parallel_tool_calls: bool | Omit = omit,
|
|
754
|
+
prediction: Dict[str, object] | Omit = omit,
|
|
755
|
+
presence_penalty: float | Omit = omit,
|
|
756
|
+
reasoning_effort: str | Omit = omit,
|
|
757
|
+
response_format: Dict[str, object] | Omit = omit,
|
|
758
|
+
seed: int | Omit = omit,
|
|
759
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
760
|
+
store: bool | Omit = omit,
|
|
761
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
762
|
+
temperature: float | Omit = omit,
|
|
763
|
+
tool_choice: Union[str, Dict[str, object]] | Omit = omit,
|
|
764
|
+
tools: Iterable[Dict[str, object]] | Omit = omit,
|
|
765
|
+
top_k: int | Omit = omit,
|
|
766
|
+
top_logprobs: int | Omit = omit,
|
|
767
|
+
top_p: float | Omit = omit,
|
|
768
768
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
769
769
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
770
770
|
extra_headers: Headers | None = None,
|
|
771
771
|
extra_query: Query | None = None,
|
|
772
772
|
extra_body: Body | None = None,
|
|
773
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
773
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
774
774
|
) -> AsyncStream[ChatCompletionChunk]:
|
|
775
775
|
"""
|
|
776
776
|
Chat Completions
|
|
@@ -867,38 +867,38 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
867
867
|
messages: Iterable[Dict[str, object]],
|
|
868
868
|
model: str,
|
|
869
869
|
stream: bool,
|
|
870
|
-
audio: Dict[str, object] |
|
|
871
|
-
frequency_penalty: float |
|
|
872
|
-
function_call: Dict[str, object] |
|
|
873
|
-
functions: Iterable[Dict[str, object]] |
|
|
874
|
-
logit_bias: Dict[str, int] |
|
|
875
|
-
logprobs: bool |
|
|
876
|
-
max_completion_tokens: int |
|
|
877
|
-
max_tokens: int |
|
|
878
|
-
metadata: Dict[str, str] |
|
|
879
|
-
modalities: SequenceNotStr[str] |
|
|
880
|
-
n: int |
|
|
881
|
-
parallel_tool_calls: bool |
|
|
882
|
-
prediction: Dict[str, object] |
|
|
883
|
-
presence_penalty: float |
|
|
884
|
-
reasoning_effort: str |
|
|
885
|
-
response_format: Dict[str, object] |
|
|
886
|
-
seed: int |
|
|
887
|
-
stop: Union[str, SequenceNotStr[str]] |
|
|
888
|
-
store: bool |
|
|
889
|
-
stream_options: Dict[str, object] |
|
|
890
|
-
temperature: float |
|
|
891
|
-
tool_choice: Union[str, Dict[str, object]] |
|
|
892
|
-
tools: Iterable[Dict[str, object]] |
|
|
893
|
-
top_k: int |
|
|
894
|
-
top_logprobs: int |
|
|
895
|
-
top_p: float |
|
|
870
|
+
audio: Dict[str, object] | Omit = omit,
|
|
871
|
+
frequency_penalty: float | Omit = omit,
|
|
872
|
+
function_call: Dict[str, object] | Omit = omit,
|
|
873
|
+
functions: Iterable[Dict[str, object]] | Omit = omit,
|
|
874
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
875
|
+
logprobs: bool | Omit = omit,
|
|
876
|
+
max_completion_tokens: int | Omit = omit,
|
|
877
|
+
max_tokens: int | Omit = omit,
|
|
878
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
879
|
+
modalities: SequenceNotStr[str] | Omit = omit,
|
|
880
|
+
n: int | Omit = omit,
|
|
881
|
+
parallel_tool_calls: bool | Omit = omit,
|
|
882
|
+
prediction: Dict[str, object] | Omit = omit,
|
|
883
|
+
presence_penalty: float | Omit = omit,
|
|
884
|
+
reasoning_effort: str | Omit = omit,
|
|
885
|
+
response_format: Dict[str, object] | Omit = omit,
|
|
886
|
+
seed: int | Omit = omit,
|
|
887
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
888
|
+
store: bool | Omit = omit,
|
|
889
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
890
|
+
temperature: float | Omit = omit,
|
|
891
|
+
tool_choice: Union[str, Dict[str, object]] | Omit = omit,
|
|
892
|
+
tools: Iterable[Dict[str, object]] | Omit = omit,
|
|
893
|
+
top_k: int | Omit = omit,
|
|
894
|
+
top_logprobs: int | Omit = omit,
|
|
895
|
+
top_p: float | Omit = omit,
|
|
896
896
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
897
897
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
898
898
|
extra_headers: Headers | None = None,
|
|
899
899
|
extra_query: Query | None = None,
|
|
900
900
|
extra_body: Body | None = None,
|
|
901
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
901
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
902
902
|
) -> CompletionCreateResponse | AsyncStream[ChatCompletionChunk]:
|
|
903
903
|
"""
|
|
904
904
|
Chat Completions
|
|
@@ -994,39 +994,39 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
994
994
|
*,
|
|
995
995
|
messages: Iterable[Dict[str, object]],
|
|
996
996
|
model: str,
|
|
997
|
-
audio: Dict[str, object] |
|
|
998
|
-
frequency_penalty: float |
|
|
999
|
-
function_call: Dict[str, object] |
|
|
1000
|
-
functions: Iterable[Dict[str, object]] |
|
|
1001
|
-
logit_bias: Dict[str, int] |
|
|
1002
|
-
logprobs: bool |
|
|
1003
|
-
max_completion_tokens: int |
|
|
1004
|
-
max_tokens: int |
|
|
1005
|
-
metadata: Dict[str, str] |
|
|
1006
|
-
modalities: SequenceNotStr[str] |
|
|
1007
|
-
n: int |
|
|
1008
|
-
parallel_tool_calls: bool |
|
|
1009
|
-
prediction: Dict[str, object] |
|
|
1010
|
-
presence_penalty: float |
|
|
1011
|
-
reasoning_effort: str |
|
|
1012
|
-
response_format: Dict[str, object] |
|
|
1013
|
-
seed: int |
|
|
1014
|
-
stop: Union[str, SequenceNotStr[str]] |
|
|
1015
|
-
store: bool |
|
|
1016
|
-
stream: Literal[False] | Literal[True] |
|
|
1017
|
-
stream_options: Dict[str, object] |
|
|
1018
|
-
temperature: float |
|
|
1019
|
-
tool_choice: Union[str, Dict[str, object]] |
|
|
1020
|
-
tools: Iterable[Dict[str, object]] |
|
|
1021
|
-
top_k: int |
|
|
1022
|
-
top_logprobs: int |
|
|
1023
|
-
top_p: float |
|
|
997
|
+
audio: Dict[str, object] | Omit = omit,
|
|
998
|
+
frequency_penalty: float | Omit = omit,
|
|
999
|
+
function_call: Dict[str, object] | Omit = omit,
|
|
1000
|
+
functions: Iterable[Dict[str, object]] | Omit = omit,
|
|
1001
|
+
logit_bias: Dict[str, int] | Omit = omit,
|
|
1002
|
+
logprobs: bool | Omit = omit,
|
|
1003
|
+
max_completion_tokens: int | Omit = omit,
|
|
1004
|
+
max_tokens: int | Omit = omit,
|
|
1005
|
+
metadata: Dict[str, str] | Omit = omit,
|
|
1006
|
+
modalities: SequenceNotStr[str] | Omit = omit,
|
|
1007
|
+
n: int | Omit = omit,
|
|
1008
|
+
parallel_tool_calls: bool | Omit = omit,
|
|
1009
|
+
prediction: Dict[str, object] | Omit = omit,
|
|
1010
|
+
presence_penalty: float | Omit = omit,
|
|
1011
|
+
reasoning_effort: str | Omit = omit,
|
|
1012
|
+
response_format: Dict[str, object] | Omit = omit,
|
|
1013
|
+
seed: int | Omit = omit,
|
|
1014
|
+
stop: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
1015
|
+
store: bool | Omit = omit,
|
|
1016
|
+
stream: Literal[False] | Literal[True] | Omit = omit,
|
|
1017
|
+
stream_options: Dict[str, object] | Omit = omit,
|
|
1018
|
+
temperature: float | Omit = omit,
|
|
1019
|
+
tool_choice: Union[str, Dict[str, object]] | Omit = omit,
|
|
1020
|
+
tools: Iterable[Dict[str, object]] | Omit = omit,
|
|
1021
|
+
top_k: int | Omit = omit,
|
|
1022
|
+
top_logprobs: int | Omit = omit,
|
|
1023
|
+
top_p: float | Omit = omit,
|
|
1024
1024
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1025
1025
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1026
1026
|
extra_headers: Headers | None = None,
|
|
1027
1027
|
extra_query: Query | None = None,
|
|
1028
1028
|
extra_body: Body | None = None,
|
|
1029
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1029
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1030
1030
|
) -> CompletionCreateResponse | AsyncStream[ChatCompletionChunk]:
|
|
1031
1031
|
return await self._post(
|
|
1032
1032
|
"/v5/chat/completions",
|
|
@@ -1079,9 +1079,9 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
1079
1079
|
async def models(
|
|
1080
1080
|
self,
|
|
1081
1081
|
*,
|
|
1082
|
-
check_availability: bool |
|
|
1083
|
-
ending_before: str |
|
|
1084
|
-
limit: int |
|
|
1082
|
+
check_availability: bool | Omit = omit,
|
|
1083
|
+
ending_before: str | Omit = omit,
|
|
1084
|
+
limit: int | Omit = omit,
|
|
1085
1085
|
model_vendor: Literal[
|
|
1086
1086
|
"openai",
|
|
1087
1087
|
"cohere",
|
|
@@ -1096,15 +1096,15 @@ class AsyncCompletionsResource(AsyncAPIResource):
|
|
|
1096
1096
|
"xai",
|
|
1097
1097
|
"fireworks_ai",
|
|
1098
1098
|
]
|
|
1099
|
-
|
|
|
1100
|
-
sort_order: Literal["asc", "desc"] |
|
|
1101
|
-
starting_after: str |
|
|
1099
|
+
| Omit = omit,
|
|
1100
|
+
sort_order: Literal["asc", "desc"] | Omit = omit,
|
|
1101
|
+
starting_after: str | Omit = omit,
|
|
1102
1102
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1103
1103
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1104
1104
|
extra_headers: Headers | None = None,
|
|
1105
1105
|
extra_query: Query | None = None,
|
|
1106
1106
|
extra_body: Body | None = None,
|
|
1107
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1107
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1108
1108
|
) -> CompletionModelsResponse:
|
|
1109
1109
|
"""
|
|
1110
1110
|
List Chat Completion Models
|