diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cc51f6f8..fc0d7ff8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.44.0" + ".": "0.45.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 026befc1..59342609 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 63 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-8a9abf45fe3e0db8c9ba59803ff9ef4ce5d0bb780765d3c1a9587dde2a8d6c93.yml -openapi_spec_hash: 0f3af27e4fc27bcbfbb17f0a2c45c060 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-5ad16eef3948ad48d494f6c0bf0b7da1063e177df5b8deaeedb53502101026d7.yml +openapi_spec_hash: 631634e0b03b231050e790e28377e51f config_hash: 557219db19e51f791a1727eac53d506c diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b6a53c1..dd935179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 0.45.0 (2025-12-23) + +Full Changelog: [v0.44.0...v0.45.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.44.0...v0.45.0) + +### Features + +* **api:** api update ([e693c21](https://github.com/mixedbread-ai/mixedbread-python/commit/e693c21580f165e34f536aebfe85d57ec51f2cd3)) + + +### Bug Fixes + +* use async_to_httpx_files in patch method ([7a64fa3](https://github.com/mixedbread-ai/mixedbread-python/commit/7a64fa34f7ff89b808f079f3f379f55527bdcfc4)) + + +### Chores + +* **internal:** add `--fix` argument to lint script ([6644d65](https://github.com/mixedbread-ai/mixedbread-python/commit/6644d6512807e3572613fa1ce21f5fc70e64dd35)) + ## 0.44.0 (2025-12-17) Full Changelog: [v0.43.0...v0.44.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.43.0...v0.44.0) diff --git a/pyproject.toml b/pyproject.toml index 2cba3dd8..862539cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mixedbread" -version = "0.44.0" +version = "0.45.0" description = "The official Python library for the Mixedbread API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/scripts/lint b/scripts/lint index 58dce445..51bbef96 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,13 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running lints" -rye run lint +if [ "$1" = "--fix" ]; then + echo "==> Running lints with --fix" + rye run fix:ruff +else + echo "==> Running lints" + rye run lint +fi echo "==> Making sure it imports" rye run python -c 'import mixedbread' diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py index 9a49fde0..9f052005 100644 --- a/src/mixedbread/_base_client.py +++ b/src/mixedbread/_base_client.py @@ -1774,7 +1774,7 @@ async def patch( options: RequestOptions = {}, ) -> ResponseT: opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py index 1e202f99..6ab4a606 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.44.0" # x-release-please-version +__version__ = "0.45.0" # x-release-please-version diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py index 0ba5cd73..972537f9 100644 --- a/src/mixedbread/types/parsing/job_list_response.py +++ b/src/mixedbread/types/parsing/job_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, Optional from datetime import datetime from typing_extensions import Literal @@ -11,7 +11,7 @@ class JobListResponse(BaseModel): - """A parsing job item for list responses, omitting result and error fields.""" + """A parsing job item for list responses.""" id: str """The ID of the job""" @@ -25,6 +25,9 @@ class JobListResponse(BaseModel): status: ParsingJobStatus """The status of the job""" + error: Optional[Dict[str, object]] = None + """The error of the job""" + started_at: Optional[datetime] = None """The started time of the job""" diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py index ab447ff8..56380010 100644 --- a/src/mixedbread/types/parsing/parsing_job.py +++ b/src/mixedbread/types/parsing/parsing_job.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -82,7 +82,7 @@ class ParsingJob(BaseModel): status: ParsingJobStatus """The status of the job""" - error: Optional[object] = None + error: Optional[Dict[str, object]] = None """The error of the job""" result: Optional[Result] = None diff --git a/src/mixedbread/types/store_chunk_search_options_param.py b/src/mixedbread/types/store_chunk_search_options_param.py index 1b472ea1..773251c4 100644 --- a/src/mixedbread/types/store_chunk_search_options_param.py +++ b/src/mixedbread/types/store_chunk_search_options_param.py @@ -7,11 +7,27 @@ from .vector_stores.rerank_config_param import RerankConfigParam -__all__ = ["StoreChunkSearchOptionsParam", "Rerank"] +__all__ = ["StoreChunkSearchOptionsParam", "Rerank", "Agentic", "AgenticAgenticSearchConfig"] Rerank: TypeAlias = Union[bool, RerankConfigParam] +class AgenticAgenticSearchConfig(TypedDict, total=False): + """Configuration for agentic multi-query search.""" + + max_rounds: int + """Maximum number of search rounds""" + + queries_per_round: int + """Maximum queries per round""" + + results_per_query: int + """Results to fetch per query""" + + +Agentic: TypeAlias = Union[bool, AgenticAgenticSearchConfig] + + class StoreChunkSearchOptionsParam(TypedDict, total=False): """Options for configuring store chunk searches.""" @@ -19,10 +35,22 @@ class StoreChunkSearchOptionsParam(TypedDict, total=False): """Minimum similarity score threshold""" rewrite_query: bool - """Whether to rewrite the query""" + """Whether to rewrite the query. + + Ignored when agentic is enabled (the agent handles query decomposition). + """ rerank: Optional[Rerank] - """Whether to rerank results and optional reranking configuration""" + """Whether to rerank results and optional reranking configuration. + + Ignored when agentic is enabled (the agent handles ranking). + """ + + agentic: Optional[Agentic] + """ + Whether to use agentic multi-query search with automatic query decomposition and + ranking. When enabled, rewrite_query and rerank options are ignored. + """ return_metadata: bool """Whether to return file metadata""" diff --git a/src/mixedbread/types/stores/file_search_params.py b/src/mixedbread/types/stores/file_search_params.py index a5d16ed2..99f27a59 100644 --- a/src/mixedbread/types/stores/file_search_params.py +++ b/src/mixedbread/types/stores/file_search_params.py @@ -9,7 +9,15 @@ from ..vector_stores.rerank_config_param import RerankConfigParam from ..shared_params.search_filter_condition import SearchFilterCondition -__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions", "SearchOptionsRerank"] +__all__ = [ + "FileSearchParams", + "Filters", + "FiltersUnionMember2", + "SearchOptions", + "SearchOptionsRerank", + "SearchOptionsAgentic", + "SearchOptionsAgenticAgenticSearchConfig", +] class FileSearchParams(TypedDict, total=False): @@ -39,6 +47,22 @@ class FileSearchParams(TypedDict, total=False): SearchOptionsRerank: TypeAlias = Union[bool, RerankConfigParam] +class SearchOptionsAgenticAgenticSearchConfig(TypedDict, total=False): + """Configuration for agentic multi-query search.""" + + max_rounds: int + """Maximum number of search rounds""" + + queries_per_round: int + """Maximum queries per round""" + + results_per_query: int + """Results to fetch per query""" + + +SearchOptionsAgentic: TypeAlias = Union[bool, SearchOptionsAgenticAgenticSearchConfig] + + class SearchOptions(TypedDict, total=False): """Search configuration options""" @@ -46,10 +70,22 @@ class SearchOptions(TypedDict, total=False): """Minimum similarity score threshold""" rewrite_query: bool - """Whether to rewrite the query""" + """Whether to rewrite the query. + + Ignored when agentic is enabled (the agent handles query decomposition). + """ rerank: Optional[SearchOptionsRerank] - """Whether to rerank results and optional reranking configuration""" + """Whether to rerank results and optional reranking configuration. + + Ignored when agentic is enabled (the agent handles ranking). + """ + + agentic: Optional[SearchOptionsAgentic] + """ + Whether to use agentic multi-query search with automatic query decomposition and + ranking. When enabled, rewrite_query and rerank options are ignored. + """ return_metadata: bool """Whether to return file metadata""" 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 bd6f1e65..b2b2f185 100644 --- a/src/mixedbread/types/vector_store_chunk_search_options_param.py +++ b/src/mixedbread/types/vector_store_chunk_search_options_param.py @@ -7,11 +7,27 @@ from .vector_stores.rerank_config_param import RerankConfigParam -__all__ = ["VectorStoreChunkSearchOptionsParam", "Rerank"] +__all__ = ["VectorStoreChunkSearchOptionsParam", "Rerank", "Agentic", "AgenticAgenticSearchConfig"] Rerank: TypeAlias = Union[bool, RerankConfigParam] +class AgenticAgenticSearchConfig(TypedDict, total=False): + """Configuration for agentic multi-query search.""" + + max_rounds: int + """Maximum number of search rounds""" + + queries_per_round: int + """Maximum queries per round""" + + results_per_query: int + """Results to fetch per query""" + + +Agentic: TypeAlias = Union[bool, AgenticAgenticSearchConfig] + + class VectorStoreChunkSearchOptionsParam(TypedDict, total=False): """Options for configuring vector store chunk searches.""" @@ -19,10 +35,22 @@ class VectorStoreChunkSearchOptionsParam(TypedDict, total=False): """Minimum similarity score threshold""" rewrite_query: bool - """Whether to rewrite the query""" + """Whether to rewrite the query. + + Ignored when agentic is enabled (the agent handles query decomposition). + """ rerank: Optional[Rerank] - """Whether to rerank results and optional reranking configuration""" + """Whether to rerank results and optional reranking configuration. + + Ignored when agentic is enabled (the agent handles ranking). + """ + + agentic: Optional[Agentic] + """ + Whether to use agentic multi-query search with automatic query decomposition and + ranking. When enabled, rewrite_query and rerank options are ignored. + """ return_metadata: bool """Whether to return file metadata""" diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py index 86780311..617a82f4 100644 --- a/src/mixedbread/types/vector_stores/file_search_params.py +++ b/src/mixedbread/types/vector_stores/file_search_params.py @@ -9,7 +9,15 @@ from .rerank_config_param import RerankConfigParam from ..shared_params.search_filter_condition import SearchFilterCondition -__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions", "SearchOptionsRerank"] +__all__ = [ + "FileSearchParams", + "Filters", + "FiltersUnionMember2", + "SearchOptions", + "SearchOptionsRerank", + "SearchOptionsAgentic", + "SearchOptionsAgenticAgenticSearchConfig", +] class FileSearchParams(TypedDict, total=False): @@ -39,6 +47,22 @@ class FileSearchParams(TypedDict, total=False): SearchOptionsRerank: TypeAlias = Union[bool, RerankConfigParam] +class SearchOptionsAgenticAgenticSearchConfig(TypedDict, total=False): + """Configuration for agentic multi-query search.""" + + max_rounds: int + """Maximum number of search rounds""" + + queries_per_round: int + """Maximum queries per round""" + + results_per_query: int + """Results to fetch per query""" + + +SearchOptionsAgentic: TypeAlias = Union[bool, SearchOptionsAgenticAgenticSearchConfig] + + class SearchOptions(TypedDict, total=False): """Search configuration options""" @@ -46,10 +70,22 @@ class SearchOptions(TypedDict, total=False): """Minimum similarity score threshold""" rewrite_query: bool - """Whether to rewrite the query""" + """Whether to rewrite the query. + + Ignored when agentic is enabled (the agent handles query decomposition). + """ rerank: Optional[SearchOptionsRerank] - """Whether to rerank results and optional reranking configuration""" + """Whether to rerank results and optional reranking configuration. + + Ignored when agentic is enabled (the agent handles ranking). + """ + + agentic: Optional[SearchOptionsAgentic] + """ + Whether to use agentic multi-query search with automatic query decomposition and + ranking. When enabled, rewrite_query and rerank options are ignored. + """ return_metadata: bool """Whether to return file metadata""" diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py index df1c6598..f59802bf 100644 --- a/tests/api_resources/stores/test_files.py +++ b/tests/api_resources/stores/test_files.py @@ -319,6 +319,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None: "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "return_chunks": True, "chunks_per_file": 0, @@ -656,6 +657,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "return_chunks": True, "chunks_per_file": 0, diff --git a/tests/api_resources/test_stores.py b/tests/api_resources/test_stores.py index f0d51069..cc59bc9f 100644 --- a/tests/api_resources/test_stores.py +++ b/tests/api_resources/test_stores.py @@ -253,6 +253,7 @@ def test_method_metadata_facets_with_all_params(self, client: Mixedbread) -> Non "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, @@ -307,6 +308,7 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) -> "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, @@ -366,6 +368,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None: "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, @@ -633,6 +636,7 @@ async def test_method_metadata_facets_with_all_params(self, async_client: AsyncM "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, @@ -687,6 +691,7 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, @@ -746,6 +751,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py index bfff5729..5bd08b5a 100644 --- a/tests/api_resources/test_vector_stores.py +++ b/tests/api_resources/test_vector_stores.py @@ -291,6 +291,7 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) -> "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, @@ -356,6 +357,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None: "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, @@ -663,6 +665,7 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, @@ -728,6 +731,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "apply_search_rules": True, }, diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py index 3e1acfd0..d893b615 100644 --- a/tests/api_resources/vector_stores/test_files.py +++ b/tests/api_resources/vector_stores/test_files.py @@ -300,6 +300,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None: "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "return_chunks": True, "chunks_per_file": 0, @@ -619,6 +620,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread "score_threshold": 0, "rewrite_query": True, "rerank": True, + "agentic": True, "return_metadata": True, "return_chunks": True, "chunks_per_file": 0,