Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.8.0"
".": "0.8.1"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.8.1 (2025-06-18)

Full Changelog: [v0.8.0...v0.8.1](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.8.0...v0.8.1)

### Bug Fixes

* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([d3a40a0](https://github.com/mixedbread-ai/mixedbread-python/commit/d3a40a0f8b7006884b530e6e2a01a8993192738b))


### Chores

* **readme:** update badges ([5560ca6](https://github.com/mixedbread-ai/mixedbread-python/commit/5560ca69463e25e9e9aa22af3c0b2f6bd6fefb74))

## 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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mixedbread API Python SDK API library

[![PyPI version](https://img.shields.io/pypi/v/mixedbread.svg)](https://pypi.org/project/mixedbread/)
[![PyPI version](<https://img.shields.io/pypi/v/mixedbread.svg?label=pypi%20(stable)>)](https://pypi.org/project/mixedbread/)

The Mixedbread API Python SDK library provides convenient access to the Mixedbread REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
version = "0.8.0"
version = "0.8.1"
description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/mixedbread/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "mixedbread"
__version__ = "0.8.0" # x-release-please-version
__version__ = "0.8.1" # x-release-please-version
45 changes: 12 additions & 33 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@

from mixedbread import Mixedbread, AsyncMixedbread, APIResponseValidationError
from mixedbread._types import Omit
from mixedbread._utils import maybe_transform
from mixedbread._models import BaseModel, FinalRequestOptions
from mixedbread._constants import RAW_RESPONSE_HEADER
from mixedbread._exceptions import APIStatusError, APITimeoutError, MixedbreadError, APIResponseValidationError
from mixedbread._base_client import (
DEFAULT_TIMEOUT,
Expand All @@ -35,7 +33,6 @@
DefaultAsyncHttpxClient,
make_request_options,
)
from mixedbread.types.vector_store_create_params import VectorStoreCreateParams

from .utils import update_env

Expand Down Expand Up @@ -733,32 +730,21 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str

@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Mixedbread) -> None:
respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))

with pytest.raises(APITimeoutError):
self.client.post(
"/v1/vector_stores",
body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
client.vector_stores.with_streaming_response.create().__enter__()

assert _get_open_connections(self.client) == 0

@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Mixedbread) -> None:
respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))

with pytest.raises(APIStatusError):
self.client.post(
"/v1/vector_stores",
body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)

client.vector_stores.with_streaming_response.create().__enter__()
assert _get_open_connections(self.client) == 0

@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
Expand Down Expand Up @@ -1568,32 +1554,25 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte

@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
async def test_retrying_timeout_errors_doesnt_leak(
self, respx_mock: MockRouter, async_client: AsyncMixedbread
) -> None:
respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))

with pytest.raises(APITimeoutError):
await self.client.post(
"/v1/vector_stores",
body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
await async_client.vector_stores.with_streaming_response.create().__aenter__()

assert _get_open_connections(self.client) == 0

@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
async def test_retrying_status_errors_doesnt_leak(
self, respx_mock: MockRouter, async_client: AsyncMixedbread
) -> None:
respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))

with pytest.raises(APIStatusError):
await self.client.post(
"/v1/vector_stores",
body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)

await async_client.vector_stores.with_streaming_response.create().__aenter__()
assert _get_open_connections(self.client) == 0

@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
Expand Down