From c49a7d306eb7cf9c3101db686f7b982f9bd53415 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:25:32 +0000 Subject: [PATCH 1/5] feat(api): api update --- .stats.yml | 4 ++-- .../resources/vector_stores/vector_stores.py | 16 ++++++++++++++++ src/mixedbread/types/vector_store.py | 3 +++ .../types/vector_store_create_params.py | 3 +++ .../types/vector_store_update_params.py | 3 +++ tests/api_resources/test_vector_stores.py | 4 ++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d4c15816..8b1b4e11 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-a331b701867ba3d3dd907c8389fde663be4fda24c91e23f54f4dde8a6ade683f.yml -openapi_spec_hash: 95587d9746abb97d5b294bfedf86b782 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-258cd9419639d2d3d821e9c63a336fb7fecc362f376a7f606868445bcef995cd.yml +openapi_spec_hash: e2c4cf1543194f94f3b0baad6a5735ba config_hash: ca0dfb431a44ea42464c42b224addf36 diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py index 2d476dac..8c125cfb 100644 --- a/src/mixedbread/resources/vector_stores/vector_stores.py +++ b/src/mixedbread/resources/vector_stores/vector_stores.py @@ -72,6 +72,7 @@ def create( *, name: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, + is_public: bool | NotGiven = NOT_GIVEN, expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -95,6 +96,8 @@ def create( description: Description of the vector store + is_public: Whether the vector store can be accessed by anyone with valid login credentials + expires_after: Represents an expiration policy for a vector store. metadata: Optional metadata key-value pairs @@ -115,6 +118,7 @@ def create( { "name": name, "description": description, + "is_public": is_public, "expires_after": expires_after, "metadata": metadata, "file_ids": file_ids, @@ -174,6 +178,7 @@ def update( *, name: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, + is_public: Optional[bool] | NotGiven = NOT_GIVEN, expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -199,6 +204,8 @@ def update( description: New description + is_public: Whether the vector store can be accessed by anyone with valid login credentials + expires_after: Represents an expiration policy for a vector store. metadata: Optional metadata key-value pairs @@ -221,6 +228,7 @@ def update( { "name": name, "description": description, + "is_public": is_public, "expires_after": expires_after, "metadata": metadata, }, @@ -507,6 +515,7 @@ async def create( *, name: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, + is_public: bool | NotGiven = NOT_GIVEN, expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -530,6 +539,8 @@ async def create( description: Description of the vector store + is_public: Whether the vector store can be accessed by anyone with valid login credentials + expires_after: Represents an expiration policy for a vector store. metadata: Optional metadata key-value pairs @@ -550,6 +561,7 @@ async def create( { "name": name, "description": description, + "is_public": is_public, "expires_after": expires_after, "metadata": metadata, "file_ids": file_ids, @@ -609,6 +621,7 @@ async def update( *, name: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, + is_public: Optional[bool] | NotGiven = NOT_GIVEN, expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN, metadata: object | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -634,6 +647,8 @@ async def update( description: New description + is_public: Whether the vector store can be accessed by anyone with valid login credentials + expires_after: Represents an expiration policy for a vector store. metadata: Optional metadata key-value pairs @@ -656,6 +671,7 @@ async def update( { "name": name, "description": description, + "is_public": is_public, "expires_after": expires_after, "metadata": metadata, }, diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py index c2ab8879..331c9913 100644 --- a/src/mixedbread/types/vector_store.py +++ b/src/mixedbread/types/vector_store.py @@ -40,6 +40,9 @@ class VectorStore(BaseModel): description: Optional[str] = None """Detailed description of the vector store's purpose and contents""" + is_public: Optional[bool] = None + """Whether the vector store can be accessed by anyone with valid login credentials""" + metadata: Optional[object] = None """Additional metadata associated with the vector store""" diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py index 3013c59c..39ee001b 100644 --- a/src/mixedbread/types/vector_store_create_params.py +++ b/src/mixedbread/types/vector_store_create_params.py @@ -17,6 +17,9 @@ class VectorStoreCreateParams(TypedDict, total=False): description: Optional[str] """Description of the vector store""" + is_public: bool + """Whether the vector store can be accessed by anyone with valid login credentials""" + expires_after: Optional[ExpiresAfterParam] """Represents an expiration policy for a vector store.""" diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py index d8e6a83b..7bf9e2ed 100644 --- a/src/mixedbread/types/vector_store_update_params.py +++ b/src/mixedbread/types/vector_store_update_params.py @@ -17,6 +17,9 @@ class VectorStoreUpdateParams(TypedDict, total=False): description: Optional[str] """New description""" + is_public: Optional[bool] + """Whether the vector store can be accessed by anyone with valid login credentials""" + expires_after: Optional[ExpiresAfterParam] """Represents an expiration policy for a vector store.""" diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py index 0dfbf64a..538f55dc 100644 --- a/tests/api_resources/test_vector_stores.py +++ b/tests/api_resources/test_vector_stores.py @@ -33,6 +33,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None: vector_store = client.vector_stores.create( name="Technical Documentation", description="Contains technical specifications and guides", + is_public=False, expires_after={ "anchor": "last_active_at", "days": 0, @@ -115,6 +116,7 @@ def test_method_update_with_all_params(self, client: Mixedbread) -> None: vector_store_identifier="vector_store_identifier", name="x", description="description", + is_public=True, expires_after={ "anchor": "last_active_at", "days": 0, @@ -415,6 +417,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread vector_store = await async_client.vector_stores.create( name="Technical Documentation", description="Contains technical specifications and guides", + is_public=False, expires_after={ "anchor": "last_active_at", "days": 0, @@ -497,6 +500,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread vector_store_identifier="vector_store_identifier", name="x", description="description", + is_public=True, expires_after={ "anchor": "last_active_at", "days": 0, From 290b160b115fe7518b71f773419ceabeecbd72b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 02:47:04 +0000 Subject: [PATCH 2/5] chore(tests): add tests for httpx client instantiation & proxies --- tests/test_client.py | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 61377980..14fe9a45 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -31,6 +31,8 @@ DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, + DefaultHttpxClient, + DefaultAsyncHttpxClient, make_request_options, ) from mixedbread.types.vector_store_create_params import VectorStoreCreateParams @@ -836,6 +838,28 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" + def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects @@ -1699,6 +1723,28 @@ async def test_main() -> None: time.sleep(0.1) + async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultAsyncHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + async def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultAsyncHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) async def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects From 8f25dcdee6c50210e5c7cdbea3af5b9e1aa2ae85 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 04:16:30 +0000 Subject: [PATCH 3/5] chore(internal): update conftest.py --- tests/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 95be7245..61ded35a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + from __future__ import annotations import os From fa2d67970ea8da1ea66ac588a774037d56571d14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 06:47:41 +0000 Subject: [PATCH 4/5] chore(ci): enable for pull requests --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e42d2173..546cbbef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,10 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: From c0a0171d6ab5fa63c09e55acf64c9fe373f1bf00 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 06:55:48 +0000 Subject: [PATCH 5/5] release: 0.8.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ pyproject.toml | 2 +- src/mixedbread/_version.py | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1bc57136..6538ca91 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.7.1" + ".": "0.8.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index befee8aa..8425ba68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.8.0 (2025-06-17) + +Full Changelog: [v0.7.1...v0.8.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.7.1...v0.8.0) + +### Features + +* **api:** api update ([c49a7d3](https://github.com/mixedbread-ai/mixedbread-python/commit/c49a7d306eb7cf9c3101db686f7b982f9bd53415)) + + +### Chores + +* **ci:** enable for pull requests ([fa2d679](https://github.com/mixedbread-ai/mixedbread-python/commit/fa2d67970ea8da1ea66ac588a774037d56571d14)) +* **internal:** update conftest.py ([8f25dcd](https://github.com/mixedbread-ai/mixedbread-python/commit/8f25dcdee6c50210e5c7cdbea3af5b9e1aa2ae85)) +* **tests:** add tests for httpx client instantiation & proxies ([290b160](https://github.com/mixedbread-ai/mixedbread-python/commit/290b160b115fe7518b71f773419ceabeecbd72b7)) + ## 0.7.1 (2025-06-16) Full Changelog: [v0.7.0...v0.7.1](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.7.0...v0.7.1) diff --git a/pyproject.toml b/pyproject.toml index 45ded62f..3c8e4489 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mixedbread" -version = "0.7.1" +version = "0.8.0" description = "The official Python library for the Mixedbread API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py index 670e6ae2..dd1d30f9 100644 --- a/src/mixedbread/_version.py +++ b/src/mixedbread/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "mixedbread" -__version__ = "0.7.1" # x-release-please-version +__version__ = "0.8.0" # x-release-please-version