Skip to content

Commit 358e581

Browse files
authored
Merge pull request #258 from mixedbread-ai/release-please--branches--main--changes--next
release: 0.41.0
2 parents 0a4aef4 + e45eb5f commit 358e581

8 files changed

Lines changed: 60 additions & 23 deletions

File tree

.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.40.0"
2+
".": "0.41.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 62
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-636ffd012f5b88d33c33cd0de8290a01564009f31d8004a87a2d516435c03868.yml
3-
openapi_spec_hash: 91c662ed12c45e766bc325d47fd6e285
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e9dc6c785e53888e6234a39f02c1a5c8b71dd423e4b7b31aa963324b713bf240.yml
3+
openapi_spec_hash: 31f9db79886e161a1696309b67d3997c
44
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71

CHANGELOG.md

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

3+
## 0.41.0 (2025-11-15)
4+
5+
Full Changelog: [v0.40.0...v0.41.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.40.0...v0.41.0)
6+
7+
### Features
8+
9+
* **api:** api update ([31afff6](https://github.com/mixedbread-ai/mixedbread-python/commit/31afff6212e416a2321fc7ee795db6e6ee1a9362))
10+
11+
12+
### Bug Fixes
13+
14+
* **compat:** update signatures of `model_dump` and `model_dump_json` for Pydantic v1 ([3532225](https://github.com/mixedbread-ai/mixedbread-python/commit/353222526c46c9287b01cec5bfc0b39a25558964))
15+
316
## 0.40.0 (2025-11-11)
417

518
Full Changelog: [v0.39.0...v0.40.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.39.0...v0.40.0)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mixedbread"
3-
version = "0.40.0"
3+
version = "0.41.0"
44
description = "The official Python library for the Mixedbread API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/mixedbread/_models.py

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -257,32 +257,41 @@ def model_dump(
257257
mode: Literal["json", "python"] | str = "python",
258258
include: IncEx | None = None,
259259
exclude: IncEx | None = None,
260+
context: Any | None = None,
260261
by_alias: bool | None = None,
261262
exclude_unset: bool = False,
262263
exclude_defaults: bool = False,
263264
exclude_none: bool = False,
265+
exclude_computed_fields: bool = False,
264266
round_trip: bool = False,
265267
warnings: bool | Literal["none", "warn", "error"] = True,
266-
context: dict[str, Any] | None = None,
267-
serialize_as_any: bool = False,
268268
fallback: Callable[[Any], Any] | None = None,
269+
serialize_as_any: bool = False,
269270
) -> dict[str, Any]:
270271
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
271272
272273
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
273274
274275
Args:
275276
mode: The mode in which `to_python` should run.
276-
If mode is 'json', the dictionary will only contain JSON serializable types.
277-
If mode is 'python', the dictionary may contain any Python objects.
278-
include: A list of fields to include in the output.
279-
exclude: A list of fields to exclude from the output.
277+
If mode is 'json', the output will only contain JSON serializable types.
278+
If mode is 'python', the output may contain non-JSON-serializable Python objects.
279+
include: A set of fields to include in the output.
280+
exclude: A set of fields to exclude from the output.
281+
context: Additional context to pass to the serializer.
280282
by_alias: Whether to use the field's alias in the dictionary key if defined.
281-
exclude_unset: Whether to exclude fields that are unset or None from the output.
282-
exclude_defaults: Whether to exclude fields that are set to their default value from the output.
283-
exclude_none: Whether to exclude fields that have a value of `None` from the output.
284-
round_trip: Whether to enable serialization and deserialization round-trip support.
285-
warnings: Whether to log warnings when invalid fields are encountered.
283+
exclude_unset: Whether to exclude fields that have not been explicitly set.
284+
exclude_defaults: Whether to exclude fields that are set to their default value.
285+
exclude_none: Whether to exclude fields that have a value of `None`.
286+
exclude_computed_fields: Whether to exclude computed fields.
287+
While this can be useful for round-tripping, it is usually recommended to use the dedicated
288+
`round_trip` parameter instead.
289+
round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T].
290+
warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors,
291+
"error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError].
292+
fallback: A function to call when an unknown value is encountered. If not provided,
293+
a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised.
294+
serialize_as_any: Whether to serialize fields with duck-typing serialization behavior.
286295
287296
Returns:
288297
A dictionary representation of the model.
@@ -299,6 +308,8 @@ def model_dump(
299308
raise ValueError("serialize_as_any is only supported in Pydantic v2")
300309
if fallback is not None:
301310
raise ValueError("fallback is only supported in Pydantic v2")
311+
if exclude_computed_fields != False:
312+
raise ValueError("exclude_computed_fields is only supported in Pydantic v2")
302313
dumped = super().dict( # pyright: ignore[reportDeprecated]
303314
include=include,
304315
exclude=exclude,
@@ -315,15 +326,17 @@ def model_dump_json(
315326
self,
316327
*,
317328
indent: int | None = None,
329+
ensure_ascii: bool = False,
318330
include: IncEx | None = None,
319331
exclude: IncEx | None = None,
332+
context: Any | None = None,
320333
by_alias: bool | None = None,
321334
exclude_unset: bool = False,
322335
exclude_defaults: bool = False,
323336
exclude_none: bool = False,
337+
exclude_computed_fields: bool = False,
324338
round_trip: bool = False,
325339
warnings: bool | Literal["none", "warn", "error"] = True,
326-
context: dict[str, Any] | None = None,
327340
fallback: Callable[[Any], Any] | None = None,
328341
serialize_as_any: bool = False,
329342
) -> str:
@@ -355,6 +368,10 @@ def model_dump_json(
355368
raise ValueError("serialize_as_any is only supported in Pydantic v2")
356369
if fallback is not None:
357370
raise ValueError("fallback is only supported in Pydantic v2")
371+
if ensure_ascii != False:
372+
raise ValueError("ensure_ascii is only supported in Pydantic v2")
373+
if exclude_computed_fields != False:
374+
raise ValueError("exclude_computed_fields is only supported in Pydantic v2")
358375
return super().json( # type: ignore[reportDeprecated]
359376
indent=indent,
360377
include=include,

src/mixedbread/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "mixedbread"
4-
__version__ = "0.40.0" # x-release-please-version
4+
__version__ = "0.41.0" # x-release-please-version

src/mixedbread/resources/stores/files.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def retrieve(
124124
file_identifier: str,
125125
*,
126126
store_identifier: str,
127-
return_chunks: bool | Omit = omit,
127+
return_chunks: Union[bool, Iterable[int]] | Omit = omit,
128128
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
129129
# The extra values given here take precedence over values defined on the client or passed to this method.
130130
extra_headers: Headers | None = None,
@@ -146,7 +146,8 @@ def retrieve(
146146
147147
file_identifier: The ID or name of the file
148148
149-
return_chunks: Whether to return the chunks for the file
149+
return_chunks: Whether to return the chunks for the file. If a list of integers is provided,
150+
only the chunks at the specified indices will be returned.
150151
151152
extra_headers: Send extra headers
152153
@@ -607,7 +608,7 @@ async def retrieve(
607608
file_identifier: str,
608609
*,
609610
store_identifier: str,
610-
return_chunks: bool | Omit = omit,
611+
return_chunks: Union[bool, Iterable[int]] | Omit = omit,
611612
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
612613
# The extra values given here take precedence over values defined on the client or passed to this method.
613614
extra_headers: Headers | None = None,
@@ -629,7 +630,8 @@ async def retrieve(
629630
630631
file_identifier: The ID or name of the file
631632
632-
return_chunks: Whether to return the chunks for the file
633+
return_chunks: Whether to return the chunks for the file. If a list of integers is provided,
634+
only the chunks at the specified indices will be returned.
633635
634636
extra_headers: Send extra headers
635637

src/mixedbread/types/stores/file_retrieve_params.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Union, Iterable
56
from typing_extensions import Required, TypedDict
67

78
__all__ = ["FileRetrieveParams"]
@@ -11,5 +12,9 @@ class FileRetrieveParams(TypedDict, total=False):
1112
store_identifier: Required[str]
1213
"""The ID or name of the store"""
1314

14-
return_chunks: bool
15-
"""Whether to return the chunks for the file"""
15+
return_chunks: Union[bool, Iterable[int]]
16+
"""Whether to return the chunks for the file.
17+
18+
If a list of integers is provided, only the chunks at the specified indices will
19+
be returned.
20+
"""

0 commit comments

Comments
 (0)