From 98c7ba286eaf0d1b487cbbad77e1e065020b41e1 Mon Sep 17 00:00:00 2001 From: zuhabul Date: Sat, 9 May 2026 21:58:58 +0000 Subject: [PATCH 1/2] docs: reduce vision sample image size Use a smaller Wikimedia thumbnail in the vision example to avoid image fetch failures caused by oversized remote assets. Closes #2776 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9450c0bc51..e15519c62b 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ With an image URL: ```python prompt = "What is in this image?" -img_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/2023_06_08_Raccoon1.jpg/1599px-2023_06_08_Raccoon1.jpg" +img_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/2023_06_08_Raccoon1.jpg/440px-2023_06_08_Raccoon1.jpg" response = client.responses.create( model="gpt-5.2", From 0a8f53c883319b0b411c583f64ca7bc88a837ef1 Mon Sep 17 00:00:00 2001 From: zuhabul Date: Sat, 9 May 2026 22:04:49 +0000 Subject: [PATCH 2/2] feat: restore beta vector_stores access Reintroduce client.beta.vector_stores as a backwards-compatible alias to client.vector_stores for both sync and async clients, including raw and streaming wrappers. Adds targeted client tests for alias behavior. Closes #2451 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/openai/resources/beta/beta.py | 34 +++++++++++++++++++++++++++++++ tests/test_client.py | 10 +++++++++ 2 files changed, 44 insertions(+) diff --git a/src/openai/resources/beta/beta.py b/src/openai/resources/beta/beta.py index 388a1c5d1f..18958b463b 100644 --- a/src/openai/resources/beta/beta.py +++ b/src/openai/resources/beta/beta.py @@ -28,6 +28,14 @@ ThreadsWithStreamingResponse, AsyncThreadsWithStreamingResponse, ) +from ..vector_stores import ( + VectorStores, + AsyncVectorStores, + VectorStoresWithRawResponse, + AsyncVectorStoresWithRawResponse, + VectorStoresWithStreamingResponse, + AsyncVectorStoresWithStreamingResponse, +) from ...resources.chat import Chat, AsyncChat from .realtime.realtime import ( Realtime, @@ -60,6 +68,11 @@ def threads(self) -> Threads: """Build Assistants that can call models and use tools.""" return Threads(self._client) + @cached_property + def vector_stores(self) -> VectorStores: + """Backwards-compatible access to Assistants v2 vector stores.""" + return self._client.vector_stores + @cached_property def with_raw_response(self) -> BetaWithRawResponse: """ @@ -103,6 +116,11 @@ def threads(self) -> AsyncThreads: """Build Assistants that can call models and use tools.""" return AsyncThreads(self._client) + @cached_property + def vector_stores(self) -> AsyncVectorStores: + """Backwards-compatible access to Assistants v2 vector stores.""" + return self._client.vector_stores + @cached_property def with_raw_response(self) -> AsyncBetaWithRawResponse: """ @@ -141,6 +159,10 @@ def threads(self) -> ThreadsWithRawResponse: """Build Assistants that can call models and use tools.""" return ThreadsWithRawResponse(self._beta.threads) + @cached_property + def vector_stores(self) -> VectorStoresWithRawResponse: + return VectorStoresWithRawResponse(self._beta.vector_stores) + class AsyncBetaWithRawResponse: def __init__(self, beta: AsyncBeta) -> None: @@ -160,6 +182,10 @@ def threads(self) -> AsyncThreadsWithRawResponse: """Build Assistants that can call models and use tools.""" return AsyncThreadsWithRawResponse(self._beta.threads) + @cached_property + def vector_stores(self) -> AsyncVectorStoresWithRawResponse: + return AsyncVectorStoresWithRawResponse(self._beta.vector_stores) + class BetaWithStreamingResponse: def __init__(self, beta: Beta) -> None: @@ -179,6 +205,10 @@ def threads(self) -> ThreadsWithStreamingResponse: """Build Assistants that can call models and use tools.""" return ThreadsWithStreamingResponse(self._beta.threads) + @cached_property + def vector_stores(self) -> VectorStoresWithStreamingResponse: + return VectorStoresWithStreamingResponse(self._beta.vector_stores) + class AsyncBetaWithStreamingResponse: def __init__(self, beta: AsyncBeta) -> None: @@ -197,3 +227,7 @@ def assistants(self) -> AsyncAssistantsWithStreamingResponse: def threads(self) -> AsyncThreadsWithStreamingResponse: """Build Assistants that can call models and use tools.""" return AsyncThreadsWithStreamingResponse(self._beta.threads) + + @cached_property + def vector_stores(self) -> AsyncVectorStoresWithStreamingResponse: + return AsyncVectorStoresWithStreamingResponse(self._beta.vector_stores) diff --git a/tests/test_client.py b/tests/test_client.py index e2bb6ea966..5c395fe96b 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -157,6 +157,11 @@ def test_copy(self, client: OpenAI) -> None: assert copied.admin_api_key == "another My Admin API Key" assert client.admin_api_key == "My Admin API Key" + def test_beta_vector_stores_alias(self, client: OpenAI) -> None: + assert client.beta.vector_stores is client.vector_stores + assert client.beta.with_raw_response.vector_stores._vector_stores is client.vector_stores + assert client.beta.with_streaming_response.vector_stores._vector_stores is client.vector_stores + def test_copy_default_options(self, client: OpenAI) -> None: # options that have a default are overridden correctly copied = client.copy(max_retries=7) @@ -1420,6 +1425,11 @@ def test_copy(self, async_client: AsyncOpenAI) -> None: assert copied.admin_api_key == "another My Admin API Key" assert async_client.admin_api_key == "My Admin API Key" + def test_beta_vector_stores_alias(self, async_client: AsyncOpenAI) -> None: + assert async_client.beta.vector_stores is async_client.vector_stores + assert async_client.beta.with_raw_response.vector_stores._vector_stores is async_client.vector_stores + assert async_client.beta.with_streaming_response.vector_stores._vector_stores is async_client.vector_stores + def test_copy_default_options(self, async_client: AsyncOpenAI) -> None: # options that have a default are overridden correctly copied = async_client.copy(max_retries=7)