From 86d36996c249024a6488d84c39150899ed8f5d97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 22:24:49 +0000 Subject: [PATCH 1/6] feat(api): update via SDK Studio --- .stats.yml | 4 ++-- src/mixedbread/types/store.py | 2 +- src/mixedbread/types/store_create_params.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index fe0dd56b..4244981e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 62 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b091721a627d75feb8567f628f99405d5778b0b88e9cc09fc664dd8e97c6d720.yml -openapi_spec_hash: a23a2aecdcff5fa1d6c8cdc0df0bdfb7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-638e345e86725ddacfcc65291e29de92cf37b9a73da1f98fb605decb7d6be6a0.yml +openapi_spec_hash: 55fbc9be48514291bc7f84f9f41ccfaa config_hash: 22ce3b96e325037f81e7dbf22bdd8d24 diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py index c380b69f..61f8fa24 100644 --- a/src/mixedbread/types/store.py +++ b/src/mixedbread/types/store.py @@ -20,7 +20,7 @@ class ConfigContextualizationContextualizationConfig(BaseModel): """ -ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig] +ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig, None] class Config(BaseModel): diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py index 92cece44..e9971d9d 100644 --- a/src/mixedbread/types/store_create_params.py +++ b/src/mixedbread/types/store_create_params.py @@ -48,5 +48,5 @@ class ConfigContextualizationContextualizationConfig(TypedDict, total=False): class Config(TypedDict, total=False): - contextualization: ConfigContextualization + contextualization: Optional[ConfigContextualization] """Contextualize files with metadata""" From 77d72b73d9cec032f145b8c4813f479c608b29d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 22:29:08 +0000 Subject: [PATCH 2/6] feat(api): api update --- .stats.yml | 4 ++-- src/mixedbread/types/store.py | 2 +- src/mixedbread/types/store_create_params.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4244981e..fe0dd56b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 62 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-638e345e86725ddacfcc65291e29de92cf37b9a73da1f98fb605decb7d6be6a0.yml -openapi_spec_hash: 55fbc9be48514291bc7f84f9f41ccfaa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b091721a627d75feb8567f628f99405d5778b0b88e9cc09fc664dd8e97c6d720.yml +openapi_spec_hash: a23a2aecdcff5fa1d6c8cdc0df0bdfb7 config_hash: 22ce3b96e325037f81e7dbf22bdd8d24 diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py index 61f8fa24..c380b69f 100644 --- a/src/mixedbread/types/store.py +++ b/src/mixedbread/types/store.py @@ -20,7 +20,7 @@ class ConfigContextualizationContextualizationConfig(BaseModel): """ -ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig, None] +ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig] class Config(BaseModel): diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py index e9971d9d..92cece44 100644 --- a/src/mixedbread/types/store_create_params.py +++ b/src/mixedbread/types/store_create_params.py @@ -48,5 +48,5 @@ class ConfigContextualizationContextualizationConfig(TypedDict, total=False): class Config(TypedDict, total=False): - contextualization: Optional[ConfigContextualization] + contextualization: ConfigContextualization """Contextualize files with metadata""" From 0b6a81c5910bb91dd2a733c4c02e0df42942689b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 23:22:10 +0000 Subject: [PATCH 3/6] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index fe0dd56b..eb55da54 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 62 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b091721a627d75feb8567f628f99405d5778b0b88e9cc09fc664dd8e97c6d720.yml openapi_spec_hash: a23a2aecdcff5fa1d6c8cdc0df0bdfb7 -config_hash: 22ce3b96e325037f81e7dbf22bdd8d24 +config_hash: c56a6c9375e7640ce70ff00420e8605a From ec7828bf0ef4e93eeccb2b734d0a9308ff366498 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 06:07:49 +0000 Subject: [PATCH 4/6] chore(internal): grammar fix (it's -> its) --- src/mixedbread/_utils/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixedbread/_utils/_utils.py b/src/mixedbread/_utils/_utils.py index 50d59269..eec7f4a1 100644 --- a/src/mixedbread/_utils/_utils.py +++ b/src/mixedbread/_utils/_utils.py @@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: # Type safe methods for narrowing types with TypeVars. # The default narrowing for isinstance(obj, dict) is dict[unknown, unknown], # however this cause Pyright to rightfully report errors. As we know we don't -# care about the contained types we can safely use `object` in it's place. +# care about the contained types we can safely use `object` in its place. # # There are two separate functions defined, `is_*` and `is_*_t` for different use cases. # `is_*` is for when you're dealing with an unknown input From 6aa3886a760680bc28b3483ee614c687e4622d80 Mon Sep 17 00:00:00 2001 From: Joel Dierkes Date: Tue, 4 Nov 2025 10:55:29 -0800 Subject: [PATCH 5/6] chore: add the external id and parsing strategy --- src/mixedbread/resources/stores/files.py | 118 +++++++++++++++++++++-- 1 file changed, 109 insertions(+), 9 deletions(-) diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py index ed7729bc..393acf4d 100644 --- a/src/mixedbread/resources/stores/files.py +++ b/src/mixedbread/resources/stores/files.py @@ -356,7 +356,7 @@ def search( def poll( self, - file_id: str, + file_identifier: str, *, store_identifier: str, poll_interval_ms: int | NotGiven = not_given, @@ -366,7 +366,7 @@ def poll( """ Poll for a file's status until it reaches a terminal state. Args: - file_id: The ID of the file to poll + file_identifier: The ID or external_id of the file to poll store_identifier: The ID of the store poll_interval_ms: The interval between polls in milliseconds poll_timeout_ms: The maximum time to poll for in milliseconds @@ -376,7 +376,7 @@ def poll( polling_interval_ms = poll_interval_ms or 500 polling_timeout_ms = poll_timeout_ms or None return polling.poll( - fn=functools.partial(self.retrieve, file_id, store_identifier=store_identifier, **kwargs), + fn=functools.partial(self.retrieve, file_identifier, store_identifier=store_identifier, **kwargs), condition=lambda res: res.status == "completed" or res.status == "failed" or res.status == "cancelled", interval_seconds=polling_interval_ms / 1000, timeout_seconds=polling_timeout_ms / 1000 if polling_timeout_ms else None, @@ -388,6 +388,9 @@ def create_and_poll( *, store_identifier: str, metadata: Optional[object] | NotGiven = not_given, + config: file_create_params.Config | Omit = omit, + external_id: Optional[str] | Omit = omit, + overwrite: bool | Omit = omit, experimental: file_create_params.Experimental | Omit = omit, poll_interval_ms: int | NotGiven = not_given, poll_timeout_ms: float | NotGiven = not_given, @@ -405,7 +408,14 @@ def create_and_poll( The file object once it reaches a terminal state """ self.create( - store_identifier=store_identifier, file_id=file_id, metadata=metadata, experimental=experimental, **kwargs + store_identifier=store_identifier, + file_id=file_id, + metadata=metadata, + config=config, + external_id=external_id, + overwrite=overwrite, + experimental=experimental, + **kwargs, ) return self.poll( file_id, @@ -421,18 +431,39 @@ def upload( store_identifier: str, file: FileTypes, metadata: Optional[object] | Omit = omit, + config: file_create_params.Config | Omit = omit, + external_id: Optional[str] | Omit = omit, + overwrite: bool | Omit = omit, experimental: file_create_params.Experimental | Omit = omit, **kwargs: Any, ) -> StoreFile: """Upload a file to the `files` API and then attach it to the given store. Note the file will be asynchronously processed (you can use the alternative polling helper method to wait for processing to complete). + + Args: + store_identifier: The ID or name of the store + file: The file to upload + metadata: Optional metadata for the file + config: Configuration for adding the file + external_id: External identifier for this file in the store + overwrite: If true, overwrite an existing file with the same external_id + experimental: Configuration for a 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 + Returns: + The file object once it reaches a terminal state """ file_obj = self._client.files.create(file=file, **kwargs) return self.create( store_identifier=store_identifier, file_id=file_obj.id, metadata=metadata, + config=config, + external_id=external_id, + overwrite=overwrite, experimental=experimental, **kwargs, ) @@ -443,17 +474,37 @@ def upload_and_poll( store_identifier: str, file: FileTypes, metadata: Optional[object] | NotGiven = not_given, + config: file_create_params.Config | Omit = omit, + external_id: Optional[str] | Omit = omit, + overwrite: bool | Omit = omit, experimental: file_create_params.Experimental | Omit = omit, poll_interval_ms: int | NotGiven = not_given, poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> StoreFile: - """Add a file to a store and poll until processing is complete.""" + """Add a file to a store and poll until processing is complete. + + Args: + store_identifier: The ID or name of the store + file: The file to upload + metadata: Optional metadata for the file + config: Configuration for adding the file + external_id: External identifier for this file in the store + overwrite: If true, overwrite an existing file with the same external_id + experimental: Configuration for a file. + poll_interval_ms: The interval between polls in milliseconds + poll_timeout_ms: The maximum time to poll for in milliseconds + Returns: + The file object once it reaches a terminal state + """ file_obj = self._client.files.create(file=file, **kwargs) return self.create_and_poll( store_identifier=store_identifier, file_id=file_obj.id, metadata=metadata, + config=config, + external_id=external_id, + overwrite=overwrite, experimental=experimental, poll_interval_ms=poll_interval_ms, poll_timeout_ms=poll_timeout_ms, @@ -790,7 +841,7 @@ async def search( async def poll( self, - file_id: str, + file_identifier: str, *, store_identifier: str, poll_interval_ms: int | NotGiven = not_given, @@ -800,7 +851,7 @@ async def poll( """ Poll for a file's status until it reaches a terminal state. Args: - file_id: The ID of the file to poll + file_identifier: The ID or external_id of the file to poll store_identifier: The ID of the store poll_interval_ms: The interval between polls in milliseconds poll_timeout_ms: The maximum time to poll for in milliseconds @@ -810,7 +861,7 @@ async def poll( polling_interval_ms = poll_interval_ms or 500 polling_timeout_ms = poll_timeout_ms or None return await polling.poll_async( - fn=functools.partial(self.retrieve, file_id, store_identifier=store_identifier, **kwargs), + fn=functools.partial(self.retrieve, file_identifier, store_identifier=store_identifier, **kwargs), condition=lambda res: res.status == "completed" or res.status == "failed" or res.status == "cancelled", interval_seconds=polling_interval_ms / 1000, timeout_seconds=polling_timeout_ms / 1000 if polling_timeout_ms else None, @@ -822,6 +873,9 @@ async def create_and_poll( *, store_identifier: str, metadata: Optional[object] | NotGiven = not_given, + config: file_create_params.Config | Omit = omit, + external_id: Optional[str] | Omit = omit, + overwrite: bool | Omit = omit, experimental: file_create_params.Experimental | Omit = omit, poll_interval_ms: int | NotGiven = not_given, poll_timeout_ms: float | NotGiven = not_given, @@ -833,6 +887,10 @@ async def create_and_poll( file_id: The ID of the file to poll store_identifier: The ID of the store metadata: The metadata to attach to the file + config: Configuration for adding the file + external_id: External identifier for this file in the store + overwrite: If true, overwrite an existing file with the same external_id + experimental: Configuration for a file. poll_interval_ms: The interval between polls in milliseconds poll_timeout_ms: The maximum time to poll for in milliseconds Returns: @@ -842,6 +900,9 @@ async def create_and_poll( store_identifier=store_identifier, file_id=file_id, metadata=metadata, + config=config, + external_id=external_id, + overwrite=overwrite, experimental=experimental, **kwargs, ) @@ -859,18 +920,37 @@ async def upload( store_identifier: str, file: FileTypes, metadata: Optional[object] | NotGiven = not_given, + config: file_create_params.Config | Omit = omit, + external_id: Optional[str] | Omit = omit, + overwrite: bool | Omit = omit, experimental: file_create_params.Experimental | Omit = omit, **kwargs: Any, ) -> StoreFile: """Upload a file to the `files` API and then attach it to the given vector store. Note the file will be asynchronously processed (you can use the alternative polling helper method to wait for processing to complete). + + Args: + store_identifier: The ID or name of the store + file: The file to upload + metadata: Optional metadata for the file + config: Configuration for adding the file + external_id: External identifier for this file in the store + overwrite: If true, overwrite an existing file with the same external_id + experimental: Configuration for a file. + poll_interval_ms: The interval between polls in milliseconds + poll_timeout_ms: The maximum time to poll for in milliseconds + Returns: + The file object once it reaches a terminal state """ file_obj = await self._client.files.create(file=file, **kwargs) return await self.create( store_identifier=store_identifier, file_id=file_obj.id, metadata=metadata, + config=config, + external_id=external_id, + overwrite=overwrite, experimental=experimental, **kwargs, ) @@ -881,17 +961,37 @@ async def upload_and_poll( store_identifier: str, file: FileTypes, metadata: Optional[object] | NotGiven = not_given, + config: file_create_params.Config | Omit = omit, + external_id: Optional[str] | Omit = omit, + overwrite: bool | Omit = omit, experimental: file_create_params.Experimental | Omit = omit, poll_interval_ms: int | NotGiven = not_given, poll_timeout_ms: float | NotGiven = not_given, **kwargs: Any, ) -> StoreFile: - """Add a file to a store and poll until processing is complete.""" + """Add a file to a store and poll until processing is complete. + + Args: + store_identifier: The ID or name of the store + file: The file to upload + metadata: Optional metadata for the file + config: Configuration for adding the file + external_id: External identifier for this file in the store + overwrite: If true, overwrite an existing file with the same external_id + experimental: Configuration for a file. + poll_interval_ms: The interval between polls in milliseconds + poll_timeout_ms: The maximum time to poll for in milliseconds + Returns: + The file object once it reaches a terminal state + """ file_obj = await self._client.files.create(file=file, **kwargs) return await self.create_and_poll( store_identifier=store_identifier, file_id=file_obj.id, metadata=metadata, + config=config, + external_id=external_id, + overwrite=overwrite, experimental=experimental, poll_interval_ms=poll_interval_ms, poll_timeout_ms=poll_timeout_ms, From 31187b03a29b146c4ab68b6e471a85d64f927521 Mon Sep 17 00:00:00 2001 From: Joel Dierkes Date: Tue, 4 Nov 2025 10:57:57 -0800 Subject: [PATCH 6/6] chore: sort import block --- src/mixedbread/resources/stores/files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py index 393acf4d..1e871645 100644 --- a/src/mixedbread/resources/stores/files.py +++ b/src/mixedbread/resources/stores/files.py @@ -8,7 +8,7 @@ import httpx from ...lib import polling -from ..._types import Body, FileTypes, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource