|
27 | 27 | from ...types.chat.chat_completion_chunk import ChatCompletionChunk
|
28 | 28 | from ...types.chat.chat_completion_tool_param import ChatCompletionToolParam
|
29 | 29 | from ...types.chat.chat_completion_message_param import ChatCompletionMessageParam
|
| 30 | +from ...types.chat.chat_completion_stream_options_param import ChatCompletionStreamOptionsParam |
30 | 31 | from ...types.chat.chat_completion_tool_choice_option_param import ChatCompletionToolChoiceOptionParam
|
31 | 32 |
|
32 | 33 | __all__ = ["Completions", "AsyncCompletions"]
|
@@ -59,6 +60,7 @@ def create(
|
59 | 60 | seed: Optional[int] | NotGiven = NOT_GIVEN,
|
60 | 61 | stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
|
61 | 62 | stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN,
|
| 63 | + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, |
62 | 64 | temperature: Optional[float] | NotGiven = NOT_GIVEN,
|
63 | 65 | tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN,
|
64 | 66 | tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
@@ -165,6 +167,8 @@ def create(
|
165 | 167 | message.
|
166 | 168 | [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
|
167 | 169 |
|
| 170 | + stream_options: Options for streaming response. Only set this when you set `stream: true`. |
| 171 | +
|
168 | 172 | temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
169 | 173 | make the output more random, while lower values like 0.2 will make it more
|
170 | 174 | focused and deterministic.
|
@@ -227,6 +231,7 @@ def create(
|
227 | 231 | response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN,
|
228 | 232 | seed: Optional[int] | NotGiven = NOT_GIVEN,
|
229 | 233 | stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
|
| 234 | + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, |
230 | 235 | temperature: Optional[float] | NotGiven = NOT_GIVEN,
|
231 | 236 | tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN,
|
232 | 237 | tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
@@ -333,6 +338,8 @@ def create(
|
333 | 338 |
|
334 | 339 | stop: Up to 4 sequences where the API will stop generating further tokens.
|
335 | 340 |
|
| 341 | + stream_options: Options for streaming response. Only set this when you set `stream: true`. |
| 342 | +
|
336 | 343 | temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
337 | 344 | make the output more random, while lower values like 0.2 will make it more
|
338 | 345 | focused and deterministic.
|
@@ -395,6 +402,7 @@ def create(
|
395 | 402 | response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN,
|
396 | 403 | seed: Optional[int] | NotGiven = NOT_GIVEN,
|
397 | 404 | stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
|
| 405 | + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, |
398 | 406 | temperature: Optional[float] | NotGiven = NOT_GIVEN,
|
399 | 407 | tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN,
|
400 | 408 | tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
@@ -501,6 +509,8 @@ def create(
|
501 | 509 |
|
502 | 510 | stop: Up to 4 sequences where the API will stop generating further tokens.
|
503 | 511 |
|
| 512 | + stream_options: Options for streaming response. Only set this when you set `stream: true`. |
| 513 | +
|
504 | 514 | temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
505 | 515 | make the output more random, while lower values like 0.2 will make it more
|
506 | 516 | focused and deterministic.
|
@@ -563,6 +573,7 @@ def create(
|
563 | 573 | seed: Optional[int] | NotGiven = NOT_GIVEN,
|
564 | 574 | stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
|
565 | 575 | stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN,
|
| 576 | + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, |
566 | 577 | temperature: Optional[float] | NotGiven = NOT_GIVEN,
|
567 | 578 | tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN,
|
568 | 579 | tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
@@ -594,6 +605,7 @@ def create(
|
594 | 605 | "seed": seed,
|
595 | 606 | "stop": stop,
|
596 | 607 | "stream": stream,
|
| 608 | + "stream_options": stream_options, |
597 | 609 | "temperature": temperature,
|
598 | 610 | "tool_choice": tool_choice,
|
599 | 611 | "tools": tools,
|
@@ -639,6 +651,7 @@ async def create(
|
639 | 651 | seed: Optional[int] | NotGiven = NOT_GIVEN,
|
640 | 652 | stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
|
641 | 653 | stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN,
|
| 654 | + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, |
642 | 655 | temperature: Optional[float] | NotGiven = NOT_GIVEN,
|
643 | 656 | tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN,
|
644 | 657 | tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
@@ -745,6 +758,8 @@ async def create(
|
745 | 758 | message.
|
746 | 759 | [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).
|
747 | 760 |
|
| 761 | + stream_options: Options for streaming response. Only set this when you set `stream: true`. |
| 762 | +
|
748 | 763 | temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
749 | 764 | make the output more random, while lower values like 0.2 will make it more
|
750 | 765 | focused and deterministic.
|
@@ -807,6 +822,7 @@ async def create(
|
807 | 822 | response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN,
|
808 | 823 | seed: Optional[int] | NotGiven = NOT_GIVEN,
|
809 | 824 | stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
|
| 825 | + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, |
810 | 826 | temperature: Optional[float] | NotGiven = NOT_GIVEN,
|
811 | 827 | tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN,
|
812 | 828 | tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
@@ -913,6 +929,8 @@ async def create(
|
913 | 929 |
|
914 | 930 | stop: Up to 4 sequences where the API will stop generating further tokens.
|
915 | 931 |
|
| 932 | + stream_options: Options for streaming response. Only set this when you set `stream: true`. |
| 933 | +
|
916 | 934 | temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
917 | 935 | make the output more random, while lower values like 0.2 will make it more
|
918 | 936 | focused and deterministic.
|
@@ -975,6 +993,7 @@ async def create(
|
975 | 993 | response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN,
|
976 | 994 | seed: Optional[int] | NotGiven = NOT_GIVEN,
|
977 | 995 | stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
|
| 996 | + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, |
978 | 997 | temperature: Optional[float] | NotGiven = NOT_GIVEN,
|
979 | 998 | tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN,
|
980 | 999 | tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
@@ -1081,6 +1100,8 @@ async def create(
|
1081 | 1100 |
|
1082 | 1101 | stop: Up to 4 sequences where the API will stop generating further tokens.
|
1083 | 1102 |
|
| 1103 | + stream_options: Options for streaming response. Only set this when you set `stream: true`. |
| 1104 | +
|
1084 | 1105 | temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
|
1085 | 1106 | make the output more random, while lower values like 0.2 will make it more
|
1086 | 1107 | focused and deterministic.
|
@@ -1143,6 +1164,7 @@ async def create(
|
1143 | 1164 | seed: Optional[int] | NotGiven = NOT_GIVEN,
|
1144 | 1165 | stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
|
1145 | 1166 | stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN,
|
| 1167 | + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, |
1146 | 1168 | temperature: Optional[float] | NotGiven = NOT_GIVEN,
|
1147 | 1169 | tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN,
|
1148 | 1170 | tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN,
|
@@ -1174,6 +1196,7 @@ async def create(
|
1174 | 1196 | "seed": seed,
|
1175 | 1197 | "stop": stop,
|
1176 | 1198 | "stream": stream,
|
| 1199 | + "stream_options": stream_options, |
1177 | 1200 | "temperature": temperature,
|
1178 | 1201 | "tool_choice": tool_choice,
|
1179 | 1202 | "tools": tools,
|
|
0 commit comments