2
2
3
3
from __future__ import annotations
4
4
5
- from typing import Dict , List , Union , Iterable , Optional
5
+ from typing import Dict , Union , Iterable , Optional
6
6
from typing_extensions import Literal , overload
7
7
8
8
import httpx
9
9
10
10
from .. import _legacy_response
11
11
from ..types import completion_create_params
12
- from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven
12
+ from .._types import NOT_GIVEN , Body , Query , Headers , NotGiven , SequenceNotStr
13
13
from .._utils import required_args , maybe_transform , async_maybe_transform
14
14
from .._compat import cached_property
15
15
from .._resource import SyncAPIResource , AsyncAPIResource
@@ -49,7 +49,7 @@ def create(
49
49
self ,
50
50
* ,
51
51
model : Union [str , Literal ["gpt-3.5-turbo-instruct" , "davinci-002" , "babbage-002" ]],
52
- prompt : Union [str , List [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
52
+ prompt : Union [str , SequenceNotStr [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
53
53
best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
54
54
echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
55
55
frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -59,7 +59,7 @@ def create(
59
59
n : Optional [int ] | NotGiven = NOT_GIVEN ,
60
60
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
61
61
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
62
- stop : Union [Optional [str ], List [str ], None ] | NotGiven = NOT_GIVEN ,
62
+ stop : Union [Optional [str ], SequenceNotStr [str ], None ] | NotGiven = NOT_GIVEN ,
63
63
stream : Optional [Literal [False ]] | NotGiven = NOT_GIVEN ,
64
64
stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
65
65
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -204,7 +204,7 @@ def create(
204
204
self ,
205
205
* ,
206
206
model : Union [str , Literal ["gpt-3.5-turbo-instruct" , "davinci-002" , "babbage-002" ]],
207
- prompt : Union [str , List [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
207
+ prompt : Union [str , SequenceNotStr [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
208
208
stream : Literal [True ],
209
209
best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
210
210
echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
@@ -215,7 +215,7 @@ def create(
215
215
n : Optional [int ] | NotGiven = NOT_GIVEN ,
216
216
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
217
217
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
218
- stop : Union [Optional [str ], List [str ], None ] | NotGiven = NOT_GIVEN ,
218
+ stop : Union [Optional [str ], SequenceNotStr [str ], None ] | NotGiven = NOT_GIVEN ,
219
219
stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
220
220
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
221
221
temperature : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -359,7 +359,7 @@ def create(
359
359
self ,
360
360
* ,
361
361
model : Union [str , Literal ["gpt-3.5-turbo-instruct" , "davinci-002" , "babbage-002" ]],
362
- prompt : Union [str , List [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
362
+ prompt : Union [str , SequenceNotStr [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
363
363
stream : bool ,
364
364
best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
365
365
echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
@@ -370,7 +370,7 @@ def create(
370
370
n : Optional [int ] | NotGiven = NOT_GIVEN ,
371
371
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
372
372
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
373
- stop : Union [Optional [str ], List [str ], None ] | NotGiven = NOT_GIVEN ,
373
+ stop : Union [Optional [str ], SequenceNotStr [str ], None ] | NotGiven = NOT_GIVEN ,
374
374
stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
375
375
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
376
376
temperature : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -514,7 +514,7 @@ def create(
514
514
self ,
515
515
* ,
516
516
model : Union [str , Literal ["gpt-3.5-turbo-instruct" , "davinci-002" , "babbage-002" ]],
517
- prompt : Union [str , List [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
517
+ prompt : Union [str , SequenceNotStr [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
518
518
best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
519
519
echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
520
520
frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -524,7 +524,7 @@ def create(
524
524
n : Optional [int ] | NotGiven = NOT_GIVEN ,
525
525
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
526
526
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
527
- stop : Union [Optional [str ], List [str ], None ] | NotGiven = NOT_GIVEN ,
527
+ stop : Union [Optional [str ], SequenceNotStr [str ], None ] | NotGiven = NOT_GIVEN ,
528
528
stream : Optional [Literal [False ]] | Literal [True ] | NotGiven = NOT_GIVEN ,
529
529
stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
530
530
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -599,7 +599,7 @@ async def create(
599
599
self ,
600
600
* ,
601
601
model : Union [str , Literal ["gpt-3.5-turbo-instruct" , "davinci-002" , "babbage-002" ]],
602
- prompt : Union [str , List [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
602
+ prompt : Union [str , SequenceNotStr [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
603
603
best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
604
604
echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
605
605
frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -609,7 +609,7 @@ async def create(
609
609
n : Optional [int ] | NotGiven = NOT_GIVEN ,
610
610
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
611
611
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
612
- stop : Union [Optional [str ], List [str ], None ] | NotGiven = NOT_GIVEN ,
612
+ stop : Union [Optional [str ], SequenceNotStr [str ], None ] | NotGiven = NOT_GIVEN ,
613
613
stream : Optional [Literal [False ]] | NotGiven = NOT_GIVEN ,
614
614
stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
615
615
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -754,7 +754,7 @@ async def create(
754
754
self ,
755
755
* ,
756
756
model : Union [str , Literal ["gpt-3.5-turbo-instruct" , "davinci-002" , "babbage-002" ]],
757
- prompt : Union [str , List [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
757
+ prompt : Union [str , SequenceNotStr [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
758
758
stream : Literal [True ],
759
759
best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
760
760
echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
@@ -765,7 +765,7 @@ async def create(
765
765
n : Optional [int ] | NotGiven = NOT_GIVEN ,
766
766
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
767
767
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
768
- stop : Union [Optional [str ], List [str ], None ] | NotGiven = NOT_GIVEN ,
768
+ stop : Union [Optional [str ], SequenceNotStr [str ], None ] | NotGiven = NOT_GIVEN ,
769
769
stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
770
770
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
771
771
temperature : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -909,7 +909,7 @@ async def create(
909
909
self ,
910
910
* ,
911
911
model : Union [str , Literal ["gpt-3.5-turbo-instruct" , "davinci-002" , "babbage-002" ]],
912
- prompt : Union [str , List [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
912
+ prompt : Union [str , SequenceNotStr [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
913
913
stream : bool ,
914
914
best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
915
915
echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
@@ -920,7 +920,7 @@ async def create(
920
920
n : Optional [int ] | NotGiven = NOT_GIVEN ,
921
921
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
922
922
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
923
- stop : Union [Optional [str ], List [str ], None ] | NotGiven = NOT_GIVEN ,
923
+ stop : Union [Optional [str ], SequenceNotStr [str ], None ] | NotGiven = NOT_GIVEN ,
924
924
stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
925
925
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
926
926
temperature : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -1064,7 +1064,7 @@ async def create(
1064
1064
self ,
1065
1065
* ,
1066
1066
model : Union [str , Literal ["gpt-3.5-turbo-instruct" , "davinci-002" , "babbage-002" ]],
1067
- prompt : Union [str , List [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
1067
+ prompt : Union [str , SequenceNotStr [str ], Iterable [int ], Iterable [Iterable [int ]], None ],
1068
1068
best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
1069
1069
echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
1070
1070
frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -1074,7 +1074,7 @@ async def create(
1074
1074
n : Optional [int ] | NotGiven = NOT_GIVEN ,
1075
1075
presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
1076
1076
seed : Optional [int ] | NotGiven = NOT_GIVEN ,
1077
- stop : Union [Optional [str ], List [str ], None ] | NotGiven = NOT_GIVEN ,
1077
+ stop : Union [Optional [str ], SequenceNotStr [str ], None ] | NotGiven = NOT_GIVEN ,
1078
1078
stream : Optional [Literal [False ]] | Literal [True ] | NotGiven = NOT_GIVEN ,
1079
1079
stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
1080
1080
suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
0 commit comments