Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.18.0"
".": "0.19.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-1cb5e131887b451004a08be20efac2fa11c58a80dcee0176c38182b335499f05.yml
openapi_spec_hash: 1476cba193e17ebfb4bbf20c74753b05
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-d45a3a3119fa9a3db2a6cae3c6d376f99fb874ed359c369d9b9531fdea55dcec.yml
openapi_spec_hash: aedb38c67ac4c4b9ee79d130ddeb583a
config_hash: 810d9712d3d0d6a1f50d71a25511d8a7
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.19.0 (2025-07-17)

Full Changelog: [v0.18.0...v0.19.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.18.0...v0.19.0)

### Features

* **api:** api update ([3f1db0c](https://github.com/mixedbread-ai/mixedbread-python/commit/3f1db0c5653fa0f8efbe22d7489fe433677db68f))

## 0.18.0 (2025-07-17)

Full Changelog: [v0.17.0...v0.18.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.17.0...v0.18.0)
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ from mixedbread.types.vector_stores import (
Methods:

- <code title="post /v1/vector_stores/{vector_store_identifier}/files">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">create</a>(vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_stores/file_create_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">VectorStoreFile</a></code>
- <code title="get /v1/vector_stores/{vector_store_identifier}/files/{file_id}">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">retrieve</a>(file_id, \*, vector_store_identifier) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">VectorStoreFile</a></code>
- <code title="get /v1/vector_stores/{vector_store_identifier}/files/{file_id}">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">retrieve</a>(file_id, \*, vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_stores/file_retrieve_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">VectorStoreFile</a></code>
- <code title="get /v1/vector_stores/{vector_store_identifier}/files">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">list</a>(vector_store_identifier, \*\*<a href="src/mixedbread/types/vector_stores/file_list_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/vector_store_file.py">SyncCursor[VectorStoreFile]</a></code>
- <code title="delete /v1/vector_stores/{vector_store_identifier}/files/{file_id}">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">delete</a>(file_id, \*, vector_store_identifier) -> <a href="./src/mixedbread/types/vector_stores/file_delete_response.py">FileDeleteResponse</a></code>
- <code title="post /v1/vector_stores/files/search">client.vector_stores.files.<a href="./src/mixedbread/resources/vector_stores/files.py">search</a>(\*\*<a href="src/mixedbread/types/vector_stores/file_search_params.py">params</a>) -> <a href="./src/mixedbread/types/vector_stores/file_search_response.py">FileSearchResponse</a></code>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
version = "0.18.0"
version = "0.19.0"
description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/mixedbread/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "mixedbread"
__version__ = "0.18.0" # x-release-please-version
__version__ = "0.19.0" # x-release-please-version
22 changes: 19 additions & 3 deletions src/mixedbread/resources/vector_stores/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)
from ...pagination import SyncCursor, AsyncCursor
from ..._base_client import AsyncPaginator, make_request_options
from ...types.vector_stores import file_list_params, file_create_params, file_search_params
from ...types.vector_stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
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
Expand Down Expand Up @@ -113,6 +113,7 @@ def retrieve(
file_id: str,
*,
vector_store_identifier: str,
return_chunks: bool | 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,
Expand All @@ -133,6 +134,8 @@ def retrieve(

file_id: The ID of the file

return_chunks: Whether to return the chunks for the file

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -150,7 +153,11 @@ def retrieve(
return self._get(
f"/v1/vector_stores/{vector_store_identifier}/files/{file_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"return_chunks": return_chunks}, file_retrieve_params.FileRetrieveParams),
),
cast_to=VectorStoreFile,
)
Expand Down Expand Up @@ -542,6 +549,7 @@ async def retrieve(
file_id: str,
*,
vector_store_identifier: str,
return_chunks: bool | 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,
Expand All @@ -562,6 +570,8 @@ async def retrieve(

file_id: The ID of the file

return_chunks: Whether to return the chunks for the file

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -579,7 +589,13 @@ async def retrieve(
return await self._get(
f"/v1/vector_stores/{vector_store_identifier}/files/{file_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"return_chunks": return_chunks}, file_retrieve_params.FileRetrieveParams
),
),
cast_to=VectorStoreFile,
)
Expand Down
1 change: 1 addition & 0 deletions src/mixedbread/types/object_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
"api_key",
"data_source",
"data_source.connector",
"vector_store.histogram",
]
6 changes: 3 additions & 3 deletions src/mixedbread/types/scored_audio_url_input_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class ScoredAudioURLInputChunk(BaseModel):
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"""

audio_url: AudioURL
"""The audio input specification."""
6 changes: 3 additions & 3 deletions src/mixedbread/types/scored_image_url_input_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class ScoredImageURLInputChunk(BaseModel):
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"""

image_url: ImageURL
"""The image input specification."""
3 changes: 3 additions & 0 deletions src/mixedbread/types/scored_text_input_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@ class ScoredTextInputChunk(BaseModel):
type: Optional[Literal["text"]] = None
"""Input type identifier"""

offset: Optional[int] = None
"""The offset of the text in the file relative to the start of the file."""

text: str
"""Text content to process"""
6 changes: 3 additions & 3 deletions src/mixedbread/types/scored_video_url_input_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class ScoredVideoURLInputChunk(BaseModel):
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"""

video_url: VideoURL
"""The video input specification."""
1 change: 1 addition & 0 deletions src/mixedbread/types/vector_stores/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .file_retrieve_params import FileRetrieveParams as FileRetrieveParams
from .file_search_response import FileSearchResponse as FileSearchResponse
from .scored_vector_store_file import ScoredVectorStoreFile as ScoredVectorStoreFile
from .vector_store_file_status import VectorStoreFileStatus as VectorStoreFileStatus
15 changes: 15 additions & 0 deletions src/mixedbread/types/vector_stores/file_retrieve_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, TypedDict

__all__ = ["FileRetrieveParams"]


class FileRetrieveParams(TypedDict, total=False):
vector_store_identifier: Required[str]
"""The ID or name of the vector store"""

return_chunks: bool
"""Whether to return the chunks for the file"""
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class ScoredVectorStoreFile(BaseModel):
object: Optional[Literal["vector_store.file"]] = None
"""Type of the object"""

score: float
"""score of the file"""

chunks: Optional[List[Chunk]] = None
"""chunks"""

score: float
"""score of the file"""
115 changes: 112 additions & 3 deletions src/mixedbread/types/vector_stores/vector_store_file.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,119 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing import Dict, 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 .vector_store_file_status import VectorStoreFileStatus

__all__ = ["VectorStoreFile"]
__all__ = [
"VectorStoreFile",
"Chunk",
"ChunkTextInputChunk",
"ChunkImageURLInputChunkBase",
"ChunkAudioURLInputChunkBase",
"ChunkVideoURLInputChunkBase",
]


class ChunkTextInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""

mime_type: Optional[str] = None
"""mime type of the chunk"""

generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""

model: Optional[str] = None
"""model used for this chunk"""

type: Optional[Literal["text"]] = None
"""Input type identifier"""

offset: Optional[int] = None
"""The offset of the text in the file relative to the start of the file."""

text: str
"""Text content to process"""


class ChunkImageURLInputChunkBase(BaseModel):
chunk_index: int
"""position of the chunk in a file"""

mime_type: Optional[str] = None
"""mime type of the chunk"""

generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""

model: Optional[str] = None
"""model used for this chunk"""

type: Optional[Literal["image_url"]] = None
"""Input type identifier"""

ocr_text: Optional[str] = None
"""ocr text of the image"""

summary: Optional[str] = None
"""summary of the image"""


class ChunkAudioURLInputChunkBase(BaseModel):
chunk_index: int
"""position of the chunk in a file"""

mime_type: Optional[str] = None
"""mime type of the chunk"""

generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""

model: Optional[str] = None
"""model used for this chunk"""

type: Optional[Literal["audio_url"]] = None
"""Input type identifier"""

transcription: Optional[str] = None
"""speech recognition (sr) text of the audio"""

summary: Optional[str] = None
"""summary of the audio"""


class ChunkVideoURLInputChunkBase(BaseModel):
chunk_index: int
"""position of the chunk in a file"""

mime_type: Optional[str] = None
"""mime type of the chunk"""

generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""

model: Optional[str] = None
"""model used for this chunk"""

type: Optional[Literal["video_url"]] = None
"""Input type identifier"""

transcription: Optional[str] = None
"""speech recognition (sr) text of the video"""

summary: Optional[str] = None
"""summary of the video"""


Chunk: TypeAlias = Annotated[
Union[ChunkTextInputChunk, ChunkImageURLInputChunkBase, ChunkAudioURLInputChunkBase, ChunkVideoURLInputChunkBase],
PropertyInfo(discriminator="type"),
]


class VectorStoreFile(BaseModel):
Expand Down Expand Up @@ -40,3 +146,6 @@ class VectorStoreFile(BaseModel):

object: Optional[Literal["vector_store.file"]] = None
"""Type of the object"""

chunks: Optional[List[Chunk]] = None
"""chunks"""
18 changes: 18 additions & 0 deletions tests/api_resources/vector_stores/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ def test_method_retrieve(self, client: Mixedbread) -> None:
)
assert_matches_type(VectorStoreFile, file, path=["response"])

@parametrize
def test_method_retrieve_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.retrieve(
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
vector_store_identifier="vector_store_identifier",
return_chunks=True,
)
assert_matches_type(VectorStoreFile, file, path=["response"])

@parametrize
def test_raw_response_retrieve(self, client: Mixedbread) -> None:
response = client.vector_stores.files.with_raw_response.retrieve(
Expand Down Expand Up @@ -390,6 +399,15 @@ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
)
assert_matches_type(VectorStoreFile, file, path=["response"])

@parametrize
async def test_method_retrieve_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.retrieve(
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
vector_store_identifier="vector_store_identifier",
return_chunks=True,
)
assert_matches_type(VectorStoreFile, file, path=["response"])

@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
response = await async_client.vector_stores.files.with_raw_response.retrieve(
Expand Down