diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ea2682c3..52afe059 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.41.0" + ".": "0.42.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 31055583..e1032ca6 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-e9dc6c785e53888e6234a39f02c1a5c8b71dd423e4b7b31aa963324b713bf240.yml -openapi_spec_hash: 31f9db79886e161a1696309b67d3997c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-bc57b04eacad32c8e89b4d6eac2a369fd0b013bb7be49b698a3372d6393753f7.yml +openapi_spec_hash: 2591884e7b1b6c328cb5a88449282ccd config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71 diff --git a/CHANGELOG.md b/CHANGELOG.md index 56cb16e8..9f647226 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 0.42.0 (2025-12-09) + +Full Changelog: [v0.41.0...v0.42.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.41.0...v0.42.0) + +### Features + +* **api:** api update ([b68552a](https://github.com/mixedbread-ai/mixedbread-python/commit/b68552a2d589b6d8fffde474f9380c55987039fd)) +* **api:** api update ([827c1c9](https://github.com/mixedbread-ai/mixedbread-python/commit/827c1c990ef63105a07fcc7343c412b8dc0adfef)) + + +### Bug Fixes + +* ensure streams are always closed ([28298c9](https://github.com/mixedbread-ai/mixedbread-python/commit/28298c9a679d40727c20d51c3e67c765db2d1801)) +* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([601ab69](https://github.com/mixedbread-ai/mixedbread-python/commit/601ab69a5e91c17f6e2973414371e77e0f2b7f0d)) + + +### Chores + +* add missing docstrings ([1935ebc](https://github.com/mixedbread-ai/mixedbread-python/commit/1935ebcea34df71c8839264cffa9076d924712f1)) +* add Python 3.14 classifier and testing ([96031f8](https://github.com/mixedbread-ai/mixedbread-python/commit/96031f8ee44ce757efcb0d73377530a4179f9c77)) +* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([fcb918d](https://github.com/mixedbread-ai/mixedbread-python/commit/fcb918dcd2bd7fe6de849981d1c224b6623b1d40)) +* **docs:** use environment variables for authentication in code snippets ([98093d0](https://github.com/mixedbread-ai/mixedbread-python/commit/98093d0c07f4f14de4d82bbc015cb9aa06f2fab7)) +* update lockfile ([8f57fad](https://github.com/mixedbread-ai/mixedbread-python/commit/8f57fad79bd7cd01ef1fcdbb4b648b16cc548109)) + ## 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) diff --git a/README.md b/README.md index fc0e2f30..33fcbd13 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ pip install mixedbread[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python +import os import asyncio from mixedbread import DefaultAioHttpClient from mixedbread import AsyncMixedbread @@ -90,7 +91,7 @@ from mixedbread import AsyncMixedbread async def main() -> None: async with AsyncMixedbread( - api_key="My API Key", + api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: store = await client.stores.create() diff --git a/pyproject.toml b/pyproject.toml index e23c54f4..110a7d5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,22 @@ [project] name = "mixedbread" -version = "0.41.0" +version = "0.42.0" description = "The official Python library for the Mixedbread API" dynamic = ["readme"] license = "Apache-2.0" authors = [ { name = "Mixedbread", email = "support@mixedbread.com" }, ] + dependencies = [ - "httpx>=0.23.0, <1", - "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", - "anyio>=3.5.0, <5", - "distro>=1.7.0, <2", - "sniffio", + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.10, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", ] + requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", @@ -24,6 +26,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", @@ -45,7 +48,7 @@ managed = true # version pins are in requirements-dev.lock dev-dependencies = [ "pyright==1.1.399", - "mypy", + "mypy==1.17", "respx", "pytest", "pytest-asyncio", diff --git a/requirements-dev.lock b/requirements-dev.lock index 3813c2e4..fe8d5892 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,40 +12,45 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via httpx-aiohttp # via mixedbread -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via httpx # via mixedbread -argcomplete==3.1.2 +argcomplete==3.6.3 # via nox async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 + # via nox +backports-asyncio-runner==1.2.0 + # via pytest-asyncio +certifi==2025.11.12 # via httpcore # via httpx -colorlog==6.7.0 +colorlog==6.10.1 + # via nox +dependency-groups==1.3.1 # via nox -dirty-equals==0.6.0 -distlib==0.3.7 +dirty-equals==0.11 +distlib==0.4.0 # via virtualenv -distro==1.8.0 +distro==1.9.0 # via mixedbread -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio # via pytest -execnet==2.1.1 +execnet==2.1.2 # via pytest-xdist -filelock==3.12.4 +filelock==3.19.1 # via virtualenv -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -58,80 +63,87 @@ httpx==0.28.1 # via respx httpx-aiohttp==0.1.9 # via mixedbread -idna==3.4 +humanize==4.13.0 + # via nox +idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==7.0.0 -iniconfig==2.0.0 +importlib-metadata==8.7.0 +iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -mypy==1.14.1 -mypy-extensions==1.0.0 +mypy==1.17.0 +mypy-extensions==1.1.0 # via mypy -nodeenv==1.8.0 +nodeenv==1.9.1 # via pyright -nox==2023.4.22 -packaging==23.2 +nox==2025.11.12 +packaging==25.0 + # via dependency-groups # via nox # via pytest -platformdirs==3.11.0 +pathspec==0.12.1 + # via mypy +platformdirs==4.4.0 # via virtualenv -pluggy==1.5.0 +pluggy==1.6.0 # via pytest -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via mixedbread -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -pygments==2.18.0 +pygments==2.19.2 + # via pytest # via rich pyright==1.1.399 -pytest==8.3.3 +pytest==8.4.2 # via pytest-asyncio # via pytest-xdist -pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.8.2 +pytest-asyncio==1.2.0 +pytest-xdist==3.8.0 +python-dateutil==2.9.0.post0 # via time-machine -pytz==2023.3.post1 - # via dirty-equals respx==0.22.0 -rich==13.7.1 -ruff==0.9.4 -setuptools==68.2.2 - # via nodeenv -six==1.16.0 +rich==14.2.0 +ruff==0.14.7 +six==1.17.0 # via python-dateutil -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via mixedbread -time-machine==2.9.0 -tomli==2.0.2 +time-machine==2.19.0 +tomli==2.3.0 + # via dependency-groups # via mypy + # via nox # via pytest -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via mixedbread # via multidict # via mypy # via pydantic # via pydantic-core # via pyright + # via pytest-asyncio # via typing-inspection -typing-inspection==0.4.1 + # via virtualenv +typing-inspection==0.4.2 # via pydantic -virtualenv==20.24.5 +virtualenv==20.35.4 # via nox -yarl==1.20.0 +yarl==1.22.0 # via aiohttp -zipp==3.17.0 +zipp==3.23.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index 8d80628d..1161d859 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,28 +12,28 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via httpx-aiohttp # via mixedbread -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via httpx # via mixedbread async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 +certifi==2025.11.12 # via httpcore # via httpx -distro==1.8.0 +distro==1.9.0 # via mixedbread -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -45,31 +45,32 @@ httpx==0.28.1 # via mixedbread httpx-aiohttp==0.1.9 # via mixedbread -idna==3.4 +idna==3.11 # via anyio # via httpx # via yarl -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via mixedbread -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via mixedbread -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via mixedbread # via multidict # via pydantic # via pydantic-core # via typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic -yarl==1.20.0 +yarl==1.22.0 # via aiohttp diff --git a/src/mixedbread/_streaming.py b/src/mixedbread/_streaming.py index ffe39031..e7f6340f 100644 --- a/src/mixedbread/_streaming.py +++ b/src/mixedbread/_streaming.py @@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - response.close() + try: + for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + response.close() def __enter__(self) -> Self: return self @@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - async for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - await response.aclose() + try: + async for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + await response.aclose() async def __aenter__(self) -> Self: return self diff --git a/src/mixedbread/_types.py b/src/mixedbread/_types.py index 97471b6c..78d87ade 100644 --- a/src/mixedbread/_types.py +++ b/src/mixedbread/_types.py @@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False): if TYPE_CHECKING: # This works because str.__contains__ does not accept object (either in typeshed or at runtime) # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + # + # Note: index() and count() methods are intentionally omitted to allow pyright to properly + # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr. class SequenceNotStr(Protocol[_T_co]): @overload def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... @@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... def __contains__(self, value: object, /) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T_co]: ... - def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... - def count(self, value: Any, /) -> int: ... def __reversed__(self) -> Iterator[_T_co]: ... else: # just point this to a normal `Sequence` at runtime to avoid having to special case diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py index 5f340587..6f179c9f 100644 --- a/src/mixedbread/_version.py +++ b/src/mixedbread/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "mixedbread" -__version__ = "0.41.0" # x-release-please-version +__version__ = "0.42.0" # x-release-please-version diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py index 970b6a4c..2f303d68 100644 --- a/src/mixedbread/resources/stores/files.py +++ b/src/mixedbread/resources/stores/files.py @@ -183,6 +183,7 @@ def list( include_total: bool | Omit = omit, statuses: Optional[List[StoreFileStatus]] | Omit = omit, metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit, + q: Optional[str] | 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, @@ -215,6 +216,8 @@ def list( metadata_filter: Metadata filter to apply to the query + q: Search query for fuzzy matching over name and description fields + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -235,6 +238,7 @@ def list( "include_total": include_total, "statuses": statuses, "metadata_filter": metadata_filter, + "q": q, }, file_list_params.FileListParams, ), @@ -669,6 +673,7 @@ async def list( include_total: bool | Omit = omit, statuses: Optional[List[StoreFileStatus]] | Omit = omit, metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit, + q: Optional[str] | 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, @@ -701,6 +706,8 @@ async def list( metadata_filter: Metadata filter to apply to the query + q: Search query for fuzzy matching over name and description fields + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -721,6 +728,7 @@ async def list( "include_total": include_total, "statuses": statuses, "metadata_filter": metadata_filter, + "q": q, }, file_list_params.FileListParams, ), diff --git a/src/mixedbread/types/api_key.py b/src/mixedbread/types/api_key.py index 87a23797..f3238c19 100644 --- a/src/mixedbread/types/api_key.py +++ b/src/mixedbread/types/api_key.py @@ -18,6 +18,8 @@ class Scope(BaseModel): class APIKey(BaseModel): + """Response model for an API key.""" + id: str """The ID of the API key""" diff --git a/src/mixedbread/types/api_key_created.py b/src/mixedbread/types/api_key_created.py index 08f16806..ae748920 100644 --- a/src/mixedbread/types/api_key_created.py +++ b/src/mixedbread/types/api_key_created.py @@ -18,6 +18,8 @@ class Scope(BaseModel): class APIKeyCreated(BaseModel): + """Response model for creating an API key.""" + id: str """The ID of the API key""" diff --git a/src/mixedbread/types/api_key_delete_response.py b/src/mixedbread/types/api_key_delete_response.py index e3fc0590..31e87669 100644 --- a/src/mixedbread/types/api_key_delete_response.py +++ b/src/mixedbread/types/api_key_delete_response.py @@ -9,6 +9,8 @@ class APIKeyDeleteResponse(BaseModel): + """Response model for deleting an API key.""" + id: str """The ID of the deleted API key""" diff --git a/src/mixedbread/types/data_source.py b/src/mixedbread/types/data_source.py index eefb4d3d..d219ef28 100644 --- a/src/mixedbread/types/data_source.py +++ b/src/mixedbread/types/data_source.py @@ -13,6 +13,8 @@ class AuthParamsDataSourceAPIKeyParams(BaseModel): + """Authentication parameters for a API key data source.""" + type: Optional[Literal["api_key"]] = None api_key: str @@ -25,6 +27,8 @@ class AuthParamsDataSourceAPIKeyParams(BaseModel): class DataSource(BaseModel): + """Service-level representation of a data source.""" + id: str """The ID of the data source""" diff --git a/src/mixedbread/types/data_source_create_params.py b/src/mixedbread/types/data_source_create_params.py index 9cc9738a..9424a1de 100644 --- a/src/mixedbread/types/data_source_create_params.py +++ b/src/mixedbread/types/data_source_create_params.py @@ -34,6 +34,8 @@ class NotionDataSource(TypedDict, total=False): class NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False): + """Base class for API key create or update parameters.""" + type: Literal["api_key"] api_key: Required[str] diff --git a/src/mixedbread/types/data_source_delete_response.py b/src/mixedbread/types/data_source_delete_response.py index 6fe26744..98a38e0c 100644 --- a/src/mixedbread/types/data_source_delete_response.py +++ b/src/mixedbread/types/data_source_delete_response.py @@ -9,6 +9,8 @@ class DataSourceDeleteResponse(BaseModel): + """Deleted data source.""" + id: str """The ID of the data source""" diff --git a/src/mixedbread/types/data_source_oauth2_params.py b/src/mixedbread/types/data_source_oauth2_params.py index 3e9c8a90..b19f4a83 100644 --- a/src/mixedbread/types/data_source_oauth2_params.py +++ b/src/mixedbread/types/data_source_oauth2_params.py @@ -10,6 +10,8 @@ class DataSourceOauth2Params(BaseModel): + """Authentication parameters for a OAuth data source.""" + type: Optional[Literal["oauth2"]] = None created_at: Optional[datetime] = None diff --git a/src/mixedbread/types/data_source_update_params.py b/src/mixedbread/types/data_source_update_params.py index 9aa8872b..96880db4 100644 --- a/src/mixedbread/types/data_source_update_params.py +++ b/src/mixedbread/types/data_source_update_params.py @@ -34,6 +34,8 @@ class NotionDataSource(TypedDict, total=False): class NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False): + """Base class for API key create or update parameters.""" + type: Literal["api_key"] api_key: Required[str] diff --git a/src/mixedbread/types/data_sources/connector_delete_response.py b/src/mixedbread/types/data_sources/connector_delete_response.py index 1f320d3e..079ccf7f 100644 --- a/src/mixedbread/types/data_sources/connector_delete_response.py +++ b/src/mixedbread/types/data_sources/connector_delete_response.py @@ -9,6 +9,8 @@ class ConnectorDeleteResponse(BaseModel): + """Deleted connector.""" + id: str """The ID of the connector""" diff --git a/src/mixedbread/types/data_sources/data_source_connector.py b/src/mixedbread/types/data_sources/data_source_connector.py index 7534233d..0fc36723 100644 --- a/src/mixedbread/types/data_sources/data_source_connector.py +++ b/src/mixedbread/types/data_sources/data_source_connector.py @@ -10,6 +10,8 @@ class DataSourceConnector(BaseModel): + """Service-level representation of a connector.""" + id: str """The ID of the connector""" diff --git a/src/mixedbread/types/expires_after.py b/src/mixedbread/types/expires_after.py index 66126cb9..4c3843e1 100644 --- a/src/mixedbread/types/expires_after.py +++ b/src/mixedbread/types/expires_after.py @@ -9,6 +9,8 @@ class ExpiresAfter(BaseModel): + """Represents an expiration policy for a store.""" + anchor: Optional[Literal["last_active_at"]] = None """Anchor date for the expiration policy""" diff --git a/src/mixedbread/types/expires_after_param.py b/src/mixedbread/types/expires_after_param.py index 432f29d7..1715aacf 100644 --- a/src/mixedbread/types/expires_after_param.py +++ b/src/mixedbread/types/expires_after_param.py @@ -8,6 +8,8 @@ class ExpiresAfterParam(TypedDict, total=False): + """Represents an expiration policy for a store.""" + anchor: Literal["last_active_at"] """Anchor date for the expiration policy""" diff --git a/src/mixedbread/types/extractions/created_json_schema.py b/src/mixedbread/types/extractions/created_json_schema.py index 7208722b..dec87e18 100644 --- a/src/mixedbread/types/extractions/created_json_schema.py +++ b/src/mixedbread/types/extractions/created_json_schema.py @@ -8,5 +8,7 @@ class CreatedJsonSchema(BaseModel): + """Result of creating a JSON schema.""" + json_schema: Dict[str, object] """The created JSON schema""" diff --git a/src/mixedbread/types/extractions/enhanced_json_schema.py b/src/mixedbread/types/extractions/enhanced_json_schema.py index f555a7c0..2e789cce 100644 --- a/src/mixedbread/types/extractions/enhanced_json_schema.py +++ b/src/mixedbread/types/extractions/enhanced_json_schema.py @@ -8,5 +8,7 @@ class EnhancedJsonSchema(BaseModel): + """Result of enhancing a JSON schema.""" + json_schema: Dict[str, object] """The enhanced JSON schema""" diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py index 9c6114e3..b3bececf 100644 --- a/src/mixedbread/types/extractions/extraction_job.py +++ b/src/mixedbread/types/extractions/extraction_job.py @@ -11,6 +11,8 @@ class ExtractionJob(BaseModel): + """A job for extracting structured data from documents.""" + id: str """Unique identifier for the extraction job""" diff --git a/src/mixedbread/types/extractions/extraction_result.py b/src/mixedbread/types/extractions/extraction_result.py index b5206a09..fdf23e83 100644 --- a/src/mixedbread/types/extractions/extraction_result.py +++ b/src/mixedbread/types/extractions/extraction_result.py @@ -8,6 +8,8 @@ class ExtractionResult(BaseModel): + """The result of an extraction job.""" + data: Dict[str, object] warnings: List[str] diff --git a/src/mixedbread/types/extractions/image_url_input_param.py b/src/mixedbread/types/extractions/image_url_input_param.py index a4480f76..cb631e56 100644 --- a/src/mixedbread/types/extractions/image_url_input_param.py +++ b/src/mixedbread/types/extractions/image_url_input_param.py @@ -8,6 +8,8 @@ class ImageURL(TypedDict, total=False): + """The image input specification.""" + url: Required[str] """The image URL. Can be either a URL or a Data URI.""" @@ -16,6 +18,8 @@ class ImageURL(TypedDict, total=False): class ImageURLInputParam(TypedDict, total=False): + """Model for image input validation.""" + type: Literal["image_url"] """Input type identifier""" diff --git a/src/mixedbread/types/extractions/text_input_param.py b/src/mixedbread/types/extractions/text_input_param.py index d8829079..9b459cf5 100644 --- a/src/mixedbread/types/extractions/text_input_param.py +++ b/src/mixedbread/types/extractions/text_input_param.py @@ -8,6 +8,13 @@ class TextInputParam(TypedDict, total=False): + """Model for text input validation. + + Attributes: + type: Input type identifier, always "text" + text: The actual text content, with length and whitespace constraints + """ + type: Literal["text"] """Input type identifier""" diff --git a/src/mixedbread/types/extractions/validated_json_schema.py b/src/mixedbread/types/extractions/validated_json_schema.py index 784c4983..79b2dff5 100644 --- a/src/mixedbread/types/extractions/validated_json_schema.py +++ b/src/mixedbread/types/extractions/validated_json_schema.py @@ -8,6 +8,8 @@ class ValidatedJsonSchema(BaseModel): + """Result of validating a JSON schema.""" + is_valid: bool """Whether the schema is valid""" diff --git a/src/mixedbread/types/file_object.py b/src/mixedbread/types/file_object.py index a237cc0d..f677bd7f 100644 --- a/src/mixedbread/types/file_object.py +++ b/src/mixedbread/types/file_object.py @@ -8,6 +8,12 @@ class FileObject(BaseModel): + """A model representing a file object in the system. + + This model contains metadata about files stored in the system, including + identifiers, size information, and timestamps. + """ + id: str """Unique identifier for the file""" diff --git a/src/mixedbread/types/info_response.py b/src/mixedbread/types/info_response.py index a7184bcf..20844293 100644 --- a/src/mixedbread/types/info_response.py +++ b/src/mixedbread/types/info_response.py @@ -6,6 +6,8 @@ class InfoResponse(BaseModel): + """Info Pydantic Response Service Message""" + name: str version: str diff --git a/src/mixedbread/types/linear_data_source_param.py b/src/mixedbread/types/linear_data_source_param.py index 8956d2e3..69c2b431 100644 --- a/src/mixedbread/types/linear_data_source_param.py +++ b/src/mixedbread/types/linear_data_source_param.py @@ -11,6 +11,8 @@ class LinearDataSourceParam(TypedDict, total=False): + """Parameters for creating or updating a Linear data source.""" + type: Literal["linear"] """The type of data source to create""" diff --git a/src/mixedbread/types/multi_encoding_embedding.py b/src/mixedbread/types/multi_encoding_embedding.py index 8a7b3ca3..1d73d05c 100644 --- a/src/mixedbread/types/multi_encoding_embedding.py +++ b/src/mixedbread/types/multi_encoding_embedding.py @@ -10,6 +10,10 @@ class Embedding(BaseModel): + """ + The encoded embedding data by encoding format.Returned, if more than one encoding format is used. + """ + float: Optional[List[builtins.float]] = None int8: Optional[List[int]] = None diff --git a/src/mixedbread/types/notion_data_source_param.py b/src/mixedbread/types/notion_data_source_param.py index 65d12b2e..12409ef6 100644 --- a/src/mixedbread/types/notion_data_source_param.py +++ b/src/mixedbread/types/notion_data_source_param.py @@ -11,6 +11,8 @@ class AuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False): + """Base class for API key create or update parameters.""" + type: Literal["api_key"] api_key: Required[str] @@ -21,6 +23,8 @@ class AuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False): class NotionDataSourceParam(TypedDict, total=False): + """Parameters for creating or updating a Notion data source.""" + type: Literal["notion"] """The type of data source to create""" diff --git a/src/mixedbread/types/oauth2_params.py b/src/mixedbread/types/oauth2_params.py index 6b0e2fa8..4bbc79f6 100644 --- a/src/mixedbread/types/oauth2_params.py +++ b/src/mixedbread/types/oauth2_params.py @@ -8,4 +8,6 @@ class Oauth2Params(TypedDict, total=False): + """Base class for OAuth2 create or update parameters.""" + type: Literal["oauth2"] diff --git a/src/mixedbread/types/pagination_with_total.py b/src/mixedbread/types/pagination_with_total.py index 2e6bd456..07ad8fb0 100644 --- a/src/mixedbread/types/pagination_with_total.py +++ b/src/mixedbread/types/pagination_with_total.py @@ -8,6 +8,8 @@ class PaginationWithTotal(BaseModel): + """Pagination model that includes total count of items.""" + limit: Optional[int] = None """Maximum number of items to return per page""" diff --git a/src/mixedbread/types/parsing/element_type.py b/src/mixedbread/types/parsing/element_type.py index 011208d8..e655f0b3 100644 --- a/src/mixedbread/types/parsing/element_type.py +++ b/src/mixedbread/types/parsing/element_type.py @@ -5,15 +5,15 @@ __all__ = ["ElementType"] ElementType: TypeAlias = Literal[ - "caption", - "footnote", - "formula", - "list-item", - "page-footer", - "page-header", - "picture", + "header", + "footer", + "title", "section-header", + "page-number", + "list-item", + "figure", "table", + "form", "text", - "title", + "footnote", ] diff --git a/src/mixedbread/types/parsing/job_delete_response.py b/src/mixedbread/types/parsing/job_delete_response.py index a6fcab70..3f2cccf9 100644 --- a/src/mixedbread/types/parsing/job_delete_response.py +++ b/src/mixedbread/types/parsing/job_delete_response.py @@ -9,6 +9,8 @@ class JobDeleteResponse(BaseModel): + """A deleted parsing job.""" + id: str """The ID of the deleted job""" diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py index 14b52eb4..0ba5cd73 100644 --- a/src/mixedbread/types/parsing/job_list_response.py +++ b/src/mixedbread/types/parsing/job_list_response.py @@ -11,6 +11,8 @@ class JobListResponse(BaseModel): + """A parsing job item for list responses, omitting result and error fields.""" + id: str """The ID of the job""" diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py index 7eaa134d..ab447ff8 100644 --- a/src/mixedbread/types/parsing/parsing_job.py +++ b/src/mixedbread/types/parsing/parsing_job.py @@ -14,6 +14,8 @@ class ResultChunkElement(BaseModel): + """Represents an extracted element from a document with its content and metadata.""" + type: ElementType """The type of the extracted element""" @@ -34,6 +36,8 @@ class ResultChunkElement(BaseModel): class ResultChunk(BaseModel): + """A chunk of text extracted from a document page.""" + content: Optional[str] = None """The full content of the chunk""" @@ -45,6 +49,8 @@ class ResultChunk(BaseModel): class Result(BaseModel): + """Result of document parsing operation.""" + chunking_strategy: ChunkingStrategy """The strategy used for chunking the document""" @@ -62,6 +68,8 @@ class Result(BaseModel): class ParsingJob(BaseModel): + """A job for parsing documents with its current state and result.""" + id: str """The ID of the job""" diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py index 107ae57e..68a8d369 100644 --- a/src/mixedbread/types/scored_audio_url_input_chunk.py +++ b/src/mixedbread/types/scored_audio_url_input_chunk.py @@ -186,6 +186,8 @@ def __getattr__(self, attr: str) -> object: ... class AudioURL(BaseModel): + """The audio input specification.""" + url: str """The audio URL. Can be either a URL or a Data URI.""" diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py index fc929eb4..c142e5c4 100644 --- a/src/mixedbread/types/scored_image_url_input_chunk.py +++ b/src/mixedbread/types/scored_image_url_input_chunk.py @@ -186,6 +186,8 @@ def __getattr__(self, attr: str) -> object: ... class ImageURL(BaseModel): + """The image input specification.""" + url: str """The image URL. Can be either a URL or a Data URI.""" diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py index 488f80d0..388c87ce 100644 --- a/src/mixedbread/types/scored_video_url_input_chunk.py +++ b/src/mixedbread/types/scored_video_url_input_chunk.py @@ -186,6 +186,8 @@ def __getattr__(self, attr: str) -> object: ... class VideoURL(BaseModel): + """The video input specification.""" + url: str """The video URL. Can be either a URL or a Data URI.""" diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py index 45e367a5..c502e6db 100644 --- a/src/mixedbread/types/shared/search_filter.py +++ b/src/mixedbread/types/shared/search_filter.py @@ -28,6 +28,8 @@ class SearchFilter(BaseModel): + """Represents a filter with AND, OR, and NOT conditions.""" + all: Optional[List[All]] = None """List of conditions or filters to be ANDed together""" diff --git a/src/mixedbread/types/shared/search_filter_condition.py b/src/mixedbread/types/shared/search_filter_condition.py index 36309f1d..f50a91e1 100644 --- a/src/mixedbread/types/shared/search_filter_condition.py +++ b/src/mixedbread/types/shared/search_filter_condition.py @@ -8,11 +8,15 @@ class SearchFilterCondition(BaseModel): + """Represents a condition with a field, operator, and value.""" + key: str """The field to apply the condition on""" value: object """The value to compare against""" - operator: Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like"] + operator: Literal[ + "eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like", "regex" + ] """The operator for the condition""" diff --git a/src/mixedbread/types/shared_params/search_filter.py b/src/mixedbread/types/shared_params/search_filter.py index 02870e0e..fd468f38 100644 --- a/src/mixedbread/types/shared_params/search_filter.py +++ b/src/mixedbread/types/shared_params/search_filter.py @@ -27,6 +27,8 @@ class SearchFilter(TypedDict, total=False): + """Represents a filter with AND, OR, and NOT conditions.""" + all: Optional[Iterable[All]] """List of conditions or filters to be ANDed together""" diff --git a/src/mixedbread/types/shared_params/search_filter_condition.py b/src/mixedbread/types/shared_params/search_filter_condition.py index 83863974..86efe345 100644 --- a/src/mixedbread/types/shared_params/search_filter_condition.py +++ b/src/mixedbread/types/shared_params/search_filter_condition.py @@ -8,6 +8,8 @@ class SearchFilterCondition(TypedDict, total=False): + """Represents a condition with a field, operator, and value.""" + key: Required[str] """The field to apply the condition on""" @@ -15,6 +17,6 @@ class SearchFilterCondition(TypedDict, total=False): """The value to compare against""" operator: Required[ - Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like"] + Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like", "regex"] ] """The operator for the condition""" diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py index c380b69f..03c809d4 100644 --- a/src/mixedbread/types/store.py +++ b/src/mixedbread/types/store.py @@ -24,11 +24,15 @@ class ConfigContextualizationContextualizationConfig(BaseModel): class Config(BaseModel): + """Configuration for a store.""" + contextualization: Optional[ConfigContextualization] = None """Contextualize files with metadata""" class FileCounts(BaseModel): + """Counts of files in different states""" + pending: Optional[int] = None """Number of files waiting to be processed""" @@ -49,6 +53,8 @@ class FileCounts(BaseModel): class Store(BaseModel): + """Model representing a store with its metadata and timestamps.""" + id: str """Unique identifier for the store""" @@ -88,6 +94,9 @@ class Store(BaseModel): usage_bytes: Optional[int] = None """Total storage usage in bytes""" + usage_tokens: Optional[int] = None + """Total storage usage in tokens""" + expires_at: Optional[datetime] = None """Optional expiration timestamp for the store""" diff --git a/src/mixedbread/types/store_chunk_search_options_param.py b/src/mixedbread/types/store_chunk_search_options_param.py index 89c64712..1b472ea1 100644 --- a/src/mixedbread/types/store_chunk_search_options_param.py +++ b/src/mixedbread/types/store_chunk_search_options_param.py @@ -13,6 +13,8 @@ class StoreChunkSearchOptionsParam(TypedDict, total=False): + """Options for configuring store chunk searches.""" + score_threshold: float """Minimum similarity score threshold""" diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py index 92cece44..1c60761d 100644 --- a/src/mixedbread/types/store_create_params.py +++ b/src/mixedbread/types/store_create_params.py @@ -48,5 +48,7 @@ class ConfigContextualizationContextualizationConfig(TypedDict, total=False): class Config(TypedDict, total=False): + """Configuration for a store.""" + contextualization: ConfigContextualization """Contextualize files with metadata""" diff --git a/src/mixedbread/types/store_delete_response.py b/src/mixedbread/types/store_delete_response.py index c35970ab..5a57079e 100644 --- a/src/mixedbread/types/store_delete_response.py +++ b/src/mixedbread/types/store_delete_response.py @@ -9,6 +9,8 @@ class StoreDeleteResponse(BaseModel): + """Response model for store deletion.""" + id: str """ID of the deleted store""" diff --git a/src/mixedbread/types/store_metadata_facets_response.py b/src/mixedbread/types/store_metadata_facets_response.py index 989562c4..6b993206 100644 --- a/src/mixedbread/types/store_metadata_facets_response.py +++ b/src/mixedbread/types/store_metadata_facets_response.py @@ -8,5 +8,7 @@ class StoreMetadataFacetsResponse(BaseModel): + """Represents metadata facets for a store.""" + facets: Dict[str, Dict[str, object]] """Metadata facets""" diff --git a/src/mixedbread/types/store_question_answering_params.py b/src/mixedbread/types/store_question_answering_params.py index 37366a6f..26abbb4e 100644 --- a/src/mixedbread/types/store_question_answering_params.py +++ b/src/mixedbread/types/store_question_answering_params.py @@ -47,6 +47,8 @@ class StoreQuestionAnsweringParams(TypedDict, total=False): class QaOptions(TypedDict, total=False): + """Question answering configuration options""" + cite: bool """Whether to use citations""" diff --git a/src/mixedbread/types/store_question_answering_response.py b/src/mixedbread/types/store_question_answering_response.py index f47f71b3..dd726f24 100644 --- a/src/mixedbread/types/store_question_answering_response.py +++ b/src/mixedbread/types/store_question_answering_response.py @@ -19,6 +19,8 @@ class StoreQuestionAnsweringResponse(BaseModel): + """Results from a question answering operation.""" + answer: str """The answer generated by the LLM""" diff --git a/src/mixedbread/types/stores/file_create_params.py b/src/mixedbread/types/stores/file_create_params.py index 76441bf9..c776ea33 100644 --- a/src/mixedbread/types/stores/file_create_params.py +++ b/src/mixedbread/types/stores/file_create_params.py @@ -29,10 +29,14 @@ class FileCreateParams(TypedDict, total=False): class Config(TypedDict, total=False): + """Configuration for adding the file""" + parsing_strategy: Literal["fast", "high_quality"] """Strategy for adding the file, this overrides the store-level default""" class Experimental(TypedDict, total=False): + """Configuration for a file.""" + parsing_strategy: Literal["fast", "high_quality"] """Strategy for adding the file, this overrides the store-level default""" diff --git a/src/mixedbread/types/stores/file_delete_response.py b/src/mixedbread/types/stores/file_delete_response.py index ada45e9c..5788f3f8 100644 --- a/src/mixedbread/types/stores/file_delete_response.py +++ b/src/mixedbread/types/stores/file_delete_response.py @@ -9,6 +9,8 @@ class FileDeleteResponse(BaseModel): + """Response model for file deletion.""" + id: str """ID of the deleted file""" diff --git a/src/mixedbread/types/stores/file_list_params.py b/src/mixedbread/types/stores/file_list_params.py index 27edd05e..2782573a 100644 --- a/src/mixedbread/types/stores/file_list_params.py +++ b/src/mixedbread/types/stores/file_list_params.py @@ -36,6 +36,9 @@ class FileListParams(TypedDict, total=False): metadata_filter: Optional[MetadataFilter] """Metadata filter to apply to the query""" + q: Optional[str] + """Search query for fuzzy matching over name and description fields""" + MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition] diff --git a/src/mixedbread/types/stores/file_list_response.py b/src/mixedbread/types/stores/file_list_response.py index 2d47abcc..6ddaf8f1 100644 --- a/src/mixedbread/types/stores/file_list_response.py +++ b/src/mixedbread/types/stores/file_list_response.py @@ -10,6 +10,8 @@ class Pagination(BaseModel): + """Response model for cursor-based pagination.""" + has_more: bool """ Contextual direction-aware flag: True if more items exist in the requested diff --git a/src/mixedbread/types/stores/file_search_params.py b/src/mixedbread/types/stores/file_search_params.py index 8558e0c8..a5d16ed2 100644 --- a/src/mixedbread/types/stores/file_search_params.py +++ b/src/mixedbread/types/stores/file_search_params.py @@ -40,6 +40,8 @@ class FileSearchParams(TypedDict, total=False): class SearchOptions(TypedDict, total=False): + """Search configuration options""" + score_threshold: float """Minimum similarity score threshold""" diff --git a/src/mixedbread/types/stores/scored_store_file.py b/src/mixedbread/types/stores/scored_store_file.py index 3d8a3c02..87483138 100644 --- a/src/mixedbread/types/stores/scored_store_file.py +++ b/src/mixedbread/types/stores/scored_store_file.py @@ -16,6 +16,8 @@ class Config(BaseModel): + """Configuration for a file.""" + parsing_strategy: Optional[Literal["fast", "high_quality"]] = None """Strategy for adding the file, this overrides the store-level default""" @@ -27,6 +29,8 @@ class Config(BaseModel): class ScoredStoreFile(BaseModel): + """Represents a scored store file.""" + id: str """Unique identifier for the file""" @@ -57,6 +61,9 @@ class ScoredStoreFile(BaseModel): usage_bytes: Optional[int] = None """Storage usage in bytes""" + usage_tokens: Optional[int] = None + """Storage usage in tokens""" + config: Optional[Config] = None """Configuration for a file.""" diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py index dccbbe40..133f054e 100644 --- a/src/mixedbread/types/stores/store_file.py +++ b/src/mixedbread/types/stores/store_file.py @@ -57,6 +57,8 @@ class Config(BaseModel): + """Configuration for a file.""" + parsing_strategy: Optional[Literal["fast", "high_quality"]] = None """Strategy for adding the file, this overrides the store-level default""" @@ -419,6 +421,8 @@ def __getattr__(self, attr: str) -> object: ... class ChunkImageURLInputChunkImageURL(BaseModel): + """The image input specification.""" + url: str """The image URL. Can be either a URL or a Data URI.""" @@ -620,6 +624,8 @@ def __getattr__(self, attr: str) -> object: ... class ChunkAudioURLInputChunkAudioURL(BaseModel): + """The audio input specification.""" + url: str """The audio URL. Can be either a URL or a Data URI.""" @@ -821,6 +827,8 @@ def __getattr__(self, attr: str) -> object: ... class ChunkVideoURLInputChunkVideoURL(BaseModel): + """The video input specification.""" + url: str """The video URL. Can be either a URL or a Data URI.""" @@ -858,6 +866,8 @@ class ChunkVideoURLInputChunk(BaseModel): class StoreFile(BaseModel): + """Represents a file stored in a store.""" + id: str """Unique identifier for the file""" @@ -888,6 +898,9 @@ class StoreFile(BaseModel): usage_bytes: Optional[int] = None """Storage usage in bytes""" + usage_tokens: Optional[int] = None + """Storage usage in tokens""" + config: Optional[Config] = None """Configuration for a file.""" diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py index cbdeeeb8..d24802cb 100644 --- a/src/mixedbread/types/vector_store.py +++ b/src/mixedbread/types/vector_store.py @@ -11,6 +11,8 @@ class FileCounts(BaseModel): + """Counts of files in different states""" + pending: Optional[int] = None """Number of files waiting to be processed""" @@ -31,6 +33,8 @@ class FileCounts(BaseModel): class VectorStore(BaseModel): + """Model representing a vector store with its metadata and timestamps.""" + id: str """Unique identifier for the vector store""" diff --git a/src/mixedbread/types/vector_store_chunk_search_options_param.py b/src/mixedbread/types/vector_store_chunk_search_options_param.py index f6ed0aad..bd6f1e65 100644 --- a/src/mixedbread/types/vector_store_chunk_search_options_param.py +++ b/src/mixedbread/types/vector_store_chunk_search_options_param.py @@ -13,6 +13,8 @@ class VectorStoreChunkSearchOptionsParam(TypedDict, total=False): + """Options for configuring vector store chunk searches.""" + score_threshold: float """Minimum similarity score threshold""" diff --git a/src/mixedbread/types/vector_store_delete_response.py b/src/mixedbread/types/vector_store_delete_response.py index 6643d44b..27af8ee3 100644 --- a/src/mixedbread/types/vector_store_delete_response.py +++ b/src/mixedbread/types/vector_store_delete_response.py @@ -9,6 +9,8 @@ class VectorStoreDeleteResponse(BaseModel): + """Response model for vector store deletion.""" + id: str """ID of the deleted vector store""" diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py index f8c3bba3..295a761b 100644 --- a/src/mixedbread/types/vector_store_question_answering_params.py +++ b/src/mixedbread/types/vector_store_question_answering_params.py @@ -47,6 +47,8 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False): class QaOptions(TypedDict, total=False): + """Question answering configuration options""" + cite: bool """Whether to use citations""" diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py index 6f1d5a9b..6aec7bbc 100644 --- a/src/mixedbread/types/vector_store_question_answering_response.py +++ b/src/mixedbread/types/vector_store_question_answering_response.py @@ -239,6 +239,8 @@ def __getattr__(self, attr: str) -> object: ... class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel): + """Scored text chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -464,6 +466,8 @@ def __getattr__(self, attr: str) -> object: ... class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel): + """The image input specification.""" + url: str """The image URL. Can be either a URL or a Data URI.""" @@ -472,6 +476,8 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputC class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel): + """Scored image chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -700,11 +706,15 @@ def __getattr__(self, attr: str) -> object: ... class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel): + """The audio input specification.""" + url: str """The audio URL. Can be either a URL or a Data URI.""" class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel): + """Scored audio chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -936,11 +946,15 @@ def __getattr__(self, attr: str) -> object: ... class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel): + """The video input specification.""" + url: str """The video URL. Can be either a URL or a Data URI.""" class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel): + """Scored video chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -995,6 +1009,8 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputC class VectorStoreQuestionAnsweringResponse(BaseModel): + """Results from a question answering operation.""" + answer: str """The answer generated by the LLM""" diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py index dd5c4f2c..8e46feb8 100644 --- a/src/mixedbread/types/vector_store_search_response.py +++ b/src/mixedbread/types/vector_store_search_response.py @@ -239,6 +239,8 @@ def __getattr__(self, attr: str) -> object: ... class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel): + """Scored text chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -464,6 +466,8 @@ def __getattr__(self, attr: str) -> object: ... class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel): + """The image input specification.""" + url: str """The image URL. Can be either a URL or a Data URI.""" @@ -472,6 +476,8 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChu class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel): + """Scored image chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -700,11 +706,15 @@ def __getattr__(self, attr: str) -> object: ... class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel): + """The audio input specification.""" + url: str """The audio URL. Can be either a URL or a Data URI.""" class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel): + """Scored audio chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -936,11 +946,15 @@ def __getattr__(self, attr: str) -> object: ... class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel): + """The video input specification.""" + url: str """The video URL. Can be either a URL or a Data URI.""" class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel): + """Scored video chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py index 76441bf9..c776ea33 100644 --- a/src/mixedbread/types/vector_stores/file_create_params.py +++ b/src/mixedbread/types/vector_stores/file_create_params.py @@ -29,10 +29,14 @@ class FileCreateParams(TypedDict, total=False): class Config(TypedDict, total=False): + """Configuration for adding the file""" + parsing_strategy: Literal["fast", "high_quality"] """Strategy for adding the file, this overrides the store-level default""" class Experimental(TypedDict, total=False): + """Configuration for a file.""" + parsing_strategy: Literal["fast", "high_quality"] """Strategy for adding the file, this overrides the store-level default""" diff --git a/src/mixedbread/types/vector_stores/file_delete_response.py b/src/mixedbread/types/vector_stores/file_delete_response.py index c56ec7b4..191203c4 100644 --- a/src/mixedbread/types/vector_stores/file_delete_response.py +++ b/src/mixedbread/types/vector_stores/file_delete_response.py @@ -9,6 +9,8 @@ class FileDeleteResponse(BaseModel): + """Response model for file deletion.""" + id: str """ID of the deleted file""" diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py index afdcc55d..9b20d19f 100644 --- a/src/mixedbread/types/vector_stores/file_list_response.py +++ b/src/mixedbread/types/vector_stores/file_list_response.py @@ -10,6 +10,8 @@ class Pagination(BaseModel): + """Response model for cursor-based pagination.""" + has_more: bool """ Contextual direction-aware flag: True if more items exist in the requested @@ -38,6 +40,8 @@ class Pagination(BaseModel): class FileListResponse(BaseModel): + """List response wrapper for vector store files.""" + pagination: Pagination """Response model for cursor-based pagination.""" diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py index c29be236..86780311 100644 --- a/src/mixedbread/types/vector_stores/file_search_params.py +++ b/src/mixedbread/types/vector_stores/file_search_params.py @@ -40,6 +40,8 @@ class FileSearchParams(TypedDict, total=False): class SearchOptions(TypedDict, total=False): + """Search configuration options""" + score_threshold: float """Minimum similarity score threshold""" diff --git a/src/mixedbread/types/vector_stores/file_search_response.py b/src/mixedbread/types/vector_stores/file_search_response.py index a7432675..04e14d9b 100644 --- a/src/mixedbread/types/vector_stores/file_search_response.py +++ b/src/mixedbread/types/vector_stores/file_search_response.py @@ -10,6 +10,8 @@ class FileSearchResponse(BaseModel): + """Search response wrapper for vector store files.""" + object: Optional[Literal["list"]] = None """The object type of the response""" diff --git a/src/mixedbread/types/vector_stores/rerank_config_param.py b/src/mixedbread/types/vector_stores/rerank_config_param.py index 9b13ef7b..392bc60a 100644 --- a/src/mixedbread/types/vector_stores/rerank_config_param.py +++ b/src/mixedbread/types/vector_stores/rerank_config_param.py @@ -11,6 +11,8 @@ class RerankConfigParam(TypedDict, total=False): + """Represents a reranking configuration.""" + model: str """The name of the reranking model""" diff --git a/src/mixedbread/types/vector_stores/scored_vector_store_file.py b/src/mixedbread/types/vector_stores/scored_vector_store_file.py index 55e1ed55..bc42fc2c 100644 --- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py +++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py @@ -241,6 +241,8 @@ def __getattr__(self, attr: str) -> object: ... class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel): + """Scored text chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -466,6 +468,8 @@ def __getattr__(self, attr: str) -> object: ... class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel): + """The image input specification.""" + url: str """The image URL. Can be either a URL or a Data URI.""" @@ -474,6 +478,8 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputCh class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel): + """Scored image chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -702,11 +708,15 @@ def __getattr__(self, attr: str) -> object: ... class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel): + """The audio input specification.""" + url: str """The audio URL. Can be either a URL or a Data URI.""" class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel): + """Scored audio chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -938,11 +948,15 @@ def __getattr__(self, attr: str) -> object: ... class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel): + """The video input specification.""" + url: str """The video URL. Can be either a URL or a Data URI.""" class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel): + """Scored video chunk for deprecated API.""" + chunk_index: int """position of the chunk in a file""" @@ -997,6 +1011,8 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputCh class ScoredVectorStoreFile(BaseModel): + """Represents a scored store file.""" + id: str """Unique identifier for the file""" diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py index 02f8f31a..51bb8fa3 100644 --- a/src/mixedbread/types/vector_stores/vector_store_file.py +++ b/src/mixedbread/types/vector_stores/vector_store_file.py @@ -413,6 +413,8 @@ def __getattr__(self, attr: str) -> object: ... class ChunkImageURLInputChunkImageURL(BaseModel): + """The image input specification.""" + url: str """The image URL. Can be either a URL or a Data URI.""" @@ -614,6 +616,8 @@ def __getattr__(self, attr: str) -> object: ... class ChunkAudioURLInputChunkAudioURL(BaseModel): + """The audio input specification.""" + url: str """The audio URL. Can be either a URL or a Data URI.""" @@ -815,6 +819,8 @@ def __getattr__(self, attr: str) -> object: ... class ChunkVideoURLInputChunkVideoURL(BaseModel): + """The video input specification.""" + url: str """The video URL. Can be either a URL or a Data URI.""" @@ -852,6 +858,8 @@ class ChunkVideoURLInputChunk(BaseModel): class VectorStoreFile(BaseModel): + """Represents a file stored in a store.""" + id: str """Unique identifier for the file""" diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py index 7ffccb59..50842fb3 100644 --- a/tests/api_resources/parsing/test_jobs.py +++ b/tests/api_resources/parsing/test_jobs.py @@ -33,7 +33,7 @@ def test_method_create(self, client: Mixedbread) -> None: def test_method_create_with_all_params(self, client: Mixedbread) -> None: job = client.parsing.jobs.create( file_id="file_id", - element_types=["caption"], + element_types=["header"], chunking_strategy="page", return_format="html", mode="fast", @@ -232,7 +232,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None: async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None: job = await async_client.parsing.jobs.create( file_id="file_id", - element_types=["caption"], + element_types=["header"], chunking_strategy="page", return_format="html", mode="fast", diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py index 97ac0e9e..67a4d8e5 100644 --- a/tests/api_resources/stores/test_files.py +++ b/tests/api_resources/stores/test_files.py @@ -188,6 +188,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None: }, ], }, + q="x", ) assert_matches_type(FileListResponse, file, path=["response"]) @@ -533,6 +534,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) }, ], }, + q="x", ) assert_matches_type(FileListResponse, file, path=["response"])