Skip to content

Commit 3002c44

Browse files
authored
Merge pull request #205 from mixedbread-ai/release-please--branches--main--changes--next
release: 0.6.0
2 parents 46ea501 + 5ae0c53 commit 3002c44

43 files changed

Lines changed: 1251 additions & 718 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.5.0"
2+
".": "0.6.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 49
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
3-
openapi_spec_hash: 07482ed86f5ccf7b480c514d6d5ebb15
4-
config_hash: 167171738605c297aa5e8bc73abc66e3
1+
configured_endpoints: 48
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-a331b701867ba3d3dd907c8389fde663be4fda24c91e23f54f4dde8a6ade683f.yml
3+
openapi_spec_hash: 95587d9746abb97d5b294bfedf86b782
4+
config_hash: 8545159b6ba2d638b8a2e7bbed6f04e7

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## 0.6.0 (2025-06-13)
4+
5+
Full Changelog: [v0.5.0...v0.6.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.5.0...v0.6.0)
6+
7+
### Features
8+
9+
* **api:** api update ([8ada0ea](https://github.com/mixedbread-ai/mixedbread-python/commit/8ada0eaeeed29b8ee2a08cf436077ee2f729794a))
10+
* **api:** api update ([22e5269](https://github.com/mixedbread-ai/mixedbread-python/commit/22e52693cb2f02fb20c0f7ca8f97d572a1091f6f))
11+
* **api:** api update ([eec921b](https://github.com/mixedbread-ai/mixedbread-python/commit/eec921b939205565f11790b08458f3e74df6e8a3))
12+
* **api:** api update ([0296d95](https://github.com/mixedbread-ai/mixedbread-python/commit/0296d958b5d8e82e2626fc04f9618a6423803515))
13+
* **api:** update via SDK Studio ([56f4e89](https://github.com/mixedbread-ai/mixedbread-python/commit/56f4e890d75c0cc54898f65f4087a828fe4bcc4e))
14+
* **api:** update via SDK Studio ([ed99b06](https://github.com/mixedbread-ai/mixedbread-python/commit/ed99b067eba308da0bb4ff24623d32b3339563a1))
15+
* **client:** add follow_redirects request option ([5f0a4ab](https://github.com/mixedbread-ai/mixedbread-python/commit/5f0a4abbecd635ad655480514685281891fd8699))
16+
17+
18+
### Bug Fixes
19+
20+
* **client:** correctly parse binary response | stream ([786bd6a](https://github.com/mixedbread-ai/mixedbread-python/commit/786bd6aeeac6fb7af0ffb1f00b6485dd253bd8fa))
21+
* **docs/api:** remove references to nonexistent types ([43c342b](https://github.com/mixedbread-ai/mixedbread-python/commit/43c342bb106371ea6057969578dc55af713f225e))
22+
23+
24+
### Chores
25+
26+
* **docs:** remove reference to rye shell ([c0c8bfd](https://github.com/mixedbread-ai/mixedbread-python/commit/c0c8bfdeac4c2ed4b7d381a9faef43485e5904de))
27+
* **docs:** remove unnecessary param examples ([54ef7c7](https://github.com/mixedbread-ai/mixedbread-python/commit/54ef7c77e392577a3038552a4a859b6351c6ddf4))
28+
* **tests:** run tests in parallel ([064a793](https://github.com/mixedbread-ai/mixedbread-python/commit/064a793c8269a6e3a30a1c84e6d7a3a783ffa31f))
29+
330
## 0.5.0 (2025-05-26)
431

532
Full Changelog: [v0.4.0...v0.5.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.4.0...v0.5.0)

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ $ rye sync --all-features
1717
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
1818

1919
```sh
20-
$ rye shell
21-
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
20+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
2221
$ source .venv/bin/activate
2322

2423
# now you can omit the `rye run` prefix

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,7 @@ from mixedbread import Mixedbread
152152
client = Mixedbread()
153153

154154
vector_store = client.vector_stores.create(
155-
expires_after={
156-
"anchor": "last_active_at",
157-
"days": 0,
158-
},
155+
expires_after={},
159156
)
160157
print(vector_store.expires_after)
161158
```

api.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ from mixedbread.types import (
4646
Methods:
4747

4848
- <code title="post /v1/vector_stores">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">create</a>(\*\*<a href="src/mixedbread/types/vector_store_create_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store.py">VectorStore</a></code>
49-
- <code title="get /v1/vector_stores/{vector_store_id}">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">retrieve</a>(vector_store_id) -> <a href="./src/mixedbread/types/vector_store.py">VectorStore</a></code>
50-
- <code title="put /v1/vector_stores/{vector_store_id}">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">update</a>(vector_store_id, \*\*<a href="src/mixedbread/types/vector_store_update_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store.py">VectorStore</a></code>
49+
- <code title="get /v1/vector_stores/{vector_store_identifier}">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">retrieve</a>(vector_store_identifier) -> <a href="./src/mixedbread/types/vector_store.py">VectorStore</a></code>
50+
- <code title="put /v1/vector_stores/{vector_store_identifier}">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">update</a>(vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_store_update_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store.py">VectorStore</a></code>
5151
- <code title="get /v1/vector_stores">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">list</a>(\*\*<a href="src/mixedbread/types/vector_store_list_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store.py">SyncLimitOffset[VectorStore]</a></code>
52-
- <code title="delete /v1/vector_stores/{vector_store_id}">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">delete</a>(vector_store_id) -> <a href="./src/mixedbread/types/vector_store_delete_response.py">VectorStoreDeleteResponse</a></code>
52+
- <code title="delete /v1/vector_stores/{vector_store_identifier}">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">delete</a>(vector_store_identifier) -> <a href="./src/mixedbread/types/vector_store_delete_response.py">VectorStoreDeleteResponse</a></code>
5353
- <code title="post /v1/vector_stores/question-answering">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">question_answering</a>(\*\*<a href="src/mixedbread/types/vector_store_question_answering_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store_question_answering_response.py">VectorStoreQuestionAnsweringResponse</a></code>
5454
- <code title="post /v1/vector_stores/search">client.vector_stores.<a href="./src/mixedbread/resources/vector_stores/vector_stores.py">search</a>(\*\*<a href="src/mixedbread/types/vector_store_search_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_store_search_response.py">VectorStoreSearchResponse</a></code>
5555

@@ -68,10 +68,10 @@ from mixedbread.types.vector_stores import (
6868

6969
Methods:
7070

71-
- <code title="post /v1/vector_stores/{vector_store_id}/files">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">create</a>(vector_store_id, \*\*<a href="src/mixedbread/types/vector_stores/file_create_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">VectorStoreFile</a></code>
72-
- <code title="get /v1/vector_stores/{vector_store_id}/files/{file_id}">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">retrieve</a>(file_id, \*, vector_store_id) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">VectorStoreFile</a></code>
73-
- <code title="get /v1/vector_stores/{vector_store_id}/files">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">list</a>(vector_store_id, \*\*<a href="src/mixedbread/types/vector_stores/file_list_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">SyncLimitOffset[VectorStoreFile]</a></code>
74-
- <code title="delete /v1/vector_stores/{vector_store_id}/files/{file_id}">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">delete</a>(file_id, \*, vector_store_id) -> <a href="./src/mixedbread/types/vector_stores/file_delete_response.py">FileDeleteResponse</a></code>
71+
- <code title="post /v1/vector_stores/{vector_store_identifier}/files">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">create</a>(vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_stores/file_create_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">VectorStoreFile</a></code>
72+
- <code title="get /v1/vector_stores/{vector_store_identifier}/files/{file_id}">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">retrieve</a>(file_id, \*, vector_store_identifier) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">VectorStoreFile</a></code>
73+
- <code title="get /v1/vector_stores/{vector_store_identifier}/files">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">list</a>(vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_stores/file_list_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">SyncLimitOffset[VectorStoreFile]</a></code>
74+
- <code title="delete /v1/vector_stores/{vector_store_identifier}/files/{file_id}">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">delete</a>(file_id, \*, vector_store_identifier) -> <a href="./src/mixedbread/types/vector_stores/file_delete_response.py">FileDeleteResponse</a></code>
7575
- <code title="post /v1/vector_stores/files/search">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">search</a>(\*\*<a href="src/mixedbread/types/vector_stores/file_search_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/file_search_response.py">FileSearchResponse</a></code>
7676

7777
# Parsing
@@ -170,18 +170,6 @@ Methods:
170170

171171
- <code title="post /v1/embeddings">client.embeddings.<a href="./src/mixedbread/resources/embeddings.py">create</a>(\*\*<a href="src/mixedbread/types/embedding_create_params.py">params</a>) -> <a href="./src/mixedbread/types/embedding_create_response.py">EmbeddingCreateResponse</a></code>
172172

173-
# Chat
174-
175-
Types:
176-
177-
```python
178-
from mixedbread.types import ChatCreateCompletionResponse
179-
```
180-
181-
Methods:
182-
183-
- <code title="post /v1/chat/completions">client.chat.<a href="./src/mixedbread/resources/chat.py">create_completion</a>() -> <a href="./src/mixedbread/types/chat_create_completion_response.py">object</a></code>
184-
185173
# DataSources
186174

187175
Types:

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mixedbread"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
description = "The official Python library for the Mixedbread API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -54,6 +54,7 @@ dev-dependencies = [
5454
"importlib-metadata>=6.7.0",
5555
"rich>=13.7.1",
5656
"nest_asyncio==1.6.0",
57+
"pytest-xdist>=3.6.1",
5758
]
5859

5960
[tool.rye.scripts]
@@ -125,7 +126,7 @@ replacement = '[\1](https://github.com/mixedbread-ai/mixedbread-python/tree/main
125126

126127
[tool.pytest.ini_options]
127128
testpaths = ["tests"]
128-
addopts = "--tb=short"
129+
addopts = "--tb=short -n auto"
129130
xfail_strict = true
130131
asyncio_mode = "auto"
131132
asyncio_default_fixture_loop_scope = "session"

requirements-dev.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ distro==1.8.0
3030
exceptiongroup==1.2.2
3131
# via anyio
3232
# via pytest
33+
execnet==2.1.1
34+
# via pytest-xdist
3335
filelock==3.12.4
3436
# via virtualenv
3537
h11==0.14.0
@@ -72,7 +74,9 @@ pygments==2.18.0
7274
pyright==1.1.399
7375
pytest==8.3.3
7476
# via pytest-asyncio
77+
# via pytest-xdist
7578
pytest-asyncio==0.24.0
79+
pytest-xdist==3.7.0
7680
python-dateutil==2.8.2
7781
# via time-machine
7882
pytz==2023.3.post1

src/mixedbread/_base_client.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,9 @@ def request(
960960
if self.custom_auth is not None:
961961
kwargs["auth"] = self.custom_auth
962962

963+
if options.follow_redirects is not None:
964+
kwargs["follow_redirects"] = options.follow_redirects
965+
963966
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
964967

965968
response = None
@@ -1068,7 +1071,14 @@ def _process_response(
10681071
) -> ResponseT:
10691072
origin = get_origin(cast_to) or cast_to
10701073

1071-
if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1074+
if (
1075+
inspect.isclass(origin)
1076+
and issubclass(origin, BaseAPIResponse)
1077+
# we only want to actually return the custom BaseAPIResponse class if we're
1078+
# returning the raw response, or if we're not streaming SSE, as if we're streaming
1079+
# SSE then `cast_to` doesn't actively reflect the type we need to parse into
1080+
and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1081+
):
10721082
if not issubclass(origin, APIResponse):
10731083
raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}")
10741084

@@ -1460,6 +1470,9 @@ async def request(
14601470
if self.custom_auth is not None:
14611471
kwargs["auth"] = self.custom_auth
14621472

1473+
if options.follow_redirects is not None:
1474+
kwargs["follow_redirects"] = options.follow_redirects
1475+
14631476
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
14641477

14651478
response = None
@@ -1568,7 +1581,14 @@ async def _process_response(
15681581
) -> ResponseT:
15691582
origin = get_origin(cast_to) or cast_to
15701583

1571-
if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
1584+
if (
1585+
inspect.isclass(origin)
1586+
and issubclass(origin, BaseAPIResponse)
1587+
# we only want to actually return the custom BaseAPIResponse class if we're
1588+
# returning the raw response, or if we're not streaming SSE, as if we're streaming
1589+
# SSE then `cast_to` doesn't actively reflect the type we need to parse into
1590+
and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
1591+
):
15721592
if not issubclass(origin, AsyncAPIResponse):
15731593
raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}")
15741594

src/mixedbread/_client.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
async_to_raw_response_wrapper,
3737
async_to_streamed_response_wrapper,
3838
)
39-
from .resources import chat, files, api_keys, embeddings
39+
from .resources import files, api_keys, embeddings
4040
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
4141
from ._exceptions import APIStatusError, MixedbreadError
4242
from ._base_client import (
@@ -78,7 +78,6 @@ class Mixedbread(SyncAPIClient):
7878
files: files.FilesResource
7979
extractions: extractions.ExtractionsResource
8080
embeddings: embeddings.EmbeddingsResource
81-
chat: chat.ChatResource
8281
data_sources: data_sources.DataSourcesResource
8382
api_keys: api_keys.APIKeysResource
8483
with_raw_response: MixedbreadWithRawResponse
@@ -167,7 +166,6 @@ def __init__(
167166
self.files = files.FilesResource(self)
168167
self.extractions = extractions.ExtractionsResource(self)
169168
self.embeddings = embeddings.EmbeddingsResource(self)
170-
self.chat = chat.ChatResource(self)
171169
self.data_sources = data_sources.DataSourcesResource(self)
172170
self.api_keys = api_keys.APIKeysResource(self)
173171
self.with_raw_response = MixedbreadWithRawResponse(self)
@@ -441,7 +439,6 @@ class AsyncMixedbread(AsyncAPIClient):
441439
files: files.AsyncFilesResource
442440
extractions: extractions.AsyncExtractionsResource
443441
embeddings: embeddings.AsyncEmbeddingsResource
444-
chat: chat.AsyncChatResource
445442
data_sources: data_sources.AsyncDataSourcesResource
446443
api_keys: api_keys.AsyncAPIKeysResource
447444
with_raw_response: AsyncMixedbreadWithRawResponse
@@ -530,7 +527,6 @@ def __init__(
530527
self.files = files.AsyncFilesResource(self)
531528
self.extractions = extractions.AsyncExtractionsResource(self)
532529
self.embeddings = embeddings.AsyncEmbeddingsResource(self)
533-
self.chat = chat.AsyncChatResource(self)
534530
self.data_sources = data_sources.AsyncDataSourcesResource(self)
535531
self.api_keys = api_keys.AsyncAPIKeysResource(self)
536532
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
@@ -805,7 +801,6 @@ def __init__(self, client: Mixedbread) -> None:
805801
self.files = files.FilesResourceWithRawResponse(client.files)
806802
self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
807803
self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
808-
self.chat = chat.ChatResourceWithRawResponse(client.chat)
809804
self.data_sources = data_sources.DataSourcesResourceWithRawResponse(client.data_sources)
810805
self.api_keys = api_keys.APIKeysResourceWithRawResponse(client.api_keys)
811806

@@ -827,7 +822,6 @@ def __init__(self, client: AsyncMixedbread) -> None:
827822
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
828823
self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
829824
self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
830-
self.chat = chat.AsyncChatResourceWithRawResponse(client.chat)
831825
self.data_sources = data_sources.AsyncDataSourcesResourceWithRawResponse(client.data_sources)
832826
self.api_keys = api_keys.AsyncAPIKeysResourceWithRawResponse(client.api_keys)
833827

@@ -849,7 +843,6 @@ def __init__(self, client: Mixedbread) -> None:
849843
self.files = files.FilesResourceWithStreamingResponse(client.files)
850844
self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
851845
self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
852-
self.chat = chat.ChatResourceWithStreamingResponse(client.chat)
853846
self.data_sources = data_sources.DataSourcesResourceWithStreamingResponse(client.data_sources)
854847
self.api_keys = api_keys.APIKeysResourceWithStreamingResponse(client.api_keys)
855848

@@ -871,7 +864,6 @@ def __init__(self, client: AsyncMixedbread) -> None:
871864
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
872865
self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
873866
self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
874-
self.chat = chat.AsyncChatResourceWithStreamingResponse(client.chat)
875867
self.data_sources = data_sources.AsyncDataSourcesResourceWithStreamingResponse(client.data_sources)
876868
self.api_keys = api_keys.AsyncAPIKeysResourceWithStreamingResponse(client.api_keys)
877869

0 commit comments

Comments
 (0)