diff --git a/.release-please-manifest.json b/.release-please-manifest.json index da59f99e..2aca35ae 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0" + ".": "0.5.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 78883d24..71c5ffa2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 49 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml -openapi_spec_hash: f6661e9fafda26e7e9f3fc06739a33ad -config_hash: 0619498f633d6a0d92ae15b21fd06d89 +openapi_spec_hash: 07482ed86f5ccf7b480c514d6d5ebb15 +config_hash: 167171738605c297aa5e8bc73abc66e3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 95b6efae..f4dee4fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 0.5.0 (2025-05-26) + +Full Changelog: [v0.4.0...v0.5.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.4.0...v0.5.0) + +### Features + +* **api:** update via SDK Studio ([5bfd6a5](https://github.com/mixedbread-ai/mixedbread-python/commit/5bfd6a5ca4c7e1f8e71a0e675272f7a5e23f9123)) +* **api:** update via SDK Studio ([e0b1fc1](https://github.com/mixedbread-ai/mixedbread-python/commit/e0b1fc12231187039ca03302b3a7b3f320fac4aa)) +* **api:** update via SDK Studio ([1977f12](https://github.com/mixedbread-ai/mixedbread-python/commit/1977f125d46011248652cc976f94e9c9585e9dfe)) + ## 0.4.0 (2025-05-26) Full Changelog: [v0.3.1...v0.4.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.3.1...v0.4.0) diff --git a/api.md b/api.md index 52d628b1..ff98c770 100644 --- a/api.md +++ b/api.md @@ -31,11 +31,12 @@ Types: ```python from mixedbread.types import ( ExpiresAfter, - FileCounts, - ScoredVectorStoreChunk, + ScoredAudioURLInputChunk, + ScoredImageURLInputChunk, + ScoredTextInputChunk, + ScoredVideoURLInputChunk, VectorStore, VectorStoreChunkSearchOptions, - VectorStoreFileSearchOptions, VectorStoreDeleteResponse, VectorStoreQuestionAnsweringResponse, VectorStoreSearchResponse, diff --git a/pyproject.toml b/pyproject.toml index 1b83a9b4..b6e83d86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "mixedbread" -version = "0.4.0" +version = "0.5.0" description = "The official Python library for the Mixedbread API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py index 57b9c213..7a42cf4e 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.4.0" # x-release-please-version +__version__ = "0.5.0" # x-release-please-version diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py index 51e7dd3b..5022d024 100644 --- a/src/mixedbread/resources/vector_stores/files.py +++ b/src/mixedbread/resources/vector_stores/files.py @@ -24,7 +24,6 @@ from ...types.vector_stores.vector_store_file import VectorStoreFile from ...types.vector_stores.file_delete_response import FileDeleteResponse from ...types.vector_stores.file_search_response import FileSearchResponse -from ...types.vector_store_file_search_options_param import VectorStoreFileSearchOptionsParam __all__ = ["FilesResource", "AsyncFilesResource"] @@ -259,7 +258,7 @@ def search( vector_store_ids: List[str], top_k: int | NotGiven = NOT_GIVEN, filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN, - search_options: VectorStoreFileSearchOptionsParam | NotGiven = NOT_GIVEN, + search_options: file_search_params.SearchOptions | NotGiven = NOT_GIVEN, # 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, @@ -659,7 +658,7 @@ async def search( vector_store_ids: List[str], top_k: int | NotGiven = NOT_GIVEN, filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN, - search_options: VectorStoreFileSearchOptionsParam | NotGiven = NOT_GIVEN, + search_options: file_search_params.SearchOptions | NotGiven = NOT_GIVEN, # 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, diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py index e7310fd0..56f206a5 100644 --- a/src/mixedbread/types/__init__.py +++ b/src/mixedbread/types/__init__.py @@ -6,7 +6,6 @@ from .api_key import APIKey as APIKey from .embedding import Embedding as Embedding from .data_source import DataSource as DataSource -from .file_counts import FileCounts as FileCounts from .file_object import FileObject as FileObject from .object_type import ObjectType as ObjectType from .vector_store import VectorStore as VectorStore @@ -29,23 +28,23 @@ from .api_key_delete_response import APIKeyDeleteResponse as APIKeyDeleteResponse from .data_source_list_params import DataSourceListParams as DataSourceListParams from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams +from .scored_text_input_chunk import ScoredTextInputChunk as ScoredTextInputChunk from .multi_encoding_embedding import MultiEncodingEmbedding as MultiEncodingEmbedding from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams from .data_source_create_params import DataSourceCreateParams as DataSourceCreateParams from .data_source_oauth2_params import DataSourceOauth2Params as DataSourceOauth2Params from .data_source_update_params import DataSourceUpdateParams as DataSourceUpdateParams from .embedding_create_response import EmbeddingCreateResponse as EmbeddingCreateResponse -from .scored_vector_store_chunk import ScoredVectorStoreChunk as ScoredVectorStoreChunk from .vector_store_create_params import VectorStoreCreateParams as VectorStoreCreateParams from .vector_store_search_params import VectorStoreSearchParams as VectorStoreSearchParams from .vector_store_update_params import VectorStoreUpdateParams as VectorStoreUpdateParams from .data_source_delete_response import DataSourceDeleteResponse as DataSourceDeleteResponse +from .scored_audio_url_input_chunk import ScoredAudioURLInputChunk as ScoredAudioURLInputChunk +from .scored_image_url_input_chunk import ScoredImageURLInputChunk as ScoredImageURLInputChunk +from .scored_video_url_input_chunk import ScoredVideoURLInputChunk as ScoredVideoURLInputChunk from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse from .data_source_oauth2_params_param import DataSourceOauth2ParamsParam as DataSourceOauth2ParamsParam -from .vector_store_file_search_options_param import ( - VectorStoreFileSearchOptionsParam as VectorStoreFileSearchOptionsParam, -) from .vector_store_question_answering_params import ( VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams, ) diff --git a/src/mixedbread/types/extractions/__init__.py b/src/mixedbread/types/extractions/__init__.py index 22892cfe..ca9fd1eb 100644 --- a/src/mixedbread/types/extractions/__init__.py +++ b/src/mixedbread/types/extractions/__init__.py @@ -2,9 +2,7 @@ from __future__ import annotations -from .text_input import TextInput as TextInput from .extraction_job import ExtractionJob as ExtractionJob -from .image_url_input import ImageURLInput as ImageURLInput from .text_input_param import TextInputParam as TextInputParam from .extraction_result import ExtractionResult as ExtractionResult from .job_create_params import JobCreateParams as JobCreateParams diff --git a/src/mixedbread/types/extractions/image_url_input.py b/src/mixedbread/types/extractions/image_url_input.py deleted file mode 100644 index 90392503..00000000 --- a/src/mixedbread/types/extractions/image_url_input.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["ImageURLInput", "ImageURL"] - - -class ImageURL(BaseModel): - url: str - """The image URL. Can be either a URL or a Data URI.""" - - -class ImageURLInput(BaseModel): - type: Optional[Literal["image_url"]] = None - """Input type identifier""" - - image_url: ImageURL - """The image input specification.""" diff --git a/src/mixedbread/types/extractions/text_input.py b/src/mixedbread/types/extractions/text_input.py deleted file mode 100644 index dde3cee0..00000000 --- a/src/mixedbread/types/extractions/text_input.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["TextInput"] - - -class TextInput(BaseModel): - type: Optional[Literal["text"]] = None - """Input type identifier""" - - text: str - """Text content to process""" diff --git a/src/mixedbread/types/file_counts.py b/src/mixedbread/types/file_counts.py deleted file mode 100644 index 05ff3f63..00000000 --- a/src/mixedbread/types/file_counts.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel - -__all__ = ["FileCounts"] - - -class FileCounts(BaseModel): - in_progress: Optional[int] = None - """Number of files currently being processed""" - - cancelled: Optional[int] = None - """Number of files whose processing was cancelled""" - - completed: Optional[int] = None - """Number of successfully processed files""" - - failed: Optional[int] = None - """Number of files that failed processing""" - - total: Optional[int] = None - """Total number of files""" diff --git a/src/mixedbread/types/rerank_response.py b/src/mixedbread/types/rerank_response.py index af6d5ff2..73ebfaaa 100644 --- a/src/mixedbread/types/rerank_response.py +++ b/src/mixedbread/types/rerank_response.py @@ -4,7 +4,6 @@ from typing_extensions import Literal from .._models import BaseModel -from .object_type import ObjectType from .shared.usage import Usage __all__ = ["RerankResponse", "Data"] @@ -34,7 +33,7 @@ class RerankResponse(BaseModel): data: List[Data] """The ranked documents.""" - object: Optional[ObjectType] = None + object: Optional[Literal["list"]] = None """The object type of the response""" top_k: int diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py new file mode 100644 index 00000000..b514f1bd --- /dev/null +++ b/src/mixedbread/types/scored_audio_url_input_chunk.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ScoredAudioURLInputChunk", "AudioURL"] + + +class AudioURL(BaseModel): + url: str + """The audio URL. Can be either a URL or a Data URI.""" + + +class ScoredAudioURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """vector store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["audio_url"]] = None + """Input type identifier""" + + audio_url: AudioURL + """The audio input specification.""" + + transcription: Optional[str] = None + """speech recognition (sr) text of the audio""" + + summary: Optional[str] = None + """summary of the audio""" diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py new file mode 100644 index 00000000..ec6ba9dd --- /dev/null +++ b/src/mixedbread/types/scored_image_url_input_chunk.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ScoredImageURLInputChunk", "ImageURL"] + + +class ImageURL(BaseModel): + url: str + """The image URL. Can be either a URL or a Data URI.""" + + +class ScoredImageURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """vector store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["image_url"]] = None + """Input type identifier""" + + image_url: ImageURL + """The image input specification.""" + + ocr_text: Optional[str] = None + """ocr text of the image""" + + summary: Optional[str] = None + """summary of the image""" diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py new file mode 100644 index 00000000..42870062 --- /dev/null +++ b/src/mixedbread/types/scored_text_input_chunk.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ScoredTextInputChunk"] + + +class ScoredTextInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """vector store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["text"]] = None + """Input type identifier""" + + text: str + """Text content to process""" diff --git a/src/mixedbread/types/scored_vector_store_chunk.py b/src/mixedbread/types/scored_vector_store_chunk.py deleted file mode 100644 index 98516a61..00000000 --- a/src/mixedbread/types/scored_vector_store_chunk.py +++ /dev/null @@ -1,38 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Union, Optional -from typing_extensions import TypeAlias - -from .._models import BaseModel -from .extractions.text_input import TextInput -from .extractions.image_url_input import ImageURLInput - -__all__ = ["ScoredVectorStoreChunk", "Value"] - -Value: TypeAlias = Union[str, ImageURLInput, TextInput, Dict[str, object], None] - - -class ScoredVectorStoreChunk(BaseModel): - position: int - """position of the chunk in a file""" - - value: Optional[Value] = None - """value of the chunk""" - - content: Optional[str] = None - """content of the chunk""" - - score: float - """score of the chunk""" - - file_id: str - """file id""" - - filename: str - """filename""" - - vector_store_id: str - """vector store id""" - - 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 new file mode 100644 index 00000000..14836909 --- /dev/null +++ b/src/mixedbread/types/scored_video_url_input_chunk.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ScoredVideoURLInputChunk", "VideoURL"] + + +class VideoURL(BaseModel): + url: str + """The video URL. Can be either a URL or a Data URI.""" + + +class ScoredVideoURLInputChunk(BaseModel): + chunk_index: int + """position of the chunk in a file""" + + mime_type: Optional[str] = None + """mime type of the chunk""" + + model: Optional[str] = None + """model used for this chunk""" + + score: float + """score of the chunk""" + + file_id: str + """file id""" + + filename: str + """filename""" + + vector_store_id: str + """vector store id""" + + metadata: Optional[object] = None + """file metadata""" + + type: Optional[Literal["video_url"]] = None + """Input type identifier""" + + video_url: VideoURL + """The video input specification.""" + + transcription: Optional[str] = None + """speech recognition (sr) text of the video""" + + summary: Optional[str] = None + """summary of the video""" diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py index b310d3e6..65cb0ede 100644 --- a/src/mixedbread/types/vector_store.py +++ b/src/mixedbread/types/vector_store.py @@ -5,10 +5,26 @@ from typing_extensions import Literal from .._models import BaseModel -from .file_counts import FileCounts from .expires_after import ExpiresAfter -__all__ = ["VectorStore"] +__all__ = ["VectorStore", "FileCounts"] + + +class FileCounts(BaseModel): + in_progress: Optional[int] = None + """Number of files currently being processed""" + + cancelled: Optional[int] = None + """Number of files whose processing was cancelled""" + + completed: Optional[int] = None + """Number of successfully processed files""" + + failed: Optional[int] = None + """Number of files that failed processing""" + + total: Optional[int] = None + """Total number of files""" class VectorStore(BaseModel): diff --git a/src/mixedbread/types/vector_store_file_search_options_param.py b/src/mixedbread/types/vector_store_file_search_options_param.py deleted file mode 100644 index 13ed8e95..00000000 --- a/src/mixedbread/types/vector_store_file_search_options_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["VectorStoreFileSearchOptionsParam"] - - -class VectorStoreFileSearchOptionsParam(TypedDict, total=False): - score_threshold: float - """Minimum similarity score threshold""" - - rewrite_query: bool - """Whether to rewrite the query""" - - return_metadata: bool - """Whether to return file metadata""" - - return_chunks: bool - """Whether to return matching text chunks""" - - chunks_per_file: int - """Number of chunks to return for each file""" diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py index 7d388f89..abb7919b 100644 --- a/src/mixedbread/types/vector_store_question_answering_params.py +++ b/src/mixedbread/types/vector_store_question_answering_params.py @@ -46,5 +46,8 @@ class QaOptions(TypedDict, total=False): cite: bool """Whether to use citations""" + multimodal: bool + """Whether to use multimodal context""" + from .shared_params.search_filter import SearchFilter diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py index 311c2cf5..2a477a87 100644 --- a/src/mixedbread/types/vector_store_question_answering_response.py +++ b/src/mixedbread/types/vector_store_question_answering_response.py @@ -1,16 +1,26 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional +from typing_extensions import Annotated, TypeAlias +from .._utils import PropertyInfo from .._models import BaseModel -from .scored_vector_store_chunk import ScoredVectorStoreChunk +from .scored_text_input_chunk import ScoredTextInputChunk +from .scored_audio_url_input_chunk import ScoredAudioURLInputChunk +from .scored_image_url_input_chunk import ScoredImageURLInputChunk +from .scored_video_url_input_chunk import ScoredVideoURLInputChunk -__all__ = ["VectorStoreQuestionAnsweringResponse"] +__all__ = ["VectorStoreQuestionAnsweringResponse", "Source"] + +Source: TypeAlias = Annotated[ + Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk], + PropertyInfo(discriminator="type"), +] class VectorStoreQuestionAnsweringResponse(BaseModel): answer: str """The answer generated by the LLM""" - sources: Optional[List[ScoredVectorStoreChunk]] = None + sources: Optional[List[Source]] = None """Source documents used to generate the answer""" diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py index bc7b860a..50143c9f 100644 --- a/src/mixedbread/types/vector_store_search_response.py +++ b/src/mixedbread/types/vector_store_search_response.py @@ -1,17 +1,26 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional -from typing_extensions import Literal +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from .._utils import PropertyInfo from .._models import BaseModel -from .scored_vector_store_chunk import ScoredVectorStoreChunk +from .scored_text_input_chunk import ScoredTextInputChunk +from .scored_audio_url_input_chunk import ScoredAudioURLInputChunk +from .scored_image_url_input_chunk import ScoredImageURLInputChunk +from .scored_video_url_input_chunk import ScoredVideoURLInputChunk -__all__ = ["VectorStoreSearchResponse"] +__all__ = ["VectorStoreSearchResponse", "Data"] + +Data: TypeAlias = Annotated[ + Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk], + PropertyInfo(discriminator="type"), +] class VectorStoreSearchResponse(BaseModel): object: Optional[Literal["list"]] = None """The object type of the response""" - data: List[ScoredVectorStoreChunk] + data: List[Data] """The list of scored vector store file chunks""" diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py index d7569c39..c34d7611 100644 --- a/src/mixedbread/types/vector_stores/file_search_params.py +++ b/src/mixedbread/types/vector_stores/file_search_params.py @@ -6,9 +6,8 @@ from typing_extensions import Required, TypeAlias, TypedDict from ..shared_params.search_filter_condition import SearchFilterCondition -from ..vector_store_file_search_options_param import VectorStoreFileSearchOptionsParam -__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2"] +__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions"] class FileSearchParams(TypedDict, total=False): @@ -24,7 +23,7 @@ class FileSearchParams(TypedDict, total=False): filters: Optional[Filters] """Optional filter conditions""" - search_options: VectorStoreFileSearchOptionsParam + search_options: SearchOptions """Search configuration options""" @@ -32,4 +31,22 @@ class FileSearchParams(TypedDict, total=False): Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]] + +class SearchOptions(TypedDict, total=False): + score_threshold: float + """Minimum similarity score threshold""" + + rewrite_query: bool + """Whether to rewrite the query""" + + return_metadata: bool + """Whether to return file metadata""" + + return_chunks: bool + """Whether to return matching text chunks""" + + chunks_per_file: int + """Number of chunks to return for each file""" + + from ..shared_params.search_filter import SearchFilter 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 72d6b8bc..7c702c1c 100644 --- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py +++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py @@ -1,13 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime -from typing_extensions import Literal +from typing_extensions import Literal, Annotated, TypeAlias +from ..._utils import PropertyInfo from ..._models import BaseModel -from ..scored_vector_store_chunk import ScoredVectorStoreChunk +from ..scored_text_input_chunk import ScoredTextInputChunk +from ..scored_audio_url_input_chunk import ScoredAudioURLInputChunk +from ..scored_image_url_input_chunk import ScoredImageURLInputChunk +from ..scored_video_url_input_chunk import ScoredVideoURLInputChunk -__all__ = ["ScoredVectorStoreFile"] +__all__ = ["ScoredVectorStoreFile", "Chunk"] + +Chunk: TypeAlias = Annotated[ + Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk], + PropertyInfo(discriminator="type"), +] class ScoredVectorStoreFile(BaseModel): @@ -44,5 +53,5 @@ class ScoredVectorStoreFile(BaseModel): score: float """score of the file""" - chunks: Optional[List[ScoredVectorStoreChunk]] = None + chunks: Optional[List[Chunk]] = None """chunks""" diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py index 4ecec3a0..4cbe5b96 100644 --- a/tests/api_resources/test_vector_stores.py +++ b/tests/api_resources/test_vector_stores.py @@ -112,7 +112,7 @@ def test_method_update_with_all_params(self, client: Mixedbread) -> None: vector_store = client.vector_stores.update( vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name="x", - description="x", + description="description", expires_after={ "anchor": "last_active_at", "days": 0, @@ -280,7 +280,10 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) -> "return_metadata": True, }, stream=True, - qa_options={"cite": True}, + qa_options={ + "cite": True, + "multimodal": True, + }, ) assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"]) @@ -487,7 +490,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread vector_store = await async_client.vector_stores.update( vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name="x", - description="x", + description="description", expires_after={ "anchor": "last_active_at", "days": 0, @@ -655,7 +658,10 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy "return_metadata": True, }, stream=True, - qa_options={"cite": True}, + qa_options={ + "cite": True, + "multimodal": True, + }, ) assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])