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.43.0"
".": "0.44.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
configured_endpoints: 63
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-8a9abf45fe3e0db8c9ba59803ff9ef4ce5d0bb780765d3c1a9587dde2a8d6c93.yml
openapi_spec_hash: 0f3af27e4fc27bcbfbb17f0a2c45c060
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
config_hash: 557219db19e51f791a1727eac53d506c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.44.0 (2025-12-17)

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

### Features

* **api:** manual updates ([06e7106](https://github.com/mixedbread-ai/mixedbread-python/commit/06e7106befea286d1f7e05268f08fe824aed3631))

## 0.43.0 (2025-12-17)

Full Changelog: [v0.42.0...v0.43.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.42.0...v0.43.0)
Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Methods:

- <code title="post /v1/stores/{store_identifier}/files">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">create</a>(store_identifier, \*\*<a href="src/mixedbread/types/stores/file_create_params.py">params</a>) -> <a href="./src/mixedbread/types/stores/store_file.py">StoreFile</a></code>
- <code title="get /v1/stores/{store_identifier}/files/{file_identifier}">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">retrieve</a>(file_identifier, \*, store_identifier, \*\*<a href="src/mixedbread/types/stores/file_retrieve_params.py">params</a>) -> <a href="./src/mixedbread/types/stores/store_file.py">StoreFile</a></code>
- <code title="patch /v1/stores/{store_identifier}/files/{file_identifier}">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">update</a>(file_identifier, \*, store_identifier, \*\*<a href="src/mixedbread/types/stores/file_update_params.py">params</a>) -> <a href="./src/mixedbread/types/stores/store_file.py">StoreFile</a></code>
- <code title="post /v1/stores/{store_identifier}/files/list">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">list</a>(store_identifier, \*\*<a href="src/mixedbread/types/stores/file_list_params.py">params</a>) -> <a href="./src/mixedbread/types/stores/file_list_response.py">FileListResponse</a></code>
- <code title="delete /v1/stores/{store_identifier}/files/{file_identifier}">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">delete</a>(file_identifier, \*, store_identifier) -> <a href="./src/mixedbread/types/stores/file_delete_response.py">FileDeleteResponse</a></code>
- <code title="post /v1/stores/files/search">client.stores.files.<a href="./src/mixedbread/resources/stores/files.py">search</a>(\*\*<a href="src/mixedbread/types/stores/file_search_params.py">params</a>) -> <a href="./src/mixedbread/types/stores/file_search_response.py">FileSearchResponse</a></code>
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.43.0"
version = "0.44.0"
description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
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.43.0" # x-release-please-version
__version__ = "0.44.0" # x-release-please-version
120 changes: 118 additions & 2 deletions src/mixedbread/resources/stores/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import functools
from typing import Any, List, Union, Iterable, Optional
from typing import Any, Dict, List, Union, Iterable, Optional

import httpx

Expand All @@ -19,7 +19,13 @@
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
from ...types.stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
from ...types.stores import (
file_list_params,
file_create_params,
file_search_params,
file_update_params,
file_retrieve_params,
)
from ...types.stores.store_file import StoreFile
from ...types.stores.store_file_status import StoreFileStatus
from ...types.stores.file_list_response import FileListResponse
Expand Down Expand Up @@ -173,6 +179,55 @@ def retrieve(
cast_to=StoreFile,
)

def update(
self,
file_identifier: str,
*,
store_identifier: str,
metadata: Optional[Dict[str, object]] | 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,
) -> StoreFile:
"""
Update metadata on a file within a store.

Args: store_identifier: The ID or name of the store. file_identifier: The ID or
name of the file to update. update_params: Metadata update payload.

Returns: StoreFile: The updated file details.

Args:
store_identifier: The ID or name of the store

file_identifier: The ID or name of the file to update

metadata: Updated metadata for the file

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not store_identifier:
raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
if not file_identifier:
raise ValueError(f"Expected a non-empty value for `file_identifier` but received {file_identifier!r}")
return self._patch(
f"/v1/stores/{store_identifier}/files/{file_identifier}",
body=maybe_transform({"metadata": metadata}, file_update_params.FileUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=StoreFile,
)

def list(
self,
store_identifier: str,
Expand Down Expand Up @@ -663,6 +718,55 @@ async def retrieve(
cast_to=StoreFile,
)

async def update(
self,
file_identifier: str,
*,
store_identifier: str,
metadata: Optional[Dict[str, object]] | 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,
) -> StoreFile:
"""
Update metadata on a file within a store.

Args: store_identifier: The ID or name of the store. file_identifier: The ID or
name of the file to update. update_params: Metadata update payload.

Returns: StoreFile: The updated file details.

Args:
store_identifier: The ID or name of the store

file_identifier: The ID or name of the file to update

metadata: Updated metadata for the file

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not store_identifier:
raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
if not file_identifier:
raise ValueError(f"Expected a non-empty value for `file_identifier` but received {file_identifier!r}")
return await self._patch(
f"/v1/stores/{store_identifier}/files/{file_identifier}",
body=await async_maybe_transform({"metadata": metadata}, file_update_params.FileUpdateParams),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=StoreFile,
)

async def list(
self,
store_identifier: str,
Expand Down Expand Up @@ -1019,6 +1123,9 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_raw_response_wrapper(
files.retrieve,
)
self.update = to_raw_response_wrapper(
files.update,
)
self.list = to_raw_response_wrapper(
files.list,
)
Expand All @@ -1040,6 +1147,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_raw_response_wrapper(
files.retrieve,
)
self.update = async_to_raw_response_wrapper(
files.update,
)
self.list = async_to_raw_response_wrapper(
files.list,
)
Expand All @@ -1061,6 +1171,9 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_streamed_response_wrapper(
files.retrieve,
)
self.update = to_streamed_response_wrapper(
files.update,
)
self.list = to_streamed_response_wrapper(
files.list,
)
Expand All @@ -1082,6 +1195,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_streamed_response_wrapper(
files.retrieve,
)
self.update = async_to_streamed_response_wrapper(
files.update,
)
self.list = async_to_streamed_response_wrapper(
files.list,
)
Expand Down
1 change: 1 addition & 0 deletions src/mixedbread/types/stores/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .file_create_params import FileCreateParams as FileCreateParams
from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .file_update_params import FileUpdateParams as FileUpdateParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .file_retrieve_params import FileRetrieveParams as FileRetrieveParams
from .file_search_response import FileSearchResponse as FileSearchResponse
16 changes: 16 additions & 0 deletions src/mixedbread/types/stores/file_update_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Dict, Optional
from typing_extensions import Required, TypedDict

__all__ = ["FileUpdateParams"]


class FileUpdateParams(TypedDict, total=False):
store_identifier: Required[str]
"""The ID or name of the store"""

metadata: Optional[Dict[str, object]]
"""Updated metadata for the file"""
114 changes: 114 additions & 0 deletions tests/api_resources/stores/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,63 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
store_identifier="store_identifier",
)

@parametrize
def test_method_update(self, client: Mixedbread) -> None:
file = client.stores.files.update(
file_identifier="file_identifier",
store_identifier="store_identifier",
)
assert_matches_type(StoreFile, file, path=["response"])

@parametrize
def test_method_update_with_all_params(self, client: Mixedbread) -> None:
file = client.stores.files.update(
file_identifier="file_identifier",
store_identifier="store_identifier",
metadata={"foo": "bar"},
)
assert_matches_type(StoreFile, file, path=["response"])

@parametrize
def test_raw_response_update(self, client: Mixedbread) -> None:
response = client.stores.files.with_raw_response.update(
file_identifier="file_identifier",
store_identifier="store_identifier",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
assert_matches_type(StoreFile, file, path=["response"])

@parametrize
def test_streaming_response_update(self, client: Mixedbread) -> None:
with client.stores.files.with_streaming_response.update(
file_identifier="file_identifier",
store_identifier="store_identifier",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

file = response.parse()
assert_matches_type(StoreFile, file, path=["response"])

assert cast(Any, response.is_closed) is True

@parametrize
def test_path_params_update(self, client: Mixedbread) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
client.stores.files.with_raw_response.update(
file_identifier="file_identifier",
store_identifier="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_identifier` but received ''"):
client.stores.files.with_raw_response.update(
file_identifier="",
store_identifier="store_identifier",
)

@parametrize
def test_method_list(self, client: Mixedbread) -> None:
file = client.stores.files.list(
Expand Down Expand Up @@ -414,6 +471,63 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
store_identifier="store_identifier",
)

@parametrize
async def test_method_update(self, async_client: AsyncMixedbread) -> None:
file = await async_client.stores.files.update(
file_identifier="file_identifier",
store_identifier="store_identifier",
)
assert_matches_type(StoreFile, file, path=["response"])

@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.stores.files.update(
file_identifier="file_identifier",
store_identifier="store_identifier",
metadata={"foo": "bar"},
)
assert_matches_type(StoreFile, file, path=["response"])

@parametrize
async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
response = await async_client.stores.files.with_raw_response.update(
file_identifier="file_identifier",
store_identifier="store_identifier",
)

assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
assert_matches_type(StoreFile, file, path=["response"])

@parametrize
async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
async with async_client.stores.files.with_streaming_response.update(
file_identifier="file_identifier",
store_identifier="store_identifier",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

file = await response.parse()
assert_matches_type(StoreFile, file, path=["response"])

assert cast(Any, response.is_closed) is True

@parametrize
async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
await async_client.stores.files.with_raw_response.update(
file_identifier="file_identifier",
store_identifier="",
)

with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_identifier` but received ''"):
await async_client.stores.files.with_raw_response.update(
file_identifier="",
store_identifier="store_identifier",
)

@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.stores.files.list(
Expand Down
Loading