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.40.0"
".": "0.41.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 62
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-636ffd012f5b88d33c33cd0de8290a01564009f31d8004a87a2d516435c03868.yml
openapi_spec_hash: 91c662ed12c45e766bc325d47fd6e285
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e9dc6c785e53888e6234a39f02c1a5c8b71dd423e4b7b31aa963324b713bf240.yml
openapi_spec_hash: 31f9db79886e161a1696309b67d3997c
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.41.0 (2025-11-15)

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

### Features

* **api:** api update ([31afff6](https://github.com/mixedbread-ai/mixedbread-python/commit/31afff6212e416a2321fc7ee795db6e6ee1a9362))


### Bug Fixes

* **compat:** update signatures of `model_dump` and `model_dump_json` for Pydantic v1 ([3532225](https://github.com/mixedbread-ai/mixedbread-python/commit/353222526c46c9287b01cec5bfc0b39a25558964))

## 0.40.0 (2025-11-11)

Full Changelog: [v0.39.0...v0.40.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.39.0...v0.40.0)
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.40.0"
version = "0.41.0"
description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
41 changes: 29 additions & 12 deletions src/mixedbread/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,32 +257,41 @@ def model_dump(
mode: Literal["json", "python"] | str = "python",
include: IncEx | None = None,
exclude: IncEx | None = None,
context: Any | None = None,
by_alias: bool | None = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
exclude_computed_fields: bool = False,
round_trip: bool = False,
warnings: bool | Literal["none", "warn", "error"] = True,
context: dict[str, Any] | None = None,
serialize_as_any: bool = False,
fallback: Callable[[Any], Any] | None = None,
serialize_as_any: bool = False,
) -> dict[str, Any]:
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Args:
mode: The mode in which `to_python` should run.
If mode is 'json', the dictionary will only contain JSON serializable types.
If mode is 'python', the dictionary may contain any Python objects.
include: A list of fields to include in the output.
exclude: A list of fields to exclude from the output.
If mode is 'json', the output will only contain JSON serializable types.
If mode is 'python', the output may contain non-JSON-serializable Python objects.
include: A set of fields to include in the output.
exclude: A set of fields to exclude from the output.
context: Additional context to pass to the serializer.
by_alias: Whether to use the field's alias in the dictionary key if defined.
exclude_unset: Whether to exclude fields that are unset or None from the output.
exclude_defaults: Whether to exclude fields that are set to their default value from the output.
exclude_none: Whether to exclude fields that have a value of `None` from the output.
round_trip: Whether to enable serialization and deserialization round-trip support.
warnings: Whether to log warnings when invalid fields are encountered.
exclude_unset: Whether to exclude fields that have not been explicitly set.
exclude_defaults: Whether to exclude fields that are set to their default value.
exclude_none: Whether to exclude fields that have a value of `None`.
exclude_computed_fields: Whether to exclude computed fields.
While this can be useful for round-tripping, it is usually recommended to use the dedicated
`round_trip` parameter instead.
round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T].
warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors,
"error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError].
fallback: A function to call when an unknown value is encountered. If not provided,
a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised.
serialize_as_any: Whether to serialize fields with duck-typing serialization behavior.

Returns:
A dictionary representation of the model.
Expand All @@ -299,6 +308,8 @@ def model_dump(
raise ValueError("serialize_as_any is only supported in Pydantic v2")
if fallback is not None:
raise ValueError("fallback is only supported in Pydantic v2")
if exclude_computed_fields != False:
raise ValueError("exclude_computed_fields is only supported in Pydantic v2")
dumped = super().dict( # pyright: ignore[reportDeprecated]
include=include,
exclude=exclude,
Expand All @@ -315,15 +326,17 @@ def model_dump_json(
self,
*,
indent: int | None = None,
ensure_ascii: bool = False,
include: IncEx | None = None,
exclude: IncEx | None = None,
context: Any | None = None,
by_alias: bool | None = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
exclude_computed_fields: bool = False,
round_trip: bool = False,
warnings: bool | Literal["none", "warn", "error"] = True,
context: dict[str, Any] | None = None,
fallback: Callable[[Any], Any] | None = None,
serialize_as_any: bool = False,
) -> str:
Expand Down Expand Up @@ -355,6 +368,10 @@ def model_dump_json(
raise ValueError("serialize_as_any is only supported in Pydantic v2")
if fallback is not None:
raise ValueError("fallback is only supported in Pydantic v2")
if ensure_ascii != False:
raise ValueError("ensure_ascii is only supported in Pydantic v2")
if exclude_computed_fields != False:
raise ValueError("exclude_computed_fields is only supported in Pydantic v2")
return super().json( # type: ignore[reportDeprecated]
indent=indent,
include=include,
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.40.0" # x-release-please-version
__version__ = "0.41.0" # x-release-please-version
10 changes: 6 additions & 4 deletions src/mixedbread/resources/stores/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def retrieve(
file_identifier: str,
*,
store_identifier: str,
return_chunks: bool | Omit = omit,
return_chunks: Union[bool, Iterable[int]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -146,7 +146,8 @@ def retrieve(

file_identifier: The ID or name of the file

return_chunks: Whether to return the chunks for the file
return_chunks: Whether to return the chunks for the file. If a list of integers is provided,
only the chunks at the specified indices will be returned.

extra_headers: Send extra headers

Expand Down Expand Up @@ -607,7 +608,7 @@ async def retrieve(
file_identifier: str,
*,
store_identifier: str,
return_chunks: bool | Omit = omit,
return_chunks: Union[bool, Iterable[int]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -629,7 +630,8 @@ async def retrieve(

file_identifier: The ID or name of the file

return_chunks: Whether to return the chunks for the file
return_chunks: Whether to return the chunks for the file. If a list of integers is provided,
only the chunks at the specified indices will be returned.

extra_headers: Send extra headers

Expand Down
9 changes: 7 additions & 2 deletions src/mixedbread/types/stores/file_retrieve_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from typing import Union, Iterable
from typing_extensions import Required, TypedDict

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

return_chunks: bool
"""Whether to return the chunks for the file"""
return_chunks: Union[bool, Iterable[int]]
"""Whether to return the chunks for the file.

If a list of integers is provided, only the chunks at the specified indices will
be returned.
"""
Loading