From 3cb064b10d661dbcc74b6bc1ed7d8e635ab2876a Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Mon, 6 May 2024 15:07:30 -0400 Subject: [PATCH] feat(api): add usage metadata when streaming (#1395) --- .stats.yml | 2 +- api.md | 1 + src/openai/resources/chat/completions.py | 23 +++++++++++++++++++ src/openai/resources/completions.py | 23 +++++++++++++++++++ src/openai/types/chat/__init__.py | 1 + .../types/chat/chat_completion_chunk.py | 12 +++++++++- .../chat_completion_stream_options_param.py | 17 ++++++++++++++ .../types/chat/completion_create_params.py | 4 ++++ src/openai/types/completion_create_params.py | 5 ++++ tests/api_resources/chat/test_completions.py | 8 ++++++- tests/api_resources/test_completions.py | 4 ++++ 11 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 src/openai/types/chat/chat_completion_stream_options_param.py diff --git a/.stats.yml b/.stats.yml index 9797002bf..49956282b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 64 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-97c9a5f089049dc9eb5cee9475558049003e37e42202cab39e59d75e08b4c613.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-edb5af3ade0cd27cf366b0654b90c7a81c43c433e11fc3f6e621e2c779de10d4.yml diff --git a/api.md b/api.md index 9dc42f0f0..696075eff 100644 --- a/api.md +++ b/api.md @@ -43,6 +43,7 @@ from openai.types.chat import ( ChatCompletionMessageToolCall, ChatCompletionNamedToolChoice, ChatCompletionRole, + ChatCompletionStreamOptions, ChatCompletionSystemMessageParam, ChatCompletionTokenLogprob, ChatCompletionTool, diff --git a/src/openai/resources/chat/completions.py b/src/openai/resources/chat/completions.py index 5104cd613..aa25bc185 100644 --- a/src/openai/resources/chat/completions.py +++ b/src/openai/resources/chat/completions.py @@ -27,6 +27,7 @@ from ...types.chat.chat_completion_chunk import ChatCompletionChunk from ...types.chat.chat_completion_tool_param import ChatCompletionToolParam from ...types.chat.chat_completion_message_param import ChatCompletionMessageParam +from ...types.chat.chat_completion_stream_options_param import ChatCompletionStreamOptionsParam from ...types.chat.chat_completion_tool_choice_option_param import ChatCompletionToolChoiceOptionParam __all__ = ["Completions", "AsyncCompletions"] @@ -59,6 +60,7 @@ def create( seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN, tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN, @@ -165,6 +167,8 @@ def create( message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + stream_options: Options for streaming response. Only set this when you set `stream: true`. + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. @@ -227,6 +231,7 @@ def create( response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN, tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN, @@ -333,6 +338,8 @@ def create( stop: Up to 4 sequences where the API will stop generating further tokens. + stream_options: Options for streaming response. Only set this when you set `stream: true`. + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. @@ -395,6 +402,7 @@ def create( response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN, tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN, @@ -501,6 +509,8 @@ def create( stop: Up to 4 sequences where the API will stop generating further tokens. + stream_options: Options for streaming response. Only set this when you set `stream: true`. + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. @@ -563,6 +573,7 @@ def create( seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN, tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN, @@ -594,6 +605,7 @@ def create( "seed": seed, "stop": stop, "stream": stream, + "stream_options": stream_options, "temperature": temperature, "tool_choice": tool_choice, "tools": tools, @@ -639,6 +651,7 @@ async def create( seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN, tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN, @@ -745,6 +758,8 @@ async def create( message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + stream_options: Options for streaming response. Only set this when you set `stream: true`. + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. @@ -807,6 +822,7 @@ async def create( response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN, tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN, @@ -913,6 +929,8 @@ async def create( stop: Up to 4 sequences where the API will stop generating further tokens. + stream_options: Options for streaming response. Only set this when you set `stream: true`. + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. @@ -975,6 +993,7 @@ async def create( response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN, tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN, @@ -1081,6 +1100,8 @@ async def create( stop: Up to 4 sequences where the API will stop generating further tokens. + stream_options: Options for streaming response. Only set this when you set `stream: true`. + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. @@ -1143,6 +1164,7 @@ async def create( seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: ChatCompletionToolChoiceOptionParam | NotGiven = NOT_GIVEN, tools: Iterable[ChatCompletionToolParam] | NotGiven = NOT_GIVEN, @@ -1174,6 +1196,7 @@ async def create( "seed": seed, "stop": stop, "stream": stream, + "stream_options": stream_options, "temperature": temperature, "tool_choice": tool_choice, "tools": tools, diff --git a/src/openai/resources/completions.py b/src/openai/resources/completions.py index eb6ca3104..0812000f7 100644 --- a/src/openai/resources/completions.py +++ b/src/openai/resources/completions.py @@ -23,6 +23,7 @@ make_request_options, ) from ..types.completion import Completion +from ..types.chat.chat_completion_stream_options_param import ChatCompletionStreamOptionsParam __all__ = ["Completions", "AsyncCompletions"] @@ -53,6 +54,7 @@ def create( seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, suffix: Optional[str] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, @@ -156,6 +158,8 @@ def create( message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + stream_options: Options for streaming response. Only set this when you set `stream: true`. + suffix: The suffix that comes after a completion of inserted text. This parameter is only supported for `gpt-3.5-turbo-instruct`. @@ -203,6 +207,7 @@ def create( presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, suffix: Optional[str] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, @@ -306,6 +311,8 @@ def create( stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + stream_options: Options for streaming response. Only set this when you set `stream: true`. + suffix: The suffix that comes after a completion of inserted text. This parameter is only supported for `gpt-3.5-turbo-instruct`. @@ -353,6 +360,7 @@ def create( presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, suffix: Optional[str] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, @@ -456,6 +464,8 @@ def create( stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + stream_options: Options for streaming response. Only set this when you set `stream: true`. + suffix: The suffix that comes after a completion of inserted text. This parameter is only supported for `gpt-3.5-turbo-instruct`. @@ -503,6 +513,7 @@ def create( seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, suffix: Optional[str] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, @@ -531,6 +542,7 @@ def create( "seed": seed, "stop": stop, "stream": stream, + "stream_options": stream_options, "suffix": suffix, "temperature": temperature, "top_p": top_p, @@ -573,6 +585,7 @@ async def create( seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, suffix: Optional[str] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, @@ -676,6 +689,8 @@ async def create( message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + stream_options: Options for streaming response. Only set this when you set `stream: true`. + suffix: The suffix that comes after a completion of inserted text. This parameter is only supported for `gpt-3.5-turbo-instruct`. @@ -723,6 +738,7 @@ async def create( presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, suffix: Optional[str] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, @@ -826,6 +842,8 @@ async def create( stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + stream_options: Options for streaming response. Only set this when you set `stream: true`. + suffix: The suffix that comes after a completion of inserted text. This parameter is only supported for `gpt-3.5-turbo-instruct`. @@ -873,6 +891,7 @@ async def create( presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, suffix: Optional[str] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, @@ -976,6 +995,8 @@ async def create( stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + stream_options: Options for streaming response. Only set this when you set `stream: true`. + suffix: The suffix that comes after a completion of inserted text. This parameter is only supported for `gpt-3.5-turbo-instruct`. @@ -1023,6 +1044,7 @@ async def create( seed: Optional[int] | NotGiven = NOT_GIVEN, stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, + stream_options: Optional[ChatCompletionStreamOptionsParam] | NotGiven = NOT_GIVEN, suffix: Optional[str] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, top_p: Optional[float] | NotGiven = NOT_GIVEN, @@ -1051,6 +1073,7 @@ async def create( "seed": seed, "stop": stop, "stream": stream, + "stream_options": stream_options, "suffix": suffix, "temperature": temperature, "top_p": top_p, diff --git a/src/openai/types/chat/__init__.py b/src/openai/types/chat/__init__.py index 5d122d202..0ba812ff9 100644 --- a/src/openai/types/chat/__init__.py +++ b/src/openai/types/chat/__init__.py @@ -14,6 +14,7 @@ from .chat_completion_content_part_param import ChatCompletionContentPartParam as ChatCompletionContentPartParam from .chat_completion_tool_message_param import ChatCompletionToolMessageParam as ChatCompletionToolMessageParam from .chat_completion_user_message_param import ChatCompletionUserMessageParam as ChatCompletionUserMessageParam +from .chat_completion_stream_options_param import ChatCompletionStreamOptionsParam as ChatCompletionStreamOptionsParam from .chat_completion_system_message_param import ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam from .chat_completion_function_message_param import ( ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam, diff --git a/src/openai/types/chat/chat_completion_chunk.py b/src/openai/types/chat/chat_completion_chunk.py index c2f18bcb7..084a5fcc0 100644 --- a/src/openai/types/chat/chat_completion_chunk.py +++ b/src/openai/types/chat/chat_completion_chunk.py @@ -4,6 +4,7 @@ from typing_extensions import Literal from ..._models import BaseModel +from ..completion_usage import CompletionUsage from .chat_completion_token_logprob import ChatCompletionTokenLogprob __all__ = [ @@ -105,7 +106,8 @@ class ChatCompletionChunk(BaseModel): choices: List[Choice] """A list of chat completion choices. - Can be more than one if `n` is greater than 1. + Can contain more than one elements if `n` is greater than 1. Can also be empty + for the last chunk if you set `stream_options: {"include_usage": true}`. """ created: int @@ -126,3 +128,11 @@ class ChatCompletionChunk(BaseModel): Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. """ + + usage: Optional[CompletionUsage] = None + """ + An optional field that will only be present when you set + `stream_options: {"include_usage": true}` in your request. When present, it + contains a null value except for the last chunk which contains the token usage + statistics for the entire request. + """ diff --git a/src/openai/types/chat/chat_completion_stream_options_param.py b/src/openai/types/chat/chat_completion_stream_options_param.py new file mode 100644 index 000000000..fbf729182 --- /dev/null +++ b/src/openai/types/chat/chat_completion_stream_options_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ChatCompletionStreamOptionsParam"] + + +class ChatCompletionStreamOptionsParam(TypedDict, total=False): + include_usage: bool + """If set, an additional chunk will be streamed before the `data: [DONE]` message. + + The `usage` field on this chunk shows the token usage statistics for the entire + request, and the `choices` field will always be an empty array. All other chunks + will also include a `usage` field, but with a null value. + """ diff --git a/src/openai/types/chat/completion_create_params.py b/src/openai/types/chat/completion_create_params.py index d30da60b1..226cf1588 100644 --- a/src/openai/types/chat/completion_create_params.py +++ b/src/openai/types/chat/completion_create_params.py @@ -9,6 +9,7 @@ from ..chat_model import ChatModel from .chat_completion_tool_param import ChatCompletionToolParam from .chat_completion_message_param import ChatCompletionMessageParam +from .chat_completion_stream_options_param import ChatCompletionStreamOptionsParam from .chat_completion_tool_choice_option_param import ChatCompletionToolChoiceOptionParam from .chat_completion_function_call_option_param import ChatCompletionFunctionCallOptionParam @@ -141,6 +142,9 @@ class CompletionCreateParamsBase(TypedDict, total=False): stop: Union[Optional[str], List[str]] """Up to 4 sequences where the API will stop generating further tokens.""" + stream_options: Optional[ChatCompletionStreamOptionsParam] + """Options for streaming response. Only set this when you set `stream: true`.""" + temperature: Optional[float] """What sampling temperature to use, between 0 and 2. diff --git a/src/openai/types/completion_create_params.py b/src/openai/types/completion_create_params.py index 36267e906..9fe22fe3c 100644 --- a/src/openai/types/completion_create_params.py +++ b/src/openai/types/completion_create_params.py @@ -5,6 +5,8 @@ from typing import Dict, List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from .chat.chat_completion_stream_options_param import ChatCompletionStreamOptionsParam + __all__ = ["CompletionCreateParamsBase", "CompletionCreateParamsNonStreaming", "CompletionCreateParamsStreaming"] @@ -123,6 +125,9 @@ class CompletionCreateParamsBase(TypedDict, total=False): The returned text will not contain the stop sequence. """ + stream_options: Optional[ChatCompletionStreamOptionsParam] + """Options for streaming response. Only set this when you set `stream: true`.""" + suffix: Optional[str] """The suffix that comes after a completion of inserted text. diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index c54b56a37..1c195c400 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -9,7 +9,9 @@ from openai import OpenAI, AsyncOpenAI from tests.utils import assert_matches_type -from openai.types.chat import ChatCompletion +from openai.types.chat import ( + ChatCompletion, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -59,6 +61,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: seed=-9223372036854776000, stop="string", stream=False, + stream_options={"include_usage": True}, temperature=1, tool_choice="none", tools=[ @@ -172,6 +175,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: response_format={"type": "json_object"}, seed=-9223372036854776000, stop="string", + stream_options={"include_usage": True}, temperature=1, tool_choice="none", tools=[ @@ -289,6 +293,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn seed=-9223372036854776000, stop="string", stream=False, + stream_options={"include_usage": True}, temperature=1, tool_choice="none", tools=[ @@ -402,6 +407,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn response_format={"type": "json_object"}, seed=-9223372036854776000, stop="string", + stream_options={"include_usage": True}, temperature=1, tool_choice="none", tools=[ diff --git a/tests/api_resources/test_completions.py b/tests/api_resources/test_completions.py index 691c4ff77..69d914200 100644 --- a/tests/api_resources/test_completions.py +++ b/tests/api_resources/test_completions.py @@ -41,6 +41,7 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: seed=-9223372036854776000, stop="\n", stream=False, + stream_options={"include_usage": True}, suffix="test.", temperature=1, top_p=1, @@ -99,6 +100,7 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: presence_penalty=-2, seed=-9223372036854776000, stop="\n", + stream_options={"include_usage": True}, suffix="test.", temperature=1, top_p=1, @@ -161,6 +163,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn seed=-9223372036854776000, stop="\n", stream=False, + stream_options={"include_usage": True}, suffix="test.", temperature=1, top_p=1, @@ -219,6 +222,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn presence_penalty=-2, seed=-9223372036854776000, stop="\n", + stream_options={"include_usage": True}, suffix="test.", temperature=1, top_p=1,