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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.prism.log
.vscode
_dev

__pycache__
Expand Down
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.21.0"
".": "0.22.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: 49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-1d55ef57d17d780e3863936f62874ea7f378ed78a30edc0eb4119d9cb3009dc6.yml
openapi_spec_hash: 1c5f41ebd04ef8a89bc257e11d7cb122
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7f00f72937a82d3184ef21bc91c848984d4c3bacf910a671ac2c5736025d862c.yml
openapi_spec_hash: 5c59e45eebcbb99551e308b194ec6243
config_hash: 810d9712d3d0d6a1f50d71a25511d8a7
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.importFormat": "relative",
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.22.0 (2025-08-06)

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

### Features

* **api:** api update ([2c7f796](https://github.com/mixedbread-ai/mixedbread-python/commit/2c7f796de4143fd921495633b9726d81332aa57d))
* **client:** support file upload requests ([42d18d6](https://github.com/mixedbread-ai/mixedbread-python/commit/42d18d6cd2e38cd4555dd6cc91a424951c8d8b48))


### Chores

* **internal:** fix ruff target version ([c1d947c](https://github.com/mixedbread-ai/mixedbread-python/commit/c1d947c8b2fd3862cf8cf281239ebf7b69adddab))
* **internal:** update examples ([b57870e](https://github.com/mixedbread-ai/mixedbread-python/commit/b57870e1d3017a09d0f91dc4feed6e447b3f459d))
* **project:** add settings file for vscode ([bd31e87](https://github.com/mixedbread-ai/mixedbread-python/commit/bd31e87164a5da07bd649a22feb318d5ef64e0fe))

## 0.21.0 (2025-07-23)

Full Changelog: [v0.20.1...v0.21.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.20.1...v0.21.0)
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Shared Types

```python
from mixedbread.types import SearchFilter, SearchFilterCondition, Usage
from mixedbread.types import SearchFilterCondition, Usage
```

# Mixedbread
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
version = "0.21.0"
version = "0.22.0"
description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -159,7 +159,7 @@ reportPrivateUsage = false
[tool.ruff]
line-length = 120
output-format = "grouped"
target-version = "py37"
target-version = "py38"

[tool.ruff.format]
docstring-code-format = true
Expand Down
5 changes: 4 additions & 1 deletion src/mixedbread/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,10 @@ def _build_request(
is_body_allowed = options.method.lower() != "get"

if is_body_allowed:
kwargs["json"] = json_data if is_given(json_data) else None
if isinstance(json_data, bytes):
kwargs["content"] = json_data
else:
kwargs["json"] = json_data if is_given(json_data) else None
kwargs["files"] = files
else:
headers.pop("Content-Type", None)
Expand Down
8 changes: 4 additions & 4 deletions src/mixedbread/_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes:
return file

if is_tuple_t(file):
return (file[0], _read_file_content(file[1]), *file[2:])
return (file[0], read_file_content(file[1]), *file[2:])

raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")


def _read_file_content(file: FileContent) -> HttpxFileContent:
def read_file_content(file: FileContent) -> HttpxFileContent:
if isinstance(file, os.PathLike):
return pathlib.Path(file).read_bytes()
return file
Expand Down Expand Up @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes:
return file

if is_tuple_t(file):
return (file[0], await _async_read_file_content(file[1]), *file[2:])
return (file[0], await async_read_file_content(file[1]), *file[2:])

raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")


async def _async_read_file_content(file: FileContent) -> HttpxFileContent:
async def async_read_file_content(file: FileContent) -> HttpxFileContent:
if isinstance(file, os.PathLike):
return await anyio.Path(file).read_bytes()

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.21.0" # x-release-please-version
__version__ = "0.22.0" # x-release-please-version
8 changes: 8 additions & 0 deletions src/mixedbread/resources/vector_stores/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
metadata_filter: Optional[file_list_params.MetadataFilter] | NotGiven = NOT_GIVEN,
# 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 Down Expand Up @@ -201,6 +202,8 @@ def list(

statuses: Status to filter by

metadata_filter: Metadata filter to apply to the query

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -228,6 +231,7 @@ def list(
"before": before,
"include_total": include_total,
"statuses": statuses,
"metadata_filter": metadata_filter,
},
file_list_params.FileListParams,
),
Expand Down Expand Up @@ -609,6 +613,7 @@ def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
metadata_filter: Optional[file_list_params.MetadataFilter] | NotGiven = NOT_GIVEN,
# 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 Down Expand Up @@ -639,6 +644,8 @@ def list(

statuses: Status to filter by

metadata_filter: Metadata filter to apply to the query

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand Down Expand Up @@ -666,6 +673,7 @@ def list(
"before": before,
"include_total": include_total,
"statuses": statuses,
"metadata_filter": metadata_filter,
},
file_list_params.FileListParams,
),
Expand Down
13 changes: 1 addition & 12 deletions src/mixedbread/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

from __future__ import annotations

from . import shared
from .. import _compat
from .shared import Usage as Usage, SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
from .shared import Usage as Usage, SearchFilterCondition as SearchFilterCondition
from .api_key import APIKey as APIKey
from .embedding import Embedding as Embedding
from .data_source import DataSource as DataSource
Expand Down Expand Up @@ -58,12 +56,3 @@
from .vector_store_question_answering_response import (
VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
)

# Rebuild cyclical models only after all modules are imported.
# This ensures that, when building the deferred (due to cyclical references) model schema,
# Pydantic can resolve the necessary references.
# See: https://github.com/pydantic/pydantic/issues/11250 for more context.
if _compat.PYDANTIC_V2:
shared.search_filter.SearchFilter.model_rebuild(_parent_namespace_depth=0)
else:
shared.search_filter.SearchFilter.update_forward_refs() # type: ignore
1 change: 0 additions & 1 deletion src/mixedbread/types/shared/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .usage import Usage as Usage
from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
38 changes: 0 additions & 38 deletions src/mixedbread/types/shared/search_filter.py

This file was deleted.

1 change: 0 additions & 1 deletion src/mixedbread/types/shared_params/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
37 changes: 0 additions & 37 deletions src/mixedbread/types/shared_params/search_filter.py

This file was deleted.

62 changes: 56 additions & 6 deletions src/mixedbread/types/vector_store_question_answering_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam

__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
__all__ = [
"VectorStoreQuestionAnsweringParams",
"Filters",
"FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
"FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
"FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
"FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
"FiltersUnionMember2",
"FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
"FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
"FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
"FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
"QaOptions",
]


class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
Expand Down Expand Up @@ -42,9 +55,49 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
"""Question answering configuration options"""


FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]

Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]

FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]


class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
"""List of conditions or filters to be ANDed together"""

any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
"""List of conditions or filters to be ORed together"""

none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
"""List of conditions or filters to be NOTed"""


FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]

FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]

FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]


class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
"""List of conditions or filters to be ANDed together"""

any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
"""List of conditions or filters to be ORed together"""

none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
"""List of conditions or filters to be NOTed"""


FiltersUnionMember2: TypeAlias = Union[
FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
]

Filters: TypeAlias = Union[
FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
]


class QaOptions(TypedDict, total=False):
Expand All @@ -53,6 +106,3 @@ class QaOptions(TypedDict, total=False):

multimodal: bool
"""Whether to use multimodal context"""


from .shared_params.search_filter import SearchFilter
Loading