diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fea3454..2601677 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0" + ".": "1.1.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 9f60014..01d8c46 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 51 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-68449c5f406b2b3bc2b94ef7f94c47b3724aa0a69e1033bef1a84477f79420f5.yml -openapi_spec_hash: 2b6de88d9a14a977a66f37c066d0b47a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-ad292a2fcdc2f827982c79762c5fdcadf57202228d0598afc6af5ef39c0897e9.yml +openapi_spec_hash: 9140dca6fb813601f82f32b54316a18a config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b diff --git a/CHANGELOG.md b/CHANGELOG.md index 844a5b1..a54ae5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## 1.1.0 (2026-03-02) + +Full Changelog: [v1.0.0...v1.1.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v1.0.0...v1.1.0) + +### Features + +* **api:** api update ([eb27c60](https://github.com/mixedbread-ai/mixedbread-python/commit/eb27c606437eea717438344e343c1adfa5ebff16)) +* **api:** api update ([c4be5ae](https://github.com/mixedbread-ai/mixedbread-python/commit/c4be5ae024212e1fd1feaabdc1d2b07c14228eb7)) +* **api:** api update ([153c4ba](https://github.com/mixedbread-ai/mixedbread-python/commit/153c4ba201048975a882983f882491352a1d7bd3)) +* **api:** api update ([216baf6](https://github.com/mixedbread-ai/mixedbread-python/commit/216baf6093ec37db5b57d0fb675a7c7212bea750)) +* **api:** api update ([8fef561](https://github.com/mixedbread-ai/mixedbread-python/commit/8fef5613483e10652fd1e35ba3e2097a26a5cfcd)) +* **api:** api update ([10a541d](https://github.com/mixedbread-ai/mixedbread-python/commit/10a541d3fa4015fdb5e2b6720fdf1f97322b5439)) + + +### Chores + +* format all `api.md` files ([d167e2d](https://github.com/mixedbread-ai/mixedbread-python/commit/d167e2d222b34334f86313213bb01d7c8a003f18)) +* **internal:** add request options to SSE classes ([f241bf6](https://github.com/mixedbread-ai/mixedbread-python/commit/f241bf6d47c31faf166869ef96219d7c7d4c8e10)) +* **internal:** fix lint error on Python 3.14 ([72f3d05](https://github.com/mixedbread-ai/mixedbread-python/commit/72f3d05d8e2b6bea43db9001270d836f21254a9e)) +* **internal:** make `test_proxy_environment_variables` more resilient ([d0ec2d9](https://github.com/mixedbread-ai/mixedbread-python/commit/d0ec2d97d74bbf31468fd8ef537f8d142dc92fc7)) +* **internal:** make `test_proxy_environment_variables` more resilient to env ([c287c24](https://github.com/mixedbread-ai/mixedbread-python/commit/c287c24551007387ccd78ce9faea8d4bae02719e)) +* update mock server docs ([b3523db](https://github.com/mixedbread-ai/mixedbread-python/commit/b3523db2445a8a389ca9828deea5d991c095bd0f)) + ## 1.0.0 (2026-02-12) Full Changelog: [v0.46.0...v1.0.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.46.0...v1.0.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b147f0..ed6fa9a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. ```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh diff --git a/pyproject.toml b/pyproject.toml index babc8df..e288245 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mixedbread" -version = "1.0.0" +version = "1.1.0" description = "The official Python library for the Mixedbread API" dynamic = ["readme"] license = "Apache-2.0" @@ -69,7 +69,7 @@ format = { chain = [ # run formatting again to fix any inconsistencies when imports are stripped "format:ruff", ]} -"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" +"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'" "format:ruff" = "ruff format" "lint" = { chain = [ diff --git a/src/mixedbread/_response.py b/src/mixedbread/_response.py index 543946b..50547a3 100644 --- a/src/mixedbread/_response.py +++ b/src/mixedbread/_response.py @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/mixedbread/_streaming.py b/src/mixedbread/_streaming.py index e7f6340..235a94a 100644 --- a/src/mixedbread/_streaming.py +++ b/src/mixedbread/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ._client import Mixedbread, AsyncMixedbread + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -22,7 +23,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -31,10 +32,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: Mixedbread, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -94,10 +97,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncMixedbread, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() diff --git a/src/mixedbread/_utils/_compat.py b/src/mixedbread/_utils/_compat.py index dd70323..2c70b29 100644 --- a/src/mixedbread/_utils/_compat.py +++ b/src/mixedbread/_utils/_compat.py @@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool: else: import types - return tp is Union or tp is types.UnionType + return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap] def is_typeddict(tp: Type[Any]) -> bool: diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py index a6b0880..3a84f33 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__ = "1.0.0" # x-release-please-version +__version__ = "1.1.0" # x-release-please-version diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py index 6edd79d..a4aafab 100644 --- a/src/mixedbread/resources/stores/files.py +++ b/src/mixedbread/resources/stores/files.py @@ -271,7 +271,7 @@ def list( metadata_filter: Metadata filter to apply to the query - q: Search query for fuzzy matching over name and description fields + q: Search query for fuzzy matching over name and external_id fields extra_headers: Send extra headers @@ -810,7 +810,7 @@ async def list( metadata_filter: Metadata filter to apply to the query - q: Search query for fuzzy matching over name and description fields + q: Search query for fuzzy matching over name and external_id fields extra_headers: Send extra headers diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py index 5638001..2f3d250 100644 --- a/src/mixedbread/types/parsing/parsing_job.py +++ b/src/mixedbread/types/parsing/parsing_job.py @@ -29,11 +29,14 @@ class ResultChunkElement(BaseModel): """The page number where the element was found""" content: str - """The full content of the extracted element""" + """The extracted text content of the element""" summary: Optional[str] = None """A brief summary of the element's content""" + image: Optional[str] = None + """The base64-encoded image data for figure elements""" + class ResultChunk(BaseModel): """A chunk of text extracted from a document page.""" diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py index ce6ad67..237a55b 100644 --- a/src/mixedbread/types/scored_audio_url_input_chunk.py +++ b/src/mixedbread/types/scored_audio_url_input_chunk.py @@ -19,6 +19,7 @@ "GeneratedMetadataCodeChunkGeneratedMetadata", "GeneratedMetadataAudioChunkGeneratedMetadata", "GeneratedMetadataVideoChunkGeneratedMetadata", + "GeneratedMetadataImageChunkGeneratedMetadata", "AudioURL", ] @@ -54,6 +55,8 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + frontmatter: Optional[Dict[str, object]] = None if TYPE_CHECKING: @@ -84,6 +87,8 @@ class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -106,6 +111,8 @@ class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): total_size: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -134,6 +141,8 @@ class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -162,6 +171,8 @@ class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): audio_format: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -192,6 +203,36 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel): frame_count: int + has_audio_stream: Optional[bool] = None + + file_extension: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataImageChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["image"]] = None + + file_type: str + + file_size: int + + width: int + + height: int + + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -213,6 +254,7 @@ def __getattr__(self, attr: str) -> object: ... GeneratedMetadataCodeChunkGeneratedMetadata, GeneratedMetadataAudioChunkGeneratedMetadata, GeneratedMetadataVideoChunkGeneratedMetadata, + GeneratedMetadataImageChunkGeneratedMetadata, None, ], PropertyInfo(discriminator="type"), @@ -251,6 +293,9 @@ class ScoredAudioURLInputChunk(BaseModel): store_id: str """store id""" + external_id: Optional[str] = None + """external identifier for this file""" + metadata: Optional[object] = None """file metadata""" diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py index 5c41db6..412bcb5 100644 --- a/src/mixedbread/types/scored_image_url_input_chunk.py +++ b/src/mixedbread/types/scored_image_url_input_chunk.py @@ -19,6 +19,7 @@ "GeneratedMetadataCodeChunkGeneratedMetadata", "GeneratedMetadataAudioChunkGeneratedMetadata", "GeneratedMetadataVideoChunkGeneratedMetadata", + "GeneratedMetadataImageChunkGeneratedMetadata", "ImageURL", ] @@ -54,6 +55,8 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + frontmatter: Optional[Dict[str, object]] = None if TYPE_CHECKING: @@ -84,6 +87,8 @@ class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -106,6 +111,8 @@ class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): total_size: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -134,6 +141,8 @@ class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -162,6 +171,8 @@ class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): audio_format: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -192,6 +203,36 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel): frame_count: int + has_audio_stream: Optional[bool] = None + + file_extension: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataImageChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["image"]] = None + + file_type: str + + file_size: int + + width: int + + height: int + + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -213,6 +254,7 @@ def __getattr__(self, attr: str) -> object: ... GeneratedMetadataCodeChunkGeneratedMetadata, GeneratedMetadataAudioChunkGeneratedMetadata, GeneratedMetadataVideoChunkGeneratedMetadata, + GeneratedMetadataImageChunkGeneratedMetadata, None, ], PropertyInfo(discriminator="type"), @@ -254,6 +296,9 @@ class ScoredImageURLInputChunk(BaseModel): store_id: str """store id""" + external_id: Optional[str] = None + """external identifier for this file""" + metadata: Optional[object] = None """file metadata""" diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py index 025eecd..7497778 100644 --- a/src/mixedbread/types/scored_text_input_chunk.py +++ b/src/mixedbread/types/scored_text_input_chunk.py @@ -19,6 +19,7 @@ "GeneratedMetadataCodeChunkGeneratedMetadata", "GeneratedMetadataAudioChunkGeneratedMetadata", "GeneratedMetadataVideoChunkGeneratedMetadata", + "GeneratedMetadataImageChunkGeneratedMetadata", ] @@ -53,6 +54,8 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + frontmatter: Optional[Dict[str, object]] = None if TYPE_CHECKING: @@ -83,6 +86,8 @@ class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -105,6 +110,8 @@ class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): total_size: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -133,6 +140,8 @@ class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -161,6 +170,8 @@ class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): audio_format: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -191,6 +202,36 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel): frame_count: int + has_audio_stream: Optional[bool] = None + + file_extension: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataImageChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["image"]] = None + + file_type: str + + file_size: int + + width: int + + height: int + + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -212,6 +253,7 @@ def __getattr__(self, attr: str) -> object: ... GeneratedMetadataCodeChunkGeneratedMetadata, GeneratedMetadataAudioChunkGeneratedMetadata, GeneratedMetadataVideoChunkGeneratedMetadata, + GeneratedMetadataImageChunkGeneratedMetadata, None, ], PropertyInfo(discriminator="type"), @@ -243,6 +285,9 @@ class ScoredTextInputChunk(BaseModel): store_id: str """store id""" + external_id: Optional[str] = None + """external identifier for this file""" + metadata: Optional[object] = None """file metadata""" diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py index 878c5bd..788e0c3 100644 --- a/src/mixedbread/types/scored_video_url_input_chunk.py +++ b/src/mixedbread/types/scored_video_url_input_chunk.py @@ -19,6 +19,7 @@ "GeneratedMetadataCodeChunkGeneratedMetadata", "GeneratedMetadataAudioChunkGeneratedMetadata", "GeneratedMetadataVideoChunkGeneratedMetadata", + "GeneratedMetadataImageChunkGeneratedMetadata", "VideoURL", ] @@ -54,6 +55,8 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + frontmatter: Optional[Dict[str, object]] = None if TYPE_CHECKING: @@ -84,6 +87,8 @@ class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -106,6 +111,8 @@ class GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): total_size: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -134,6 +141,8 @@ class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -162,6 +171,8 @@ class GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel): audio_format: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -192,6 +203,36 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel): frame_count: int + has_audio_stream: Optional[bool] = None + + file_extension: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class GeneratedMetadataImageChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["image"]] = None + + file_type: str + + file_size: int + + width: int + + height: int + + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -213,6 +254,7 @@ def __getattr__(self, attr: str) -> object: ... GeneratedMetadataCodeChunkGeneratedMetadata, GeneratedMetadataAudioChunkGeneratedMetadata, GeneratedMetadataVideoChunkGeneratedMetadata, + GeneratedMetadataImageChunkGeneratedMetadata, None, ], PropertyInfo(discriminator="type"), @@ -251,6 +293,9 @@ class ScoredVideoURLInputChunk(BaseModel): store_id: str """store id""" + external_id: Optional[str] = None + """external identifier for this file""" + metadata: Optional[object] = None """file metadata""" diff --git a/src/mixedbread/types/store_chunk_search_options_param.py b/src/mixedbread/types/store_chunk_search_options_param.py index 12e5f59..90bb981 100644 --- a/src/mixedbread/types/store_chunk_search_options_param.py +++ b/src/mixedbread/types/store_chunk_search_options_param.py @@ -38,9 +38,6 @@ class AgenticAgenticSearchConfig(TypedDict, total=False): queries_per_round: int """Maximum queries per round""" - results_per_query: int - """Results to fetch per query""" - Agentic: TypeAlias = Union[bool, AgenticAgenticSearchConfig] diff --git a/src/mixedbread/types/stores/file_list_params.py b/src/mixedbread/types/stores/file_list_params.py index 2782573..2089f9c 100644 --- a/src/mixedbread/types/stores/file_list_params.py +++ b/src/mixedbread/types/stores/file_list_params.py @@ -37,7 +37,7 @@ class FileListParams(TypedDict, total=False): """Metadata filter to apply to the query""" q: Optional[str] - """Search query for fuzzy matching over name and description fields""" + """Search query for fuzzy matching over name and external_id fields""" MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition] diff --git a/src/mixedbread/types/stores/file_search_params.py b/src/mixedbread/types/stores/file_search_params.py index e70bc15..6f6aa2d 100644 --- a/src/mixedbread/types/stores/file_search_params.py +++ b/src/mixedbread/types/stores/file_search_params.py @@ -78,9 +78,6 @@ class SearchOptionsAgenticAgenticSearchConfig(TypedDict, total=False): queries_per_round: int """Maximum queries per round""" - results_per_query: int - """Results to fetch per query""" - SearchOptionsAgentic: TypeAlias = Union[bool, SearchOptionsAgenticAgenticSearchConfig] diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py index 7c3c0e2..f8d4c16 100644 --- a/src/mixedbread/types/stores/store_file.py +++ b/src/mixedbread/types/stores/store_file.py @@ -24,6 +24,7 @@ "ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", "ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkTextInputChunkGeneratedMetadataVideoChunkGeneratedMetadata", + "ChunkTextInputChunkGeneratedMetadataImageChunkGeneratedMetadata", "ChunkImageURLInputChunk", "ChunkImageURLInputChunkGeneratedMetadata", "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata", @@ -34,6 +35,7 @@ "ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", "ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkImageURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata", + "ChunkImageURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata", "ChunkImageURLInputChunkImageURL", "ChunkAudioURLInputChunk", "ChunkAudioURLInputChunkGeneratedMetadata", @@ -45,6 +47,7 @@ "ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", "ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkAudioURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata", + "ChunkAudioURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata", "ChunkAudioURLInputChunkAudioURL", "ChunkVideoURLInputChunk", "ChunkVideoURLInputChunkGeneratedMetadata", @@ -56,6 +59,7 @@ "ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata", "ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata", "ChunkVideoURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata", + "ChunkVideoURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata", "ChunkVideoURLInputChunkVideoURL", ] @@ -102,6 +106,8 @@ class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseMod num_lines: Optional[int] = None + file_extension: Optional[str] = None + frontmatter: Optional[Dict[str, object]] = None if TYPE_CHECKING: @@ -132,6 +138,8 @@ class ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -154,6 +162,8 @@ class ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel): total_size: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -182,6 +192,8 @@ class ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel): num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -210,6 +222,8 @@ class ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel) audio_format: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -240,6 +254,36 @@ class ChunkTextInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseModel) frame_count: int + has_audio_stream: Optional[bool] = None + + file_extension: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkTextInputChunkGeneratedMetadataImageChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["image"]] = None + + file_type: str + + file_size: int + + width: int + + height: int + + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -261,6 +305,7 @@ def __getattr__(self, attr: str) -> object: ... ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, ChunkTextInputChunkGeneratedMetadataVideoChunkGeneratedMetadata, + ChunkTextInputChunkGeneratedMetadataImageChunkGeneratedMetadata, None, ], PropertyInfo(discriminator="type"), @@ -325,6 +370,8 @@ class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas num_lines: Optional[int] = None + file_extension: Optional[str] = None + frontmatter: Optional[Dict[str, object]] = None if TYPE_CHECKING: @@ -355,6 +402,8 @@ class ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseMod num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -377,6 +426,8 @@ class ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseMode total_size: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -405,6 +456,8 @@ class ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseMod num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -433,6 +486,8 @@ class ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseMo audio_format: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -463,6 +518,36 @@ class ChunkImageURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseMo frame_count: int + has_audio_stream: Optional[bool] = None + + file_extension: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkImageURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["image"]] = None + + file_type: str + + file_size: int + + width: int + + height: int + + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -484,6 +569,7 @@ def __getattr__(self, attr: str) -> object: ... ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, ChunkImageURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata, + ChunkImageURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata, None, ], PropertyInfo(discriminator="type"), @@ -561,6 +647,8 @@ class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas num_lines: Optional[int] = None + file_extension: Optional[str] = None + frontmatter: Optional[Dict[str, object]] = None if TYPE_CHECKING: @@ -591,6 +679,8 @@ class ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseMod num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -613,6 +703,8 @@ class ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseMode total_size: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -641,6 +733,8 @@ class ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseMod num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -669,6 +763,8 @@ class ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseMo audio_format: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -699,6 +795,36 @@ class ChunkAudioURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseMo frame_count: int + has_audio_stream: Optional[bool] = None + + file_extension: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkAudioURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["image"]] = None + + file_type: str + + file_size: int + + width: int + + height: int + + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -720,6 +846,7 @@ def __getattr__(self, attr: str) -> object: ... ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, ChunkAudioURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata, + ChunkAudioURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata, None, ], PropertyInfo(discriminator="type"), @@ -797,6 +924,8 @@ class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas num_lines: Optional[int] = None + file_extension: Optional[str] = None + frontmatter: Optional[Dict[str, object]] = None if TYPE_CHECKING: @@ -827,6 +956,8 @@ class ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseMod num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -849,6 +980,8 @@ class ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseMode total_size: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -877,6 +1010,8 @@ class ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseMod num_lines: Optional[int] = None + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -905,6 +1040,8 @@ class ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseMo audio_format: int + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -935,6 +1072,36 @@ class ChunkVideoURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseMo frame_count: int + has_audio_stream: Optional[bool] = None + + file_extension: Optional[str] = None + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + else: + __pydantic_extra__: Dict[str, object] + + +class ChunkVideoURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata(BaseModel): + type: Optional[Literal["image"]] = None + + file_type: str + + file_size: int + + width: int + + height: int + + file_extension: Optional[str] = None + if TYPE_CHECKING: # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a # value to this field, so for compatibility we avoid doing it at runtime. @@ -956,6 +1123,7 @@ def __getattr__(self, attr: str) -> object: ... ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata, ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata, ChunkVideoURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata, + ChunkVideoURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata, None, ], PropertyInfo(discriminator="type"), diff --git a/tests/test_client.py b/tests/test_client.py index 6696b53..8cc0017 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -967,6 +967,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has any proxy env vars set + monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultHttpxClient() @@ -1887,6 +1895,14 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has any proxy env vars set + monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultAsyncHttpxClient()