From 26236303f0f6de5df887e8ee3e41d5bc39a3abb1 Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Mon, 12 Aug 2024 15:08:41 -0400 Subject: [PATCH 1/5] chore(tests): fix pydantic v1 tests --- tests/lib/chat/test_completions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/lib/chat/test_completions.py b/tests/lib/chat/test_completions.py index d2189e7cb6..f003866653 100644 --- a/tests/lib/chat/test_completions.py +++ b/tests/lib/chat/test_completions.py @@ -15,6 +15,7 @@ import openai from openai import OpenAI, AsyncOpenAI from openai._utils import assert_signatures_in_sync +from openai._compat import PYDANTIC_V2 from ._utils import print_obj from ...conftest import base_url @@ -147,6 +148,9 @@ class ColorDetection(BaseModel): color: Color hex_color_code: str = Field(description="The hex color code of the detected color") + if not PYDANTIC_V2: + ColorDetection.update_forward_refs(**locals()) # type: ignore + completion = _make_snapshot_request( lambda c: c.beta.chat.completions.parse( model="gpt-4o-2024-08-06", From fce1ea72a89ba2737bc77775fe04f3a21ecb28e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:21:15 +0000 Subject: [PATCH 2/5] chore(internal): update some imports (#1642) --- .../beta/assistant_response_format_option_param.py | 9 ++++----- src/openai/types/beta/function_tool_param.py | 4 ++-- src/openai/types/chat/chat_completion_tool_param.py | 4 ++-- src/openai/types/chat/completion_create_params.py | 11 ++++++----- src/openai/types/shared_params/function_definition.py | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/openai/types/beta/assistant_response_format_option_param.py b/src/openai/types/beta/assistant_response_format_option_param.py index 680a060c3c..5e724a4d98 100644 --- a/src/openai/types/beta/assistant_response_format_option_param.py +++ b/src/openai/types/beta/assistant_response_format_option_param.py @@ -5,13 +5,12 @@ from typing import Union from typing_extensions import Literal, TypeAlias -from ...types import shared_params +from ..shared_params.response_format_text import ResponseFormatText +from ..shared_params.response_format_json_object import ResponseFormatJSONObject +from ..shared_params.response_format_json_schema import ResponseFormatJSONSchema __all__ = ["AssistantResponseFormatOptionParam"] AssistantResponseFormatOptionParam: TypeAlias = Union[ - Literal["auto"], - shared_params.ResponseFormatText, - shared_params.ResponseFormatJSONObject, - shared_params.ResponseFormatJSONSchema, + Literal["auto"], ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema ] diff --git a/src/openai/types/beta/function_tool_param.py b/src/openai/types/beta/function_tool_param.py index b44c0d47ef..d906e02b88 100644 --- a/src/openai/types/beta/function_tool_param.py +++ b/src/openai/types/beta/function_tool_param.py @@ -4,13 +4,13 @@ from typing_extensions import Literal, Required, TypedDict -from ...types import shared_params +from ..shared_params.function_definition import FunctionDefinition __all__ = ["FunctionToolParam"] class FunctionToolParam(TypedDict, total=False): - function: Required[shared_params.FunctionDefinition] + function: Required[FunctionDefinition] type: Required[Literal["function"]] """The type of tool being defined: `function`""" diff --git a/src/openai/types/chat/chat_completion_tool_param.py b/src/openai/types/chat/chat_completion_tool_param.py index 0cf6ea7268..6c2b1a36f0 100644 --- a/src/openai/types/chat/chat_completion_tool_param.py +++ b/src/openai/types/chat/chat_completion_tool_param.py @@ -4,13 +4,13 @@ from typing_extensions import Literal, Required, TypedDict -from ...types import shared_params +from ..shared_params.function_definition import FunctionDefinition __all__ = ["ChatCompletionToolParam"] class ChatCompletionToolParam(TypedDict, total=False): - function: Required[shared_params.FunctionDefinition] + function: Required[FunctionDefinition] type: Required[Literal["function"]] """The type of the tool. Currently, only `function` is supported.""" diff --git a/src/openai/types/chat/completion_create_params.py b/src/openai/types/chat/completion_create_params.py index 61126b37ac..91435dcedd 100644 --- a/src/openai/types/chat/completion_create_params.py +++ b/src/openai/types/chat/completion_create_params.py @@ -5,12 +5,15 @@ from typing import Dict, List, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict -from ...types import shared_params from ..chat_model import ChatModel from .chat_completion_tool_param import ChatCompletionToolParam from .chat_completion_message_param import ChatCompletionMessageParam +from ..shared_params.function_parameters import FunctionParameters +from ..shared_params.response_format_text import ResponseFormatText from .chat_completion_stream_options_param import ChatCompletionStreamOptionsParam from .chat_completion_tool_choice_option_param import ChatCompletionToolChoiceOptionParam +from ..shared_params.response_format_json_object import ResponseFormatJSONObject +from ..shared_params.response_format_json_schema import ResponseFormatJSONSchema from .chat_completion_function_call_option_param import ChatCompletionFunctionCallOptionParam __all__ = [ @@ -244,7 +247,7 @@ class Function(TypedDict, total=False): how to call the function. """ - parameters: shared_params.FunctionParameters + parameters: FunctionParameters """The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for @@ -256,9 +259,7 @@ class Function(TypedDict, total=False): """ -ResponseFormat: TypeAlias = Union[ - shared_params.ResponseFormatText, shared_params.ResponseFormatJSONObject, shared_params.ResponseFormatJSONSchema -] +ResponseFormat: TypeAlias = Union[ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema] class CompletionCreateParamsNonStreaming(CompletionCreateParamsBase): diff --git a/src/openai/types/shared_params/function_definition.py b/src/openai/types/shared_params/function_definition.py index f41392f154..d45ec13f1e 100644 --- a/src/openai/types/shared_params/function_definition.py +++ b/src/openai/types/shared_params/function_definition.py @@ -5,7 +5,7 @@ from typing import Optional from typing_extensions import Required, TypedDict -from ...types import shared_params +from .function_parameters import FunctionParameters __all__ = ["FunctionDefinition"] @@ -24,7 +24,7 @@ class FunctionDefinition(TypedDict, total=False): how to call the function. """ - parameters: shared_params.FunctionParameters + parameters: FunctionParameters """The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for From e08acf1c6edd1501ed70c4634cd884ab1658af0d Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Mon, 12 Aug 2024 19:52:09 +0000 Subject: [PATCH 3/5] chore(examples): minor formatting changes (#1644) --- tests/api_resources/beta/test_assistants.py | 4 +- tests/api_resources/beta/test_threads.py | 56 ++++++------ tests/api_resources/beta/threads/test_runs.py | 48 +++++----- tests/api_resources/chat/test_completions.py | 88 +++++++++---------- tests/api_resources/fine_tuning/test_jobs.py | 24 ++--- tests/api_resources/test_images.py | 12 +-- 6 files changed, 116 insertions(+), 116 deletions(-) diff --git a/tests/api_resources/beta/test_assistants.py b/tests/api_resources/beta/test_assistants.py index fbd5ff0597..642935cdaf 100644 --- a/tests/api_resources/beta/test_assistants.py +++ b/tests/api_resources/beta/test_assistants.py @@ -44,8 +44,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "vector_store_ids": ["string"], "vector_stores": [ { - "file_ids": ["string", "string", "string"], "chunking_strategy": {"type": "auto"}, + "file_ids": ["string", "string", "string"], "metadata": {}, } ], @@ -276,8 +276,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "vector_store_ids": ["string"], "vector_stores": [ { - "file_ids": ["string", "string", "string"], "chunking_strategy": {"type": "auto"}, + "file_ids": ["string", "string", "string"], "metadata": {}, } ], diff --git a/tests/api_resources/beta/test_threads.py b/tests/api_resources/beta/test_threads.py index 67fff736dd..95bebd84f5 100644 --- a/tests/api_resources/beta/test_threads.py +++ b/tests/api_resources/beta/test_threads.py @@ -31,8 +31,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: thread = client.beta.threads.create( messages=[ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -62,8 +62,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -93,8 +93,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -131,8 +131,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "vector_store_ids": ["string"], "vector_stores": [ { - "file_ids": ["string", "string", "string"], "chunking_strategy": {"type": "auto"}, + "file_ids": ["string", "string", "string"], "metadata": {}, } ], @@ -310,8 +310,8 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) thread={ "messages": [ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -341,8 +341,8 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -372,8 +372,8 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -403,20 +403,20 @@ def test_method_create_and_run_with_all_params_overload_1(self, client: OpenAI) "metadata": {}, }, ], + "metadata": {}, "tool_resources": { "code_interpreter": {"file_ids": ["string", "string", "string"]}, "file_search": { "vector_store_ids": ["string"], "vector_stores": [ { - "file_ids": ["string", "string", "string"], "chunking_strategy": {"type": "auto"}, + "file_ids": ["string", "string", "string"], "metadata": {}, } ], }, }, - "metadata": {}, }, tool_choice="none", tool_resources={ @@ -480,8 +480,8 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) thread={ "messages": [ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -511,8 +511,8 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -542,8 +542,8 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -573,20 +573,20 @@ def test_method_create_and_run_with_all_params_overload_2(self, client: OpenAI) "metadata": {}, }, ], + "metadata": {}, "tool_resources": { "code_interpreter": {"file_ids": ["string", "string", "string"]}, "file_search": { "vector_store_ids": ["string"], "vector_stores": [ { - "file_ids": ["string", "string", "string"], "chunking_strategy": {"type": "auto"}, + "file_ids": ["string", "string", "string"], "metadata": {}, } ], }, }, - "metadata": {}, }, tool_choice="none", tool_resources={ @@ -641,8 +641,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> thread = await async_client.beta.threads.create( messages=[ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -672,8 +672,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -703,8 +703,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -741,8 +741,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "vector_store_ids": ["string"], "vector_stores": [ { - "file_ids": ["string", "string", "string"], "chunking_strategy": {"type": "auto"}, + "file_ids": ["string", "string", "string"], "metadata": {}, } ], @@ -920,8 +920,8 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie thread={ "messages": [ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -951,8 +951,8 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -982,8 +982,8 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -1013,20 +1013,20 @@ async def test_method_create_and_run_with_all_params_overload_1(self, async_clie "metadata": {}, }, ], + "metadata": {}, "tool_resources": { "code_interpreter": {"file_ids": ["string", "string", "string"]}, "file_search": { "vector_store_ids": ["string"], "vector_stores": [ { - "file_ids": ["string", "string", "string"], "chunking_strategy": {"type": "auto"}, + "file_ids": ["string", "string", "string"], "metadata": {}, } ], }, }, - "metadata": {}, }, tool_choice="none", tool_resources={ @@ -1090,8 +1090,8 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie thread={ "messages": [ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -1121,8 +1121,8 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -1152,8 +1152,8 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -1183,20 +1183,20 @@ async def test_method_create_and_run_with_all_params_overload_2(self, async_clie "metadata": {}, }, ], + "metadata": {}, "tool_resources": { "code_interpreter": {"file_ids": ["string", "string", "string"]}, "file_search": { "vector_store_ids": ["string"], "vector_stores": [ { - "file_ids": ["string", "string", "string"], "chunking_strategy": {"type": "auto"}, + "file_ids": ["string", "string", "string"], "metadata": {}, } ], }, }, - "metadata": {}, }, tool_choice="none", tool_resources={ diff --git a/tests/api_resources/beta/threads/test_runs.py b/tests/api_resources/beta/threads/test_runs.py index e21c6c2c77..5d16bdb364 100644 --- a/tests/api_resources/beta/threads/test_runs.py +++ b/tests/api_resources/beta/threads/test_runs.py @@ -38,8 +38,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: additional_instructions="string", additional_messages=[ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -69,8 +69,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -100,8 +100,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -202,8 +202,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: additional_instructions="string", additional_messages=[ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -233,8 +233,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -264,8 +264,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -567,16 +567,16 @@ def test_method_submit_tool_outputs_with_all_params_overload_1(self, client: Ope thread_id="string", tool_outputs=[ { - "tool_call_id": "string", - "output": "string", + "output": "output", + "tool_call_id": "tool_call_id", }, { - "tool_call_id": "string", - "output": "string", + "output": "output", + "tool_call_id": "tool_call_id", }, { - "tool_call_id": "string", - "output": "string", + "output": "output", + "tool_call_id": "tool_call_id", }, ], stream=False, @@ -704,8 +704,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn additional_instructions="string", additional_messages=[ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -735,8 +735,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -766,8 +766,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -868,8 +868,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn additional_instructions="string", additional_messages=[ { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -899,8 +899,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -930,8 +930,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "metadata": {}, }, { - "role": "user", "content": "string", + "role": "user", "attachments": [ { "file_id": "string", @@ -1233,16 +1233,16 @@ async def test_method_submit_tool_outputs_with_all_params_overload_1(self, async thread_id="string", tool_outputs=[ { - "tool_call_id": "string", - "output": "string", + "output": "output", + "tool_call_id": "tool_call_id", }, { - "tool_call_id": "string", - "output": "string", + "output": "output", + "tool_call_id": "tool_call_id", }, { - "tool_call_id": "string", - "output": "string", + "output": "output", + "tool_call_id": "tool_call_id", }, ], stream=False, diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index 9fa3cc8284..0b89fbf9cd 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -48,8 +48,8 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: function_call="none", functions=[ { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, } ], @@ -69,31 +69,31 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: tool_choice="none", tools=[ { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, ], top_logprobs=0, @@ -168,8 +168,8 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: function_call="none", functions=[ { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, } ], @@ -188,31 +188,31 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: tool_choice="none", tools=[ { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, ], top_logprobs=0, @@ -307,8 +307,8 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn function_call="none", functions=[ { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, } ], @@ -328,31 +328,31 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn tool_choice="none", tools=[ { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, ], top_logprobs=0, @@ -427,8 +427,8 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn function_call="none", functions=[ { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, } ], @@ -447,31 +447,31 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn tool_choice="none", tools=[ { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, { - "type": "function", "function": { - "description": "string", - "name": "string", + "name": "name", + "description": "description", "parameters": {"foo": "bar"}, "strict": True, }, + "type": "function", }, ], top_logprobs=0, diff --git a/tests/api_resources/fine_tuning/test_jobs.py b/tests/api_resources/fine_tuning/test_jobs.py index 68b3d73ac5..d1ad611219 100644 --- a/tests/api_resources/fine_tuning/test_jobs.py +++ b/tests/api_resources/fine_tuning/test_jobs.py @@ -44,8 +44,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "entity": "entity", + "name": "name", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -53,8 +53,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "entity": "entity", + "name": "name", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -62,8 +62,8 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "entity": "entity", + "name": "name", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -283,8 +283,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "entity": "entity", + "name": "name", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -292,8 +292,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "entity": "entity", + "name": "name", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, @@ -301,8 +301,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "type": "wandb", "wandb": { "project": "my-wandb-project", - "name": "string", - "entity": "string", + "entity": "entity", + "name": "name", "tags": ["custom-tag", "custom-tag", "custom-tag"], }, }, diff --git a/tests/api_resources/test_images.py b/tests/api_resources/test_images.py index 2e31f3354a..9bc9719bc5 100644 --- a/tests/api_resources/test_images.py +++ b/tests/api_resources/test_images.py @@ -31,7 +31,7 @@ def test_method_create_variation_with_all_params(self, client: OpenAI) -> None: model="dall-e-2", n=1, response_format="url", - size="1024x1024", + size="256x256", user="user-1234", ) assert_matches_type(ImagesResponse, image, path=["response"]) @@ -77,7 +77,7 @@ def test_method_edit_with_all_params(self, client: OpenAI) -> None: model="dall-e-2", n=1, response_format="url", - size="1024x1024", + size="256x256", user="user-1234", ) assert_matches_type(ImagesResponse, image, path=["response"]) @@ -123,7 +123,7 @@ def test_method_generate_with_all_params(self, client: OpenAI) -> None: n=1, quality="standard", response_format="url", - size="1024x1024", + size="256x256", style="vivid", user="user-1234", ) @@ -171,7 +171,7 @@ async def test_method_create_variation_with_all_params(self, async_client: Async model="dall-e-2", n=1, response_format="url", - size="1024x1024", + size="256x256", user="user-1234", ) assert_matches_type(ImagesResponse, image, path=["response"]) @@ -217,7 +217,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncOpenAI) -> N model="dall-e-2", n=1, response_format="url", - size="1024x1024", + size="256x256", user="user-1234", ) assert_matches_type(ImagesResponse, image, path=["response"]) @@ -263,7 +263,7 @@ async def test_method_generate_with_all_params(self, async_client: AsyncOpenAI) n=1, quality="standard", response_format="url", - size="1024x1024", + size="256x256", style="vivid", user="user-1234", ) From 8ae380123ada0bfaca9961e222a0e9c8b585e2d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 21:25:41 +0000 Subject: [PATCH 4/5] chore: sync openapi url (#1646) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index cad2c64cd0..2371b7b8d4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 68 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-97797a9363b9960b5f2fbdc84426a2b91e75533ecd409fe99e37c231180a4339.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-285bce7dcdae7eea5fe84a8d6e5af2c1473d65ea193109370fb2257851eef7eb.yml From 36ed6b249d6243091c47429937faae881ab908b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 21:26:09 +0000 Subject: [PATCH 5/5] release: 1.40.6 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 11 +++++++++++ pyproject.toml | 2 +- src/openai/_version.py | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 190c2adda3..ae6438060f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.40.5" + ".": "1.40.6" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ee946c4df..7dd2a34ef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 1.40.6 (2024-08-12) + +Full Changelog: [v1.40.5...v1.40.6](https://github.com/openai/openai-python/compare/v1.40.5...v1.40.6) + +### Chores + +* **examples:** minor formatting changes ([#1644](https://github.com/openai/openai-python/issues/1644)) ([e08acf1](https://github.com/openai/openai-python/commit/e08acf1c6edd1501ed70c4634cd884ab1658af0d)) +* **internal:** update some imports ([#1642](https://github.com/openai/openai-python/issues/1642)) ([fce1ea7](https://github.com/openai/openai-python/commit/fce1ea72a89ba2737bc77775fe04f3a21ecb28e7)) +* sync openapi url ([#1646](https://github.com/openai/openai-python/issues/1646)) ([8ae3801](https://github.com/openai/openai-python/commit/8ae380123ada0bfaca9961e222a0e9c8b585e2d4)) +* **tests:** fix pydantic v1 tests ([2623630](https://github.com/openai/openai-python/commit/26236303f0f6de5df887e8ee3e41d5bc39a3abb1)) + ## 1.40.5 (2024-08-12) Full Changelog: [v1.40.4...v1.40.5](https://github.com/openai/openai-python/compare/v1.40.4...v1.40.5) diff --git a/pyproject.toml b/pyproject.toml index 1e094d14a6..a92be494cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "1.40.5" +version = "1.40.6" description = "The official Python library for the openai API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/openai/_version.py b/src/openai/_version.py index d416db5cac..d4083f4a69 100644 --- a/src/openai/_version.py +++ b/src/openai/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openai" -__version__ = "1.40.5" # x-release-please-version +__version__ = "1.40.6" # x-release-please-version