|
8 | 8 | import httpx |
9 | 9 |
|
10 | 10 | from ... import _legacy_response |
| 11 | +from ...types import ChatModel |
11 | 12 | from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven |
12 | 13 | from ..._utils import ( |
13 | 14 | required_args, |
@@ -47,30 +48,7 @@ def create( |
47 | 48 | self, |
48 | 49 | *, |
49 | 50 | messages: Iterable[ChatCompletionMessageParam], |
50 | | - model: Union[ |
51 | | - str, |
52 | | - Literal[ |
53 | | - "gpt-4-turbo", |
54 | | - "gpt-4-turbo-2024-04-09", |
55 | | - "gpt-4-0125-preview", |
56 | | - "gpt-4-turbo-preview", |
57 | | - "gpt-4-1106-preview", |
58 | | - "gpt-4-vision-preview", |
59 | | - "gpt-4", |
60 | | - "gpt-4-0314", |
61 | | - "gpt-4-0613", |
62 | | - "gpt-4-32k", |
63 | | - "gpt-4-32k-0314", |
64 | | - "gpt-4-32k-0613", |
65 | | - "gpt-3.5-turbo", |
66 | | - "gpt-3.5-turbo-16k", |
67 | | - "gpt-3.5-turbo-0301", |
68 | | - "gpt-3.5-turbo-0613", |
69 | | - "gpt-3.5-turbo-1106", |
70 | | - "gpt-3.5-turbo-0125", |
71 | | - "gpt-3.5-turbo-16k-0613", |
72 | | - ], |
73 | | - ], |
| 51 | + model: Union[str, ChatModel], |
74 | 52 | frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, |
75 | 53 | function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN, |
76 | 54 | functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN, |
@@ -238,30 +216,7 @@ def create( |
238 | 216 | self, |
239 | 217 | *, |
240 | 218 | messages: Iterable[ChatCompletionMessageParam], |
241 | | - model: Union[ |
242 | | - str, |
243 | | - Literal[ |
244 | | - "gpt-4-turbo", |
245 | | - "gpt-4-turbo-2024-04-09", |
246 | | - "gpt-4-0125-preview", |
247 | | - "gpt-4-turbo-preview", |
248 | | - "gpt-4-1106-preview", |
249 | | - "gpt-4-vision-preview", |
250 | | - "gpt-4", |
251 | | - "gpt-4-0314", |
252 | | - "gpt-4-0613", |
253 | | - "gpt-4-32k", |
254 | | - "gpt-4-32k-0314", |
255 | | - "gpt-4-32k-0613", |
256 | | - "gpt-3.5-turbo", |
257 | | - "gpt-3.5-turbo-16k", |
258 | | - "gpt-3.5-turbo-0301", |
259 | | - "gpt-3.5-turbo-0613", |
260 | | - "gpt-3.5-turbo-1106", |
261 | | - "gpt-3.5-turbo-0125", |
262 | | - "gpt-3.5-turbo-16k-0613", |
263 | | - ], |
264 | | - ], |
| 219 | + model: Union[str, ChatModel], |
265 | 220 | stream: Literal[True], |
266 | 221 | frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, |
267 | 222 | function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN, |
@@ -429,30 +384,7 @@ def create( |
429 | 384 | self, |
430 | 385 | *, |
431 | 386 | messages: Iterable[ChatCompletionMessageParam], |
432 | | - model: Union[ |
433 | | - str, |
434 | | - Literal[ |
435 | | - "gpt-4-turbo", |
436 | | - "gpt-4-turbo-2024-04-09", |
437 | | - "gpt-4-0125-preview", |
438 | | - "gpt-4-turbo-preview", |
439 | | - "gpt-4-1106-preview", |
440 | | - "gpt-4-vision-preview", |
441 | | - "gpt-4", |
442 | | - "gpt-4-0314", |
443 | | - "gpt-4-0613", |
444 | | - "gpt-4-32k", |
445 | | - "gpt-4-32k-0314", |
446 | | - "gpt-4-32k-0613", |
447 | | - "gpt-3.5-turbo", |
448 | | - "gpt-3.5-turbo-16k", |
449 | | - "gpt-3.5-turbo-0301", |
450 | | - "gpt-3.5-turbo-0613", |
451 | | - "gpt-3.5-turbo-1106", |
452 | | - "gpt-3.5-turbo-0125", |
453 | | - "gpt-3.5-turbo-16k-0613", |
454 | | - ], |
455 | | - ], |
| 387 | + model: Union[str, ChatModel], |
456 | 388 | stream: bool, |
457 | 389 | frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, |
458 | 390 | function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN, |
@@ -620,30 +552,7 @@ def create( |
620 | 552 | self, |
621 | 553 | *, |
622 | 554 | messages: Iterable[ChatCompletionMessageParam], |
623 | | - model: Union[ |
624 | | - str, |
625 | | - Literal[ |
626 | | - "gpt-4-turbo", |
627 | | - "gpt-4-turbo-2024-04-09", |
628 | | - "gpt-4-0125-preview", |
629 | | - "gpt-4-turbo-preview", |
630 | | - "gpt-4-1106-preview", |
631 | | - "gpt-4-vision-preview", |
632 | | - "gpt-4", |
633 | | - "gpt-4-0314", |
634 | | - "gpt-4-0613", |
635 | | - "gpt-4-32k", |
636 | | - "gpt-4-32k-0314", |
637 | | - "gpt-4-32k-0613", |
638 | | - "gpt-3.5-turbo", |
639 | | - "gpt-3.5-turbo-16k", |
640 | | - "gpt-3.5-turbo-0301", |
641 | | - "gpt-3.5-turbo-0613", |
642 | | - "gpt-3.5-turbo-1106", |
643 | | - "gpt-3.5-turbo-0125", |
644 | | - "gpt-3.5-turbo-16k-0613", |
645 | | - ], |
646 | | - ], |
| 555 | + model: Union[str, ChatModel], |
647 | 556 | frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, |
648 | 557 | function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN, |
649 | 558 | functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN, |
@@ -719,30 +628,7 @@ async def create( |
719 | 628 | self, |
720 | 629 | *, |
721 | 630 | messages: Iterable[ChatCompletionMessageParam], |
722 | | - model: Union[ |
723 | | - str, |
724 | | - Literal[ |
725 | | - "gpt-4-turbo", |
726 | | - "gpt-4-turbo-2024-04-09", |
727 | | - "gpt-4-0125-preview", |
728 | | - "gpt-4-turbo-preview", |
729 | | - "gpt-4-1106-preview", |
730 | | - "gpt-4-vision-preview", |
731 | | - "gpt-4", |
732 | | - "gpt-4-0314", |
733 | | - "gpt-4-0613", |
734 | | - "gpt-4-32k", |
735 | | - "gpt-4-32k-0314", |
736 | | - "gpt-4-32k-0613", |
737 | | - "gpt-3.5-turbo", |
738 | | - "gpt-3.5-turbo-16k", |
739 | | - "gpt-3.5-turbo-0301", |
740 | | - "gpt-3.5-turbo-0613", |
741 | | - "gpt-3.5-turbo-1106", |
742 | | - "gpt-3.5-turbo-0125", |
743 | | - "gpt-3.5-turbo-16k-0613", |
744 | | - ], |
745 | | - ], |
| 631 | + model: Union[str, ChatModel], |
746 | 632 | frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, |
747 | 633 | function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN, |
748 | 634 | functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN, |
@@ -910,30 +796,7 @@ async def create( |
910 | 796 | self, |
911 | 797 | *, |
912 | 798 | messages: Iterable[ChatCompletionMessageParam], |
913 | | - model: Union[ |
914 | | - str, |
915 | | - Literal[ |
916 | | - "gpt-4-turbo", |
917 | | - "gpt-4-turbo-2024-04-09", |
918 | | - "gpt-4-0125-preview", |
919 | | - "gpt-4-turbo-preview", |
920 | | - "gpt-4-1106-preview", |
921 | | - "gpt-4-vision-preview", |
922 | | - "gpt-4", |
923 | | - "gpt-4-0314", |
924 | | - "gpt-4-0613", |
925 | | - "gpt-4-32k", |
926 | | - "gpt-4-32k-0314", |
927 | | - "gpt-4-32k-0613", |
928 | | - "gpt-3.5-turbo", |
929 | | - "gpt-3.5-turbo-16k", |
930 | | - "gpt-3.5-turbo-0301", |
931 | | - "gpt-3.5-turbo-0613", |
932 | | - "gpt-3.5-turbo-1106", |
933 | | - "gpt-3.5-turbo-0125", |
934 | | - "gpt-3.5-turbo-16k-0613", |
935 | | - ], |
936 | | - ], |
| 799 | + model: Union[str, ChatModel], |
937 | 800 | stream: Literal[True], |
938 | 801 | frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, |
939 | 802 | function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN, |
@@ -1101,30 +964,7 @@ async def create( |
1101 | 964 | self, |
1102 | 965 | *, |
1103 | 966 | messages: Iterable[ChatCompletionMessageParam], |
1104 | | - model: Union[ |
1105 | | - str, |
1106 | | - Literal[ |
1107 | | - "gpt-4-turbo", |
1108 | | - "gpt-4-turbo-2024-04-09", |
1109 | | - "gpt-4-0125-preview", |
1110 | | - "gpt-4-turbo-preview", |
1111 | | - "gpt-4-1106-preview", |
1112 | | - "gpt-4-vision-preview", |
1113 | | - "gpt-4", |
1114 | | - "gpt-4-0314", |
1115 | | - "gpt-4-0613", |
1116 | | - "gpt-4-32k", |
1117 | | - "gpt-4-32k-0314", |
1118 | | - "gpt-4-32k-0613", |
1119 | | - "gpt-3.5-turbo", |
1120 | | - "gpt-3.5-turbo-16k", |
1121 | | - "gpt-3.5-turbo-0301", |
1122 | | - "gpt-3.5-turbo-0613", |
1123 | | - "gpt-3.5-turbo-1106", |
1124 | | - "gpt-3.5-turbo-0125", |
1125 | | - "gpt-3.5-turbo-16k-0613", |
1126 | | - ], |
1127 | | - ], |
| 967 | + model: Union[str, ChatModel], |
1128 | 968 | stream: bool, |
1129 | 969 | frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, |
1130 | 970 | function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN, |
@@ -1292,30 +1132,7 @@ async def create( |
1292 | 1132 | self, |
1293 | 1133 | *, |
1294 | 1134 | messages: Iterable[ChatCompletionMessageParam], |
1295 | | - model: Union[ |
1296 | | - str, |
1297 | | - Literal[ |
1298 | | - "gpt-4-turbo", |
1299 | | - "gpt-4-turbo-2024-04-09", |
1300 | | - "gpt-4-0125-preview", |
1301 | | - "gpt-4-turbo-preview", |
1302 | | - "gpt-4-1106-preview", |
1303 | | - "gpt-4-vision-preview", |
1304 | | - "gpt-4", |
1305 | | - "gpt-4-0314", |
1306 | | - "gpt-4-0613", |
1307 | | - "gpt-4-32k", |
1308 | | - "gpt-4-32k-0314", |
1309 | | - "gpt-4-32k-0613", |
1310 | | - "gpt-3.5-turbo", |
1311 | | - "gpt-3.5-turbo-16k", |
1312 | | - "gpt-3.5-turbo-0301", |
1313 | | - "gpt-3.5-turbo-0613", |
1314 | | - "gpt-3.5-turbo-1106", |
1315 | | - "gpt-3.5-turbo-0125", |
1316 | | - "gpt-3.5-turbo-16k-0613", |
1317 | | - ], |
1318 | | - ], |
| 1135 | + model: Union[str, ChatModel], |
1319 | 1136 | frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, |
1320 | 1137 | function_call: completion_create_params.FunctionCall | NotGiven = NOT_GIVEN, |
1321 | 1138 | functions: Iterable[completion_create_params.Function] | NotGiven = NOT_GIVEN, |
|
0 commit comments