22
33from __future__ import annotations
44
5- from typing import Dict , List , Union , Iterable , Optional
5+ from typing import Dict , Union , Iterable , Optional
66from typing_extensions import Literal , overload
77
88import httpx
99
1010from .. import _legacy_response
1111from ..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
1313from .._utils import required_args , maybe_transform , async_maybe_transform
1414from .._compat import cached_property
1515from .._resource import SyncAPIResource , AsyncAPIResource
@@ -49,7 +49,7 @@ def create(
4949 self ,
5050 * ,
5151 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 ],
5353 best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
5454 echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
5555 frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -59,7 +59,7 @@ def create(
5959 n : Optional [int ] | NotGiven = NOT_GIVEN ,
6060 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
6161 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 ,
6363 stream : Optional [Literal [False ]] | NotGiven = NOT_GIVEN ,
6464 stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
6565 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -204,7 +204,7 @@ def create(
204204 self ,
205205 * ,
206206 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 ],
208208 stream : Literal [True ],
209209 best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
210210 echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
@@ -215,7 +215,7 @@ def create(
215215 n : Optional [int ] | NotGiven = NOT_GIVEN ,
216216 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
217217 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 ,
219219 stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
220220 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
221221 temperature : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -359,7 +359,7 @@ def create(
359359 self ,
360360 * ,
361361 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 ],
363363 stream : bool ,
364364 best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
365365 echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
@@ -370,7 +370,7 @@ def create(
370370 n : Optional [int ] | NotGiven = NOT_GIVEN ,
371371 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
372372 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 ,
374374 stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
375375 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
376376 temperature : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -514,7 +514,7 @@ def create(
514514 self ,
515515 * ,
516516 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 ],
518518 best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
519519 echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
520520 frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -524,7 +524,7 @@ def create(
524524 n : Optional [int ] | NotGiven = NOT_GIVEN ,
525525 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
526526 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 ,
528528 stream : Optional [Literal [False ]] | Literal [True ] | NotGiven = NOT_GIVEN ,
529529 stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
530530 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -599,7 +599,7 @@ async def create(
599599 self ,
600600 * ,
601601 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 ],
603603 best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
604604 echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
605605 frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -609,7 +609,7 @@ async def create(
609609 n : Optional [int ] | NotGiven = NOT_GIVEN ,
610610 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
611611 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 ,
613613 stream : Optional [Literal [False ]] | NotGiven = NOT_GIVEN ,
614614 stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
615615 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
@@ -754,7 +754,7 @@ async def create(
754754 self ,
755755 * ,
756756 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 ],
758758 stream : Literal [True ],
759759 best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
760760 echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
@@ -765,7 +765,7 @@ async def create(
765765 n : Optional [int ] | NotGiven = NOT_GIVEN ,
766766 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
767767 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 ,
769769 stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
770770 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
771771 temperature : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -909,7 +909,7 @@ async def create(
909909 self ,
910910 * ,
911911 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 ],
913913 stream : bool ,
914914 best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
915915 echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
@@ -920,7 +920,7 @@ async def create(
920920 n : Optional [int ] | NotGiven = NOT_GIVEN ,
921921 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
922922 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 ,
924924 stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
925925 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
926926 temperature : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -1064,7 +1064,7 @@ async def create(
10641064 self ,
10651065 * ,
10661066 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 ],
10681068 best_of : Optional [int ] | NotGiven = NOT_GIVEN ,
10691069 echo : Optional [bool ] | NotGiven = NOT_GIVEN ,
10701070 frequency_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
@@ -1074,7 +1074,7 @@ async def create(
10741074 n : Optional [int ] | NotGiven = NOT_GIVEN ,
10751075 presence_penalty : Optional [float ] | NotGiven = NOT_GIVEN ,
10761076 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 ,
10781078 stream : Optional [Literal [False ]] | Literal [True ] | NotGiven = NOT_GIVEN ,
10791079 stream_options : Optional [ChatCompletionStreamOptionsParam ] | NotGiven = NOT_GIVEN ,
10801080 suffix : Optional [str ] | NotGiven = NOT_GIVEN ,
0 commit comments