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.30.0"
".": "0.31.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-922df6375506208e6003aa26bdf065a8221e5a99aac6d654b9d2a76175339828.yml
openapi_spec_hash: 19b698680ff92d3c5dc7e3f6c4ec12b1
config_hash: 22524d9aa927566851636768f6a861cd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-34b8fc657696023cc3a74eee6febe0d2fc0decda668f874bfa42abe6222d8566.yml
openapi_spec_hash: dcd015b362c3fcb4ef449606a8027873
config_hash: a2549e1f1923904c8cee4ea4f5ff58e1
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 0.31.0 (2025-10-01)

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

### Features

* **api:** api update ([26ce1c1](https://github.com/mixedbread-ai/mixedbread-python/commit/26ce1c1583f2eef287cdf5383398326d755428c4))
* **api:** api update ([91f4c77](https://github.com/mixedbread-ai/mixedbread-python/commit/91f4c77e0679065d375bb70b6f4618683aa7d77d))
* **api:** api update ([cea8399](https://github.com/mixedbread-ai/mixedbread-python/commit/cea83993a41231f4351dba325e798122660dabc3))
* **api:** update via SDK Studio ([0031d74](https://github.com/mixedbread-ai/mixedbread-python/commit/0031d74491330b7ecbd7965ff88837e1da71fb22))


### Chores

* do not install brew dependencies in ./scripts/bootstrap by default ([3dab10e](https://github.com/mixedbread-ai/mixedbread-python/commit/3dab10eca037653e15743682f304859d491202aa))
* **internal:** improve examples ([3edbd38](https://github.com/mixedbread-ai/mixedbread-python/commit/3edbd387ef7fa62afc255a80b9ac0a385f2cef29))
* **internal:** update pydantic dependency ([90fe5a9](https://github.com/mixedbread-ai/mixedbread-python/commit/90fe5a9b7626b6fefeb720058ce08eee191687eb))
* **internal:** use some smaller example values ([7566937](https://github.com/mixedbread-ai/mixedbread-python/commit/7566937f6cc6e0d777294adb70963f06023d4358))
* **types:** change optional parameter type from NotGiven to Omit ([402891b](https://github.com/mixedbread-ai/mixedbread-python/commit/402891b4bc2a09b774827338509bd730747d210c))

## 0.30.0 (2025-09-08)

Full Changelog: [v0.29.0...v0.30.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.29.0...v0.30.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.30.0"
version = "0.31.0"
description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
7 changes: 5 additions & 2 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ pluggy==1.5.0
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
pydantic==2.11.9
# via mixedbread
pydantic-core==2.27.1
pydantic-core==2.33.2
# via pydantic
pygments==2.18.0
# via rich
Expand Down Expand Up @@ -126,6 +126,9 @@ typing-extensions==4.12.2
# via pydantic
# via pydantic-core
# via pyright
# via typing-inspection
typing-inspection==0.4.1
# via pydantic
virtualenv==20.24.5
# via nox
yarl==1.20.0
Expand Down
7 changes: 5 additions & 2 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ multidict==6.4.4
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
pydantic==2.11.9
# via mixedbread
pydantic-core==2.27.1
pydantic-core==2.33.2
# via pydantic
sniffio==1.3.0
# via anyio
Expand All @@ -68,5 +68,8 @@ typing-extensions==4.12.2
# via multidict
# via pydantic
# via pydantic-core
# via typing-inspection
typing-inspection==0.4.1
# via pydantic
yarl==1.20.0
# via aiohttp
14 changes: 11 additions & 3 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ set -e

cd "$(dirname "$0")/.."

if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
case "$response" in
[yY][eE][sS]|[yY])
brew bundle
;;
*)
;;
esac
echo
}
fi

Expand Down
4 changes: 3 additions & 1 deletion src/mixedbread/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import typing as _t

from . import types
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
from ._utils import file_from_path
from ._client import (
ENVIRONMENTS,
Expand Down Expand Up @@ -49,7 +49,9 @@
"ProxiesTypes",
"NotGiven",
"NOT_GIVEN",
"not_given",
"Omit",
"omit",
"MixedbreadError",
"APIError",
"APIStatusError",
Expand Down
18 changes: 9 additions & 9 deletions src/mixedbread/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
from ._qs import Querystring
from ._files import to_httpx_files, async_to_httpx_files
from ._types import (
NOT_GIVEN,
Body,
Omit,
Query,
Expand All @@ -57,6 +56,7 @@
RequestOptions,
HttpxRequestFiles,
ModelBuilderProtocol,
not_given,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import PYDANTIC_V1, model_copy, model_dump
Expand Down Expand Up @@ -145,9 +145,9 @@ def __init__(
def __init__(
self,
*,
url: URL | NotGiven = NOT_GIVEN,
json: Body | NotGiven = NOT_GIVEN,
params: Query | NotGiven = NOT_GIVEN,
url: URL | NotGiven = not_given,
json: Body | NotGiven = not_given,
params: Query | NotGiven = not_given,
) -> None:
self.url = url
self.json = json
Expand Down Expand Up @@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques
# we internally support defining a temporary header to override the
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
# see _response.py for implementation details
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
if is_given(override_cast_to):
options.headers = headers
return cast(Type[ResponseT], override_cast_to)
Expand Down Expand Up @@ -825,7 +825,7 @@ def __init__(
version: str,
base_url: str | URL,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -1356,7 +1356,7 @@ def __init__(
base_url: str | URL,
_strict_response_validation: bool,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -1818,8 +1818,8 @@ def make_request_options(
extra_query: Query | None = None,
extra_body: Body | None = None,
idempotency_key: str | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
post_parser: PostParser | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
post_parser: PostParser | NotGiven = not_given,
) -> RequestOptions:
"""Create a dict of type RequestOptions without keys of NotGiven values."""
options: RequestOptions = {}
Expand Down
71 changes: 36 additions & 35 deletions src/mixedbread/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from ._qs import Querystring
from .types import client_embed_params, client_rerank_params
from ._types import (
NOT_GIVEN,
Body,
Omit,
Query,
Expand All @@ -23,6 +22,8 @@
ProxiesTypes,
RequestOptions,
SequenceNotStr,
omit,
not_given,
)
from ._utils import (
is_given,
Expand Down Expand Up @@ -95,9 +96,9 @@ def __init__(
self,
*,
api_key: str | None = None,
environment: Literal["production", "development", "local"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
environment: Literal["production", "development", "local"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -201,9 +202,9 @@ def copy(
api_key: str | None = None,
environment: Literal["production", "development", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -253,16 +254,16 @@ def embed(
*,
model: str,
input: Union[str, SequenceNotStr[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN,
dimensions: Optional[int] | Omit = omit,
prompt: Optional[str] | Omit = omit,
normalized: bool | Omit = omit,
encoding_format: Union[EncodingFormat, List[EncodingFormat]] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
Expand Down Expand Up @@ -321,7 +322,7 @@ def info(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InfoResponse:
"""
Returns service information, including name and version.
Expand All @@ -339,19 +340,19 @@ def info(
def rerank(
self,
*,
model: str | NotGiven = NOT_GIVEN,
model: str | Omit = omit,
query: str,
input: SequenceNotStr[Union[str, Iterable[object], object]],
rank_fields: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
return_input: bool | NotGiven = NOT_GIVEN,
rewrite_query: bool | NotGiven = NOT_GIVEN,
rank_fields: Optional[SequenceNotStr[str]] | Omit = omit,
top_k: int | Omit = omit,
return_input: bool | Omit = omit,
rewrite_query: bool | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> RerankResponse:
"""
Rerank different kind of documents for a given query.
Expand Down Expand Up @@ -458,9 +459,9 @@ def __init__(
self,
*,
api_key: str | None = None,
environment: Literal["production", "development", "local"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
environment: Literal["production", "development", "local"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -564,9 +565,9 @@ def copy(
api_key: str | None = None,
environment: Literal["production", "development", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -616,16 +617,16 @@ async def embed(
*,
model: str,
input: Union[str, SequenceNotStr[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN,
dimensions: Optional[int] | Omit = omit,
prompt: Optional[str] | Omit = omit,
normalized: bool | Omit = omit,
encoding_format: Union[EncodingFormat, List[EncodingFormat]] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
Expand Down Expand Up @@ -684,7 +685,7 @@ async def info(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InfoResponse:
"""
Returns service information, including name and version.
Expand All @@ -702,19 +703,19 @@ async def info(
async def rerank(
self,
*,
model: str | NotGiven = NOT_GIVEN,
model: str | Omit = omit,
query: str,
input: SequenceNotStr[Union[str, Iterable[object], object]],
rank_fields: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
return_input: bool | NotGiven = NOT_GIVEN,
rewrite_query: bool | NotGiven = NOT_GIVEN,
rank_fields: Optional[SequenceNotStr[str]] | Omit = omit,
top_k: int | Omit = omit,
return_input: bool | Omit = omit,
rewrite_query: bool | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> RerankResponse:
"""
Rerank different kind of documents for a given query.
Expand Down
Loading
Loading