From 25d9759e51334732f79ebbe31b29c04222ae02c5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 13 Jan 2025 10:15:34 +0000
Subject: [PATCH 001/375] feat(api): update via SDK Studio (#61)
---
.github/workflows/publish-pypi.yml | 31 ++
.github/workflows/release-doctor.yml | 21 ++
.release-please-manifest.json | 3 +
.stats.yml | 2 +-
CONTRIBUTING.md | 4 +-
README.md | 123 ++++--
SECURITY.md | 2 +-
api.md | 144 +++----
bin/check-release-environment | 21 ++
pyproject.toml | 8 +-
release-please-config.json | 66 ++++
src/mixedbread/_client.py | 175 +++++----
src/mixedbread/_version.py | 2 +-
src/mixedbread/pagination.py | 89 +++++
src/mixedbread/resources/__init__.py | 78 +---
src/mixedbread/resources/completions.py | 164 --------
src/mixedbread/resources/embeddings.py | 8 +-
.../resources/extractions/__init__.py | 61 ---
.../resources/extractions/content.py | 196 ----------
.../resources/extractions/extractions.py | 166 --------
src/mixedbread/resources/extractions/jobs.py | 286 --------------
.../resources/extractions/schema.py | 356 ------------------
src/mixedbread/resources/{files => }/files.py | 190 +++++++---
src/mixedbread/resources/files/__init__.py | 33 --
src/mixedbread/resources/files/content.py | 184 ---------
src/mixedbread/resources/parsing/jobs.py | 8 +-
src/mixedbread/resources/parsing/parsing.py | 8 +-
src/mixedbread/resources/reranking.py | 8 +-
src/mixedbread/resources/service_info.py | 143 -------
.../resources/vector_stores/files.py | 40 +-
.../resources/vector_stores/vector_stores.py | 182 ++-------
src/mixedbread/types/__init__.py | 14 +-
src/mixedbread/types/embedding.py | 19 +
.../types/embedding_create_response.py | 16 +-
src/mixedbread/types/expires_after.py | 16 +
src/mixedbread/types/expires_after_param.py | 15 +
src/mixedbread/types/extractions/__init__.py | 14 -
.../extractions/content_create_params.py | 15 -
.../types/extractions/created_json_schema.py | 11 -
.../types/extractions/enhanced_json_schema.py | 11 -
.../types/extractions/extraction_job.py | 33 --
.../types/extractions/extraction_result.py | 11 -
.../types/extractions/job_create_params.py | 15 -
.../types/extractions/schema_create_params.py | 12 -
.../extractions/schema_enhance_params.py | 12 -
.../extractions/schema_validate_params.py | 12 -
.../extractions/validated_json_schema.py | 18 -
src/mixedbread/types/file_counts.py | 24 ++
...ile_deleted.py => file_delete_response.py} | 4 +-
src/mixedbread/types/file_list_response.py | 31 --
src/mixedbread/types/files/__init__.py | 3 -
.../types/scored_vector_store_chunk.py | 55 +++
src/mixedbread/types/vector_store.py | 29 +-
.../types/vector_store_create_params.py | 16 +-
...ted.py => vector_store_delete_response.py} | 4 +-
.../types/vector_store_list_response.py | 31 --
.../vector_store_question_answering_params.py | 50 ---
.../types/vector_store_search_response.py | 63 +---
.../types/vector_store_update_params.py | 16 +-
.../types/vector_stores/__init__.py | 4 +-
...ile_deleted.py => file_delete_response.py} | 4 +-
.../types/vector_stores/file_list_response.py | 31 --
.../vector_stores/file_search_response.py | 91 +----
.../vector_stores/scored_vector_store_file.py | 35 ++
tests/api_resources/extractions/__init__.py | 1 -
.../api_resources/extractions/test_content.py | 90 -----
tests/api_resources/extractions/test_jobs.py | 166 --------
.../api_resources/extractions/test_schema.py | 212 -----------
tests/api_resources/files/__init__.py | 1 -
tests/api_resources/files/test_content.py | 140 -------
tests/api_resources/test_client.py | 72 ++++
tests/api_resources/test_completions.py | 71 ----
tests/api_resources/test_files.py | 153 +++++++-
tests/api_resources/test_service_info.py | 72 ----
tests/api_resources/test_vector_stores.py | 128 +------
.../api_resources/vector_stores/test_files.py | 32 +-
tests/test_client.py | 78 ++--
77 files changed, 1186 insertions(+), 3567 deletions(-)
create mode 100644 .github/workflows/publish-pypi.yml
create mode 100644 .github/workflows/release-doctor.yml
create mode 100644 .release-please-manifest.json
create mode 100644 bin/check-release-environment
create mode 100644 release-please-config.json
create mode 100644 src/mixedbread/pagination.py
delete mode 100644 src/mixedbread/resources/completions.py
delete mode 100644 src/mixedbread/resources/extractions/__init__.py
delete mode 100644 src/mixedbread/resources/extractions/content.py
delete mode 100644 src/mixedbread/resources/extractions/extractions.py
delete mode 100644 src/mixedbread/resources/extractions/jobs.py
delete mode 100644 src/mixedbread/resources/extractions/schema.py
rename src/mixedbread/resources/{files => }/files.py (79%)
delete mode 100644 src/mixedbread/resources/files/__init__.py
delete mode 100644 src/mixedbread/resources/files/content.py
delete mode 100644 src/mixedbread/resources/service_info.py
create mode 100644 src/mixedbread/types/embedding.py
create mode 100644 src/mixedbread/types/expires_after.py
create mode 100644 src/mixedbread/types/expires_after_param.py
delete mode 100644 src/mixedbread/types/extractions/__init__.py
delete mode 100644 src/mixedbread/types/extractions/content_create_params.py
delete mode 100644 src/mixedbread/types/extractions/created_json_schema.py
delete mode 100644 src/mixedbread/types/extractions/enhanced_json_schema.py
delete mode 100644 src/mixedbread/types/extractions/extraction_job.py
delete mode 100644 src/mixedbread/types/extractions/extraction_result.py
delete mode 100644 src/mixedbread/types/extractions/job_create_params.py
delete mode 100644 src/mixedbread/types/extractions/schema_create_params.py
delete mode 100644 src/mixedbread/types/extractions/schema_enhance_params.py
delete mode 100644 src/mixedbread/types/extractions/schema_validate_params.py
delete mode 100644 src/mixedbread/types/extractions/validated_json_schema.py
create mode 100644 src/mixedbread/types/file_counts.py
rename src/mixedbread/types/{file_deleted.py => file_delete_response.py} (85%)
delete mode 100644 src/mixedbread/types/file_list_response.py
delete mode 100644 src/mixedbread/types/files/__init__.py
create mode 100644 src/mixedbread/types/scored_vector_store_chunk.py
rename src/mixedbread/types/{vector_store_deleted.py => vector_store_delete_response.py} (82%)
delete mode 100644 src/mixedbread/types/vector_store_list_response.py
delete mode 100644 src/mixedbread/types/vector_store_question_answering_params.py
rename src/mixedbread/types/vector_stores/{vector_store_file_deleted.py => file_delete_response.py} (84%)
delete mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
create mode 100644 src/mixedbread/types/vector_stores/scored_vector_store_file.py
delete mode 100644 tests/api_resources/extractions/__init__.py
delete mode 100644 tests/api_resources/extractions/test_content.py
delete mode 100644 tests/api_resources/extractions/test_jobs.py
delete mode 100644 tests/api_resources/extractions/test_schema.py
delete mode 100644 tests/api_resources/files/__init__.py
delete mode 100644 tests/api_resources/files/test_content.py
create mode 100644 tests/api_resources/test_client.py
delete mode 100644 tests/api_resources/test_completions.py
delete mode 100644 tests/api_resources/test_service_info.py
diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml
new file mode 100644
index 00000000..467239d4
--- /dev/null
+++ b/.github/workflows/publish-pypi.yml
@@ -0,0 +1,31 @@
+# This workflow is triggered when a GitHub release is created.
+# It can also be run manually to re-publish to PyPI in case it failed for some reason.
+# You can run this workflow by navigating to https://www.github.com/mixedbread-ai/mixedbread-python/actions/workflows/publish-pypi.yml
+name: Publish PyPI
+on:
+ workflow_dispatch:
+
+ release:
+ types: [published]
+
+jobs:
+ publish:
+ name: publish
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Install Rye
+ run: |
+ curl -sSf https://rye.astral.sh/get | bash
+ echo "$HOME/.rye/shims" >> $GITHUB_PATH
+ env:
+ RYE_VERSION: '0.35.0'
+ RYE_INSTALL_OPTION: '--yes'
+
+ - name: Publish to PyPI
+ run: |
+ bash ./bin/publish-pypi
+ env:
+ PYPI_TOKEN: ${{ secrets.MIXEDBREAD_PYPI_TOKEN || secrets.PYPI_TOKEN }}
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
new file mode 100644
index 00000000..f49b8bb9
--- /dev/null
+++ b/.github/workflows/release-doctor.yml
@@ -0,0 +1,21 @@
+name: Release Doctor
+on:
+ pull_request:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ release_doctor:
+ name: release doctor
+ runs-on: ubuntu-latest
+ if: github.repository == 'mixedbread-ai/mixedbread-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Check release environment
+ run: |
+ bash ./bin/check-release-environment
+ env:
+ PYPI_TOKEN: ${{ secrets.MIXEDBREAD_PYPI_TOKEN || secrets.PYPI_TOKEN }}
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
new file mode 100644
index 00000000..ee49ac2d
--- /dev/null
+++ b/.release-please-manifest.json
@@ -0,0 +1,3 @@
+{
+ ".": "0.1.0-alpha.11"
+}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 17a58af2..11d09278 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 30
+configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-a9b8728ee918c023a0e1458cfab7f26721d4ac851c533c6ce2f53411bc1576d1.yml
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5ba0d641..e9ccd896 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -63,7 +63,7 @@ If you’d like to use the repository from source, you can either install from g
To install via git:
```sh
-$ pip install git+ssh://git@github.com/stainless-sdks/mixedbread-python.git
+$ pip install git+ssh://git@github.com/mixedbread-ai/mixedbread-python.git
```
Alternatively, you can build from source and install the wheel file:
@@ -121,7 +121,7 @@ the changes aren't made through the automated pipeline, you may want to make rel
### Publish with a GitHub workflow
-You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/mixedbread-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
+You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/mixedbread-ai/mixedbread-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
### Publish manually
diff --git a/README.md b/README.md
index a22d9f2a..6340a1c1 100644
--- a/README.md
+++ b/README.md
@@ -10,13 +10,13 @@ It is generated with [Stainless](https://www.stainlessapi.com/).
## Documentation
-The REST API documentation can be found on [docs.mixedbread.com](https://docs.mixedbread.com). The full API of this library can be found in [api.md](api.md).
+The REST API documentation can be found on [mixedbread.ai](https://mixedbread.ai/docs). The full API of this library can be found in [api.md](api.md).
## Installation
```sh
-# install from this staging repo
-pip install git+ssh://git@github.com/stainless-sdks/mixedbread-python.git
+# install from the production repo
+pip install git+ssh://git@github.com/mixedbread-ai/mixedbread-python.git
```
> [!NOTE]
@@ -27,22 +27,22 @@ pip install git+ssh://git@github.com/stainless-sdks/mixedbread-python.git
The full API of this library can be found in [api.md](api.md).
```python
+import os
from mixedbread import Mixedbread
client = Mixedbread(
+ api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
# defaults to "production".
- environment="environment_1",
+ environment="local",
)
-file_object = client.files.create(
- file=b"raw file contents",
-)
-print(file_object.id)
+vector_store = client.vector_stores.create()
+print(vector_store.id)
```
While you can provide an `api_key` keyword argument,
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
-to add `API_KEY="My API Key"` to your `.env` file
+to add `MXBAI_API_KEY="My API Key"` to your `.env` file
so that your API Key is not stored in source control.
## Async usage
@@ -50,20 +50,20 @@ so that your API Key is not stored in source control.
Simply import `AsyncMixedbread` instead of `Mixedbread` and use `await` with each API call:
```python
+import os
import asyncio
from mixedbread import AsyncMixedbread
client = AsyncMixedbread(
+ api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
# defaults to "production".
- environment="environment_1",
+ environment="local",
)
async def main() -> None:
- file_object = await client.files.create(
- file=b"raw file contents",
- )
- print(file_object.id)
+ vector_store = await client.vector_stores.create()
+ print(vector_store.id)
asyncio.run(main())
@@ -80,6 +80,71 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
+## Pagination
+
+List methods in the Mixedbread API are paginated.
+
+This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
+
+```python
+from mixedbread import Mixedbread
+
+client = Mixedbread()
+
+all_vector_stores = []
+# Automatically fetches more pages as needed.
+for vector_store in client.vector_stores.list():
+ # Do something with vector_store here
+ all_vector_stores.append(vector_store)
+print(all_vector_stores)
+```
+
+Or, asynchronously:
+
+```python
+import asyncio
+from mixedbread import AsyncMixedbread
+
+client = AsyncMixedbread()
+
+
+async def main() -> None:
+ all_vector_stores = []
+ # Iterate through items across all pages, issuing requests as needed.
+ async for vector_store in client.vector_stores.list():
+ all_vector_stores.append(vector_store)
+ print(all_vector_stores)
+
+
+asyncio.run(main())
+```
+
+Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
+
+```python
+first_page = await client.vector_stores.list()
+if first_page.has_next_page():
+ print(f"will fetch next page using these details: {first_page.next_page_info()}")
+ next_page = await first_page.get_next_page()
+ print(f"number of items we just fetched: {len(next_page.data)}")
+
+# Remove `await` for non-async usage.
+```
+
+Or just work directly with the returned data:
+
+```python
+first_page = await client.vector_stores.list()
+
+print(
+ f"the current start offset for this page: {first_page.pagination.offset}"
+) # => "the current start offset for this page: 1"
+for vector_store in first_page.data:
+ print(vector_store.id)
+
+# Remove `await` for non-async usage.
+```
+
## Handling errors
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `mixedbread.APIConnectionError` is raised.
@@ -96,9 +161,7 @@ from mixedbread import Mixedbread
client = Mixedbread()
try:
- client.files.create(
- file=b"raw file contents",
- )
+ client.vector_stores.create()
except mixedbread.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -141,9 +204,7 @@ client = Mixedbread(
)
# Or, configure per-request:
-client.with_options(max_retries=5).files.create(
- file=b"raw file contents",
-)
+client.with_options(max_retries=5).vector_stores.create()
```
### Timeouts
@@ -166,9 +227,7 @@ client = Mixedbread(
)
# Override per-request:
-client.with_options(timeout=5.0).files.create(
- file=b"raw file contents",
-)
+client.with_options(timeout=5.0).vector_stores.create()
```
On timeout, an `APITimeoutError` is thrown.
@@ -209,18 +268,16 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
from mixedbread import Mixedbread
client = Mixedbread()
-response = client.files.with_raw_response.create(
- file=b'raw file contents',
-)
+response = client.vector_stores.with_raw_response.create()
print(response.headers.get('X-My-Header'))
-file = response.parse() # get the object that `files.create()` would have returned
-print(file.id)
+vector_store = response.parse() # get the object that `vector_stores.create()` would have returned
+print(vector_store.id)
```
-These methods return an [`APIResponse`](https://github.com/stainless-sdks/mixedbread-python/tree/main/src/mixedbread/_response.py) object.
+These methods return an [`APIResponse`](https://github.com/mixedbread-ai/mixedbread-python/tree/main/src/mixedbread/_response.py) object.
-The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/mixedbread-python/tree/main/src/mixedbread/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
+The async client returns an [`AsyncAPIResponse`](https://github.com/mixedbread-ai/mixedbread-python/tree/main/src/mixedbread/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
#### `.with_streaming_response`
@@ -229,9 +286,7 @@ The above interface eagerly reads the full response body when you make the reque
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
```python
-with client.files.with_streaming_response.create(
- file=b"raw file contents",
-) as response:
+with client.vector_stores.with_streaming_response.create() as response:
print(response.headers.get("X-My-Header"))
for line in response.iter_lines():
@@ -326,7 +381,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
-We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/mixedbread-python/issues) with questions, bugs, or suggestions.
+We are keen for your feedback; please open an [issue](https://www.github.com/mixedbread-ai/mixedbread-python/issues) with questions, bugs, or suggestions.
### Determining the installed version
diff --git a/SECURITY.md b/SECURITY.md
index 61396288..83c8a2fe 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -20,7 +20,7 @@ or products provided by Mixedbread please follow the respective company's securi
### Mixedbread Terms and Policies
-Please contact dev-feedback@mixedbread.com for any questions or concerns regarding security of our services.
+Please contact support@mixedbread.ai for any questions or concerns regarding security of our services.
---
diff --git a/api.md b/api.md
index ab0ed54c..ddce9b34 100644
--- a/api.md
+++ b/api.md
@@ -1,4 +1,4 @@
-# ServiceInfo
+# Mixedbread
Types:
@@ -8,86 +8,31 @@ from mixedbread.types import InfoResponse
Methods:
-- client.service_info.retrieve() -> InfoResponse
+- client.info() -> InfoResponse
-# Files
-
-Types:
-
-```python
-from mixedbread.types import FileDeleted, FileObject, FileListResponse
-```
-
-Methods:
-
-- client.files.create(\*\*params) -> FileObject
-- client.files.retrieve(file_id) -> FileObject
-- client.files.update(file_id, \*\*params) -> FileObject
-- client.files.list(\*\*params) -> FileListResponse
-- client.files.delete(file_id) -> FileDeleted
-
-## Content
-
-Methods:
-
-- client.files.content.retrieve(file_id) -> BinaryAPIResponse
-
-# Completions
-
-Types:
-
-```python
-from mixedbread.types import CompletionCreateResponse
-```
-
-Methods:
-
-- client.completions.create() -> object
-
-# VectorStores
+# Embeddings
Types:
```python
-from mixedbread.types import (
- VectorStore,
- VectorStoreDeleted,
- VectorStoreListResponse,
- VectorStoreQuestionAnsweringResponse,
- VectorStoreSearchResponse,
-)
+from mixedbread.types import Embedding, EmbeddingCreateResponse
```
Methods:
-- client.vector_stores.create(\*\*params) -> VectorStore
-- client.vector_stores.retrieve(vector_store_id) -> VectorStore
-- client.vector_stores.update(vector_store_id, \*\*params) -> VectorStore
-- client.vector_stores.list(\*\*params) -> VectorStoreListResponse
-- client.vector_stores.delete(vector_store_id) -> VectorStoreDeleted
-- client.vector_stores.question_answering(\*\*params) -> object
-- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
+- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
-## Files
+# Reranking
Types:
```python
-from mixedbread.types.vector_stores import (
- VectorStoreFile,
- VectorStoreFileDeleted,
- FileListResponse,
- FileSearchResponse,
-)
+from mixedbread.types import RerankingCreateResponse
```
Methods:
-- client.vector_stores.files.create(vector_store_id, \*\*params) -> VectorStoreFile
-- client.vector_stores.files.retrieve(file_id, \*, vector_store_id) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_id, \*\*params) -> FileListResponse
-- client.vector_stores.files.delete(file_id, \*, vector_store_id) -> VectorStoreFileDeleted
-- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
+- client.reranking.create(\*\*params) -> RerankingCreateResponse
# Parsing
@@ -104,67 +49,64 @@ Methods:
- client.parsing.jobs.create(\*\*params) -> ParsingJob
- client.parsing.jobs.retrieve(job_id) -> ParsingJob
-# Extractions
-
-## Jobs
-
-Types:
-
-```python
-from mixedbread.types.extractions import ExtractionJob
-```
-
-Methods:
-
-- client.extractions.jobs.create(\*\*params) -> ExtractionJob
-- client.extractions.jobs.retrieve(job_id) -> ExtractionJob
-
-## Schema
-
-Types:
-
-```python
-from mixedbread.types.extractions import CreatedJsonSchema, EnhancedJsonSchema, ValidatedJsonSchema
-```
-
-Methods:
-
-- client.extractions.schema.create(\*\*params) -> CreatedJsonSchema
-- client.extractions.schema.enhance(\*\*params) -> EnhancedJsonSchema
-- client.extractions.schema.validate(\*\*params) -> ValidatedJsonSchema
-
-## Content
+# Files
Types:
```python
-from mixedbread.types.extractions import ExtractionResult
+from mixedbread.types import FileObject, FileDeleteResponse
```
Methods:
-- client.extractions.content.create(\*\*params) -> ExtractionResult
+- client.files.create(\*\*params) -> FileObject
+- client.files.retrieve(file_id) -> FileObject
+- client.files.update(file_id, \*\*params) -> FileObject
+- client.files.list(\*\*params) -> SyncLimitOffset[FileObject]
+- client.files.delete(file_id) -> FileDeleteResponse
+- client.files.content(file_id) -> BinaryAPIResponse
-# Embeddings
+# VectorStores
Types:
```python
-from mixedbread.types import EmbeddingCreateResponse
+from mixedbread.types import (
+ ExpiresAfter,
+ FileCounts,
+ ScoredVectorStoreChunk,
+ VectorStore,
+ VectorStoreDeleteResponse,
+ VectorStoreSearchResponse,
+)
```
Methods:
-- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
+- client.vector_stores.create(\*\*params) -> VectorStore
+- client.vector_stores.retrieve(vector_store_id) -> VectorStore
+- client.vector_stores.update(vector_store_id, \*\*params) -> VectorStore
+- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStore]
+- client.vector_stores.delete(vector_store_id) -> VectorStoreDeleteResponse
+- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
-# Reranking
+## Files
Types:
```python
-from mixedbread.types import RerankingCreateResponse
+from mixedbread.types.vector_stores import (
+ ScoredVectorStoreFile,
+ VectorStoreFile,
+ FileDeleteResponse,
+ FileSearchResponse,
+)
```
Methods:
-- client.reranking.create(\*\*params) -> RerankingCreateResponse
+- client.vector_stores.files.create(vector_store_id, \*\*params) -> VectorStoreFile
+- client.vector_stores.files.retrieve(file_id, \*, vector_store_id) -> VectorStoreFile
+- client.vector_stores.files.list(vector_store_id, \*\*params) -> SyncLimitOffset[VectorStoreFile]
+- client.vector_stores.files.delete(file_id, \*, vector_store_id) -> FileDeleteResponse
+- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/bin/check-release-environment b/bin/check-release-environment
new file mode 100644
index 00000000..fa95a3ba
--- /dev/null
+++ b/bin/check-release-environment
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+errors=()
+
+if [ -z "${PYPI_TOKEN}" ]; then
+ errors+=("The MIXEDBREAD_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
+fi
+
+lenErrors=${#errors[@]}
+
+if [[ lenErrors -gt 0 ]]; then
+ echo -e "Found the following errors in the release environment:\n"
+
+ for error in "${errors[@]}"; do
+ echo -e "- $error\n"
+ done
+
+ exit 1
+fi
+
+echo "The environment is ready to push releases!"
diff --git a/pyproject.toml b/pyproject.toml
index 9b12293b..9f0dc211 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,7 +5,7 @@ description = "The official Python library for the mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
-{ name = "Mixedbread", email = "dev-feedback@mixedbread.com" },
+{ name = "Mixedbread", email = "support@mixedbread.ai" },
]
dependencies = [
"httpx>=0.23.0, <1",
@@ -34,8 +34,8 @@ classifiers = [
]
[project.urls]
-Homepage = "https://github.com/stainless-sdks/mixedbread-python"
-Repository = "https://github.com/stainless-sdks/mixedbread-python"
+Homepage = "https://github.com/mixedbread-ai/mixedbread-python"
+Repository = "https://github.com/mixedbread-ai/mixedbread-python"
@@ -122,7 +122,7 @@ path = "README.md"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# replace relative links with absolute links
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
-replacement = '[\1](https://github.com/stainless-sdks/mixedbread-python/tree/main/\g<2>)'
+replacement = '[\1](https://github.com/mixedbread-ai/mixedbread-python/tree/main/\g<2>)'
[tool.pytest.ini_options]
testpaths = ["tests"]
diff --git a/release-please-config.json b/release-please-config.json
new file mode 100644
index 00000000..0e2bc44e
--- /dev/null
+++ b/release-please-config.json
@@ -0,0 +1,66 @@
+{
+ "packages": {
+ ".": {}
+ },
+ "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
+ "include-v-in-tag": true,
+ "include-component-in-tag": false,
+ "versioning": "prerelease",
+ "prerelease": true,
+ "bump-minor-pre-major": true,
+ "bump-patch-for-minor-pre-major": false,
+ "pull-request-header": "Automated Release PR",
+ "pull-request-title-pattern": "release: ${version}",
+ "changelog-sections": [
+ {
+ "type": "feat",
+ "section": "Features"
+ },
+ {
+ "type": "fix",
+ "section": "Bug Fixes"
+ },
+ {
+ "type": "perf",
+ "section": "Performance Improvements"
+ },
+ {
+ "type": "revert",
+ "section": "Reverts"
+ },
+ {
+ "type": "chore",
+ "section": "Chores"
+ },
+ {
+ "type": "docs",
+ "section": "Documentation"
+ },
+ {
+ "type": "style",
+ "section": "Styles"
+ },
+ {
+ "type": "refactor",
+ "section": "Refactors"
+ },
+ {
+ "type": "test",
+ "section": "Tests",
+ "hidden": true
+ },
+ {
+ "type": "build",
+ "section": "Build System"
+ },
+ {
+ "type": "ci",
+ "section": "Continuous Integration",
+ "hidden": true
+ }
+ ],
+ "release-type": "python",
+ "extra-files": [
+ "src/mixedbread/_version.py"
+ ]
+}
\ No newline at end of file
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 3c02ec0f..e8a02a46 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -12,7 +12,10 @@
from ._qs import Querystring
from ._types import (
NOT_GIVEN,
+ Body,
Omit,
+ Query,
+ Headers,
Timeout,
NotGiven,
Transport,
@@ -24,17 +27,23 @@
get_async_library,
)
from ._version import __version__
-from .resources import reranking, embeddings, completions, service_info
+from ._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from .resources import files, reranking, embeddings
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, MixedbreadError
from ._base_client import (
DEFAULT_MAX_RETRIES,
SyncAPIClient,
AsyncAPIClient,
+ make_request_options,
)
-from .resources.files import files
from .resources.parsing import parsing
-from .resources.extractions import extractions
+from .types.info_response import InfoResponse
from .resources.vector_stores import vector_stores
__all__ = [
@@ -51,32 +60,29 @@
ENVIRONMENTS: Dict[str, str] = {
"production": "https://api.mixedbread.ai",
- "environment_1": "http://127.0.0.1:8000",
+ "local": "http://127.0.0.1:8000",
}
class Mixedbread(SyncAPIClient):
- service_info: service_info.ServiceInfoResource
- files: files.FilesResource
- completions: completions.CompletionsResource
- vector_stores: vector_stores.VectorStoresResource
- parsing: parsing.ParsingResource
- extractions: extractions.ExtractionsResource
embeddings: embeddings.EmbeddingsResource
reranking: reranking.RerankingResource
+ parsing: parsing.ParsingResource
+ files: files.FilesResource
+ vector_stores: vector_stores.VectorStoresResource
with_raw_response: MixedbreadWithRawResponse
with_streaming_response: MixedbreadWithStreamedResponse
# client options
api_key: str
- _environment: Literal["production", "environment_1"] | NotGiven
+ _environment: Literal["production", "local"] | NotGiven
def __init__(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "environment_1"] | NotGiven = NOT_GIVEN,
+ environment: Literal["production", "local"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -98,13 +104,13 @@ def __init__(
) -> None:
"""Construct a new synchronous mixedbread client instance.
- This automatically infers the `api_key` argument from the `API_KEY` environment variable if it is not provided.
+ This automatically infers the `api_key` argument from the `MXBAI_API_KEY` environment variable if it is not provided.
"""
if api_key is None:
- api_key = os.environ.get("API_KEY")
+ api_key = os.environ.get("MXBAI_API_KEY")
if api_key is None:
raise MixedbreadError(
- "The api_key client option must be set either by passing api_key to the client or by setting the API_KEY environment variable"
+ "The api_key client option must be set either by passing api_key to the client or by setting the MXBAI_API_KEY environment variable"
)
self.api_key = api_key
@@ -145,14 +151,11 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.service_info = service_info.ServiceInfoResource(self)
- self.files = files.FilesResource(self)
- self.completions = completions.CompletionsResource(self)
- self.vector_stores = vector_stores.VectorStoresResource(self)
- self.parsing = parsing.ParsingResource(self)
- self.extractions = extractions.ExtractionsResource(self)
self.embeddings = embeddings.EmbeddingsResource(self)
self.reranking = reranking.RerankingResource(self)
+ self.parsing = parsing.ParsingResource(self)
+ self.files = files.FilesResource(self)
+ self.vector_stores = vector_stores.VectorStoresResource(self)
self.with_raw_response = MixedbreadWithRawResponse(self)
self.with_streaming_response = MixedbreadWithStreamedResponse(self)
@@ -180,7 +183,7 @@ def copy(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "environment_1"] | None = None,
+ environment: Literal["production", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
http_client: httpx.Client | None = None,
@@ -229,6 +232,29 @@ def copy(
# client.with_options(timeout=10).foo.create(...)
with_options = copy
+ def info(
+ self,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> InfoResponse:
+ """
+ Returns service information, including name and version.
+
+ Returns: InfoResponse: A response containing the service name and version.
+ """
+ return self.get(
+ "/",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=InfoResponse,
+ )
+
@override
def _make_status_error(
self,
@@ -264,27 +290,24 @@ def _make_status_error(
class AsyncMixedbread(AsyncAPIClient):
- service_info: service_info.AsyncServiceInfoResource
- files: files.AsyncFilesResource
- completions: completions.AsyncCompletionsResource
- vector_stores: vector_stores.AsyncVectorStoresResource
- parsing: parsing.AsyncParsingResource
- extractions: extractions.AsyncExtractionsResource
embeddings: embeddings.AsyncEmbeddingsResource
reranking: reranking.AsyncRerankingResource
+ parsing: parsing.AsyncParsingResource
+ files: files.AsyncFilesResource
+ vector_stores: vector_stores.AsyncVectorStoresResource
with_raw_response: AsyncMixedbreadWithRawResponse
with_streaming_response: AsyncMixedbreadWithStreamedResponse
# client options
api_key: str
- _environment: Literal["production", "environment_1"] | NotGiven
+ _environment: Literal["production", "local"] | NotGiven
def __init__(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "environment_1"] | NotGiven = NOT_GIVEN,
+ environment: Literal["production", "local"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -306,13 +329,13 @@ def __init__(
) -> None:
"""Construct a new async mixedbread client instance.
- This automatically infers the `api_key` argument from the `API_KEY` environment variable if it is not provided.
+ This automatically infers the `api_key` argument from the `MXBAI_API_KEY` environment variable if it is not provided.
"""
if api_key is None:
- api_key = os.environ.get("API_KEY")
+ api_key = os.environ.get("MXBAI_API_KEY")
if api_key is None:
raise MixedbreadError(
- "The api_key client option must be set either by passing api_key to the client or by setting the API_KEY environment variable"
+ "The api_key client option must be set either by passing api_key to the client or by setting the MXBAI_API_KEY environment variable"
)
self.api_key = api_key
@@ -353,14 +376,11 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.service_info = service_info.AsyncServiceInfoResource(self)
- self.files = files.AsyncFilesResource(self)
- self.completions = completions.AsyncCompletionsResource(self)
- self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
- self.parsing = parsing.AsyncParsingResource(self)
- self.extractions = extractions.AsyncExtractionsResource(self)
self.embeddings = embeddings.AsyncEmbeddingsResource(self)
self.reranking = reranking.AsyncRerankingResource(self)
+ self.parsing = parsing.AsyncParsingResource(self)
+ self.files = files.AsyncFilesResource(self)
+ self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)
@@ -388,7 +408,7 @@ def copy(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "environment_1"] | None = None,
+ environment: Literal["production", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
http_client: httpx.AsyncClient | None = None,
@@ -437,6 +457,29 @@ def copy(
# client.with_options(timeout=10).foo.create(...)
with_options = copy
+ async def info(
+ self,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> InfoResponse:
+ """
+ Returns service information, including name and version.
+
+ Returns: InfoResponse: A response containing the service name and version.
+ """
+ return await self.get(
+ "/",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=InfoResponse,
+ )
+
@override
def _make_status_error(
self,
@@ -473,50 +516,54 @@ def _make_status_error(
class MixedbreadWithRawResponse:
def __init__(self, client: Mixedbread) -> None:
- self.service_info = service_info.ServiceInfoResourceWithRawResponse(client.service_info)
- self.files = files.FilesResourceWithRawResponse(client.files)
- self.completions = completions.CompletionsResourceWithRawResponse(client.completions)
- self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
- self.parsing = parsing.ParsingResourceWithRawResponse(client.parsing)
- self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
self.reranking = reranking.RerankingResourceWithRawResponse(client.reranking)
+ self.parsing = parsing.ParsingResourceWithRawResponse(client.parsing)
+ self.files = files.FilesResourceWithRawResponse(client.files)
+ self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
+
+ self.info = to_raw_response_wrapper(
+ client.info,
+ )
class AsyncMixedbreadWithRawResponse:
def __init__(self, client: AsyncMixedbread) -> None:
- self.service_info = service_info.AsyncServiceInfoResourceWithRawResponse(client.service_info)
- self.files = files.AsyncFilesResourceWithRawResponse(client.files)
- self.completions = completions.AsyncCompletionsResourceWithRawResponse(client.completions)
- self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
- self.parsing = parsing.AsyncParsingResourceWithRawResponse(client.parsing)
- self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
self.reranking = reranking.AsyncRerankingResourceWithRawResponse(client.reranking)
+ self.parsing = parsing.AsyncParsingResourceWithRawResponse(client.parsing)
+ self.files = files.AsyncFilesResourceWithRawResponse(client.files)
+ self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
+
+ self.info = async_to_raw_response_wrapper(
+ client.info,
+ )
class MixedbreadWithStreamedResponse:
def __init__(self, client: Mixedbread) -> None:
- self.service_info = service_info.ServiceInfoResourceWithStreamingResponse(client.service_info)
- self.files = files.FilesResourceWithStreamingResponse(client.files)
- self.completions = completions.CompletionsResourceWithStreamingResponse(client.completions)
- self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
- self.parsing = parsing.ParsingResourceWithStreamingResponse(client.parsing)
- self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
self.reranking = reranking.RerankingResourceWithStreamingResponse(client.reranking)
+ self.parsing = parsing.ParsingResourceWithStreamingResponse(client.parsing)
+ self.files = files.FilesResourceWithStreamingResponse(client.files)
+ self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
+
+ self.info = to_streamed_response_wrapper(
+ client.info,
+ )
class AsyncMixedbreadWithStreamedResponse:
def __init__(self, client: AsyncMixedbread) -> None:
- self.service_info = service_info.AsyncServiceInfoResourceWithStreamingResponse(client.service_info)
- self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
- self.completions = completions.AsyncCompletionsResourceWithStreamingResponse(client.completions)
- self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
- self.parsing = parsing.AsyncParsingResourceWithStreamingResponse(client.parsing)
- self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
self.reranking = reranking.AsyncRerankingResourceWithStreamingResponse(client.reranking)
+ self.parsing = parsing.AsyncParsingResourceWithStreamingResponse(client.parsing)
+ self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
+ self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
+
+ self.info = async_to_streamed_response_wrapper(
+ client.info,
+ )
Client = Mixedbread
diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py
index c367ca09..2127bcb8 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.1.0-alpha.11"
+__version__ = "0.1.0-alpha.11" # x-release-please-version
diff --git a/src/mixedbread/pagination.py b/src/mixedbread/pagination.py
new file mode 100644
index 00000000..b72f9fcc
--- /dev/null
+++ b/src/mixedbread/pagination.py
@@ -0,0 +1,89 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Generic, TypeVar, Optional
+from typing_extensions import override
+
+from ._models import BaseModel
+from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage
+
+__all__ = ["LimitOffsetPagination", "SyncLimitOffset", "AsyncLimitOffset"]
+
+_T = TypeVar("_T")
+
+
+class LimitOffsetPagination(BaseModel):
+ offset: Optional[int] = None
+
+ total: Optional[int] = None
+
+
+class SyncLimitOffset(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
+ data: List[_T]
+ pagination: Optional[LimitOffsetPagination] = None
+
+ @override
+ def _get_page_items(self) -> List[_T]:
+ data = self.data
+ if not data:
+ return []
+ return data
+
+ @override
+ def next_page_info(self) -> Optional[PageInfo]:
+ offset = None
+ if self.pagination is not None:
+ if self.pagination.offset is not None:
+ offset = self.pagination.offset
+ if offset is None:
+ return None
+
+ length = len(self._get_page_items())
+ current_count = offset + length
+
+ total = None
+ if self.pagination is not None:
+ if self.pagination.total is not None:
+ total = self.pagination.total
+ if total is None:
+ return None
+
+ if current_count < total:
+ return PageInfo(params={"offset": current_count})
+
+ return None
+
+
+class AsyncLimitOffset(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
+ data: List[_T]
+ pagination: Optional[LimitOffsetPagination] = None
+
+ @override
+ def _get_page_items(self) -> List[_T]:
+ data = self.data
+ if not data:
+ return []
+ return data
+
+ @override
+ def next_page_info(self) -> Optional[PageInfo]:
+ offset = None
+ if self.pagination is not None:
+ if self.pagination.offset is not None:
+ offset = self.pagination.offset
+ if offset is None:
+ return None
+
+ length = len(self._get_page_items())
+ current_count = offset + length
+
+ total = None
+ if self.pagination is not None:
+ if self.pagination.total is not None:
+ total = self.pagination.total
+ if total is None:
+ return None
+
+ if current_count < total:
+ return PageInfo(params={"offset": current_count})
+
+ return None
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index 3dda4b1c..df3fc03a 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -32,30 +32,6 @@
EmbeddingsResourceWithStreamingResponse,
AsyncEmbeddingsResourceWithStreamingResponse,
)
-from .completions import (
- CompletionsResource,
- AsyncCompletionsResource,
- CompletionsResourceWithRawResponse,
- AsyncCompletionsResourceWithRawResponse,
- CompletionsResourceWithStreamingResponse,
- AsyncCompletionsResourceWithStreamingResponse,
-)
-from .extractions import (
- ExtractionsResource,
- AsyncExtractionsResource,
- ExtractionsResourceWithRawResponse,
- AsyncExtractionsResourceWithRawResponse,
- ExtractionsResourceWithStreamingResponse,
- AsyncExtractionsResourceWithStreamingResponse,
-)
-from .service_info import (
- ServiceInfoResource,
- AsyncServiceInfoResource,
- ServiceInfoResourceWithRawResponse,
- AsyncServiceInfoResourceWithRawResponse,
- ServiceInfoResourceWithStreamingResponse,
- AsyncServiceInfoResourceWithStreamingResponse,
-)
from .vector_stores import (
VectorStoresResource,
AsyncVectorStoresResource,
@@ -66,42 +42,6 @@
)
__all__ = [
- "ServiceInfoResource",
- "AsyncServiceInfoResource",
- "ServiceInfoResourceWithRawResponse",
- "AsyncServiceInfoResourceWithRawResponse",
- "ServiceInfoResourceWithStreamingResponse",
- "AsyncServiceInfoResourceWithStreamingResponse",
- "FilesResource",
- "AsyncFilesResource",
- "FilesResourceWithRawResponse",
- "AsyncFilesResourceWithRawResponse",
- "FilesResourceWithStreamingResponse",
- "AsyncFilesResourceWithStreamingResponse",
- "CompletionsResource",
- "AsyncCompletionsResource",
- "CompletionsResourceWithRawResponse",
- "AsyncCompletionsResourceWithRawResponse",
- "CompletionsResourceWithStreamingResponse",
- "AsyncCompletionsResourceWithStreamingResponse",
- "VectorStoresResource",
- "AsyncVectorStoresResource",
- "VectorStoresResourceWithRawResponse",
- "AsyncVectorStoresResourceWithRawResponse",
- "VectorStoresResourceWithStreamingResponse",
- "AsyncVectorStoresResourceWithStreamingResponse",
- "ParsingResource",
- "AsyncParsingResource",
- "ParsingResourceWithRawResponse",
- "AsyncParsingResourceWithRawResponse",
- "ParsingResourceWithStreamingResponse",
- "AsyncParsingResourceWithStreamingResponse",
- "ExtractionsResource",
- "AsyncExtractionsResource",
- "ExtractionsResourceWithRawResponse",
- "AsyncExtractionsResourceWithRawResponse",
- "ExtractionsResourceWithStreamingResponse",
- "AsyncExtractionsResourceWithStreamingResponse",
"EmbeddingsResource",
"AsyncEmbeddingsResource",
"EmbeddingsResourceWithRawResponse",
@@ -114,4 +54,22 @@
"AsyncRerankingResourceWithRawResponse",
"RerankingResourceWithStreamingResponse",
"AsyncRerankingResourceWithStreamingResponse",
+ "ParsingResource",
+ "AsyncParsingResource",
+ "ParsingResourceWithRawResponse",
+ "AsyncParsingResourceWithRawResponse",
+ "ParsingResourceWithStreamingResponse",
+ "AsyncParsingResourceWithStreamingResponse",
+ "FilesResource",
+ "AsyncFilesResource",
+ "FilesResourceWithRawResponse",
+ "AsyncFilesResourceWithRawResponse",
+ "FilesResourceWithStreamingResponse",
+ "AsyncFilesResourceWithStreamingResponse",
+ "VectorStoresResource",
+ "AsyncVectorStoresResource",
+ "VectorStoresResourceWithRawResponse",
+ "AsyncVectorStoresResourceWithRawResponse",
+ "VectorStoresResourceWithStreamingResponse",
+ "AsyncVectorStoresResourceWithStreamingResponse",
]
diff --git a/src/mixedbread/resources/completions.py b/src/mixedbread/resources/completions.py
deleted file mode 100644
index 0132a58f..00000000
--- a/src/mixedbread/resources/completions.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from .._compat import cached_property
-from .._resource import SyncAPIResource, AsyncAPIResource
-from .._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from .._base_client import make_request_options
-
-__all__ = ["CompletionsResource", "AsyncCompletionsResource"]
-
-
-class CompletionsResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> CompletionsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return CompletionsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> CompletionsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return CompletionsResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
- """
- Create a chat completion using the provided parameters.
-
- Generates a completion response based on the chat messages and model parameters
- provided. The response can be either a full completion or streamed chunks
- depending on the request parameters.
-
- Args: params: Parameters for creating the chat completion including messages,
- model selection, and generation settings user: The authenticated user making the
- request
-
- Returns: Either a ChatCompletion containing the full response, or
- ChatCompletionChunk for streaming
-
- Raises: HTTPException: If there is an error creating the completion (500)
- """
- return self._post(
- "/v1/chat/completions",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=object,
- )
-
-
-class AsyncCompletionsResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncCompletionsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncCompletionsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncCompletionsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return AsyncCompletionsResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
- """
- Create a chat completion using the provided parameters.
-
- Generates a completion response based on the chat messages and model parameters
- provided. The response can be either a full completion or streamed chunks
- depending on the request parameters.
-
- Args: params: Parameters for creating the chat completion including messages,
- model selection, and generation settings user: The authenticated user making the
- request
-
- Returns: Either a ChatCompletion containing the full response, or
- ChatCompletionChunk for streaming
-
- Raises: HTTPException: If there is an error creating the completion (500)
- """
- return await self._post(
- "/v1/chat/completions",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=object,
- )
-
-
-class CompletionsResourceWithRawResponse:
- def __init__(self, completions: CompletionsResource) -> None:
- self._completions = completions
-
- self.create = to_raw_response_wrapper(
- completions.create,
- )
-
-
-class AsyncCompletionsResourceWithRawResponse:
- def __init__(self, completions: AsyncCompletionsResource) -> None:
- self._completions = completions
-
- self.create = async_to_raw_response_wrapper(
- completions.create,
- )
-
-
-class CompletionsResourceWithStreamingResponse:
- def __init__(self, completions: CompletionsResource) -> None:
- self._completions = completions
-
- self.create = to_streamed_response_wrapper(
- completions.create,
- )
-
-
-class AsyncCompletionsResourceWithStreamingResponse:
- def __init__(self, completions: AsyncCompletionsResource) -> None:
- self._completions = completions
-
- self.create = async_to_streamed_response_wrapper(
- completions.create,
- )
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index fb15b5c6..15f1e35f 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -34,7 +34,7 @@ def with_raw_response(self) -> EmbeddingsResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return EmbeddingsResourceWithRawResponse(self)
@@ -43,7 +43,7 @@ def with_streaming_response(self) -> EmbeddingsResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return EmbeddingsResourceWithStreamingResponse(self)
@@ -123,7 +123,7 @@ def with_raw_response(self) -> AsyncEmbeddingsResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return AsyncEmbeddingsResourceWithRawResponse(self)
@@ -132,7 +132,7 @@ def with_streaming_response(self) -> AsyncEmbeddingsResourceWithStreamingRespons
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return AsyncEmbeddingsResourceWithStreamingResponse(self)
diff --git a/src/mixedbread/resources/extractions/__init__.py b/src/mixedbread/resources/extractions/__init__.py
deleted file mode 100644
index d9a42002..00000000
--- a/src/mixedbread/resources/extractions/__init__.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from .jobs import (
- JobsResource,
- AsyncJobsResource,
- JobsResourceWithRawResponse,
- AsyncJobsResourceWithRawResponse,
- JobsResourceWithStreamingResponse,
- AsyncJobsResourceWithStreamingResponse,
-)
-from .schema import (
- SchemaResource,
- AsyncSchemaResource,
- SchemaResourceWithRawResponse,
- AsyncSchemaResourceWithRawResponse,
- SchemaResourceWithStreamingResponse,
- AsyncSchemaResourceWithStreamingResponse,
-)
-from .content import (
- ContentResource,
- AsyncContentResource,
- ContentResourceWithRawResponse,
- AsyncContentResourceWithRawResponse,
- ContentResourceWithStreamingResponse,
- AsyncContentResourceWithStreamingResponse,
-)
-from .extractions import (
- ExtractionsResource,
- AsyncExtractionsResource,
- ExtractionsResourceWithRawResponse,
- AsyncExtractionsResourceWithRawResponse,
- ExtractionsResourceWithStreamingResponse,
- AsyncExtractionsResourceWithStreamingResponse,
-)
-
-__all__ = [
- "JobsResource",
- "AsyncJobsResource",
- "JobsResourceWithRawResponse",
- "AsyncJobsResourceWithRawResponse",
- "JobsResourceWithStreamingResponse",
- "AsyncJobsResourceWithStreamingResponse",
- "SchemaResource",
- "AsyncSchemaResource",
- "SchemaResourceWithRawResponse",
- "AsyncSchemaResourceWithRawResponse",
- "SchemaResourceWithStreamingResponse",
- "AsyncSchemaResourceWithStreamingResponse",
- "ContentResource",
- "AsyncContentResource",
- "ContentResourceWithRawResponse",
- "AsyncContentResourceWithRawResponse",
- "ContentResourceWithStreamingResponse",
- "AsyncContentResourceWithStreamingResponse",
- "ExtractionsResource",
- "AsyncExtractionsResource",
- "ExtractionsResourceWithRawResponse",
- "AsyncExtractionsResourceWithRawResponse",
- "ExtractionsResourceWithStreamingResponse",
- "AsyncExtractionsResourceWithStreamingResponse",
-]
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
deleted file mode 100644
index 9cefef45..00000000
--- a/src/mixedbread/resources/extractions/content.py
+++ /dev/null
@@ -1,196 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from ..._base_client import make_request_options
-from ...types.extractions import content_create_params
-from ...types.extractions.extraction_result import ExtractionResult
-
-__all__ = ["ContentResource", "AsyncContentResource"]
-
-
-class ContentResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> ContentResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return ContentResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> ContentResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return ContentResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- content: str,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionResult:
- """
- Extract content from a string using the provided schema.
-
- Args: params: The parameters for extracting content from a string.
-
- Returns: The extracted content.
-
- Args:
- content: The content to extract from
-
- json_schema: The JSON schema to use for extraction
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/content",
- body=maybe_transform(
- {
- "content": content,
- "json_schema": json_schema,
- },
- content_create_params.ContentCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionResult,
- )
-
-
-class AsyncContentResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncContentResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncContentResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncContentResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return AsyncContentResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- content: str,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionResult:
- """
- Extract content from a string using the provided schema.
-
- Args: params: The parameters for extracting content from a string.
-
- Returns: The extracted content.
-
- Args:
- content: The content to extract from
-
- json_schema: The JSON schema to use for extraction
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/content",
- body=await async_maybe_transform(
- {
- "content": content,
- "json_schema": json_schema,
- },
- content_create_params.ContentCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionResult,
- )
-
-
-class ContentResourceWithRawResponse:
- def __init__(self, content: ContentResource) -> None:
- self._content = content
-
- self.create = to_raw_response_wrapper(
- content.create,
- )
-
-
-class AsyncContentResourceWithRawResponse:
- def __init__(self, content: AsyncContentResource) -> None:
- self._content = content
-
- self.create = async_to_raw_response_wrapper(
- content.create,
- )
-
-
-class ContentResourceWithStreamingResponse:
- def __init__(self, content: ContentResource) -> None:
- self._content = content
-
- self.create = to_streamed_response_wrapper(
- content.create,
- )
-
-
-class AsyncContentResourceWithStreamingResponse:
- def __init__(self, content: AsyncContentResource) -> None:
- self._content = content
-
- self.create = async_to_streamed_response_wrapper(
- content.create,
- )
diff --git a/src/mixedbread/resources/extractions/extractions.py b/src/mixedbread/resources/extractions/extractions.py
deleted file mode 100644
index 1b6da3b1..00000000
--- a/src/mixedbread/resources/extractions/extractions.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from .jobs import (
- JobsResource,
- AsyncJobsResource,
- JobsResourceWithRawResponse,
- AsyncJobsResourceWithRawResponse,
- JobsResourceWithStreamingResponse,
- AsyncJobsResourceWithStreamingResponse,
-)
-from .schema import (
- SchemaResource,
- AsyncSchemaResource,
- SchemaResourceWithRawResponse,
- AsyncSchemaResourceWithRawResponse,
- SchemaResourceWithStreamingResponse,
- AsyncSchemaResourceWithStreamingResponse,
-)
-from .content import (
- ContentResource,
- AsyncContentResource,
- ContentResourceWithRawResponse,
- AsyncContentResourceWithRawResponse,
- ContentResourceWithStreamingResponse,
- AsyncContentResourceWithStreamingResponse,
-)
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-
-__all__ = ["ExtractionsResource", "AsyncExtractionsResource"]
-
-
-class ExtractionsResource(SyncAPIResource):
- @cached_property
- def jobs(self) -> JobsResource:
- return JobsResource(self._client)
-
- @cached_property
- def schema(self) -> SchemaResource:
- return SchemaResource(self._client)
-
- @cached_property
- def content(self) -> ContentResource:
- return ContentResource(self._client)
-
- @cached_property
- def with_raw_response(self) -> ExtractionsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return ExtractionsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> ExtractionsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return ExtractionsResourceWithStreamingResponse(self)
-
-
-class AsyncExtractionsResource(AsyncAPIResource):
- @cached_property
- def jobs(self) -> AsyncJobsResource:
- return AsyncJobsResource(self._client)
-
- @cached_property
- def schema(self) -> AsyncSchemaResource:
- return AsyncSchemaResource(self._client)
-
- @cached_property
- def content(self) -> AsyncContentResource:
- return AsyncContentResource(self._client)
-
- @cached_property
- def with_raw_response(self) -> AsyncExtractionsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncExtractionsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncExtractionsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return AsyncExtractionsResourceWithStreamingResponse(self)
-
-
-class ExtractionsResourceWithRawResponse:
- def __init__(self, extractions: ExtractionsResource) -> None:
- self._extractions = extractions
-
- @cached_property
- def jobs(self) -> JobsResourceWithRawResponse:
- return JobsResourceWithRawResponse(self._extractions.jobs)
-
- @cached_property
- def schema(self) -> SchemaResourceWithRawResponse:
- return SchemaResourceWithRawResponse(self._extractions.schema)
-
- @cached_property
- def content(self) -> ContentResourceWithRawResponse:
- return ContentResourceWithRawResponse(self._extractions.content)
-
-
-class AsyncExtractionsResourceWithRawResponse:
- def __init__(self, extractions: AsyncExtractionsResource) -> None:
- self._extractions = extractions
-
- @cached_property
- def jobs(self) -> AsyncJobsResourceWithRawResponse:
- return AsyncJobsResourceWithRawResponse(self._extractions.jobs)
-
- @cached_property
- def schema(self) -> AsyncSchemaResourceWithRawResponse:
- return AsyncSchemaResourceWithRawResponse(self._extractions.schema)
-
- @cached_property
- def content(self) -> AsyncContentResourceWithRawResponse:
- return AsyncContentResourceWithRawResponse(self._extractions.content)
-
-
-class ExtractionsResourceWithStreamingResponse:
- def __init__(self, extractions: ExtractionsResource) -> None:
- self._extractions = extractions
-
- @cached_property
- def jobs(self) -> JobsResourceWithStreamingResponse:
- return JobsResourceWithStreamingResponse(self._extractions.jobs)
-
- @cached_property
- def schema(self) -> SchemaResourceWithStreamingResponse:
- return SchemaResourceWithStreamingResponse(self._extractions.schema)
-
- @cached_property
- def content(self) -> ContentResourceWithStreamingResponse:
- return ContentResourceWithStreamingResponse(self._extractions.content)
-
-
-class AsyncExtractionsResourceWithStreamingResponse:
- def __init__(self, extractions: AsyncExtractionsResource) -> None:
- self._extractions = extractions
-
- @cached_property
- def jobs(self) -> AsyncJobsResourceWithStreamingResponse:
- return AsyncJobsResourceWithStreamingResponse(self._extractions.jobs)
-
- @cached_property
- def schema(self) -> AsyncSchemaResourceWithStreamingResponse:
- return AsyncSchemaResourceWithStreamingResponse(self._extractions.schema)
-
- @cached_property
- def content(self) -> AsyncContentResourceWithStreamingResponse:
- return AsyncContentResourceWithStreamingResponse(self._extractions.content)
diff --git a/src/mixedbread/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py
deleted file mode 100644
index 8ac9016f..00000000
--- a/src/mixedbread/resources/extractions/jobs.py
+++ /dev/null
@@ -1,286 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from ..._base_client import make_request_options
-from ...types.extractions import job_create_params
-from ...types.extractions.extraction_job import ExtractionJob
-
-__all__ = ["JobsResource", "AsyncJobsResource"]
-
-
-class JobsResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> JobsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return JobsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> JobsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return JobsResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- file_id: str,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionJob:
- """
- Start an extraction job for the provided file and schema.
-
- Args: params: The parameters for creating an extraction job.
-
- Returns: The created extraction job.
-
- Args:
- file_id: The ID of the file to extract from
-
- json_schema: The JSON schema to use for extraction
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/jobs",
- body=maybe_transform(
- {
- "file_id": file_id,
- "json_schema": json_schema,
- },
- job_create_params.JobCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionJob,
- )
-
- def retrieve(
- self,
- job_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionJob:
- """
- Get detailed information about a specific extraction job.
-
- Args: job_id: The ID of the extraction job.
-
- Returns: Detailed information about the extraction job.
-
- Args:
- job_id: The ID of the extraction job to retrieve
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not job_id:
- raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
- return self._get(
- f"/v1/extractions/jobs/{job_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionJob,
- )
-
-
-class AsyncJobsResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncJobsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncJobsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return AsyncJobsResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- file_id: str,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionJob:
- """
- Start an extraction job for the provided file and schema.
-
- Args: params: The parameters for creating an extraction job.
-
- Returns: The created extraction job.
-
- Args:
- file_id: The ID of the file to extract from
-
- json_schema: The JSON schema to use for extraction
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/jobs",
- body=await async_maybe_transform(
- {
- "file_id": file_id,
- "json_schema": json_schema,
- },
- job_create_params.JobCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionJob,
- )
-
- async def retrieve(
- self,
- job_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionJob:
- """
- Get detailed information about a specific extraction job.
-
- Args: job_id: The ID of the extraction job.
-
- Returns: Detailed information about the extraction job.
-
- Args:
- job_id: The ID of the extraction job to retrieve
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not job_id:
- raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
- return await self._get(
- f"/v1/extractions/jobs/{job_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionJob,
- )
-
-
-class JobsResourceWithRawResponse:
- def __init__(self, jobs: JobsResource) -> None:
- self._jobs = jobs
-
- self.create = to_raw_response_wrapper(
- jobs.create,
- )
- self.retrieve = to_raw_response_wrapper(
- jobs.retrieve,
- )
-
-
-class AsyncJobsResourceWithRawResponse:
- def __init__(self, jobs: AsyncJobsResource) -> None:
- self._jobs = jobs
-
- self.create = async_to_raw_response_wrapper(
- jobs.create,
- )
- self.retrieve = async_to_raw_response_wrapper(
- jobs.retrieve,
- )
-
-
-class JobsResourceWithStreamingResponse:
- def __init__(self, jobs: JobsResource) -> None:
- self._jobs = jobs
-
- self.create = to_streamed_response_wrapper(
- jobs.create,
- )
- self.retrieve = to_streamed_response_wrapper(
- jobs.retrieve,
- )
-
-
-class AsyncJobsResourceWithStreamingResponse:
- def __init__(self, jobs: AsyncJobsResource) -> None:
- self._jobs = jobs
-
- self.create = async_to_streamed_response_wrapper(
- jobs.create,
- )
- self.retrieve = async_to_streamed_response_wrapper(
- jobs.retrieve,
- )
diff --git a/src/mixedbread/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py
deleted file mode 100644
index c0e507e0..00000000
--- a/src/mixedbread/resources/extractions/schema.py
+++ /dev/null
@@ -1,356 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from ..._base_client import make_request_options
-from ...types.extractions import schema_create_params, schema_enhance_params, schema_validate_params
-from ...types.extractions.created_json_schema import CreatedJsonSchema
-from ...types.extractions.enhanced_json_schema import EnhancedJsonSchema
-from ...types.extractions.validated_json_schema import ValidatedJsonSchema
-
-__all__ = ["SchemaResource", "AsyncSchemaResource"]
-
-
-class SchemaResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> SchemaResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return SchemaResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> SchemaResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return SchemaResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- description: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> CreatedJsonSchema:
- """
- Create a schema with the provided parameters.
-
- Args: params: The parameters for creating a schema.
-
- Returns: The created schema.
-
- Args:
- description: Description of the data to extract
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/schema",
- body=maybe_transform({"description": description}, schema_create_params.SchemaCreateParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=CreatedJsonSchema,
- )
-
- def enhance(
- self,
- *,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EnhancedJsonSchema:
- """
- Enhance a schema by enriching the descriptions to aid extraction.
-
- Args: params: The parameters for enhancing a schema.
-
- Returns: The enhanced schema.
-
- Args:
- json_schema: The JSON schema to enhance
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/schema/enhance",
- body=maybe_transform({"json_schema": json_schema}, schema_enhance_params.SchemaEnhanceParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=EnhancedJsonSchema,
- )
-
- def validate(
- self,
- *,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ValidatedJsonSchema:
- """
- Validate a schema.
-
- Args: params: The parameters for validating a schema.
-
- Returns: The validation result.
-
- Args:
- json_schema: The JSON schema to validate
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/schema/validate",
- body=maybe_transform({"json_schema": json_schema}, schema_validate_params.SchemaValidateParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ValidatedJsonSchema,
- )
-
-
-class AsyncSchemaResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncSchemaResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncSchemaResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return AsyncSchemaResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- description: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> CreatedJsonSchema:
- """
- Create a schema with the provided parameters.
-
- Args: params: The parameters for creating a schema.
-
- Returns: The created schema.
-
- Args:
- description: Description of the data to extract
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/schema",
- body=await async_maybe_transform({"description": description}, schema_create_params.SchemaCreateParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=CreatedJsonSchema,
- )
-
- async def enhance(
- self,
- *,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EnhancedJsonSchema:
- """
- Enhance a schema by enriching the descriptions to aid extraction.
-
- Args: params: The parameters for enhancing a schema.
-
- Returns: The enhanced schema.
-
- Args:
- json_schema: The JSON schema to enhance
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/schema/enhance",
- body=await async_maybe_transform({"json_schema": json_schema}, schema_enhance_params.SchemaEnhanceParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=EnhancedJsonSchema,
- )
-
- async def validate(
- self,
- *,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ValidatedJsonSchema:
- """
- Validate a schema.
-
- Args: params: The parameters for validating a schema.
-
- Returns: The validation result.
-
- Args:
- json_schema: The JSON schema to validate
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/schema/validate",
- body=await async_maybe_transform({"json_schema": json_schema}, schema_validate_params.SchemaValidateParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ValidatedJsonSchema,
- )
-
-
-class SchemaResourceWithRawResponse:
- def __init__(self, schema: SchemaResource) -> None:
- self._schema = schema
-
- self.create = to_raw_response_wrapper(
- schema.create,
- )
- self.enhance = to_raw_response_wrapper(
- schema.enhance,
- )
- self.validate = to_raw_response_wrapper(
- schema.validate,
- )
-
-
-class AsyncSchemaResourceWithRawResponse:
- def __init__(self, schema: AsyncSchemaResource) -> None:
- self._schema = schema
-
- self.create = async_to_raw_response_wrapper(
- schema.create,
- )
- self.enhance = async_to_raw_response_wrapper(
- schema.enhance,
- )
- self.validate = async_to_raw_response_wrapper(
- schema.validate,
- )
-
-
-class SchemaResourceWithStreamingResponse:
- def __init__(self, schema: SchemaResource) -> None:
- self._schema = schema
-
- self.create = to_streamed_response_wrapper(
- schema.create,
- )
- self.enhance = to_streamed_response_wrapper(
- schema.enhance,
- )
- self.validate = to_streamed_response_wrapper(
- schema.validate,
- )
-
-
-class AsyncSchemaResourceWithStreamingResponse:
- def __init__(self, schema: AsyncSchemaResource) -> None:
- self._schema = schema
-
- self.create = async_to_streamed_response_wrapper(
- schema.create,
- )
- self.enhance = async_to_streamed_response_wrapper(
- schema.enhance,
- )
- self.validate = async_to_streamed_response_wrapper(
- schema.validate,
- )
diff --git a/src/mixedbread/resources/files/files.py b/src/mixedbread/resources/files.py
similarity index 79%
rename from src/mixedbread/resources/files/files.py
rename to src/mixedbread/resources/files.py
index 1ec24376..1eeb5722 100644
--- a/src/mixedbread/resources/files/files.py
+++ b/src/mixedbread/resources/files.py
@@ -6,50 +6,46 @@
import httpx
-from ...types import file_list_params, file_create_params, file_update_params
-from .content import (
- ContentResource,
- AsyncContentResource,
- ContentResourceWithRawResponse,
- AsyncContentResourceWithRawResponse,
- ContentResourceWithStreamingResponse,
- AsyncContentResourceWithStreamingResponse,
-)
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
-from ..._utils import (
+from ..types import file_list_params, file_create_params, file_update_params
+from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
+from .._utils import (
extract_files,
maybe_transform,
deepcopy_minimal,
async_maybe_transform,
)
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
+from .._compat import cached_property
+from .._resource import SyncAPIResource, AsyncAPIResource
+from .._response import (
+ BinaryAPIResponse,
+ AsyncBinaryAPIResponse,
+ StreamedBinaryAPIResponse,
+ AsyncStreamedBinaryAPIResponse,
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
+ to_custom_raw_response_wrapper,
async_to_streamed_response_wrapper,
+ to_custom_streamed_response_wrapper,
+ async_to_custom_raw_response_wrapper,
+ async_to_custom_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
-from ...types.file_object import FileObject
-from ...types.file_deleted import FileDeleted
-from ...types.file_list_response import FileListResponse
+from ..pagination import SyncLimitOffset, AsyncLimitOffset
+from .._base_client import AsyncPaginator, make_request_options
+from ..types.file_object import FileObject
+from ..types.file_delete_response import FileDeleteResponse
__all__ = ["FilesResource", "AsyncFilesResource"]
class FilesResource(SyncAPIResource):
- @cached_property
- def content(self) -> ContentResource:
- return ContentResource(self._client)
-
@cached_property
def with_raw_response(self) -> FilesResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return FilesResourceWithRawResponse(self)
@@ -58,7 +54,7 @@ def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return FilesResourceWithStreamingResponse(self)
@@ -207,7 +203,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> SyncLimitOffset[FileObject]:
"""
List all files for the authenticated user.
@@ -228,8 +224,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/files",
+ page=SyncLimitOffset[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -243,7 +240,7 @@ def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=FileObject,
)
def delete(
@@ -256,7 +253,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileDeleted:
+ ) -> FileDeleteResponse:
"""
Delete a specific file by its ID.
@@ -282,22 +279,58 @@ def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=FileDeleted,
+ cast_to=FileDeleteResponse,
)
+ def content(
+ self,
+ file_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> BinaryAPIResponse:
+ """
+ Download a specific file by its ID.
-class AsyncFilesResource(AsyncAPIResource):
- @cached_property
- def content(self) -> AsyncContentResource:
- return AsyncContentResource(self._client)
+ Args: file_id: The ID of the file to download.
+
+ Returns: FileStreamResponse: The response containing the file to be downloaded.
+
+ Args:
+ file_id: The ID of the file to download
+
+ extra_headers: Send extra headers
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
+ return self._get(
+ f"/v1/files/{file_id}/content",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=BinaryAPIResponse,
+ )
+
+
+class AsyncFilesResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncFilesResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return AsyncFilesResourceWithRawResponse(self)
@@ -306,7 +339,7 @@ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return AsyncFilesResourceWithStreamingResponse(self)
@@ -444,7 +477,7 @@ async def update(
cast_to=FileObject,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -455,7 +488,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> AsyncPaginator[FileObject, AsyncLimitOffset[FileObject]]:
"""
List all files for the authenticated user.
@@ -476,14 +509,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/files",
+ page=AsyncLimitOffset[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"offset": offset,
@@ -491,7 +525,7 @@ async def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=FileObject,
)
async def delete(
@@ -504,7 +538,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileDeleted:
+ ) -> FileDeleteResponse:
"""
Delete a specific file by its ID.
@@ -530,7 +564,47 @@ async def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=FileDeleted,
+ cast_to=FileDeleteResponse,
+ )
+
+ async def content(
+ self,
+ file_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> AsyncBinaryAPIResponse:
+ """
+ Download a specific file by its ID.
+
+ Args: file_id: The ID of the file to download.
+
+ Returns: FileStreamResponse: The response containing the file to be downloaded.
+
+ Args:
+ file_id: The ID of the file to download
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
+ return await self._get(
+ f"/v1/files/{file_id}/content",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=AsyncBinaryAPIResponse,
)
@@ -553,10 +627,10 @@ def __init__(self, files: FilesResource) -> None:
self.delete = to_raw_response_wrapper(
files.delete,
)
-
- @cached_property
- def content(self) -> ContentResourceWithRawResponse:
- return ContentResourceWithRawResponse(self._files.content)
+ self.content = to_custom_raw_response_wrapper(
+ files.content,
+ BinaryAPIResponse,
+ )
class AsyncFilesResourceWithRawResponse:
@@ -578,10 +652,10 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.delete = async_to_raw_response_wrapper(
files.delete,
)
-
- @cached_property
- def content(self) -> AsyncContentResourceWithRawResponse:
- return AsyncContentResourceWithRawResponse(self._files.content)
+ self.content = async_to_custom_raw_response_wrapper(
+ files.content,
+ AsyncBinaryAPIResponse,
+ )
class FilesResourceWithStreamingResponse:
@@ -603,10 +677,10 @@ def __init__(self, files: FilesResource) -> None:
self.delete = to_streamed_response_wrapper(
files.delete,
)
-
- @cached_property
- def content(self) -> ContentResourceWithStreamingResponse:
- return ContentResourceWithStreamingResponse(self._files.content)
+ self.content = to_custom_streamed_response_wrapper(
+ files.content,
+ StreamedBinaryAPIResponse,
+ )
class AsyncFilesResourceWithStreamingResponse:
@@ -628,7 +702,7 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.delete = async_to_streamed_response_wrapper(
files.delete,
)
-
- @cached_property
- def content(self) -> AsyncContentResourceWithStreamingResponse:
- return AsyncContentResourceWithStreamingResponse(self._files.content)
+ self.content = async_to_custom_streamed_response_wrapper(
+ files.content,
+ AsyncStreamedBinaryAPIResponse,
+ )
diff --git a/src/mixedbread/resources/files/__init__.py b/src/mixedbread/resources/files/__init__.py
deleted file mode 100644
index d1f68da6..00000000
--- a/src/mixedbread/resources/files/__init__.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from .files import (
- FilesResource,
- AsyncFilesResource,
- FilesResourceWithRawResponse,
- AsyncFilesResourceWithRawResponse,
- FilesResourceWithStreamingResponse,
- AsyncFilesResourceWithStreamingResponse,
-)
-from .content import (
- ContentResource,
- AsyncContentResource,
- ContentResourceWithRawResponse,
- AsyncContentResourceWithRawResponse,
- ContentResourceWithStreamingResponse,
- AsyncContentResourceWithStreamingResponse,
-)
-
-__all__ = [
- "ContentResource",
- "AsyncContentResource",
- "ContentResourceWithRawResponse",
- "AsyncContentResourceWithRawResponse",
- "ContentResourceWithStreamingResponse",
- "AsyncContentResourceWithStreamingResponse",
- "FilesResource",
- "AsyncFilesResource",
- "FilesResourceWithRawResponse",
- "AsyncFilesResourceWithRawResponse",
- "FilesResourceWithStreamingResponse",
- "AsyncFilesResourceWithStreamingResponse",
-]
diff --git a/src/mixedbread/resources/files/content.py b/src/mixedbread/resources/files/content.py
deleted file mode 100644
index a55cb4c1..00000000
--- a/src/mixedbread/resources/files/content.py
+++ /dev/null
@@ -1,184 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
- BinaryAPIResponse,
- AsyncBinaryAPIResponse,
- StreamedBinaryAPIResponse,
- AsyncStreamedBinaryAPIResponse,
- to_custom_raw_response_wrapper,
- to_custom_streamed_response_wrapper,
- async_to_custom_raw_response_wrapper,
- async_to_custom_streamed_response_wrapper,
-)
-from ..._base_client import make_request_options
-
-__all__ = ["ContentResource", "AsyncContentResource"]
-
-
-class ContentResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> ContentResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return ContentResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> ContentResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return ContentResourceWithStreamingResponse(self)
-
- def retrieve(
- self,
- file_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> BinaryAPIResponse:
- """
- Download a specific file by its ID.
-
- Args: file_id: The ID of the file to download.
-
- Returns: FileStreamResponse: The response containing the file to be downloaded.
-
- Args:
- file_id: The ID of the file to download
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
- return self._get(
- f"/v1/files/{file_id}/content",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=BinaryAPIResponse,
- )
-
-
-class AsyncContentResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncContentResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncContentResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncContentResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return AsyncContentResourceWithStreamingResponse(self)
-
- async def retrieve(
- self,
- file_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncBinaryAPIResponse:
- """
- Download a specific file by its ID.
-
- Args: file_id: The ID of the file to download.
-
- Returns: FileStreamResponse: The response containing the file to be downloaded.
-
- Args:
- file_id: The ID of the file to download
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})}
- return await self._get(
- f"/v1/files/{file_id}/content",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=AsyncBinaryAPIResponse,
- )
-
-
-class ContentResourceWithRawResponse:
- def __init__(self, content: ContentResource) -> None:
- self._content = content
-
- self.retrieve = to_custom_raw_response_wrapper(
- content.retrieve,
- BinaryAPIResponse,
- )
-
-
-class AsyncContentResourceWithRawResponse:
- def __init__(self, content: AsyncContentResource) -> None:
- self._content = content
-
- self.retrieve = async_to_custom_raw_response_wrapper(
- content.retrieve,
- AsyncBinaryAPIResponse,
- )
-
-
-class ContentResourceWithStreamingResponse:
- def __init__(self, content: ContentResource) -> None:
- self._content = content
-
- self.retrieve = to_custom_streamed_response_wrapper(
- content.retrieve,
- StreamedBinaryAPIResponse,
- )
-
-
-class AsyncContentResourceWithStreamingResponse:
- def __init__(self, content: AsyncContentResource) -> None:
- self._content = content
-
- self.retrieve = async_to_custom_streamed_response_wrapper(
- content.retrieve,
- AsyncStreamedBinaryAPIResponse,
- )
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index ace6052c..b0d597bf 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -34,7 +34,7 @@ def with_raw_response(self) -> JobsResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return JobsResourceWithRawResponse(self)
@@ -43,7 +43,7 @@ def with_streaming_response(self) -> JobsResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return JobsResourceWithStreamingResponse(self)
@@ -166,7 +166,7 @@ def with_raw_response(self) -> AsyncJobsResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return AsyncJobsResourceWithRawResponse(self)
@@ -175,7 +175,7 @@ def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return AsyncJobsResourceWithStreamingResponse(self)
diff --git a/src/mixedbread/resources/parsing/parsing.py b/src/mixedbread/resources/parsing/parsing.py
index be6f103f..e6875462 100644
--- a/src/mixedbread/resources/parsing/parsing.py
+++ b/src/mixedbread/resources/parsing/parsing.py
@@ -27,7 +27,7 @@ def with_raw_response(self) -> ParsingResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return ParsingResourceWithRawResponse(self)
@@ -36,7 +36,7 @@ def with_streaming_response(self) -> ParsingResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return ParsingResourceWithStreamingResponse(self)
@@ -52,7 +52,7 @@ def with_raw_response(self) -> AsyncParsingResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return AsyncParsingResourceWithRawResponse(self)
@@ -61,7 +61,7 @@ def with_streaming_response(self) -> AsyncParsingResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return AsyncParsingResourceWithStreamingResponse(self)
diff --git a/src/mixedbread/resources/reranking.py b/src/mixedbread/resources/reranking.py
index 73185c1c..cead6c07 100644
--- a/src/mixedbread/resources/reranking.py
+++ b/src/mixedbread/resources/reranking.py
@@ -33,7 +33,7 @@ def with_raw_response(self) -> RerankingResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return RerankingResourceWithRawResponse(self)
@@ -42,7 +42,7 @@ def with_streaming_response(self) -> RerankingResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return RerankingResourceWithStreamingResponse(self)
@@ -117,7 +117,7 @@ def with_raw_response(self) -> AsyncRerankingResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return AsyncRerankingResourceWithRawResponse(self)
@@ -126,7 +126,7 @@ def with_streaming_response(self) -> AsyncRerankingResourceWithStreamingResponse
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return AsyncRerankingResourceWithStreamingResponse(self)
diff --git a/src/mixedbread/resources/service_info.py b/src/mixedbread/resources/service_info.py
deleted file mode 100644
index 6ca3b45f..00000000
--- a/src/mixedbread/resources/service_info.py
+++ /dev/null
@@ -1,143 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from .._compat import cached_property
-from .._resource import SyncAPIResource, AsyncAPIResource
-from .._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from .._base_client import make_request_options
-from ..types.info_response import InfoResponse
-
-__all__ = ["ServiceInfoResource", "AsyncServiceInfoResource"]
-
-
-class ServiceInfoResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> ServiceInfoResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return ServiceInfoResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> ServiceInfoResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return ServiceInfoResourceWithStreamingResponse(self)
-
- def retrieve(
- self,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> InfoResponse:
- """
- Returns service information, including name and version.
-
- Returns: InfoResponse: A response containing the service name and version.
- """
- return self._get(
- "/",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=InfoResponse,
- )
-
-
-class AsyncServiceInfoResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncServiceInfoResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return the
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncServiceInfoResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncServiceInfoResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
- """
- return AsyncServiceInfoResourceWithStreamingResponse(self)
-
- async def retrieve(
- self,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> InfoResponse:
- """
- Returns service information, including name and version.
-
- Returns: InfoResponse: A response containing the service name and version.
- """
- return await self._get(
- "/",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=InfoResponse,
- )
-
-
-class ServiceInfoResourceWithRawResponse:
- def __init__(self, service_info: ServiceInfoResource) -> None:
- self._service_info = service_info
-
- self.retrieve = to_raw_response_wrapper(
- service_info.retrieve,
- )
-
-
-class AsyncServiceInfoResourceWithRawResponse:
- def __init__(self, service_info: AsyncServiceInfoResource) -> None:
- self._service_info = service_info
-
- self.retrieve = async_to_raw_response_wrapper(
- service_info.retrieve,
- )
-
-
-class ServiceInfoResourceWithStreamingResponse:
- def __init__(self, service_info: ServiceInfoResource) -> None:
- self._service_info = service_info
-
- self.retrieve = to_streamed_response_wrapper(
- service_info.retrieve,
- )
-
-
-class AsyncServiceInfoResourceWithStreamingResponse:
- def __init__(self, service_info: AsyncServiceInfoResource) -> None:
- self._service_info = service_info
-
- self.retrieve = async_to_streamed_response_wrapper(
- service_info.retrieve,
- )
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index cc7f699c..a5848412 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -19,12 +19,12 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncLimitOffset, AsyncLimitOffset
+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.vector_store_file import VectorStoreFile
-from ...types.vector_stores.file_list_response import FileListResponse
+from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
-from ...types.vector_stores.vector_store_file_deleted import VectorStoreFileDeleted
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -36,7 +36,7 @@ def with_raw_response(self) -> FilesResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return FilesResourceWithRawResponse(self)
@@ -45,7 +45,7 @@ def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return FilesResourceWithStreamingResponse(self)
@@ -158,7 +158,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> SyncLimitOffset[VectorStoreFile]:
"""
List files indexed in a vector store with pagination.
@@ -184,8 +184,9 @@ def list(
"""
if not vector_store_id:
raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return self._get(
+ return self._get_api_list(
f"/v1/vector_stores/{vector_store_id}/files",
+ page=SyncLimitOffset[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -199,7 +200,7 @@ def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=VectorStoreFile,
)
def delete(
@@ -213,7 +214,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreFileDeleted:
+ ) -> FileDeleteResponse:
"""
Delete a file from a vector store.
@@ -244,7 +245,7 @@ def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreFileDeleted,
+ cast_to=FileDeleteResponse,
)
def search(
@@ -321,7 +322,7 @@ def with_raw_response(self) -> AsyncFilesResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return AsyncFilesResourceWithRawResponse(self)
@@ -330,7 +331,7 @@ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return AsyncFilesResourceWithStreamingResponse(self)
@@ -431,7 +432,7 @@ async def retrieve(
cast_to=VectorStoreFile,
)
- async def list(
+ def list(
self,
vector_store_id: str,
*,
@@ -443,7 +444,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> AsyncPaginator[VectorStoreFile, AsyncLimitOffset[VectorStoreFile]]:
"""
List files indexed in a vector store with pagination.
@@ -469,14 +470,15 @@ async def list(
"""
if not vector_store_id:
raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return await self._get(
+ return self._get_api_list(
f"/v1/vector_stores/{vector_store_id}/files",
+ page=AsyncLimitOffset[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"offset": offset,
@@ -484,7 +486,7 @@ async def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=VectorStoreFile,
)
async def delete(
@@ -498,7 +500,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreFileDeleted:
+ ) -> FileDeleteResponse:
"""
Delete a file from a vector store.
@@ -529,7 +531,7 @@ async def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreFileDeleted,
+ cast_to=FileDeleteResponse,
)
async def search(
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 94bd80cc..be1a6b79 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -19,7 +19,6 @@
vector_store_create_params,
vector_store_search_params,
vector_store_update_params,
- vector_store_question_answering_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
@@ -34,10 +33,11 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncLimitOffset, AsyncLimitOffset
+from ..._base_client import AsyncPaginator, make_request_options
from ...types.vector_store import VectorStore
-from ...types.vector_store_deleted import VectorStoreDeleted
-from ...types.vector_store_list_response import VectorStoreListResponse
+from ...types.expires_after_param import ExpiresAfterParam
+from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
__all__ = ["VectorStoresResource", "AsyncVectorStoresResource"]
@@ -54,7 +54,7 @@ def with_raw_response(self) -> VectorStoresResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return VectorStoresResourceWithRawResponse(self)
@@ -63,7 +63,7 @@ def with_streaming_response(self) -> VectorStoresResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return VectorStoresResourceWithStreamingResponse(self)
@@ -71,7 +71,7 @@ def create(
self,
*,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[vector_store_create_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
@@ -171,7 +171,7 @@ def update(
vector_store_id: str,
*,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[vector_store_update_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -239,7 +239,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreListResponse:
+ ) -> SyncLimitOffset[VectorStore]:
"""
List all vector stores.
@@ -260,8 +260,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/vector_stores",
+ page=SyncLimitOffset[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -275,7 +276,7 @@ def list(
vector_store_list_params.VectorStoreListParams,
),
),
- cast_to=VectorStoreListResponse,
+ model=VectorStore,
)
def delete(
@@ -288,7 +289,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreDeleted:
+ ) -> VectorStoreDeleteResponse:
"""
Delete a vector store by ID.
@@ -314,67 +315,7 @@ def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreDeleted,
- )
-
- def question_answering(
- self,
- *,
- vector_store_ids: List[str],
- qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
- query: str | NotGiven = NOT_GIVEN,
- search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
- stream: bool | NotGiven = NOT_GIVEN,
- top_k: int | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
- """
- Question answering
-
- Args:
- vector_store_ids: IDs of vector stores to search
-
- qa_options: Question answering configuration options
-
- query: Question to answer. If not provided, the question will be extracted from the
- passed messages.
-
- search_options: Search configuration options
-
- stream: Whether to stream the answer
-
- top_k: Number of results to return
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/vector_stores/question-answering",
- body=maybe_transform(
- {
- "vector_store_ids": vector_store_ids,
- "qa_options": qa_options,
- "query": query,
- "search_options": search_options,
- "stream": stream,
- "top_k": top_k,
- },
- vector_store_question_answering_params.VectorStoreQuestionAnsweringParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=object,
+ cast_to=VectorStoreDeleteResponse,
)
def search(
@@ -454,7 +395,7 @@ def with_raw_response(self) -> AsyncVectorStoresResourceWithRawResponse:
This property can be used as a prefix for any HTTP method call to return the
the raw response object instead of the parsed content.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#accessing-raw-response-data-eg-headers
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
"""
return AsyncVectorStoresResourceWithRawResponse(self)
@@ -463,7 +404,7 @@ def with_streaming_response(self) -> AsyncVectorStoresResourceWithStreamingRespo
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
- For more information, see https://www.github.com/stainless-sdks/mixedbread-python#with_streaming_response
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
"""
return AsyncVectorStoresResourceWithStreamingResponse(self)
@@ -471,7 +412,7 @@ async def create(
self,
*,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[vector_store_create_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
@@ -571,7 +512,7 @@ async def update(
vector_store_id: str,
*,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[vector_store_update_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -628,7 +569,7 @@ async def update(
cast_to=VectorStore,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -639,7 +580,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreListResponse:
+ ) -> AsyncPaginator[VectorStore, AsyncLimitOffset[VectorStore]]:
"""
List all vector stores.
@@ -660,14 +601,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/vector_stores",
+ page=AsyncLimitOffset[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"offset": offset,
@@ -675,7 +617,7 @@ async def list(
vector_store_list_params.VectorStoreListParams,
),
),
- cast_to=VectorStoreListResponse,
+ model=VectorStore,
)
async def delete(
@@ -688,7 +630,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreDeleted:
+ ) -> VectorStoreDeleteResponse:
"""
Delete a vector store by ID.
@@ -714,67 +656,7 @@ async def delete(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreDeleted,
- )
-
- async def question_answering(
- self,
- *,
- vector_store_ids: List[str],
- qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
- query: str | NotGiven = NOT_GIVEN,
- search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
- stream: bool | NotGiven = NOT_GIVEN,
- top_k: int | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
- """
- Question answering
-
- Args:
- vector_store_ids: IDs of vector stores to search
-
- qa_options: Question answering configuration options
-
- query: Question to answer. If not provided, the question will be extracted from the
- passed messages.
-
- search_options: Search configuration options
-
- stream: Whether to stream the answer
-
- top_k: Number of results to return
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/vector_stores/question-answering",
- body=await async_maybe_transform(
- {
- "vector_store_ids": vector_store_ids,
- "qa_options": qa_options,
- "query": query,
- "search_options": search_options,
- "stream": stream,
- "top_k": top_k,
- },
- vector_store_question_answering_params.VectorStoreQuestionAnsweringParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=object,
+ cast_to=VectorStoreDeleteResponse,
)
async def search(
@@ -862,9 +744,6 @@ def __init__(self, vector_stores: VectorStoresResource) -> None:
self.delete = to_raw_response_wrapper(
vector_stores.delete,
)
- self.question_answering = to_raw_response_wrapper(
- vector_stores.question_answering,
- )
self.search = to_raw_response_wrapper(
vector_stores.search,
)
@@ -893,9 +772,6 @@ def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self.delete = async_to_raw_response_wrapper(
vector_stores.delete,
)
- self.question_answering = async_to_raw_response_wrapper(
- vector_stores.question_answering,
- )
self.search = async_to_raw_response_wrapper(
vector_stores.search,
)
@@ -924,9 +800,6 @@ def __init__(self, vector_stores: VectorStoresResource) -> None:
self.delete = to_streamed_response_wrapper(
vector_stores.delete,
)
- self.question_answering = to_streamed_response_wrapper(
- vector_stores.question_answering,
- )
self.search = to_streamed_response_wrapper(
vector_stores.search,
)
@@ -955,9 +828,6 @@ def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self.delete = async_to_streamed_response_wrapper(
vector_stores.delete,
)
- self.question_answering = async_to_streamed_response_wrapper(
- vector_stores.question_answering,
- )
self.search = async_to_streamed_response_wrapper(
vector_stores.search,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 7afb0f50..3c0319ec 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,25 +2,25 @@
from __future__ import annotations
+from .embedding import Embedding as Embedding
+from .file_counts import FileCounts as FileCounts
from .file_object import FileObject as FileObject
-from .file_deleted import FileDeleted as FileDeleted
from .vector_store import VectorStore as VectorStore
+from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
-from .file_list_response import FileListResponse as FileListResponse
from .file_update_params import FileUpdateParams as FileUpdateParams
-from .vector_store_deleted import VectorStoreDeleted as VectorStoreDeleted
+from .expires_after_param import ExpiresAfterParam as ExpiresAfterParam
+from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
from .reranking_create_params import RerankingCreateParams as RerankingCreateParams
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
from .embedding_create_response import EmbeddingCreateResponse as EmbeddingCreateResponse
from .reranking_create_response import RerankingCreateResponse as RerankingCreateResponse
+from .scored_vector_store_chunk import ScoredVectorStoreChunk as ScoredVectorStoreChunk
from .vector_store_create_params import VectorStoreCreateParams as VectorStoreCreateParams
-from .vector_store_list_response import VectorStoreListResponse as VectorStoreListResponse
from .vector_store_search_params import VectorStoreSearchParams as VectorStoreSearchParams
from .vector_store_update_params import VectorStoreUpdateParams as VectorStoreUpdateParams
+from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
-from .vector_store_question_answering_params import (
- VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams,
-)
diff --git a/src/mixedbread/types/embedding.py b/src/mixedbread/types/embedding.py
new file mode 100644
index 00000000..ad8cd3f0
--- /dev/null
+++ b/src/mixedbread/types/embedding.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["Embedding"]
+
+
+class Embedding(BaseModel):
+ embedding: Union[List[float], List[int], str]
+ """The encoded embedding."""
+
+ index: int
+ """The index of the embedding."""
+
+ object: Literal["embedding"]
+ """The object type of the embedding."""
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index ffc8eff2..9b84cb1d 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -5,19 +5,9 @@
from typing_extensions import Literal
from .._models import BaseModel
+from .embedding import Embedding
-__all__ = ["EmbeddingCreateResponse", "DataUnionMember0", "DataUnionMember1", "DataUnionMember1Embedding", "Usage"]
-
-
-class DataUnionMember0(BaseModel):
- embedding: Union[List[float], List[int], str]
- """The encoded embedding."""
-
- index: int
- """The index of the embedding."""
-
- object: Literal["embedding"]
- """The object type of the embedding."""
+__all__ = ["EmbeddingCreateResponse", "DataUnionMember1", "DataUnionMember1Embedding", "Usage"]
class DataUnionMember1Embedding(BaseModel):
@@ -60,7 +50,7 @@ class Usage(BaseModel):
class EmbeddingCreateResponse(BaseModel):
- data: Union[List[DataUnionMember0], List[DataUnionMember1]]
+ data: Union[List[Embedding], List[DataUnionMember1]]
"""The created embeddings."""
dimensions: Optional[int] = None
diff --git a/src/mixedbread/types/expires_after.py b/src/mixedbread/types/expires_after.py
new file mode 100644
index 00000000..5401efb9
--- /dev/null
+++ b/src/mixedbread/types/expires_after.py
@@ -0,0 +1,16 @@
+# 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__ = ["ExpiresAfter"]
+
+
+class ExpiresAfter(BaseModel):
+ anchor: Optional[Literal["last_used_at"]] = None
+ """Anchor date for the expiration policy"""
+
+ days: Optional[int] = None
+ """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/expires_after_param.py b/src/mixedbread/types/expires_after_param.py
new file mode 100644
index 00000000..6ea61fe9
--- /dev/null
+++ b/src/mixedbread/types/expires_after_param.py
@@ -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 Literal, TypedDict
+
+__all__ = ["ExpiresAfterParam"]
+
+
+class ExpiresAfterParam(TypedDict, total=False):
+ anchor: Literal["last_used_at"]
+ """Anchor date for the expiration policy"""
+
+ days: int
+ """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/extractions/__init__.py b/src/mixedbread/types/extractions/__init__.py
deleted file mode 100644
index 6457c670..00000000
--- a/src/mixedbread/types/extractions/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from .extraction_job import ExtractionJob as ExtractionJob
-from .extraction_result import ExtractionResult as ExtractionResult
-from .job_create_params import JobCreateParams as JobCreateParams
-from .created_json_schema import CreatedJsonSchema as CreatedJsonSchema
-from .enhanced_json_schema import EnhancedJsonSchema as EnhancedJsonSchema
-from .schema_create_params import SchemaCreateParams as SchemaCreateParams
-from .content_create_params import ContentCreateParams as ContentCreateParams
-from .schema_enhance_params import SchemaEnhanceParams as SchemaEnhanceParams
-from .validated_json_schema import ValidatedJsonSchema as ValidatedJsonSchema
-from .schema_validate_params import SchemaValidateParams as SchemaValidateParams
diff --git a/src/mixedbread/types/extractions/content_create_params.py b/src/mixedbread/types/extractions/content_create_params.py
deleted file mode 100644
index 2bbdada2..00000000
--- a/src/mixedbread/types/extractions/content_create_params.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["ContentCreateParams"]
-
-
-class ContentCreateParams(TypedDict, total=False):
- content: Required[str]
- """The content to extract from"""
-
- json_schema: Required[object]
- """The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/created_json_schema.py b/src/mixedbread/types/extractions/created_json_schema.py
deleted file mode 100644
index 4b50c4c6..00000000
--- a/src/mixedbread/types/extractions/created_json_schema.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-
-from ..._models import BaseModel
-
-__all__ = ["CreatedJsonSchema"]
-
-
-class CreatedJsonSchema(BaseModel):
- json_schema: object
- """The created JSON schema"""
diff --git a/src/mixedbread/types/extractions/enhanced_json_schema.py b/src/mixedbread/types/extractions/enhanced_json_schema.py
deleted file mode 100644
index 7b2ab04a..00000000
--- a/src/mixedbread/types/extractions/enhanced_json_schema.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-
-from ..._models import BaseModel
-
-__all__ = ["EnhancedJsonSchema"]
-
-
-class EnhancedJsonSchema(BaseModel):
- json_schema: object
- """The enhanced JSON schema"""
diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py
deleted file mode 100644
index d6e204c9..00000000
--- a/src/mixedbread/types/extractions/extraction_job.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .extraction_result import ExtractionResult
-
-__all__ = ["ExtractionJob"]
-
-
-class ExtractionJob(BaseModel):
- id: str
- """The ID of the job"""
-
- result: Optional[ExtractionResult] = None
- """Result of an extraction operation."""
-
- status: Literal["none", "running", "canceled", "successful", "failed", "resumable", "pending"]
- """The status of the job"""
-
- created_at: Optional[datetime] = None
- """The creation time of the job"""
-
- errors: Optional[List[str]] = None
- """The errors of the job"""
-
- finished_at: Optional[datetime] = None
- """The finished time of the job"""
-
- object: Optional[Literal["job"]] = None
- """The type of the object"""
diff --git a/src/mixedbread/types/extractions/extraction_result.py b/src/mixedbread/types/extractions/extraction_result.py
deleted file mode 100644
index fbac5d5f..00000000
--- a/src/mixedbread/types/extractions/extraction_result.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-
-from ..._models import BaseModel
-
-__all__ = ["ExtractionResult"]
-
-
-class ExtractionResult(BaseModel):
- data: object
- """The extracted data"""
diff --git a/src/mixedbread/types/extractions/job_create_params.py b/src/mixedbread/types/extractions/job_create_params.py
deleted file mode 100644
index 476154b2..00000000
--- a/src/mixedbread/types/extractions/job_create_params.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["JobCreateParams"]
-
-
-class JobCreateParams(TypedDict, total=False):
- file_id: Required[str]
- """The ID of the file to extract from"""
-
- json_schema: Required[object]
- """The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/schema_create_params.py b/src/mixedbread/types/extractions/schema_create_params.py
deleted file mode 100644
index 8625ea66..00000000
--- a/src/mixedbread/types/extractions/schema_create_params.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["SchemaCreateParams"]
-
-
-class SchemaCreateParams(TypedDict, total=False):
- description: Required[str]
- """Description of the data to extract"""
diff --git a/src/mixedbread/types/extractions/schema_enhance_params.py b/src/mixedbread/types/extractions/schema_enhance_params.py
deleted file mode 100644
index e0facf34..00000000
--- a/src/mixedbread/types/extractions/schema_enhance_params.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["SchemaEnhanceParams"]
-
-
-class SchemaEnhanceParams(TypedDict, total=False):
- json_schema: Required[object]
- """The JSON schema to enhance"""
diff --git a/src/mixedbread/types/extractions/schema_validate_params.py b/src/mixedbread/types/extractions/schema_validate_params.py
deleted file mode 100644
index 947182ca..00000000
--- a/src/mixedbread/types/extractions/schema_validate_params.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["SchemaValidateParams"]
-
-
-class SchemaValidateParams(TypedDict, total=False):
- json_schema: Required[object]
- """The JSON schema to validate"""
diff --git a/src/mixedbread/types/extractions/validated_json_schema.py b/src/mixedbread/types/extractions/validated_json_schema.py
deleted file mode 100644
index 42e6da5b..00000000
--- a/src/mixedbread/types/extractions/validated_json_schema.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List
-
-from ..._models import BaseModel
-
-__all__ = ["ValidatedJsonSchema"]
-
-
-class ValidatedJsonSchema(BaseModel):
- errors: List[str]
- """List of validation errors"""
-
- is_valid: bool
- """Whether the schema is valid"""
-
- json_schema: object
- """The validated JSON schema"""
diff --git a/src/mixedbread/types/file_counts.py b/src/mixedbread/types/file_counts.py
new file mode 100644
index 00000000..8166d0bb
--- /dev/null
+++ b/src/mixedbread/types/file_counts.py
@@ -0,0 +1,24 @@
+# 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):
+ canceled: Optional[int] = None
+ """Number of files whose processing was canceled"""
+
+ failed: Optional[int] = None
+ """Number of files that failed processing"""
+
+ in_progress: Optional[int] = None
+ """Number of files currently being processed"""
+
+ successful: Optional[int] = None
+ """Number of successfully processed files"""
+
+ total: Optional[int] = None
+ """Total number of files"""
diff --git a/src/mixedbread/types/file_deleted.py b/src/mixedbread/types/file_delete_response.py
similarity index 85%
rename from src/mixedbread/types/file_deleted.py
rename to src/mixedbread/types/file_delete_response.py
index 5557b674..1cc6bbb7 100644
--- a/src/mixedbread/types/file_deleted.py
+++ b/src/mixedbread/types/file_delete_response.py
@@ -5,10 +5,10 @@
from .._models import BaseModel
-__all__ = ["FileDeleted"]
+__all__ = ["FileDeleteResponse"]
-class FileDeleted(BaseModel):
+class FileDeleteResponse(BaseModel):
id: str
"""The ID of the deleted file"""
diff --git a/src/mixedbread/types/file_list_response.py b/src/mixedbread/types/file_list_response.py
deleted file mode 100644
index defc63f1..00000000
--- a/src/mixedbread/types/file_list_response.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .file_object import FileObject
-
-__all__ = ["FileListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- limit: Optional[int] = None
- """Maximum number of items to return per page"""
-
- offset: Optional[int] = None
- """Offset of the first item to return"""
-
- total: Optional[int] = None
- """Total number of items available"""
-
-
-class FileListResponse(BaseModel):
- data: List[FileObject]
- """The list of files"""
-
- pagination: Pagination
- """Pagination model that includes total count of items."""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/files/__init__.py b/src/mixedbread/types/files/__init__.py
deleted file mode 100644
index f8ee8b14..00000000
--- a/src/mixedbread/types/files/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
diff --git a/src/mixedbread/types/scored_vector_store_chunk.py b/src/mixedbread/types/scored_vector_store_chunk.py
new file mode 100644
index 00000000..4ef37030
--- /dev/null
+++ b/src/mixedbread/types/scored_vector_store_chunk.py
@@ -0,0 +1,55 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict, Union, Optional
+from typing_extensions import Literal, TypeAlias
+
+from .._models import BaseModel
+
+__all__ = ["ScoredVectorStoreChunk", "Value", "ValueImageURLInput", "ValueImageURLInputImage", "ValueTextInput"]
+
+
+class ValueImageURLInputImage(BaseModel):
+ url: str
+ """The image URL. Can be either a URL or a Data URI."""
+
+
+class ValueImageURLInput(BaseModel):
+ image: ValueImageURLInputImage
+ """The image input specification."""
+
+ type: Optional[Literal["image_url"]] = None
+ """Input type identifier"""
+
+
+class ValueTextInput(BaseModel):
+ text: str
+ """Text content to process"""
+
+ type: Optional[Literal["text"]] = None
+ """Input type identifier"""
+
+
+Value: TypeAlias = Union[str, ValueImageURLInput, ValueTextInput, Dict[str, object], None]
+
+
+class ScoredVectorStoreChunk(BaseModel):
+ file_id: str
+ """file id"""
+
+ position: int
+ """position of the chunk in a file"""
+
+ score: float
+ """score of the chunk"""
+
+ vector_store_id: str
+ """vector store id"""
+
+ content: Optional[str] = None
+ """content of the chunk"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ value: Optional[Value] = None
+ """value of the chunk"""
diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py
index 262d13c3..e6e381ac 100644
--- a/src/mixedbread/types/vector_store.py
+++ b/src/mixedbread/types/vector_store.py
@@ -5,33 +5,10 @@
from typing_extensions import Literal
from .._models import BaseModel
+from .file_counts import FileCounts
+from .expires_after import ExpiresAfter
-__all__ = ["VectorStore", "ExpiresAfter", "FileCounts"]
-
-
-class ExpiresAfter(BaseModel):
- anchor: Optional[Literal["last_used_at"]] = None
- """Anchor date for the expiration policy"""
-
- days: Optional[int] = None
- """Number of days after which the vector store expires"""
-
-
-class FileCounts(BaseModel):
- canceled: Optional[int] = None
- """Number of files whose processing was canceled"""
-
- failed: Optional[int] = None
- """Number of files that failed processing"""
-
- in_progress: Optional[int] = None
- """Number of files currently being processed"""
-
- successful: Optional[int] = None
- """Number of successfully processed files"""
-
- total: Optional[int] = None
- """Total number of files"""
+__all__ = ["VectorStore"]
class VectorStore(BaseModel):
diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py
index 891e58c9..c7b919c1 100644
--- a/src/mixedbread/types/vector_store_create_params.py
+++ b/src/mixedbread/types/vector_store_create_params.py
@@ -3,16 +3,18 @@
from __future__ import annotations
from typing import List, Optional
-from typing_extensions import Literal, TypedDict
+from typing_extensions import TypedDict
-__all__ = ["VectorStoreCreateParams", "ExpiresAfter"]
+from .expires_after_param import ExpiresAfterParam
+
+__all__ = ["VectorStoreCreateParams"]
class VectorStoreCreateParams(TypedDict, total=False):
description: Optional[str]
"""Description of the vector store"""
- expires_after: Optional[ExpiresAfter]
+ expires_after: Optional[ExpiresAfterParam]
"""Represents an expiration policy for a vector store."""
file_ids: Optional[List[str]]
@@ -23,11 +25,3 @@ class VectorStoreCreateParams(TypedDict, total=False):
name: Optional[str]
"""Name for the new vector store"""
-
-
-class ExpiresAfter(TypedDict, total=False):
- anchor: Literal["last_used_at"]
- """Anchor date for the expiration policy"""
-
- days: int
- """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/vector_store_deleted.py b/src/mixedbread/types/vector_store_delete_response.py
similarity index 82%
rename from src/mixedbread/types/vector_store_deleted.py
rename to src/mixedbread/types/vector_store_delete_response.py
index 393f8977..6643d44b 100644
--- a/src/mixedbread/types/vector_store_deleted.py
+++ b/src/mixedbread/types/vector_store_delete_response.py
@@ -5,10 +5,10 @@
from .._models import BaseModel
-__all__ = ["VectorStoreDeleted"]
+__all__ = ["VectorStoreDeleteResponse"]
-class VectorStoreDeleted(BaseModel):
+class VectorStoreDeleteResponse(BaseModel):
id: str
"""ID of the deleted vector store"""
diff --git a/src/mixedbread/types/vector_store_list_response.py b/src/mixedbread/types/vector_store_list_response.py
deleted file mode 100644
index 0b1f21c2..00000000
--- a/src/mixedbread/types/vector_store_list_response.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .vector_store import VectorStore
-
-__all__ = ["VectorStoreListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- limit: Optional[int] = None
- """Maximum number of items to return per page"""
-
- offset: Optional[int] = None
- """Offset of the first item to return"""
-
- total: Optional[int] = None
- """Total number of items available"""
-
-
-class VectorStoreListResponse(BaseModel):
- data: List[VectorStore]
- """The list of vector stores"""
-
- pagination: Pagination
- """Pagination model that includes total count of items."""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
deleted file mode 100644
index 1d901395..00000000
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import List
-from typing_extensions import Required, TypedDict
-
-__all__ = ["VectorStoreQuestionAnsweringParams", "QaOptions", "SearchOptions"]
-
-
-class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
- vector_store_ids: Required[List[str]]
- """IDs of vector stores to search"""
-
- qa_options: QaOptions
- """Question answering configuration options"""
-
- query: str
- """Question to answer.
-
- If not provided, the question will be extracted from the passed messages.
- """
-
- search_options: SearchOptions
- """Search configuration options"""
-
- stream: bool
- """Whether to stream the answer"""
-
- top_k: int
- """Number of results to return"""
-
-
-class QaOptions(TypedDict, total=False):
- cite: bool
- """Whether to use citations"""
-
-
-class SearchOptions(TypedDict, total=False):
- return_chunks: bool
- """Whether to return matching text chunks"""
-
- return_metadata: bool
- """Whether to return file metadata"""
-
- rewrite_query: bool
- """Whether to rewrite the query"""
-
- score_threshold: float
- """Minimum similarity score threshold"""
diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py
index 53d32217..ad653c35 100644
--- a/src/mixedbread/types/vector_store_search_response.py
+++ b/src/mixedbread/types/vector_store_search_response.py
@@ -1,69 +1,16 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, List, Union, Optional
-from typing_extensions import Literal, TypeAlias
+from typing import List, Optional
+from typing_extensions import Literal
from .._models import BaseModel
+from .scored_vector_store_chunk import ScoredVectorStoreChunk
-__all__ = [
- "VectorStoreSearchResponse",
- "Data",
- "DataValue",
- "DataValueImageURLInput",
- "DataValueImageURLInputImage",
- "DataValueTextInput",
-]
-
-
-class DataValueImageURLInputImage(BaseModel):
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class DataValueImageURLInput(BaseModel):
- image: DataValueImageURLInputImage
- """The image input specification."""
-
- type: Optional[Literal["image_url"]] = None
- """Input type identifier"""
-
-
-class DataValueTextInput(BaseModel):
- text: str
- """Text content to process"""
-
- type: Optional[Literal["text"]] = None
- """Input type identifier"""
-
-
-DataValue: TypeAlias = Union[str, DataValueImageURLInput, DataValueTextInput, Dict[str, object], None]
-
-
-class Data(BaseModel):
- file_id: str
- """file id"""
-
- position: int
- """position of the chunk in a file"""
-
- score: float
- """score of the chunk"""
-
- vector_store_id: str
- """vector store id"""
-
- content: Optional[str] = None
- """content of the chunk"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- value: Optional[DataValue] = None
- """value of the chunk"""
+__all__ = ["VectorStoreSearchResponse"]
class VectorStoreSearchResponse(BaseModel):
- data: List[Data]
+ data: List[ScoredVectorStoreChunk]
"""The list of scored vector store file chunks"""
object: Optional[Literal["list"]] = None
diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py
index 74008480..3acbde1d 100644
--- a/src/mixedbread/types/vector_store_update_params.py
+++ b/src/mixedbread/types/vector_store_update_params.py
@@ -3,16 +3,18 @@
from __future__ import annotations
from typing import Optional
-from typing_extensions import Literal, TypedDict
+from typing_extensions import TypedDict
-__all__ = ["VectorStoreUpdateParams", "ExpiresAfter"]
+from .expires_after_param import ExpiresAfterParam
+
+__all__ = ["VectorStoreUpdateParams"]
class VectorStoreUpdateParams(TypedDict, total=False):
description: Optional[str]
"""New description"""
- expires_after: Optional[ExpiresAfter]
+ expires_after: Optional[ExpiresAfterParam]
"""Represents an expiration policy for a vector store."""
metadata: object
@@ -20,11 +22,3 @@ class VectorStoreUpdateParams(TypedDict, total=False):
name: Optional[str]
"""New name for the vector store"""
-
-
-class ExpiresAfter(TypedDict, total=False):
- anchor: Literal["last_used_at"]
- """Anchor date for the expiration policy"""
-
- days: int
- """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index dfdfd4e4..e1af64d5 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -5,7 +5,7 @@
from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
-from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
+from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .file_search_response import FileSearchResponse as FileSearchResponse
-from .vector_store_file_deleted import VectorStoreFileDeleted as VectorStoreFileDeleted
+from .scored_vector_store_file import ScoredVectorStoreFile as ScoredVectorStoreFile
diff --git a/src/mixedbread/types/vector_stores/vector_store_file_deleted.py b/src/mixedbread/types/vector_stores/file_delete_response.py
similarity index 84%
rename from src/mixedbread/types/vector_stores/vector_store_file_deleted.py
rename to src/mixedbread/types/vector_stores/file_delete_response.py
index 3291c3b8..c56ec7b4 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file_deleted.py
+++ b/src/mixedbread/types/vector_stores/file_delete_response.py
@@ -5,10 +5,10 @@
from ..._models import BaseModel
-__all__ = ["VectorStoreFileDeleted"]
+__all__ = ["FileDeleteResponse"]
-class VectorStoreFileDeleted(BaseModel):
+class FileDeleteResponse(BaseModel):
id: str
"""ID of the deleted file"""
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
deleted file mode 100644
index aec81cf9..00000000
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .vector_store_file import VectorStoreFile
-
-__all__ = ["FileListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- limit: Optional[int] = None
- """Maximum number of items to return per page"""
-
- offset: Optional[int] = None
- """Offset of the first item to return"""
-
- total: Optional[int] = None
- """Total number of items available"""
-
-
-class FileListResponse(BaseModel):
- data: List[VectorStoreFile]
- """The list of vector store files"""
-
- pagination: Pagination
- """Pagination model that includes total count of items."""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/vector_stores/file_search_response.py b/src/mixedbread/types/vector_stores/file_search_response.py
index 57ee464f..338a98da 100644
--- a/src/mixedbread/types/vector_stores/file_search_response.py
+++ b/src/mixedbread/types/vector_stores/file_search_response.py
@@ -1,97 +1,16 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, List, Union, Optional
-from datetime import datetime
-from typing_extensions import Literal, TypeAlias
+from typing import List, Optional
+from typing_extensions import Literal
from ..._models import BaseModel
+from .scored_vector_store_file import ScoredVectorStoreFile
-__all__ = [
- "FileSearchResponse",
- "Data",
- "DataChunk",
- "DataChunkValue",
- "DataChunkValueImageURLInput",
- "DataChunkValueImageURLInputImage",
- "DataChunkValueTextInput",
-]
-
-
-class DataChunkValueImageURLInputImage(BaseModel):
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class DataChunkValueImageURLInput(BaseModel):
- image: DataChunkValueImageURLInputImage
- """The image input specification."""
-
- type: Optional[Literal["image_url"]] = None
- """Input type identifier"""
-
-
-class DataChunkValueTextInput(BaseModel):
- text: str
- """Text content to process"""
-
- type: Optional[Literal["text"]] = None
- """Input type identifier"""
-
-
-DataChunkValue: TypeAlias = Union[str, DataChunkValueImageURLInput, DataChunkValueTextInput, Dict[str, object], None]
-
-
-class DataChunk(BaseModel):
- file_id: str
- """file id"""
-
- position: int
- """position of the chunk in a file"""
-
- score: float
- """score of the chunk"""
-
- vector_store_id: str
- """vector store id"""
-
- content: Optional[str] = None
- """content of the chunk"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- value: Optional[DataChunkValue] = None
- """value of the chunk"""
-
-
-class Data(BaseModel):
- id: str
- """file id"""
-
- created_at: datetime
- """Timestamp of vector store file creation"""
-
- score: float
- """score of the file"""
-
- usage_bytes: int
- """usage in bytes"""
-
- vector_store_id: str
- """vector store id"""
-
- version: int
- """version of the file"""
-
- chunks: Optional[List[DataChunk]] = None
- """chunks"""
-
- metadata: Optional[object] = None
- """metadata"""
+__all__ = ["FileSearchResponse"]
class FileSearchResponse(BaseModel):
- data: List[Data]
+ data: List[ScoredVectorStoreFile]
"""The list of scored vector store files"""
object: Optional[Literal["list"]] = None
diff --git a/src/mixedbread/types/vector_stores/scored_vector_store_file.py b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
new file mode 100644
index 00000000..d49a8582
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -0,0 +1,35 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from datetime import datetime
+
+from ..._models import BaseModel
+from ..scored_vector_store_chunk import ScoredVectorStoreChunk
+
+__all__ = ["ScoredVectorStoreFile"]
+
+
+class ScoredVectorStoreFile(BaseModel):
+ id: str
+ """file id"""
+
+ created_at: datetime
+ """Timestamp of vector store file creation"""
+
+ score: float
+ """score of the file"""
+
+ usage_bytes: int
+ """usage in bytes"""
+
+ vector_store_id: str
+ """vector store id"""
+
+ version: int
+ """version of the file"""
+
+ chunks: Optional[List[ScoredVectorStoreChunk]] = None
+ """chunks"""
+
+ metadata: Optional[object] = None
+ """metadata"""
diff --git a/tests/api_resources/extractions/__init__.py b/tests/api_resources/extractions/__init__.py
deleted file mode 100644
index fd8019a9..00000000
--- a/tests/api_resources/extractions/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
diff --git a/tests/api_resources/extractions/test_content.py b/tests/api_resources/extractions/test_content.py
deleted file mode 100644
index 7beb468b..00000000
--- a/tests/api_resources/extractions/test_content.py
+++ /dev/null
@@ -1,90 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types.extractions import ExtractionResult
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestContent:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- content = client.extractions.content.create(
- content="content",
- json_schema={},
- )
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.extractions.content.with_raw_response.create(
- content="content",
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- content = response.parse()
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.extractions.content.with_streaming_response.create(
- content="content",
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- content = response.parse()
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncContent:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- content = await async_client.extractions.content.create(
- content="content",
- json_schema={},
- )
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.content.with_raw_response.create(
- content="content",
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- content = await response.parse()
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.content.with_streaming_response.create(
- content="content",
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- content = await response.parse()
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/extractions/test_jobs.py b/tests/api_resources/extractions/test_jobs.py
deleted file mode 100644
index bb055ba7..00000000
--- a/tests/api_resources/extractions/test_jobs.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types.extractions import ExtractionJob
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestJobs:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- job = client.extractions.jobs.create(
- file_id="file_id",
- json_schema={},
- )
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.extractions.jobs.with_raw_response.create(
- file_id="file_id",
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- job = response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.extractions.jobs.with_streaming_response.create(
- file_id="file_id",
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- job = response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_method_retrieve(self, client: Mixedbread) -> None:
- job = client.extractions.jobs.retrieve(
- "job_id",
- )
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- def test_raw_response_retrieve(self, client: Mixedbread) -> None:
- response = client.extractions.jobs.with_raw_response.retrieve(
- "job_id",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- job = response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with client.extractions.jobs.with_streaming_response.retrieve(
- "job_id",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- job = response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
- client.extractions.jobs.with_raw_response.retrieve(
- "",
- )
-
-
-class TestAsyncJobs:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- job = await async_client.extractions.jobs.create(
- file_id="file_id",
- json_schema={},
- )
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.jobs.with_raw_response.create(
- file_id="file_id",
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- job = await response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.jobs.with_streaming_response.create(
- file_id="file_id",
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- job = await response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
- job = await async_client.extractions.jobs.retrieve(
- "job_id",
- )
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.jobs.with_raw_response.retrieve(
- "job_id",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- job = await response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.jobs.with_streaming_response.retrieve(
- "job_id",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- job = await response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
- await async_client.extractions.jobs.with_raw_response.retrieve(
- "",
- )
diff --git a/tests/api_resources/extractions/test_schema.py b/tests/api_resources/extractions/test_schema.py
deleted file mode 100644
index 5bff1298..00000000
--- a/tests/api_resources/extractions/test_schema.py
+++ /dev/null
@@ -1,212 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types.extractions import (
- CreatedJsonSchema,
- EnhancedJsonSchema,
- ValidatedJsonSchema,
-)
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestSchema:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- schema = client.extractions.schema.create(
- description="description",
- )
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.extractions.schema.with_raw_response.create(
- description="description",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = response.parse()
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.extractions.schema.with_streaming_response.create(
- description="description",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = response.parse()
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_method_enhance(self, client: Mixedbread) -> None:
- schema = client.extractions.schema.enhance(
- json_schema={},
- )
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_raw_response_enhance(self, client: Mixedbread) -> None:
- response = client.extractions.schema.with_raw_response.enhance(
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = response.parse()
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_streaming_response_enhance(self, client: Mixedbread) -> None:
- with client.extractions.schema.with_streaming_response.enhance(
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = response.parse()
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_method_validate(self, client: Mixedbread) -> None:
- schema = client.extractions.schema.validate(
- json_schema={},
- )
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_raw_response_validate(self, client: Mixedbread) -> None:
- response = client.extractions.schema.with_raw_response.validate(
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = response.parse()
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_streaming_response_validate(self, client: Mixedbread) -> None:
- with client.extractions.schema.with_streaming_response.validate(
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = response.parse()
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncSchema:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- schema = await async_client.extractions.schema.create(
- description="description",
- )
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.schema.with_raw_response.create(
- description="description",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = await response.parse()
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.schema.with_streaming_response.create(
- description="description",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = await response.parse()
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_method_enhance(self, async_client: AsyncMixedbread) -> None:
- schema = await async_client.extractions.schema.enhance(
- json_schema={},
- )
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_raw_response_enhance(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.schema.with_raw_response.enhance(
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = await response.parse()
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_streaming_response_enhance(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.schema.with_streaming_response.enhance(
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = await response.parse()
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_method_validate(self, async_client: AsyncMixedbread) -> None:
- schema = await async_client.extractions.schema.validate(
- json_schema={},
- )
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_raw_response_validate(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.schema.with_raw_response.validate(
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = await response.parse()
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_streaming_response_validate(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.schema.with_streaming_response.validate(
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = await response.parse()
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/files/__init__.py b/tests/api_resources/files/__init__.py
deleted file mode 100644
index fd8019a9..00000000
--- a/tests/api_resources/files/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
diff --git a/tests/api_resources/files/test_content.py b/tests/api_resources/files/test_content.py
deleted file mode 100644
index d8d219f2..00000000
--- a/tests/api_resources/files/test_content.py
+++ /dev/null
@@ -1,140 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import httpx
-import pytest
-from respx import MockRouter
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from mixedbread._response import (
- BinaryAPIResponse,
- AsyncBinaryAPIResponse,
- StreamedBinaryAPIResponse,
- AsyncStreamedBinaryAPIResponse,
-)
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestContent:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- @pytest.mark.respx(base_url=base_url)
- def test_method_retrieve(self, client: Mixedbread, respx_mock: MockRouter) -> None:
- respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
- return_value=httpx.Response(200, json={"foo": "bar"})
- )
- content = client.files.content.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert content.is_closed
- assert content.json() == {"foo": "bar"}
- assert cast(Any, content.is_closed) is True
- assert isinstance(content, BinaryAPIResponse)
-
- @parametrize
- @pytest.mark.respx(base_url=base_url)
- def test_raw_response_retrieve(self, client: Mixedbread, respx_mock: MockRouter) -> None:
- respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
- return_value=httpx.Response(200, json={"foo": "bar"})
- )
-
- content = client.files.content.with_raw_response.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert content.is_closed is True
- assert content.http_request.headers.get("X-Stainless-Lang") == "python"
- assert content.json() == {"foo": "bar"}
- assert isinstance(content, BinaryAPIResponse)
-
- @parametrize
- @pytest.mark.respx(base_url=base_url)
- def test_streaming_response_retrieve(self, client: Mixedbread, respx_mock: MockRouter) -> None:
- respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
- return_value=httpx.Response(200, json={"foo": "bar"})
- )
- with client.files.content.with_streaming_response.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as content:
- assert not content.is_closed
- assert content.http_request.headers.get("X-Stainless-Lang") == "python"
-
- assert content.json() == {"foo": "bar"}
- assert cast(Any, content.is_closed) is True
- assert isinstance(content, StreamedBinaryAPIResponse)
-
- assert cast(Any, content.is_closed) is True
-
- @parametrize
- @pytest.mark.respx(base_url=base_url)
- def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- client.files.content.with_raw_response.retrieve(
- "",
- )
-
-
-class TestAsyncContent:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- @pytest.mark.respx(base_url=base_url)
- async def test_method_retrieve(self, async_client: AsyncMixedbread, respx_mock: MockRouter) -> None:
- respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
- return_value=httpx.Response(200, json={"foo": "bar"})
- )
- content = await async_client.files.content.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert content.is_closed
- assert await content.json() == {"foo": "bar"}
- assert cast(Any, content.is_closed) is True
- assert isinstance(content, AsyncBinaryAPIResponse)
-
- @parametrize
- @pytest.mark.respx(base_url=base_url)
- async def test_raw_response_retrieve(self, async_client: AsyncMixedbread, respx_mock: MockRouter) -> None:
- respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
- return_value=httpx.Response(200, json={"foo": "bar"})
- )
-
- content = await async_client.files.content.with_raw_response.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert content.is_closed is True
- assert content.http_request.headers.get("X-Stainless-Lang") == "python"
- assert await content.json() == {"foo": "bar"}
- assert isinstance(content, AsyncBinaryAPIResponse)
-
- @parametrize
- @pytest.mark.respx(base_url=base_url)
- async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread, respx_mock: MockRouter) -> None:
- respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
- return_value=httpx.Response(200, json={"foo": "bar"})
- )
- async with async_client.files.content.with_streaming_response.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as content:
- assert not content.is_closed
- assert content.http_request.headers.get("X-Stainless-Lang") == "python"
-
- assert await content.json() == {"foo": "bar"}
- assert cast(Any, content.is_closed) is True
- assert isinstance(content, AsyncStreamedBinaryAPIResponse)
-
- assert cast(Any, content.is_closed) is True
-
- @parametrize
- @pytest.mark.respx(base_url=base_url)
- async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- await async_client.files.content.with_raw_response.retrieve(
- "",
- )
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
new file mode 100644
index 00000000..6b84bb7a
--- /dev/null
+++ b/tests/api_resources/test_client.py
@@ -0,0 +1,72 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types import InfoResponse
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestClient:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_info(self, client: Mixedbread) -> None:
+ client_ = client.info()
+ assert_matches_type(InfoResponse, client_, path=["response"])
+
+ @parametrize
+ def test_raw_response_info(self, client: Mixedbread) -> None:
+ response = client.with_raw_response.info()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ client_ = response.parse()
+ assert_matches_type(InfoResponse, client_, path=["response"])
+
+ @parametrize
+ def test_streaming_response_info(self, client: Mixedbread) -> None:
+ with client.with_streaming_response.info() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ client_ = response.parse()
+ assert_matches_type(InfoResponse, client_, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncClient:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_info(self, async_client: AsyncMixedbread) -> None:
+ client = await async_client.info()
+ assert_matches_type(InfoResponse, client, path=["response"])
+
+ @parametrize
+ async def test_raw_response_info(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.with_raw_response.info()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ client = await response.parse()
+ assert_matches_type(InfoResponse, client, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_info(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.with_streaming_response.info() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ client = await response.parse()
+ assert_matches_type(InfoResponse, client, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_completions.py b/tests/api_resources/test_completions.py
deleted file mode 100644
index af7af678..00000000
--- a/tests/api_resources/test_completions.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestCompletions:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- completion = client.completions.create()
- assert_matches_type(object, completion, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.completions.with_raw_response.create()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- completion = response.parse()
- assert_matches_type(object, completion, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.completions.with_streaming_response.create() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- completion = response.parse()
- assert_matches_type(object, completion, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncCompletions:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- completion = await async_client.completions.create()
- assert_matches_type(object, completion, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.completions.with_raw_response.create()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- completion = await response.parse()
- assert_matches_type(object, completion, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.completions.with_streaming_response.create() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- completion = await response.parse()
- assert_matches_type(object, completion, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py
index 1685fe4e..459804aa 100644
--- a/tests/api_resources/test_files.py
+++ b/tests/api_resources/test_files.py
@@ -5,15 +5,20 @@
import os
from typing import Any, cast
+import httpx
import pytest
+from respx import MockRouter
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import (
- FileObject,
- FileDeleted,
- FileListResponse,
+from mixedbread.types import FileObject, FileDeleteResponse
+from mixedbread._response import (
+ BinaryAPIResponse,
+ AsyncBinaryAPIResponse,
+ StreamedBinaryAPIResponse,
+ AsyncStreamedBinaryAPIResponse,
)
+from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -135,7 +140,7 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
file = client.files.list()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncLimitOffset[FileObject], file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -143,7 +148,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
limit=0,
offset=0,
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncLimitOffset[FileObject], file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -152,7 +157,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncLimitOffset[FileObject], file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -161,7 +166,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncLimitOffset[FileObject], file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -170,7 +175,7 @@ def test_method_delete(self, client: Mixedbread) -> None:
file = client.files.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(FileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
def test_raw_response_delete(self, client: Mixedbread) -> None:
@@ -181,7 +186,7 @@ def test_raw_response_delete(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
def test_streaming_response_delete(self, client: Mixedbread) -> None:
@@ -192,7 +197,7 @@ def test_streaming_response_delete(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -203,6 +208,62 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
"",
)
+ @parametrize
+ @pytest.mark.respx(base_url=base_url)
+ def test_method_content(self, client: Mixedbread, respx_mock: MockRouter) -> None:
+ respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
+ return_value=httpx.Response(200, json={"foo": "bar"})
+ )
+ file = client.files.content(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert file.is_closed
+ assert file.json() == {"foo": "bar"}
+ assert cast(Any, file.is_closed) is True
+ assert isinstance(file, BinaryAPIResponse)
+
+ @parametrize
+ @pytest.mark.respx(base_url=base_url)
+ def test_raw_response_content(self, client: Mixedbread, respx_mock: MockRouter) -> None:
+ respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
+ return_value=httpx.Response(200, json={"foo": "bar"})
+ )
+
+ file = client.files.with_raw_response.content(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert file.is_closed is True
+ assert file.http_request.headers.get("X-Stainless-Lang") == "python"
+ assert file.json() == {"foo": "bar"}
+ assert isinstance(file, BinaryAPIResponse)
+
+ @parametrize
+ @pytest.mark.respx(base_url=base_url)
+ def test_streaming_response_content(self, client: Mixedbread, respx_mock: MockRouter) -> None:
+ respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
+ return_value=httpx.Response(200, json={"foo": "bar"})
+ )
+ with client.files.with_streaming_response.content(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as file:
+ assert not file.is_closed
+ assert file.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ assert file.json() == {"foo": "bar"}
+ assert cast(Any, file.is_closed) is True
+ assert isinstance(file, StreamedBinaryAPIResponse)
+
+ assert cast(Any, file.is_closed) is True
+
+ @parametrize
+ @pytest.mark.respx(base_url=base_url)
+ def test_path_params_content(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ client.files.with_raw_response.content(
+ "",
+ )
+
class TestAsyncFiles:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@@ -321,7 +382,7 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncLimitOffset[FileObject], file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -329,7 +390,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
limit=0,
offset=0,
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncLimitOffset[FileObject], file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -338,7 +399,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncLimitOffset[FileObject], file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -347,7 +408,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncLimitOffset[FileObject], file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -356,7 +417,7 @@ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(FileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
@@ -367,7 +428,7 @@ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
@@ -378,7 +439,7 @@ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -388,3 +449,59 @@ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
await async_client.files.with_raw_response.delete(
"",
)
+
+ @parametrize
+ @pytest.mark.respx(base_url=base_url)
+ async def test_method_content(self, async_client: AsyncMixedbread, respx_mock: MockRouter) -> None:
+ respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
+ return_value=httpx.Response(200, json={"foo": "bar"})
+ )
+ file = await async_client.files.content(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert file.is_closed
+ assert await file.json() == {"foo": "bar"}
+ assert cast(Any, file.is_closed) is True
+ assert isinstance(file, AsyncBinaryAPIResponse)
+
+ @parametrize
+ @pytest.mark.respx(base_url=base_url)
+ async def test_raw_response_content(self, async_client: AsyncMixedbread, respx_mock: MockRouter) -> None:
+ respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
+ return_value=httpx.Response(200, json={"foo": "bar"})
+ )
+
+ file = await async_client.files.with_raw_response.content(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert file.is_closed is True
+ assert file.http_request.headers.get("X-Stainless-Lang") == "python"
+ assert await file.json() == {"foo": "bar"}
+ assert isinstance(file, AsyncBinaryAPIResponse)
+
+ @parametrize
+ @pytest.mark.respx(base_url=base_url)
+ async def test_streaming_response_content(self, async_client: AsyncMixedbread, respx_mock: MockRouter) -> None:
+ respx_mock.get("/v1/files/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/content").mock(
+ return_value=httpx.Response(200, json={"foo": "bar"})
+ )
+ async with async_client.files.with_streaming_response.content(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as file:
+ assert not file.is_closed
+ assert file.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ assert await file.json() == {"foo": "bar"}
+ assert cast(Any, file.is_closed) is True
+ assert isinstance(file, AsyncStreamedBinaryAPIResponse)
+
+ assert cast(Any, file.is_closed) is True
+
+ @parametrize
+ @pytest.mark.respx(base_url=base_url)
+ async def test_path_params_content(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ await async_client.files.with_raw_response.content(
+ "",
+ )
diff --git a/tests/api_resources/test_service_info.py b/tests/api_resources/test_service_info.py
deleted file mode 100644
index 6bc48955..00000000
--- a/tests/api_resources/test_service_info.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types import InfoResponse
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestServiceInfo:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_retrieve(self, client: Mixedbread) -> None:
- service_info = client.service_info.retrieve()
- assert_matches_type(InfoResponse, service_info, path=["response"])
-
- @parametrize
- def test_raw_response_retrieve(self, client: Mixedbread) -> None:
- response = client.service_info.with_raw_response.retrieve()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- service_info = response.parse()
- assert_matches_type(InfoResponse, service_info, path=["response"])
-
- @parametrize
- def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with client.service_info.with_streaming_response.retrieve() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- service_info = response.parse()
- assert_matches_type(InfoResponse, service_info, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncServiceInfo:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
- service_info = await async_client.service_info.retrieve()
- assert_matches_type(InfoResponse, service_info, path=["response"])
-
- @parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.service_info.with_raw_response.retrieve()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- service_info = await response.parse()
- assert_matches_type(InfoResponse, service_info, path=["response"])
-
- @parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- async with async_client.service_info.with_streaming_response.retrieve() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- service_info = await response.parse()
- assert_matches_type(InfoResponse, service_info, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 25798670..9303bdc2 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -11,10 +11,10 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
VectorStore,
- VectorStoreDeleted,
- VectorStoreListResponse,
+ VectorStoreDeleteResponse,
VectorStoreSearchResponse,
)
+from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -154,7 +154,7 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -162,7 +162,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
limit=0,
offset=0,
)
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -171,7 +171,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -180,7 +180,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -189,7 +189,7 @@ def test_method_delete(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStoreDeleted, vector_store, path=["response"])
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_delete(self, client: Mixedbread) -> None:
@@ -200,7 +200,7 @@ def test_raw_response_delete(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreDeleted, vector_store, path=["response"])
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
@parametrize
def test_streaming_response_delete(self, client: Mixedbread) -> None:
@@ -211,7 +211,7 @@ def test_streaming_response_delete(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreDeleted, vector_store, path=["response"])
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -222,54 +222,6 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
"",
)
- @parametrize
- def test_method_question_answering(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
- assert_matches_type(object, vector_store, path=["response"])
-
- @parametrize
- def test_method_question_answering_with_all_params(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- qa_options={"cite": True},
- query="x",
- search_options={
- "return_chunks": True,
- "return_metadata": True,
- "rewrite_query": True,
- "score_threshold": 0,
- },
- stream=True,
- top_k=1,
- )
- assert_matches_type(object, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_question_answering(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(object, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_question_answering(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(object, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
@parametrize
def test_method_search(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.search(
@@ -455,7 +407,7 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -463,7 +415,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
limit=0,
offset=0,
)
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -472,7 +424,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -481,7 +433,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -490,7 +442,7 @@ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.delete(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStoreDeleted, vector_store, path=["response"])
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
@@ -501,7 +453,7 @@ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreDeleted, vector_store, path=["response"])
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
@@ -512,7 +464,7 @@ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreDeleted, vector_store, path=["response"])
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -523,54 +475,6 @@ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
"",
)
- @parametrize
- async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
- assert_matches_type(object, vector_store, path=["response"])
-
- @parametrize
- async def test_method_question_answering_with_all_params(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- qa_options={"cite": True},
- query="x",
- search_options={
- "return_chunks": True,
- "return_metadata": True,
- "rewrite_query": True,
- "score_threshold": 0,
- },
- stream=True,
- top_k=1,
- )
- assert_matches_type(object, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(object, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(object, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
@parametrize
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.search(
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index c3900a06..60027b49 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -9,11 +9,11 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
+from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
from mixedbread.types.vector_stores import (
VectorStoreFile,
- FileListResponse,
+ FileDeleteResponse,
FileSearchResponse,
- VectorStoreFileDeleted,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -126,7 +126,7 @@ def test_method_list(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -135,7 +135,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
limit=0,
offset=0,
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -146,7 +146,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -157,7 +157,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -174,7 +174,7 @@ def test_method_delete(self, client: Mixedbread) -> None:
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStoreFileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
def test_raw_response_delete(self, client: Mixedbread) -> None:
@@ -186,7 +186,7 @@ def test_raw_response_delete(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(VectorStoreFileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
def test_streaming_response_delete(self, client: Mixedbread) -> None:
@@ -198,7 +198,7 @@ def test_streaming_response_delete(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(VectorStoreFileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -373,7 +373,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -382,7 +382,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
limit=0,
offset=0,
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -393,7 +393,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -404,7 +404,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -421,7 +421,7 @@ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStoreFileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
@@ -433,7 +433,7 @@ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(VectorStoreFileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
@@ -445,7 +445,7 @@ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(VectorStoreFileDeleted, file, path=["response"])
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/test_client.py b/tests/test_client.py
index 5c2e3f24..b8ca316a 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -24,7 +24,7 @@
from mixedbread._types import Omit
from mixedbread._models import BaseModel, FinalRequestOptions
from mixedbread._constants import RAW_RESPONSE_HEADER
-from mixedbread._exceptions import APIStatusError, APITimeoutError, APIResponseValidationError
+from mixedbread._exceptions import APIStatusError, APITimeoutError, MixedbreadError, APIResponseValidationError
from mixedbread._base_client import (
DEFAULT_TIMEOUT,
HTTPX_DEFAULT_TIMEOUT,
@@ -333,6 +333,16 @@ def test_default_headers_option(self) -> None:
assert request.headers.get("x-foo") == "stainless"
assert request.headers.get("x-stainless-lang") == "my-overriding-header"
+ def test_validate_headers(self) -> None:
+ client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
+ assert request.headers.get("Authorization") == f"Bearer {api_key}"
+
+ with pytest.raises(MixedbreadError):
+ with update_env(**{"MXBAI_API_KEY": Omit()}):
+ client2 = Mixedbread(base_url=base_url, api_key=None, _strict_response_validation=True)
+ _ = client2
+
def test_default_query_option(self) -> None:
client = Mixedbread(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"}
@@ -719,12 +729,12 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/files").mock(side_effect=httpx.TimeoutException("Test timeout error"))
+ respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
self.client.post(
- "/v1/files",
- body=cast(object, dict(file=b"raw file contents")),
+ "/v1/vector_stores",
+ body=cast(object, dict()),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -734,12 +744,12 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/files").mock(return_value=httpx.Response(500))
+ respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
self.client.post(
- "/v1/files",
- body=cast(object, dict(file=b"raw file contents")),
+ "/v1/vector_stores",
+ body=cast(object, dict()),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -770,9 +780,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/files").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = client.files.with_raw_response.create(file=b"raw file contents")
+ response = client.vector_stores.with_raw_response.create()
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -794,11 +804,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/files").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = client.files.with_raw_response.create(
- file=b"raw file contents", extra_headers={"x-stainless-retry-count": Omit()}
- )
+ response = client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()})
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -819,11 +827,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/files").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = client.files.with_raw_response.create(
- file=b"raw file contents", extra_headers={"x-stainless-retry-count": "42"}
- )
+ response = client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
@@ -1107,6 +1113,16 @@ def test_default_headers_option(self) -> None:
assert request.headers.get("x-foo") == "stainless"
assert request.headers.get("x-stainless-lang") == "my-overriding-header"
+ def test_validate_headers(self) -> None:
+ client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
+ assert request.headers.get("Authorization") == f"Bearer {api_key}"
+
+ with pytest.raises(MixedbreadError):
+ with update_env(**{"MXBAI_API_KEY": Omit()}):
+ client2 = AsyncMixedbread(base_url=base_url, api_key=None, _strict_response_validation=True)
+ _ = client2
+
def test_default_query_option(self) -> None:
client = AsyncMixedbread(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"}
@@ -1499,12 +1515,12 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/files").mock(side_effect=httpx.TimeoutException("Test timeout error"))
+ respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
await self.client.post(
- "/v1/files",
- body=cast(object, dict(file=b"raw file contents")),
+ "/v1/vector_stores",
+ body=cast(object, dict()),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1514,12 +1530,12 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/files").mock(return_value=httpx.Response(500))
+ respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
await self.client.post(
- "/v1/files",
- body=cast(object, dict(file=b"raw file contents")),
+ "/v1/vector_stores",
+ body=cast(object, dict()),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1551,9 +1567,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/files").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = await client.files.with_raw_response.create(file=b"raw file contents")
+ response = await client.vector_stores.with_raw_response.create()
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -1576,10 +1592,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/files").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = await client.files.with_raw_response.create(
- file=b"raw file contents", extra_headers={"x-stainless-retry-count": Omit()}
+ response = await client.vector_stores.with_raw_response.create(
+ extra_headers={"x-stainless-retry-count": Omit()}
)
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -1602,11 +1618,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/files").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = await client.files.with_raw_response.create(
- file=b"raw file contents", extra_headers={"x-stainless-retry-count": "42"}
- )
+ response = await client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
From 6a978f68029d2f6930073e74d98d00a9d3598be9 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 13 Jan 2025 10:17:13 +0000
Subject: [PATCH 002/375] chore(internal): version bump (#62)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index ee49ac2d..fd0ccba9 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.11"
+ ".": "0.1.0-alpha.12"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 9f0dc211..5a77ec18 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.11"
+version = "0.1.0-alpha.12"
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 2127bcb8..052bfe42 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.1.0-alpha.11" # x-release-please-version
+__version__ = "0.1.0-alpha.12" # x-release-please-version
From f5411ae4731fc5b1dc01789db6f867f501d8d0af Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 13 Jan 2025 20:02:23 +0000
Subject: [PATCH 003/375] feat(api): update via SDK Studio (#65)
---
pyproject.toml | 2 +-
src/mixedbread/_client.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 5a77ec18..a8a45c6e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,7 @@
[project]
name = "mixedbread"
version = "0.1.0-alpha.12"
-description = "The official Python library for the mixedbread API"
+description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index e8a02a46..b39fe539 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -102,7 +102,7 @@ def __init__(
# part of our public interface in the future.
_strict_response_validation: bool = False,
) -> None:
- """Construct a new synchronous mixedbread client instance.
+ """Construct a new synchronous Mixedbread client instance.
This automatically infers the `api_key` argument from the `MXBAI_API_KEY` environment variable if it is not provided.
"""
@@ -327,7 +327,7 @@ def __init__(
# part of our public interface in the future.
_strict_response_validation: bool = False,
) -> None:
- """Construct a new async mixedbread client instance.
+ """Construct a new async Mixedbread client instance.
This automatically infers the `api_key` argument from the `MXBAI_API_KEY` environment variable if it is not provided.
"""
From faf691caa4384b969da78138c95ff5cd51328b5e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 17 Jan 2025 06:56:00 +0000
Subject: [PATCH 004/375] chore(internal): codegen related update (#66)
---
mypy.ini | 2 +-
requirements-dev.lock | 4 ++--
src/mixedbread/_response.py | 8 +++++++-
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/mypy.ini b/mypy.ini
index 4f4fe9c6..5d8f89a9 100644
--- a/mypy.ini
+++ b/mypy.ini
@@ -41,7 +41,7 @@ cache_fine_grained = True
# ```
# Changing this codegen to make mypy happy would increase complexity
# and would not be worth it.
-disable_error_code = func-returns-value
+disable_error_code = func-returns-value,overload-cannot-match
# https://github.com/python/mypy/issues/12162
[mypy.overrides]
diff --git a/requirements-dev.lock b/requirements-dev.lock
index f054d9bd..c8c44ee4 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -48,7 +48,7 @@ markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
-mypy==1.13.0
+mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
nest-asyncio==1.6.0
@@ -68,7 +68,7 @@ pydantic-core==2.27.1
# via pydantic
pygments==2.18.0
# via rich
-pyright==1.1.390
+pyright==1.1.392.post0
pytest==8.3.3
# via pytest-asyncio
pytest-asyncio==0.24.0
diff --git a/src/mixedbread/_response.py b/src/mixedbread/_response.py
index 3221a254..58b6c8ce 100644
--- a/src/mixedbread/_response.py
+++ b/src/mixedbread/_response.py
@@ -210,7 +210,13 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
raise ValueError(f"Subclasses of httpx.Response cannot be passed to `cast_to`")
return cast(R, response)
- if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel):
+ if (
+ inspect.isclass(
+ origin # pyright: ignore[reportUnknownArgumentType]
+ )
+ and not issubclass(origin, BaseModel)
+ and issubclass(origin, pydantic.BaseModel)
+ ):
raise TypeError(
"Pydantic models must subclass our base model type, e.g. `from mixedbread import BaseModel`"
)
From 7e20a4ebc72494ed225e136170e1dfd37345ea35 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 17 Jan 2025 14:41:39 +0000
Subject: [PATCH 005/375] feat(api): update via SDK Studio (#67)
---
.stats.yml | 4 +-
api.md | 64 ++++
src/mixedbread/_client.py | 19 +-
src/mixedbread/resources/__init__.py | 28 ++
src/mixedbread/resources/completions.py | 164 ++++++++
.../resources/extractions/__init__.py | 61 +++
.../resources/extractions/content.py | 196 ++++++++++
.../resources/extractions/extractions.py | 166 ++++++++
src/mixedbread/resources/extractions/jobs.py | 286 ++++++++++++++
.../resources/extractions/schema.py | 356 ++++++++++++++++++
src/mixedbread/resources/parsing/jobs.py | 211 ++++++++++-
.../resources/vector_stores/files.py | 15 +-
.../resources/vector_stores/vector_stores.py | 154 +++++++-
src/mixedbread/types/__init__.py | 5 +
.../types/embedding_create_response.py | 1 +
src/mixedbread/types/extractions/__init__.py | 14 +
.../extractions/content_create_params.py | 15 +
.../types/extractions/created_json_schema.py | 11 +
.../types/extractions/enhanced_json_schema.py | 11 +
.../types/extractions/extraction_job.py | 13 +
.../types/extractions/extraction_result.py | 11 +
.../types/extractions/job_create_params.py | 15 +
.../types/extractions/schema_create_params.py | 12 +
.../extractions/schema_enhance_params.py | 12 +
.../extractions/schema_validate_params.py | 12 +
.../extractions/validated_json_schema.py | 18 +
src/mixedbread/types/parsing/__init__.py | 1 +
.../types/parsing/job_list_params.py | 15 +
src/mixedbread/types/parsing/parsing_job.py | 14 +-
.../types/reranking_create_response.py | 2 +
src/mixedbread/types/shared/__init__.py | 4 +
src/mixedbread/types/shared/search_filter.py | 35 ++
.../types/shared/search_filter_condition.py | 18 +
.../types/shared_params/__init__.py | 4 +
.../types/shared_params/search_filter.py | 27 ++
.../shared_params/search_filter_condition.py | 18 +
.../vector_store_question_answering_params.py | 50 +++
.../vector_store_search_options_param.py | 21 ++
.../types/vector_store_search_params.py | 27 +-
.../types/vector_stores/file_search_params.py | 27 +-
.../vector_stores/scored_vector_store_file.py | 7 +
.../types/vector_stores/vector_store_file.py | 10 +-
tests/api_resources/extractions/__init__.py | 1 +
.../api_resources/extractions/test_content.py | 90 +++++
tests/api_resources/extractions/test_jobs.py | 166 ++++++++
.../api_resources/extractions/test_schema.py | 212 +++++++++++
tests/api_resources/parsing/test_jobs.py | 155 +++++++-
tests/api_resources/test_completions.py | 71 ++++
tests/api_resources/test_vector_stores.py | 248 ++++++++++++
.../api_resources/vector_stores/test_files.py | 76 ++++
50 files changed, 3120 insertions(+), 53 deletions(-)
create mode 100644 src/mixedbread/resources/completions.py
create mode 100644 src/mixedbread/resources/extractions/__init__.py
create mode 100644 src/mixedbread/resources/extractions/content.py
create mode 100644 src/mixedbread/resources/extractions/extractions.py
create mode 100644 src/mixedbread/resources/extractions/jobs.py
create mode 100644 src/mixedbread/resources/extractions/schema.py
create mode 100644 src/mixedbread/types/extractions/__init__.py
create mode 100644 src/mixedbread/types/extractions/content_create_params.py
create mode 100644 src/mixedbread/types/extractions/created_json_schema.py
create mode 100644 src/mixedbread/types/extractions/enhanced_json_schema.py
create mode 100644 src/mixedbread/types/extractions/extraction_job.py
create mode 100644 src/mixedbread/types/extractions/extraction_result.py
create mode 100644 src/mixedbread/types/extractions/job_create_params.py
create mode 100644 src/mixedbread/types/extractions/schema_create_params.py
create mode 100644 src/mixedbread/types/extractions/schema_enhance_params.py
create mode 100644 src/mixedbread/types/extractions/schema_validate_params.py
create mode 100644 src/mixedbread/types/extractions/validated_json_schema.py
create mode 100644 src/mixedbread/types/parsing/job_list_params.py
create mode 100644 src/mixedbread/types/shared/__init__.py
create mode 100644 src/mixedbread/types/shared/search_filter.py
create mode 100644 src/mixedbread/types/shared/search_filter_condition.py
create mode 100644 src/mixedbread/types/shared_params/__init__.py
create mode 100644 src/mixedbread/types/shared_params/search_filter.py
create mode 100644 src/mixedbread/types/shared_params/search_filter_condition.py
create mode 100644 src/mixedbread/types/vector_store_question_answering_params.py
create mode 100644 src/mixedbread/types/vector_store_search_options_param.py
create mode 100644 tests/api_resources/extractions/__init__.py
create mode 100644 tests/api_resources/extractions/test_content.py
create mode 100644 tests/api_resources/extractions/test_jobs.py
create mode 100644 tests/api_resources/extractions/test_schema.py
create mode 100644 tests/api_resources/test_completions.py
diff --git a/.stats.yml b/.stats.yml
index 11d09278..25121c1f 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 22
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-a9b8728ee918c023a0e1458cfab7f26721d4ac851c533c6ce2f53411bc1576d1.yml
+configured_endpoints: 32
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-973fae5ec9e58a3ce2621748fda3601cb95ea7ee7c44fc8514eb6ea9f0861bbe.yml
diff --git a/api.md b/api.md
index ddce9b34..96450b8d 100644
--- a/api.md
+++ b/api.md
@@ -1,3 +1,9 @@
+# Shared Types
+
+```python
+from mixedbread.types import SearchFilter, SearchFilterCondition
+```
+
# Mixedbread
Types:
@@ -48,6 +54,8 @@ Methods:
- client.parsing.jobs.create(\*\*params) -> ParsingJob
- client.parsing.jobs.retrieve(job_id) -> ParsingJob
+- client.parsing.jobs.list(\*\*params) -> SyncLimitOffset[ParsingJob]
+- client.parsing.jobs.cancel(job_id) -> ParsingJob
# Files
@@ -76,7 +84,9 @@ from mixedbread.types import (
FileCounts,
ScoredVectorStoreChunk,
VectorStore,
+ VectorStoreSearchOptions,
VectorStoreDeleteResponse,
+ VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
)
```
@@ -88,6 +98,7 @@ Methods:
- client.vector_stores.update(vector_store_id, \*\*params) -> VectorStore
- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStore]
- client.vector_stores.delete(vector_store_id) -> VectorStoreDeleteResponse
+- client.vector_stores.question_answering(\*\*params) -> object
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
## Files
@@ -110,3 +121,56 @@ Methods:
- client.vector_stores.files.list(vector_store_id, \*\*params) -> SyncLimitOffset[VectorStoreFile]
- client.vector_stores.files.delete(file_id, \*, vector_store_id) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
+
+# Completions
+
+Types:
+
+```python
+from mixedbread.types import CompletionCreateResponse
+```
+
+Methods:
+
+- client.completions.create() -> object
+
+# Extractions
+
+## Jobs
+
+Types:
+
+```python
+from mixedbread.types.extractions import ExtractionJob
+```
+
+Methods:
+
+- client.extractions.jobs.create(\*\*params) -> ExtractionJob
+- client.extractions.jobs.retrieve(job_id) -> ExtractionJob
+
+## Schema
+
+Types:
+
+```python
+from mixedbread.types.extractions import CreatedJsonSchema, EnhancedJsonSchema, ValidatedJsonSchema
+```
+
+Methods:
+
+- client.extractions.schema.create(\*\*params) -> CreatedJsonSchema
+- client.extractions.schema.enhance(\*\*params) -> EnhancedJsonSchema
+- client.extractions.schema.validate(\*\*params) -> ValidatedJsonSchema
+
+## Content
+
+Types:
+
+```python
+from mixedbread.types.extractions import ExtractionResult
+```
+
+Methods:
+
+- client.extractions.content.create(\*\*params) -> ExtractionResult
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index b39fe539..1fcffdbb 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -33,7 +33,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from .resources import files, reranking, embeddings
+from .resources import files, reranking, embeddings, completions
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, MixedbreadError
from ._base_client import (
@@ -44,6 +44,7 @@
)
from .resources.parsing import parsing
from .types.info_response import InfoResponse
+from .resources.extractions import extractions
from .resources.vector_stores import vector_stores
__all__ = [
@@ -70,6 +71,8 @@ class Mixedbread(SyncAPIClient):
parsing: parsing.ParsingResource
files: files.FilesResource
vector_stores: vector_stores.VectorStoresResource
+ completions: completions.CompletionsResource
+ extractions: extractions.ExtractionsResource
with_raw_response: MixedbreadWithRawResponse
with_streaming_response: MixedbreadWithStreamedResponse
@@ -156,6 +159,8 @@ def __init__(
self.parsing = parsing.ParsingResource(self)
self.files = files.FilesResource(self)
self.vector_stores = vector_stores.VectorStoresResource(self)
+ self.completions = completions.CompletionsResource(self)
+ self.extractions = extractions.ExtractionsResource(self)
self.with_raw_response = MixedbreadWithRawResponse(self)
self.with_streaming_response = MixedbreadWithStreamedResponse(self)
@@ -295,6 +300,8 @@ class AsyncMixedbread(AsyncAPIClient):
parsing: parsing.AsyncParsingResource
files: files.AsyncFilesResource
vector_stores: vector_stores.AsyncVectorStoresResource
+ completions: completions.AsyncCompletionsResource
+ extractions: extractions.AsyncExtractionsResource
with_raw_response: AsyncMixedbreadWithRawResponse
with_streaming_response: AsyncMixedbreadWithStreamedResponse
@@ -381,6 +388,8 @@ def __init__(
self.parsing = parsing.AsyncParsingResource(self)
self.files = files.AsyncFilesResource(self)
self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
+ self.completions = completions.AsyncCompletionsResource(self)
+ self.extractions = extractions.AsyncExtractionsResource(self)
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)
@@ -521,6 +530,8 @@ def __init__(self, client: Mixedbread) -> None:
self.parsing = parsing.ParsingResourceWithRawResponse(client.parsing)
self.files = files.FilesResourceWithRawResponse(client.files)
self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
+ self.completions = completions.CompletionsResourceWithRawResponse(client.completions)
+ self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
self.info = to_raw_response_wrapper(
client.info,
@@ -534,6 +545,8 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.parsing = parsing.AsyncParsingResourceWithRawResponse(client.parsing)
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
+ self.completions = completions.AsyncCompletionsResourceWithRawResponse(client.completions)
+ self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
self.info = async_to_raw_response_wrapper(
client.info,
@@ -547,6 +560,8 @@ def __init__(self, client: Mixedbread) -> None:
self.parsing = parsing.ParsingResourceWithStreamingResponse(client.parsing)
self.files = files.FilesResourceWithStreamingResponse(client.files)
self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
+ self.completions = completions.CompletionsResourceWithStreamingResponse(client.completions)
+ self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
self.info = to_streamed_response_wrapper(
client.info,
@@ -560,6 +575,8 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.parsing = parsing.AsyncParsingResourceWithStreamingResponse(client.parsing)
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
+ self.completions = completions.AsyncCompletionsResourceWithStreamingResponse(client.completions)
+ self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
self.info = async_to_streamed_response_wrapper(
client.info,
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index df3fc03a..1cca98be 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -32,6 +32,22 @@
EmbeddingsResourceWithStreamingResponse,
AsyncEmbeddingsResourceWithStreamingResponse,
)
+from .completions import (
+ CompletionsResource,
+ AsyncCompletionsResource,
+ CompletionsResourceWithRawResponse,
+ AsyncCompletionsResourceWithRawResponse,
+ CompletionsResourceWithStreamingResponse,
+ AsyncCompletionsResourceWithStreamingResponse,
+)
+from .extractions import (
+ ExtractionsResource,
+ AsyncExtractionsResource,
+ ExtractionsResourceWithRawResponse,
+ AsyncExtractionsResourceWithRawResponse,
+ ExtractionsResourceWithStreamingResponse,
+ AsyncExtractionsResourceWithStreamingResponse,
+)
from .vector_stores import (
VectorStoresResource,
AsyncVectorStoresResource,
@@ -72,4 +88,16 @@
"AsyncVectorStoresResourceWithRawResponse",
"VectorStoresResourceWithStreamingResponse",
"AsyncVectorStoresResourceWithStreamingResponse",
+ "CompletionsResource",
+ "AsyncCompletionsResource",
+ "CompletionsResourceWithRawResponse",
+ "AsyncCompletionsResourceWithRawResponse",
+ "CompletionsResourceWithStreamingResponse",
+ "AsyncCompletionsResourceWithStreamingResponse",
+ "ExtractionsResource",
+ "AsyncExtractionsResource",
+ "ExtractionsResourceWithRawResponse",
+ "AsyncExtractionsResourceWithRawResponse",
+ "ExtractionsResourceWithStreamingResponse",
+ "AsyncExtractionsResourceWithStreamingResponse",
]
diff --git a/src/mixedbread/resources/completions.py b/src/mixedbread/resources/completions.py
new file mode 100644
index 00000000..0446e5ae
--- /dev/null
+++ b/src/mixedbread/resources/completions.py
@@ -0,0 +1,164 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._compat import cached_property
+from .._resource import SyncAPIResource, AsyncAPIResource
+from .._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from .._base_client import make_request_options
+
+__all__ = ["CompletionsResource", "AsyncCompletionsResource"]
+
+
+class CompletionsResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> CompletionsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return CompletionsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> CompletionsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return CompletionsResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> object:
+ """
+ Create a chat completion using the provided parameters.
+
+ Generates a completion response based on the chat messages and model parameters
+ provided. The response can be either a full completion or streamed chunks
+ depending on the request parameters.
+
+ Args: params: Parameters for creating the chat completion including messages,
+ model selection, and generation settings user: The authenticated user making the
+ request
+
+ Returns: Either a ChatCompletion containing the full response, or
+ ChatCompletionChunk for streaming
+
+ Raises: HTTPException: If there is an error creating the completion (500)
+ """
+ return self._post(
+ "/v1/chat/completions",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=object,
+ )
+
+
+class AsyncCompletionsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncCompletionsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncCompletionsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncCompletionsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncCompletionsResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> object:
+ """
+ Create a chat completion using the provided parameters.
+
+ Generates a completion response based on the chat messages and model parameters
+ provided. The response can be either a full completion or streamed chunks
+ depending on the request parameters.
+
+ Args: params: Parameters for creating the chat completion including messages,
+ model selection, and generation settings user: The authenticated user making the
+ request
+
+ Returns: Either a ChatCompletion containing the full response, or
+ ChatCompletionChunk for streaming
+
+ Raises: HTTPException: If there is an error creating the completion (500)
+ """
+ return await self._post(
+ "/v1/chat/completions",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=object,
+ )
+
+
+class CompletionsResourceWithRawResponse:
+ def __init__(self, completions: CompletionsResource) -> None:
+ self._completions = completions
+
+ self.create = to_raw_response_wrapper(
+ completions.create,
+ )
+
+
+class AsyncCompletionsResourceWithRawResponse:
+ def __init__(self, completions: AsyncCompletionsResource) -> None:
+ self._completions = completions
+
+ self.create = async_to_raw_response_wrapper(
+ completions.create,
+ )
+
+
+class CompletionsResourceWithStreamingResponse:
+ def __init__(self, completions: CompletionsResource) -> None:
+ self._completions = completions
+
+ self.create = to_streamed_response_wrapper(
+ completions.create,
+ )
+
+
+class AsyncCompletionsResourceWithStreamingResponse:
+ def __init__(self, completions: AsyncCompletionsResource) -> None:
+ self._completions = completions
+
+ self.create = async_to_streamed_response_wrapper(
+ completions.create,
+ )
diff --git a/src/mixedbread/resources/extractions/__init__.py b/src/mixedbread/resources/extractions/__init__.py
new file mode 100644
index 00000000..d9a42002
--- /dev/null
+++ b/src/mixedbread/resources/extractions/__init__.py
@@ -0,0 +1,61 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .jobs import (
+ JobsResource,
+ AsyncJobsResource,
+ JobsResourceWithRawResponse,
+ AsyncJobsResourceWithRawResponse,
+ JobsResourceWithStreamingResponse,
+ AsyncJobsResourceWithStreamingResponse,
+)
+from .schema import (
+ SchemaResource,
+ AsyncSchemaResource,
+ SchemaResourceWithRawResponse,
+ AsyncSchemaResourceWithRawResponse,
+ SchemaResourceWithStreamingResponse,
+ AsyncSchemaResourceWithStreamingResponse,
+)
+from .content import (
+ ContentResource,
+ AsyncContentResource,
+ ContentResourceWithRawResponse,
+ AsyncContentResourceWithRawResponse,
+ ContentResourceWithStreamingResponse,
+ AsyncContentResourceWithStreamingResponse,
+)
+from .extractions import (
+ ExtractionsResource,
+ AsyncExtractionsResource,
+ ExtractionsResourceWithRawResponse,
+ AsyncExtractionsResourceWithRawResponse,
+ ExtractionsResourceWithStreamingResponse,
+ AsyncExtractionsResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "JobsResource",
+ "AsyncJobsResource",
+ "JobsResourceWithRawResponse",
+ "AsyncJobsResourceWithRawResponse",
+ "JobsResourceWithStreamingResponse",
+ "AsyncJobsResourceWithStreamingResponse",
+ "SchemaResource",
+ "AsyncSchemaResource",
+ "SchemaResourceWithRawResponse",
+ "AsyncSchemaResourceWithRawResponse",
+ "SchemaResourceWithStreamingResponse",
+ "AsyncSchemaResourceWithStreamingResponse",
+ "ContentResource",
+ "AsyncContentResource",
+ "ContentResourceWithRawResponse",
+ "AsyncContentResourceWithRawResponse",
+ "ContentResourceWithStreamingResponse",
+ "AsyncContentResourceWithStreamingResponse",
+ "ExtractionsResource",
+ "AsyncExtractionsResource",
+ "ExtractionsResourceWithRawResponse",
+ "AsyncExtractionsResourceWithRawResponse",
+ "ExtractionsResourceWithStreamingResponse",
+ "AsyncExtractionsResourceWithStreamingResponse",
+]
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
new file mode 100644
index 00000000..83b139ef
--- /dev/null
+++ b/src/mixedbread/resources/extractions/content.py
@@ -0,0 +1,196 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import (
+ maybe_transform,
+ async_maybe_transform,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._base_client import make_request_options
+from ...types.extractions import content_create_params
+from ...types.extractions.extraction_result import ExtractionResult
+
+__all__ = ["ContentResource", "AsyncContentResource"]
+
+
+class ContentResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> ContentResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return ContentResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ContentResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return ContentResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ content: str,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionResult:
+ """
+ Extract content from a string using the provided schema.
+
+ Args: params: The parameters for extracting content from a string.
+
+ Returns: The extracted content.
+
+ Args:
+ content: The content to extract from
+
+ json_schema: The JSON schema to use for extraction
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/content",
+ body=maybe_transform(
+ {
+ "content": content,
+ "json_schema": json_schema,
+ },
+ content_create_params.ContentCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionResult,
+ )
+
+
+class AsyncContentResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncContentResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncContentResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncContentResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncContentResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ content: str,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionResult:
+ """
+ Extract content from a string using the provided schema.
+
+ Args: params: The parameters for extracting content from a string.
+
+ Returns: The extracted content.
+
+ Args:
+ content: The content to extract from
+
+ json_schema: The JSON schema to use for extraction
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/content",
+ body=await async_maybe_transform(
+ {
+ "content": content,
+ "json_schema": json_schema,
+ },
+ content_create_params.ContentCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionResult,
+ )
+
+
+class ContentResourceWithRawResponse:
+ def __init__(self, content: ContentResource) -> None:
+ self._content = content
+
+ self.create = to_raw_response_wrapper(
+ content.create,
+ )
+
+
+class AsyncContentResourceWithRawResponse:
+ def __init__(self, content: AsyncContentResource) -> None:
+ self._content = content
+
+ self.create = async_to_raw_response_wrapper(
+ content.create,
+ )
+
+
+class ContentResourceWithStreamingResponse:
+ def __init__(self, content: ContentResource) -> None:
+ self._content = content
+
+ self.create = to_streamed_response_wrapper(
+ content.create,
+ )
+
+
+class AsyncContentResourceWithStreamingResponse:
+ def __init__(self, content: AsyncContentResource) -> None:
+ self._content = content
+
+ self.create = async_to_streamed_response_wrapper(
+ content.create,
+ )
diff --git a/src/mixedbread/resources/extractions/extractions.py b/src/mixedbread/resources/extractions/extractions.py
new file mode 100644
index 00000000..eb34814c
--- /dev/null
+++ b/src/mixedbread/resources/extractions/extractions.py
@@ -0,0 +1,166 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .jobs import (
+ JobsResource,
+ AsyncJobsResource,
+ JobsResourceWithRawResponse,
+ AsyncJobsResourceWithRawResponse,
+ JobsResourceWithStreamingResponse,
+ AsyncJobsResourceWithStreamingResponse,
+)
+from .schema import (
+ SchemaResource,
+ AsyncSchemaResource,
+ SchemaResourceWithRawResponse,
+ AsyncSchemaResourceWithRawResponse,
+ SchemaResourceWithStreamingResponse,
+ AsyncSchemaResourceWithStreamingResponse,
+)
+from .content import (
+ ContentResource,
+ AsyncContentResource,
+ ContentResourceWithRawResponse,
+ AsyncContentResourceWithRawResponse,
+ ContentResourceWithStreamingResponse,
+ AsyncContentResourceWithStreamingResponse,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+
+__all__ = ["ExtractionsResource", "AsyncExtractionsResource"]
+
+
+class ExtractionsResource(SyncAPIResource):
+ @cached_property
+ def jobs(self) -> JobsResource:
+ return JobsResource(self._client)
+
+ @cached_property
+ def schema(self) -> SchemaResource:
+ return SchemaResource(self._client)
+
+ @cached_property
+ def content(self) -> ContentResource:
+ return ContentResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> ExtractionsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return ExtractionsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ExtractionsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return ExtractionsResourceWithStreamingResponse(self)
+
+
+class AsyncExtractionsResource(AsyncAPIResource):
+ @cached_property
+ def jobs(self) -> AsyncJobsResource:
+ return AsyncJobsResource(self._client)
+
+ @cached_property
+ def schema(self) -> AsyncSchemaResource:
+ return AsyncSchemaResource(self._client)
+
+ @cached_property
+ def content(self) -> AsyncContentResource:
+ return AsyncContentResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncExtractionsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncExtractionsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncExtractionsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncExtractionsResourceWithStreamingResponse(self)
+
+
+class ExtractionsResourceWithRawResponse:
+ def __init__(self, extractions: ExtractionsResource) -> None:
+ self._extractions = extractions
+
+ @cached_property
+ def jobs(self) -> JobsResourceWithRawResponse:
+ return JobsResourceWithRawResponse(self._extractions.jobs)
+
+ @cached_property
+ def schema(self) -> SchemaResourceWithRawResponse:
+ return SchemaResourceWithRawResponse(self._extractions.schema)
+
+ @cached_property
+ def content(self) -> ContentResourceWithRawResponse:
+ return ContentResourceWithRawResponse(self._extractions.content)
+
+
+class AsyncExtractionsResourceWithRawResponse:
+ def __init__(self, extractions: AsyncExtractionsResource) -> None:
+ self._extractions = extractions
+
+ @cached_property
+ def jobs(self) -> AsyncJobsResourceWithRawResponse:
+ return AsyncJobsResourceWithRawResponse(self._extractions.jobs)
+
+ @cached_property
+ def schema(self) -> AsyncSchemaResourceWithRawResponse:
+ return AsyncSchemaResourceWithRawResponse(self._extractions.schema)
+
+ @cached_property
+ def content(self) -> AsyncContentResourceWithRawResponse:
+ return AsyncContentResourceWithRawResponse(self._extractions.content)
+
+
+class ExtractionsResourceWithStreamingResponse:
+ def __init__(self, extractions: ExtractionsResource) -> None:
+ self._extractions = extractions
+
+ @cached_property
+ def jobs(self) -> JobsResourceWithStreamingResponse:
+ return JobsResourceWithStreamingResponse(self._extractions.jobs)
+
+ @cached_property
+ def schema(self) -> SchemaResourceWithStreamingResponse:
+ return SchemaResourceWithStreamingResponse(self._extractions.schema)
+
+ @cached_property
+ def content(self) -> ContentResourceWithStreamingResponse:
+ return ContentResourceWithStreamingResponse(self._extractions.content)
+
+
+class AsyncExtractionsResourceWithStreamingResponse:
+ def __init__(self, extractions: AsyncExtractionsResource) -> None:
+ self._extractions = extractions
+
+ @cached_property
+ def jobs(self) -> AsyncJobsResourceWithStreamingResponse:
+ return AsyncJobsResourceWithStreamingResponse(self._extractions.jobs)
+
+ @cached_property
+ def schema(self) -> AsyncSchemaResourceWithStreamingResponse:
+ return AsyncSchemaResourceWithStreamingResponse(self._extractions.schema)
+
+ @cached_property
+ def content(self) -> AsyncContentResourceWithStreamingResponse:
+ return AsyncContentResourceWithStreamingResponse(self._extractions.content)
diff --git a/src/mixedbread/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py
new file mode 100644
index 00000000..62a86477
--- /dev/null
+++ b/src/mixedbread/resources/extractions/jobs.py
@@ -0,0 +1,286 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import (
+ maybe_transform,
+ async_maybe_transform,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._base_client import make_request_options
+from ...types.extractions import job_create_params
+from ...types.extractions.extraction_job import ExtractionJob
+
+__all__ = ["JobsResource", "AsyncJobsResource"]
+
+
+class JobsResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> JobsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return JobsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> JobsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return JobsResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ file_id: str,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionJob:
+ """
+ Start an extraction job for the provided file and schema.
+
+ Args: params: The parameters for creating an extraction job.
+
+ Returns: The created extraction job.
+
+ Args:
+ file_id: The ID of the file to extract from
+
+ json_schema: The JSON schema to use for extraction
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/jobs",
+ body=maybe_transform(
+ {
+ "file_id": file_id,
+ "json_schema": json_schema,
+ },
+ job_create_params.JobCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionJob,
+ )
+
+ def retrieve(
+ self,
+ job_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionJob:
+ """
+ Get detailed information about a specific extraction job.
+
+ Args: job_id: The ID of the extraction job.
+
+ Returns: Detailed information about the extraction job.
+
+ Args:
+ job_id: The ID of the extraction job to retrieve
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return self._get(
+ f"/v1/extractions/jobs/{job_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionJob,
+ )
+
+
+class AsyncJobsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncJobsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncJobsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncJobsResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ file_id: str,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionJob:
+ """
+ Start an extraction job for the provided file and schema.
+
+ Args: params: The parameters for creating an extraction job.
+
+ Returns: The created extraction job.
+
+ Args:
+ file_id: The ID of the file to extract from
+
+ json_schema: The JSON schema to use for extraction
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/jobs",
+ body=await async_maybe_transform(
+ {
+ "file_id": file_id,
+ "json_schema": json_schema,
+ },
+ job_create_params.JobCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionJob,
+ )
+
+ async def retrieve(
+ self,
+ job_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionJob:
+ """
+ Get detailed information about a specific extraction job.
+
+ Args: job_id: The ID of the extraction job.
+
+ Returns: Detailed information about the extraction job.
+
+ Args:
+ job_id: The ID of the extraction job to retrieve
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return await self._get(
+ f"/v1/extractions/jobs/{job_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionJob,
+ )
+
+
+class JobsResourceWithRawResponse:
+ def __init__(self, jobs: JobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = to_raw_response_wrapper(
+ jobs.create,
+ )
+ self.retrieve = to_raw_response_wrapper(
+ jobs.retrieve,
+ )
+
+
+class AsyncJobsResourceWithRawResponse:
+ def __init__(self, jobs: AsyncJobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = async_to_raw_response_wrapper(
+ jobs.create,
+ )
+ self.retrieve = async_to_raw_response_wrapper(
+ jobs.retrieve,
+ )
+
+
+class JobsResourceWithStreamingResponse:
+ def __init__(self, jobs: JobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = to_streamed_response_wrapper(
+ jobs.create,
+ )
+ self.retrieve = to_streamed_response_wrapper(
+ jobs.retrieve,
+ )
+
+
+class AsyncJobsResourceWithStreamingResponse:
+ def __init__(self, jobs: AsyncJobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = async_to_streamed_response_wrapper(
+ jobs.create,
+ )
+ self.retrieve = async_to_streamed_response_wrapper(
+ jobs.retrieve,
+ )
diff --git a/src/mixedbread/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py
new file mode 100644
index 00000000..501865f8
--- /dev/null
+++ b/src/mixedbread/resources/extractions/schema.py
@@ -0,0 +1,356 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import (
+ maybe_transform,
+ async_maybe_transform,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._base_client import make_request_options
+from ...types.extractions import schema_create_params, schema_enhance_params, schema_validate_params
+from ...types.extractions.created_json_schema import CreatedJsonSchema
+from ...types.extractions.enhanced_json_schema import EnhancedJsonSchema
+from ...types.extractions.validated_json_schema import ValidatedJsonSchema
+
+__all__ = ["SchemaResource", "AsyncSchemaResource"]
+
+
+class SchemaResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> SchemaResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return SchemaResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> SchemaResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return SchemaResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ description: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> CreatedJsonSchema:
+ """
+ Create a schema with the provided parameters.
+
+ Args: params: The parameters for creating a schema.
+
+ Returns: The created schema.
+
+ Args:
+ description: Description of the data to extract
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/schema",
+ body=maybe_transform({"description": description}, schema_create_params.SchemaCreateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=CreatedJsonSchema,
+ )
+
+ def enhance(
+ self,
+ *,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> EnhancedJsonSchema:
+ """
+ Enhance a schema by enriching the descriptions to aid extraction.
+
+ Args: params: The parameters for enhancing a schema.
+
+ Returns: The enhanced schema.
+
+ Args:
+ json_schema: The JSON schema to enhance
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/schema/enhance",
+ body=maybe_transform({"json_schema": json_schema}, schema_enhance_params.SchemaEnhanceParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=EnhancedJsonSchema,
+ )
+
+ def validate(
+ self,
+ *,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ValidatedJsonSchema:
+ """
+ Validate a schema.
+
+ Args: params: The parameters for validating a schema.
+
+ Returns: The validation result.
+
+ Args:
+ json_schema: The JSON schema to validate
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/schema/validate",
+ body=maybe_transform({"json_schema": json_schema}, schema_validate_params.SchemaValidateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ValidatedJsonSchema,
+ )
+
+
+class AsyncSchemaResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncSchemaResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return the
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncSchemaResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncSchemaResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ description: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> CreatedJsonSchema:
+ """
+ Create a schema with the provided parameters.
+
+ Args: params: The parameters for creating a schema.
+
+ Returns: The created schema.
+
+ Args:
+ description: Description of the data to extract
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/schema",
+ body=await async_maybe_transform({"description": description}, schema_create_params.SchemaCreateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=CreatedJsonSchema,
+ )
+
+ async def enhance(
+ self,
+ *,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> EnhancedJsonSchema:
+ """
+ Enhance a schema by enriching the descriptions to aid extraction.
+
+ Args: params: The parameters for enhancing a schema.
+
+ Returns: The enhanced schema.
+
+ Args:
+ json_schema: The JSON schema to enhance
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/schema/enhance",
+ body=await async_maybe_transform({"json_schema": json_schema}, schema_enhance_params.SchemaEnhanceParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=EnhancedJsonSchema,
+ )
+
+ async def validate(
+ self,
+ *,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ValidatedJsonSchema:
+ """
+ Validate a schema.
+
+ Args: params: The parameters for validating a schema.
+
+ Returns: The validation result.
+
+ Args:
+ json_schema: The JSON schema to validate
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/schema/validate",
+ body=await async_maybe_transform({"json_schema": json_schema}, schema_validate_params.SchemaValidateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ValidatedJsonSchema,
+ )
+
+
+class SchemaResourceWithRawResponse:
+ def __init__(self, schema: SchemaResource) -> None:
+ self._schema = schema
+
+ self.create = to_raw_response_wrapper(
+ schema.create,
+ )
+ self.enhance = to_raw_response_wrapper(
+ schema.enhance,
+ )
+ self.validate = to_raw_response_wrapper(
+ schema.validate,
+ )
+
+
+class AsyncSchemaResourceWithRawResponse:
+ def __init__(self, schema: AsyncSchemaResource) -> None:
+ self._schema = schema
+
+ self.create = async_to_raw_response_wrapper(
+ schema.create,
+ )
+ self.enhance = async_to_raw_response_wrapper(
+ schema.enhance,
+ )
+ self.validate = async_to_raw_response_wrapper(
+ schema.validate,
+ )
+
+
+class SchemaResourceWithStreamingResponse:
+ def __init__(self, schema: SchemaResource) -> None:
+ self._schema = schema
+
+ self.create = to_streamed_response_wrapper(
+ schema.create,
+ )
+ self.enhance = to_streamed_response_wrapper(
+ schema.enhance,
+ )
+ self.validate = to_streamed_response_wrapper(
+ schema.validate,
+ )
+
+
+class AsyncSchemaResourceWithStreamingResponse:
+ def __init__(self, schema: AsyncSchemaResource) -> None:
+ self._schema = schema
+
+ self.create = async_to_streamed_response_wrapper(
+ schema.create,
+ )
+ self.enhance = async_to_streamed_response_wrapper(
+ schema.enhance,
+ )
+ self.validate = async_to_streamed_response_wrapper(
+ schema.validate,
+ )
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index b0d597bf..b9244f18 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -20,8 +20,9 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
-from ...types.parsing import job_create_params
+from ...pagination import SyncLimitOffset, AsyncLimitOffset
+from ..._base_client import AsyncPaginator, make_request_options
+from ...types.parsing import job_list_params, job_create_params
from ...types.parsing.parsing_job import ParsingJob
__all__ = ["JobsResource", "AsyncJobsResource"]
@@ -158,6 +159,97 @@ def retrieve(
cast_to=ParsingJob,
)
+ def list(
+ self,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> SyncLimitOffset[ParsingJob]:
+ """List parsing jobs with pagination.
+
+ Args: limit: The number of items to return.
+
+ offset: The number of items to skip.
+
+ Returns: List of parsing jobs with pagination.
+
+ Args:
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/v1/parsing/jobs",
+ page=SyncLimitOffset[ParsingJob],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ job_list_params.JobListParams,
+ ),
+ ),
+ model=ParsingJob,
+ )
+
+ def cancel(
+ self,
+ job_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ParsingJob:
+ """
+ Cancel a specific parse job.
+
+ Args: job_id: The ID of the parse job to cancel.
+
+ Returns: The cancelled parsing job.
+
+ Args:
+ job_id: The ID of the parse job to cancel
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return self._delete(
+ f"/v1/parsing/jobs/{job_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ParsingJob,
+ )
+
class AsyncJobsResource(AsyncAPIResource):
@cached_property
@@ -290,6 +382,97 @@ async def retrieve(
cast_to=ParsingJob,
)
+ def list(
+ self,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> AsyncPaginator[ParsingJob, AsyncLimitOffset[ParsingJob]]:
+ """List parsing jobs with pagination.
+
+ Args: limit: The number of items to return.
+
+ offset: The number of items to skip.
+
+ Returns: List of parsing jobs with pagination.
+
+ Args:
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/v1/parsing/jobs",
+ page=AsyncLimitOffset[ParsingJob],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ job_list_params.JobListParams,
+ ),
+ ),
+ model=ParsingJob,
+ )
+
+ async def cancel(
+ self,
+ job_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ParsingJob:
+ """
+ Cancel a specific parse job.
+
+ Args: job_id: The ID of the parse job to cancel.
+
+ Returns: The cancelled parsing job.
+
+ Args:
+ job_id: The ID of the parse job to cancel
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return await self._delete(
+ f"/v1/parsing/jobs/{job_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ParsingJob,
+ )
+
class JobsResourceWithRawResponse:
def __init__(self, jobs: JobsResource) -> None:
@@ -301,6 +484,12 @@ def __init__(self, jobs: JobsResource) -> None:
self.retrieve = to_raw_response_wrapper(
jobs.retrieve,
)
+ self.list = to_raw_response_wrapper(
+ jobs.list,
+ )
+ self.cancel = to_raw_response_wrapper(
+ jobs.cancel,
+ )
class AsyncJobsResourceWithRawResponse:
@@ -313,6 +502,12 @@ def __init__(self, jobs: AsyncJobsResource) -> None:
self.retrieve = async_to_raw_response_wrapper(
jobs.retrieve,
)
+ self.list = async_to_raw_response_wrapper(
+ jobs.list,
+ )
+ self.cancel = async_to_raw_response_wrapper(
+ jobs.cancel,
+ )
class JobsResourceWithStreamingResponse:
@@ -325,6 +520,12 @@ def __init__(self, jobs: JobsResource) -> None:
self.retrieve = to_streamed_response_wrapper(
jobs.retrieve,
)
+ self.list = to_streamed_response_wrapper(
+ jobs.list,
+ )
+ self.cancel = to_streamed_response_wrapper(
+ jobs.cancel,
+ )
class AsyncJobsResourceWithStreamingResponse:
@@ -337,3 +538,9 @@ def __init__(self, jobs: AsyncJobsResource) -> None:
self.retrieve = async_to_streamed_response_wrapper(
jobs.retrieve,
)
+ self.list = async_to_streamed_response_wrapper(
+ jobs.list,
+ )
+ self.cancel = async_to_streamed_response_wrapper(
+ jobs.cancel,
+ )
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index a5848412..f475f18d 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import List
+from typing import List, Optional
import httpx
@@ -23,6 +23,7 @@
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.vector_store_file import VectorStoreFile
+from ...types.vector_store_search_options_param import VectorStoreSearchOptionsParam
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
@@ -253,7 +254,8 @@ def search(
*,
query: str,
vector_store_ids: List[str],
- search_options: file_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
top_k: int | 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.
@@ -285,6 +287,8 @@ def search(
vector_store_ids: IDs of vector stores to search
+ filters: Optional filter conditions
+
search_options: Search configuration options
top_k: Number of results to return
@@ -303,6 +307,7 @@ def search(
{
"query": query,
"vector_store_ids": vector_store_ids,
+ "filters": filters,
"search_options": search_options,
"top_k": top_k,
},
@@ -539,7 +544,8 @@ async def search(
*,
query: str,
vector_store_ids: List[str],
- search_options: file_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
top_k: int | 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.
@@ -571,6 +577,8 @@ async def search(
vector_store_ids: IDs of vector stores to search
+ filters: Optional filter conditions
+
search_options: Search configuration options
top_k: Number of results to return
@@ -589,6 +597,7 @@ async def search(
{
"query": query,
"vector_store_ids": vector_store_ids,
+ "filters": filters,
"search_options": search_options,
"top_k": top_k,
},
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index be1a6b79..4ef578b6 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -19,6 +19,7 @@
vector_store_create_params,
vector_store_search_params,
vector_store_update_params,
+ vector_store_question_answering_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
@@ -39,6 +40,7 @@
from ...types.expires_after_param import ExpiresAfterParam
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
+from ...types.vector_store_search_options_param import VectorStoreSearchOptionsParam
__all__ = ["VectorStoresResource", "AsyncVectorStoresResource"]
@@ -318,12 +320,77 @@ def delete(
cast_to=VectorStoreDeleteResponse,
)
+ def question_answering(
+ self,
+ *,
+ vector_store_ids: List[str],
+ filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
+ qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
+ query: str | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
+ stream: bool | NotGiven = NOT_GIVEN,
+ top_k: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> object:
+ """
+ Question answering
+
+ Args:
+ vector_store_ids: IDs of vector stores to search
+
+ filters: Optional filter conditions
+
+ qa_options: Question answering configuration options
+
+ query: Question to answer. If not provided, the question will be extracted from the
+ passed messages.
+
+ search_options: Search configuration options
+
+ stream: Whether to stream the answer
+
+ top_k: Number of results to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/vector_stores/question-answering",
+ body=maybe_transform(
+ {
+ "vector_store_ids": vector_store_ids,
+ "filters": filters,
+ "qa_options": qa_options,
+ "query": query,
+ "search_options": search_options,
+ "stream": stream,
+ "top_k": top_k,
+ },
+ vector_store_question_answering_params.VectorStoreQuestionAnsweringParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=object,
+ )
+
def search(
self,
*,
query: str,
vector_store_ids: List[str],
- search_options: vector_store_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
top_k: int | 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.
@@ -354,6 +421,8 @@ def search(
vector_store_ids: IDs of vector stores to search
+ filters: Optional filter conditions
+
search_options: Search configuration options
top_k: Number of results to return
@@ -372,6 +441,7 @@ def search(
{
"query": query,
"vector_store_ids": vector_store_ids,
+ "filters": filters,
"search_options": search_options,
"top_k": top_k,
},
@@ -659,12 +729,77 @@ async def delete(
cast_to=VectorStoreDeleteResponse,
)
+ async def question_answering(
+ self,
+ *,
+ vector_store_ids: List[str],
+ filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
+ qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
+ query: str | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
+ stream: bool | NotGiven = NOT_GIVEN,
+ top_k: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> object:
+ """
+ Question answering
+
+ Args:
+ vector_store_ids: IDs of vector stores to search
+
+ filters: Optional filter conditions
+
+ qa_options: Question answering configuration options
+
+ query: Question to answer. If not provided, the question will be extracted from the
+ passed messages.
+
+ search_options: Search configuration options
+
+ stream: Whether to stream the answer
+
+ top_k: Number of results to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/vector_stores/question-answering",
+ body=await async_maybe_transform(
+ {
+ "vector_store_ids": vector_store_ids,
+ "filters": filters,
+ "qa_options": qa_options,
+ "query": query,
+ "search_options": search_options,
+ "stream": stream,
+ "top_k": top_k,
+ },
+ vector_store_question_answering_params.VectorStoreQuestionAnsweringParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=object,
+ )
+
async def search(
self,
*,
query: str,
vector_store_ids: List[str],
- search_options: vector_store_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
top_k: int | 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.
@@ -695,6 +830,8 @@ async def search(
vector_store_ids: IDs of vector stores to search
+ filters: Optional filter conditions
+
search_options: Search configuration options
top_k: Number of results to return
@@ -713,6 +850,7 @@ async def search(
{
"query": query,
"vector_store_ids": vector_store_ids,
+ "filters": filters,
"search_options": search_options,
"top_k": top_k,
},
@@ -744,6 +882,9 @@ def __init__(self, vector_stores: VectorStoresResource) -> None:
self.delete = to_raw_response_wrapper(
vector_stores.delete,
)
+ self.question_answering = to_raw_response_wrapper(
+ vector_stores.question_answering,
+ )
self.search = to_raw_response_wrapper(
vector_stores.search,
)
@@ -772,6 +913,9 @@ def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self.delete = async_to_raw_response_wrapper(
vector_stores.delete,
)
+ self.question_answering = async_to_raw_response_wrapper(
+ vector_stores.question_answering,
+ )
self.search = async_to_raw_response_wrapper(
vector_stores.search,
)
@@ -800,6 +944,9 @@ def __init__(self, vector_stores: VectorStoresResource) -> None:
self.delete = to_streamed_response_wrapper(
vector_stores.delete,
)
+ self.question_answering = to_streamed_response_wrapper(
+ vector_stores.question_answering,
+ )
self.search = to_streamed_response_wrapper(
vector_stores.search,
)
@@ -828,6 +975,9 @@ def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self.delete = async_to_streamed_response_wrapper(
vector_stores.delete,
)
+ self.question_answering = async_to_streamed_response_wrapper(
+ vector_stores.question_answering,
+ )
self.search = async_to_streamed_response_wrapper(
vector_stores.search,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 3c0319ec..a426aa67 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from .shared import SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
from .embedding import Embedding as Embedding
from .file_counts import FileCounts as FileCounts
from .file_object import FileObject as FileObject
@@ -24,3 +25,7 @@
from .vector_store_update_params import VectorStoreUpdateParams as VectorStoreUpdateParams
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
+from .vector_store_search_options_param import VectorStoreSearchOptionsParam as VectorStoreSearchOptionsParam
+from .vector_store_question_answering_params import (
+ VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams,
+)
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index 9b84cb1d..d31d69b4 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -74,6 +74,7 @@ class EmbeddingCreateResponse(BaseModel):
object: Optional[
Literal[
"list",
+ "parsing_job",
"job",
"embedding",
"embedding_dict",
diff --git a/src/mixedbread/types/extractions/__init__.py b/src/mixedbread/types/extractions/__init__.py
new file mode 100644
index 00000000..6457c670
--- /dev/null
+++ b/src/mixedbread/types/extractions/__init__.py
@@ -0,0 +1,14 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .extraction_job import ExtractionJob as ExtractionJob
+from .extraction_result import ExtractionResult as ExtractionResult
+from .job_create_params import JobCreateParams as JobCreateParams
+from .created_json_schema import CreatedJsonSchema as CreatedJsonSchema
+from .enhanced_json_schema import EnhancedJsonSchema as EnhancedJsonSchema
+from .schema_create_params import SchemaCreateParams as SchemaCreateParams
+from .content_create_params import ContentCreateParams as ContentCreateParams
+from .schema_enhance_params import SchemaEnhanceParams as SchemaEnhanceParams
+from .validated_json_schema import ValidatedJsonSchema as ValidatedJsonSchema
+from .schema_validate_params import SchemaValidateParams as SchemaValidateParams
diff --git a/src/mixedbread/types/extractions/content_create_params.py b/src/mixedbread/types/extractions/content_create_params.py
new file mode 100644
index 00000000..2bbdada2
--- /dev/null
+++ b/src/mixedbread/types/extractions/content_create_params.py
@@ -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__ = ["ContentCreateParams"]
+
+
+class ContentCreateParams(TypedDict, total=False):
+ content: Required[str]
+ """The content to extract from"""
+
+ json_schema: Required[object]
+ """The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/created_json_schema.py b/src/mixedbread/types/extractions/created_json_schema.py
new file mode 100644
index 00000000..4b50c4c6
--- /dev/null
+++ b/src/mixedbread/types/extractions/created_json_schema.py
@@ -0,0 +1,11 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+
+from ..._models import BaseModel
+
+__all__ = ["CreatedJsonSchema"]
+
+
+class CreatedJsonSchema(BaseModel):
+ json_schema: object
+ """The created JSON schema"""
diff --git a/src/mixedbread/types/extractions/enhanced_json_schema.py b/src/mixedbread/types/extractions/enhanced_json_schema.py
new file mode 100644
index 00000000..7b2ab04a
--- /dev/null
+++ b/src/mixedbread/types/extractions/enhanced_json_schema.py
@@ -0,0 +1,11 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+
+from ..._models import BaseModel
+
+__all__ = ["EnhancedJsonSchema"]
+
+
+class EnhancedJsonSchema(BaseModel):
+ json_schema: object
+ """The enhanced JSON schema"""
diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py
new file mode 100644
index 00000000..5d8a1604
--- /dev/null
+++ b/src/mixedbread/types/extractions/extraction_job.py
@@ -0,0 +1,13 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+
+from ..._models import BaseModel
+from .extraction_result import ExtractionResult
+
+__all__ = ["ExtractionJob"]
+
+
+class ExtractionJob(BaseModel):
+ result: Optional[ExtractionResult] = None
+ """Result of an extraction operation."""
diff --git a/src/mixedbread/types/extractions/extraction_result.py b/src/mixedbread/types/extractions/extraction_result.py
new file mode 100644
index 00000000..fbac5d5f
--- /dev/null
+++ b/src/mixedbread/types/extractions/extraction_result.py
@@ -0,0 +1,11 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+
+from ..._models import BaseModel
+
+__all__ = ["ExtractionResult"]
+
+
+class ExtractionResult(BaseModel):
+ data: object
+ """The extracted data"""
diff --git a/src/mixedbread/types/extractions/job_create_params.py b/src/mixedbread/types/extractions/job_create_params.py
new file mode 100644
index 00000000..476154b2
--- /dev/null
+++ b/src/mixedbread/types/extractions/job_create_params.py
@@ -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__ = ["JobCreateParams"]
+
+
+class JobCreateParams(TypedDict, total=False):
+ file_id: Required[str]
+ """The ID of the file to extract from"""
+
+ json_schema: Required[object]
+ """The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/schema_create_params.py b/src/mixedbread/types/extractions/schema_create_params.py
new file mode 100644
index 00000000..8625ea66
--- /dev/null
+++ b/src/mixedbread/types/extractions/schema_create_params.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Required, TypedDict
+
+__all__ = ["SchemaCreateParams"]
+
+
+class SchemaCreateParams(TypedDict, total=False):
+ description: Required[str]
+ """Description of the data to extract"""
diff --git a/src/mixedbread/types/extractions/schema_enhance_params.py b/src/mixedbread/types/extractions/schema_enhance_params.py
new file mode 100644
index 00000000..e0facf34
--- /dev/null
+++ b/src/mixedbread/types/extractions/schema_enhance_params.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Required, TypedDict
+
+__all__ = ["SchemaEnhanceParams"]
+
+
+class SchemaEnhanceParams(TypedDict, total=False):
+ json_schema: Required[object]
+ """The JSON schema to enhance"""
diff --git a/src/mixedbread/types/extractions/schema_validate_params.py b/src/mixedbread/types/extractions/schema_validate_params.py
new file mode 100644
index 00000000..947182ca
--- /dev/null
+++ b/src/mixedbread/types/extractions/schema_validate_params.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Required, TypedDict
+
+__all__ = ["SchemaValidateParams"]
+
+
+class SchemaValidateParams(TypedDict, total=False):
+ json_schema: Required[object]
+ """The JSON schema to validate"""
diff --git a/src/mixedbread/types/extractions/validated_json_schema.py b/src/mixedbread/types/extractions/validated_json_schema.py
new file mode 100644
index 00000000..42e6da5b
--- /dev/null
+++ b/src/mixedbread/types/extractions/validated_json_schema.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List
+
+from ..._models import BaseModel
+
+__all__ = ["ValidatedJsonSchema"]
+
+
+class ValidatedJsonSchema(BaseModel):
+ errors: List[str]
+ """List of validation errors"""
+
+ is_valid: bool
+ """Whether the schema is valid"""
+
+ json_schema: object
+ """The validated JSON schema"""
diff --git a/src/mixedbread/types/parsing/__init__.py b/src/mixedbread/types/parsing/__init__.py
index 94393293..f399fb3e 100644
--- a/src/mixedbread/types/parsing/__init__.py
+++ b/src/mixedbread/types/parsing/__init__.py
@@ -3,4 +3,5 @@
from __future__ import annotations
from .parsing_job import ParsingJob as ParsingJob
+from .job_list_params import JobListParams as JobListParams
from .job_create_params import JobCreateParams as JobCreateParams
diff --git a/src/mixedbread/types/parsing/job_list_params.py b/src/mixedbread/types/parsing/job_list_params.py
new file mode 100644
index 00000000..f8e7c7b0
--- /dev/null
+++ b/src/mixedbread/types/parsing/job_list_params.py
@@ -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 TypedDict
+
+__all__ = ["JobListParams"]
+
+
+class JobListParams(TypedDict, total=False):
+ limit: int
+ """Maximum number of items to return per page"""
+
+ offset: int
+ """Offset of the first item to return"""
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index e457e260..ef52023e 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -84,20 +84,26 @@ class ParsingJob(BaseModel):
id: str
"""The ID of the job"""
- status: Literal["none", "running", "canceled", "successful", "failed", "resumable", "pending"]
+ status: Literal["PENDING", "RUNNING", "CANCELLED", "FAILED", "SUCCESSFUL"]
"""The status of the job"""
created_at: Optional[datetime] = None
"""The creation time of the job"""
- errors: Optional[List[str]] = None
- """The errors of the job"""
+ error: Optional[str] = None
+ """The error of the job"""
finished_at: Optional[datetime] = None
"""The finished time of the job"""
- object: Optional[Literal["job"]] = None
+ object: Optional[Literal["parsing_job"]] = None
"""The type of the object"""
result: Optional[Result] = None
"""Result of document parsing operation."""
+
+ started_at: Optional[datetime] = None
+ """The started time of the job"""
+
+ updated_at: Optional[datetime] = None
+ """The updated time of the job"""
diff --git a/src/mixedbread/types/reranking_create_response.py b/src/mixedbread/types/reranking_create_response.py
index 28710545..a9d91d9c 100644
--- a/src/mixedbread/types/reranking_create_response.py
+++ b/src/mixedbread/types/reranking_create_response.py
@@ -20,6 +20,7 @@ class Data(BaseModel):
object: Optional[
Literal[
"list",
+ "parsing_job",
"job",
"embedding",
"embedding_dict",
@@ -63,6 +64,7 @@ class RerankingCreateResponse(BaseModel):
object: Optional[
Literal[
"list",
+ "parsing_job",
"job",
"embedding",
"embedding_dict",
diff --git a/src/mixedbread/types/shared/__init__.py b/src/mixedbread/types/shared/__init__.py
new file mode 100644
index 00000000..c91e740d
--- /dev/null
+++ b/src/mixedbread/types/shared/__init__.py
@@ -0,0 +1,4 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .search_filter import SearchFilter as SearchFilter
+from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py
new file mode 100644
index 00000000..76eaab35
--- /dev/null
+++ b/src/mixedbread/types/shared/search_filter.py
@@ -0,0 +1,35 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Optional
+from typing_extensions import TypeAlias
+
+from ..._compat import PYDANTIC_V2
+from ..._models import BaseModel
+from .search_filter_condition import SearchFilterCondition
+
+__all__ = ["SearchFilter", "All", "Any", "NoneType"]
+
+All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+
+class SearchFilter(BaseModel):
+ all: Optional[List[All]] = None
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[List[Any]] = None
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[List[NoneType]] = None
+ """List of conditions or filters to be NOTed"""
+
+
+if PYDANTIC_V2:
+ SearchFilter.model_rebuild()
+else:
+ SearchFilter.update_forward_refs() # type: ignore
diff --git a/src/mixedbread/types/shared/search_filter_condition.py b/src/mixedbread/types/shared/search_filter_condition.py
new file mode 100644
index 00000000..176185a7
--- /dev/null
+++ b/src/mixedbread/types/shared/search_filter_condition.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["SearchFilterCondition"]
+
+
+class SearchFilterCondition(BaseModel):
+ key: str
+ """The field to apply the condition on"""
+
+ operator: Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "not_like"]
+ """The operator for the condition"""
+
+ value: object
+ """The value to compare against"""
diff --git a/src/mixedbread/types/shared_params/__init__.py b/src/mixedbread/types/shared_params/__init__.py
new file mode 100644
index 00000000..c91e740d
--- /dev/null
+++ b/src/mixedbread/types/shared_params/__init__.py
@@ -0,0 +1,4 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .search_filter import SearchFilter as SearchFilter
+from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared_params/search_filter.py b/src/mixedbread/types/shared_params/search_filter.py
new file mode 100644
index 00000000..455119db
--- /dev/null
+++ b/src/mixedbread/types/shared_params/search_filter.py
@@ -0,0 +1,27 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict
+
+from .search_filter_condition import SearchFilterCondition
+
+__all__ = ["SearchFilter", "All", "Any", "NoneType"]
+
+All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+
+class SearchFilter(TypedDict, total=False):
+ all: Optional[Iterable[All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[NoneType]]
+ """List of conditions or filters to be NOTed"""
diff --git a/src/mixedbread/types/shared_params/search_filter_condition.py b/src/mixedbread/types/shared_params/search_filter_condition.py
new file mode 100644
index 00000000..0d8ff30f
--- /dev/null
+++ b/src/mixedbread/types/shared_params/search_filter_condition.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["SearchFilterCondition"]
+
+
+class SearchFilterCondition(TypedDict, total=False):
+ key: Required[str]
+ """The field to apply the condition on"""
+
+ operator: Required[Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "not_like"]]
+ """The operator for the condition"""
+
+ value: Required[object]
+ """The value to compare against"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
new file mode 100644
index 00000000..d74241b3
--- /dev/null
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -0,0 +1,50 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Iterable, Optional
+from typing_extensions import Required, TypeAlias, TypedDict
+
+from .vector_store_search_options_param import VectorStoreSearchOptionsParam
+from .shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
+
+
+class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
+ vector_store_ids: Required[List[str]]
+ """IDs of vector stores to search"""
+
+ filters: Optional[Filters]
+ """Optional filter conditions"""
+
+ qa_options: QaOptions
+ """Question answering configuration options"""
+
+ query: str
+ """Question to answer.
+
+ If not provided, the question will be extracted from the passed messages.
+ """
+
+ search_options: VectorStoreSearchOptionsParam
+ """Search configuration options"""
+
+ stream: bool
+ """Whether to stream the answer"""
+
+ top_k: int
+ """Number of results to return"""
+
+
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+
+
+class QaOptions(TypedDict, total=False):
+ cite: bool
+ """Whether to use citations"""
+
+
+from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_store_search_options_param.py b/src/mixedbread/types/vector_store_search_options_param.py
new file mode 100644
index 00000000..8fbf7f0d
--- /dev/null
+++ b/src/mixedbread/types/vector_store_search_options_param.py
@@ -0,0 +1,21 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import TypedDict
+
+__all__ = ["VectorStoreSearchOptionsParam"]
+
+
+class VectorStoreSearchOptionsParam(TypedDict, total=False):
+ return_chunks: bool
+ """Whether to return matching text chunks"""
+
+ return_metadata: bool
+ """Whether to return file metadata"""
+
+ rewrite_query: bool
+ """Whether to rewrite the query"""
+
+ score_threshold: float
+ """Minimum similarity score threshold"""
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 90900d4a..81559a57 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -2,10 +2,13 @@
from __future__ import annotations
-from typing import List
-from typing_extensions import Required, TypedDict
+from typing import List, Union, Iterable, Optional
+from typing_extensions import Required, TypeAlias, TypedDict
-__all__ = ["VectorStoreSearchParams", "SearchOptions"]
+from .vector_store_search_options_param import VectorStoreSearchOptionsParam
+from .shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
class VectorStoreSearchParams(TypedDict, total=False):
@@ -15,22 +18,18 @@ class VectorStoreSearchParams(TypedDict, total=False):
vector_store_ids: Required[List[str]]
"""IDs of vector stores to search"""
- search_options: SearchOptions
+ filters: Optional[Filters]
+ """Optional filter conditions"""
+
+ search_options: VectorStoreSearchOptionsParam
"""Search configuration options"""
top_k: int
"""Number of results to return"""
-class SearchOptions(TypedDict, total=False):
- return_chunks: bool
- """Whether to return matching text chunks"""
-
- return_metadata: bool
- """Whether to return file metadata"""
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
- rewrite_query: bool
- """Whether to rewrite the query"""
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
- score_threshold: float
- """Minimum similarity score threshold"""
+from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index f98e3f10..246e52a6 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -2,10 +2,13 @@
from __future__ import annotations
-from typing import List
-from typing_extensions import Required, TypedDict
+from typing import List, Union, Iterable, Optional
+from typing_extensions import Required, TypeAlias, TypedDict
-__all__ = ["FileSearchParams", "SearchOptions"]
+from ..vector_store_search_options_param import VectorStoreSearchOptionsParam
+from ..shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2"]
class FileSearchParams(TypedDict, total=False):
@@ -15,22 +18,18 @@ class FileSearchParams(TypedDict, total=False):
vector_store_ids: Required[List[str]]
"""IDs of vector stores to search"""
- search_options: SearchOptions
+ filters: Optional[Filters]
+ """Optional filter conditions"""
+
+ search_options: VectorStoreSearchOptionsParam
"""Search configuration options"""
top_k: int
"""Number of results to return"""
-class SearchOptions(TypedDict, total=False):
- return_chunks: bool
- """Whether to return matching text chunks"""
-
- return_metadata: bool
- """Whether to return file metadata"""
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
- rewrite_query: bool
- """Whether to rewrite the query"""
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
- score_threshold: float
- """Minimum similarity score threshold"""
+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 d49a8582..7b3d09c9 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -2,6 +2,7 @@
from typing import List, Optional
from datetime import datetime
+from typing_extensions import Literal
from ..._models import BaseModel
from ..scored_vector_store_chunk import ScoredVectorStoreChunk
@@ -31,5 +32,11 @@ class ScoredVectorStoreFile(BaseModel):
chunks: Optional[List[ScoredVectorStoreChunk]] = None
"""chunks"""
+ last_error: Optional[object] = None
+ """last error"""
+
metadata: Optional[object] = None
"""metadata"""
+
+ status: Optional[Literal["in_progress", "completed", "failed", "cancelled"]] = None
+ """status of the file"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 996333bc..a0389c4d 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.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 Optional
from datetime import datetime
from typing_extensions import Literal
@@ -20,9 +20,6 @@ class VectorStoreFile(BaseModel):
vector_store_id: str
"""ID of the containing vector store"""
- errors: Optional[List[str]] = None
- """List of error messages if processing failed"""
-
file_object: Optional[FileObject] = None
"""A model representing a file object in the system.
@@ -30,13 +27,16 @@ class VectorStoreFile(BaseModel):
identifiers, size information, and timestamps.
"""
+ last_error: Optional[object] = None
+ """Last error message if processing failed"""
+
metadata: Optional[object] = None
"""Optional file metadata"""
object: Optional[Literal["vector_store.file"]] = None
"""Type of the object"""
- status: Optional[Literal["none", "running", "canceled", "successful", "failed", "resumable", "pending"]] = None
+ status: Optional[str] = None
"""Processing status of the file"""
usage_bytes: Optional[int] = None
diff --git a/tests/api_resources/extractions/__init__.py b/tests/api_resources/extractions/__init__.py
new file mode 100644
index 00000000..fd8019a9
--- /dev/null
+++ b/tests/api_resources/extractions/__init__.py
@@ -0,0 +1 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
diff --git a/tests/api_resources/extractions/test_content.py b/tests/api_resources/extractions/test_content.py
new file mode 100644
index 00000000..7beb468b
--- /dev/null
+++ b/tests/api_resources/extractions/test_content.py
@@ -0,0 +1,90 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types.extractions import ExtractionResult
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestContent:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ content = client.extractions.content.create(
+ content="content",
+ json_schema={},
+ )
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.extractions.content.with_raw_response.create(
+ content="content",
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ content = response.parse()
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.extractions.content.with_streaming_response.create(
+ content="content",
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ content = response.parse()
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncContent:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ content = await async_client.extractions.content.create(
+ content="content",
+ json_schema={},
+ )
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.content.with_raw_response.create(
+ content="content",
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ content = await response.parse()
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.content.with_streaming_response.create(
+ content="content",
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ content = await response.parse()
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/extractions/test_jobs.py b/tests/api_resources/extractions/test_jobs.py
new file mode 100644
index 00000000..bb055ba7
--- /dev/null
+++ b/tests/api_resources/extractions/test_jobs.py
@@ -0,0 +1,166 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types.extractions import ExtractionJob
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestJobs:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ job = client.extractions.jobs.create(
+ file_id="file_id",
+ json_schema={},
+ )
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.extractions.jobs.with_raw_response.create(
+ file_id="file_id",
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.extractions.jobs.with_streaming_response.create(
+ file_id="file_id",
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ job = client.extractions.jobs.retrieve(
+ "job_id",
+ )
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
+ response = client.extractions.jobs.with_raw_response.retrieve(
+ "job_id",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.extractions.jobs.with_streaming_response.retrieve(
+ "job_id",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
+ client.extractions.jobs.with_raw_response.retrieve(
+ "",
+ )
+
+
+class TestAsyncJobs:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ job = await async_client.extractions.jobs.create(
+ file_id="file_id",
+ json_schema={},
+ )
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.jobs.with_raw_response.create(
+ file_id="file_id",
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = await response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.jobs.with_streaming_response.create(
+ file_id="file_id",
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = await response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
+ job = await async_client.extractions.jobs.retrieve(
+ "job_id",
+ )
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.jobs.with_raw_response.retrieve(
+ "job_id",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = await response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.jobs.with_streaming_response.retrieve(
+ "job_id",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = await response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
+ await async_client.extractions.jobs.with_raw_response.retrieve(
+ "",
+ )
diff --git a/tests/api_resources/extractions/test_schema.py b/tests/api_resources/extractions/test_schema.py
new file mode 100644
index 00000000..5bff1298
--- /dev/null
+++ b/tests/api_resources/extractions/test_schema.py
@@ -0,0 +1,212 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types.extractions import (
+ CreatedJsonSchema,
+ EnhancedJsonSchema,
+ ValidatedJsonSchema,
+)
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestSchema:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ schema = client.extractions.schema.create(
+ description="description",
+ )
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.extractions.schema.with_raw_response.create(
+ description="description",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = response.parse()
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.extractions.schema.with_streaming_response.create(
+ description="description",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = response.parse()
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_enhance(self, client: Mixedbread) -> None:
+ schema = client.extractions.schema.enhance(
+ json_schema={},
+ )
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_raw_response_enhance(self, client: Mixedbread) -> None:
+ response = client.extractions.schema.with_raw_response.enhance(
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = response.parse()
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_streaming_response_enhance(self, client: Mixedbread) -> None:
+ with client.extractions.schema.with_streaming_response.enhance(
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = response.parse()
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_validate(self, client: Mixedbread) -> None:
+ schema = client.extractions.schema.validate(
+ json_schema={},
+ )
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_raw_response_validate(self, client: Mixedbread) -> None:
+ response = client.extractions.schema.with_raw_response.validate(
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = response.parse()
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_streaming_response_validate(self, client: Mixedbread) -> None:
+ with client.extractions.schema.with_streaming_response.validate(
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = response.parse()
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncSchema:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ schema = await async_client.extractions.schema.create(
+ description="description",
+ )
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.schema.with_raw_response.create(
+ description="description",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = await response.parse()
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.schema.with_streaming_response.create(
+ description="description",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = await response.parse()
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_enhance(self, async_client: AsyncMixedbread) -> None:
+ schema = await async_client.extractions.schema.enhance(
+ json_schema={},
+ )
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_raw_response_enhance(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.schema.with_raw_response.enhance(
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = await response.parse()
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_enhance(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.schema.with_streaming_response.enhance(
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = await response.parse()
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_validate(self, async_client: AsyncMixedbread) -> None:
+ schema = await async_client.extractions.schema.validate(
+ json_schema={},
+ )
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_raw_response_validate(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.schema.with_raw_response.validate(
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = await response.parse()
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_validate(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.schema.with_streaming_response.validate(
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = await response.parse()
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 1ec0df5b..964950ba 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -9,6 +9,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
+from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
from mixedbread.types.parsing import ParsingJob
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -61,14 +62,14 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
@parametrize
def test_method_retrieve(self, client: Mixedbread) -> None:
job = client.parsing.jobs.retrieve(
- "job_id",
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(ParsingJob, job, path=["response"])
@parametrize
def test_raw_response_retrieve(self, client: Mixedbread) -> None:
response = client.parsing.jobs.with_raw_response.retrieve(
- "job_id",
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert response.is_closed is True
@@ -79,7 +80,7 @@ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
with client.parsing.jobs.with_streaming_response.retrieve(
- "job_id",
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -96,6 +97,77 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
"",
)
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ job = client.parsing.jobs.list()
+ assert_matches_type(SyncLimitOffset[ParsingJob], job, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
+ job = client.parsing.jobs.list(
+ limit=0,
+ offset=0,
+ )
+ assert_matches_type(SyncLimitOffset[ParsingJob], job, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Mixedbread) -> None:
+ response = client.parsing.jobs.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = response.parse()
+ assert_matches_type(SyncLimitOffset[ParsingJob], job, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Mixedbread) -> None:
+ with client.parsing.jobs.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = response.parse()
+ assert_matches_type(SyncLimitOffset[ParsingJob], job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_cancel(self, client: Mixedbread) -> None:
+ job = client.parsing.jobs.cancel(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ParsingJob, job, path=["response"])
+
+ @parametrize
+ def test_raw_response_cancel(self, client: Mixedbread) -> None:
+ response = client.parsing.jobs.with_raw_response.cancel(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = response.parse()
+ assert_matches_type(ParsingJob, job, path=["response"])
+
+ @parametrize
+ def test_streaming_response_cancel(self, client: Mixedbread) -> None:
+ with client.parsing.jobs.with_streaming_response.cancel(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = response.parse()
+ assert_matches_type(ParsingJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_cancel(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
+ client.parsing.jobs.with_raw_response.cancel(
+ "",
+ )
+
class TestAsyncJobs:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@@ -144,14 +216,14 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
@parametrize
async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.retrieve(
- "job_id",
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(ParsingJob, job, path=["response"])
@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
response = await async_client.parsing.jobs.with_raw_response.retrieve(
- "job_id",
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert response.is_closed is True
@@ -162,7 +234,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> Non
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
async with async_client.parsing.jobs.with_streaming_response.retrieve(
- "job_id",
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -178,3 +250,74 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
await async_client.parsing.jobs.with_raw_response.retrieve(
"",
)
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ job = await async_client.parsing.jobs.list()
+ assert_matches_type(AsyncLimitOffset[ParsingJob], job, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ job = await async_client.parsing.jobs.list(
+ limit=0,
+ offset=0,
+ )
+ assert_matches_type(AsyncLimitOffset[ParsingJob], job, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.parsing.jobs.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = await response.parse()
+ assert_matches_type(AsyncLimitOffset[ParsingJob], job, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.parsing.jobs.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = await response.parse()
+ assert_matches_type(AsyncLimitOffset[ParsingJob], job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_cancel(self, async_client: AsyncMixedbread) -> None:
+ job = await async_client.parsing.jobs.cancel(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ParsingJob, job, path=["response"])
+
+ @parametrize
+ async def test_raw_response_cancel(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.parsing.jobs.with_raw_response.cancel(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = await response.parse()
+ assert_matches_type(ParsingJob, job, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_cancel(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.parsing.jobs.with_streaming_response.cancel(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = await response.parse()
+ assert_matches_type(ParsingJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_cancel(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
+ await async_client.parsing.jobs.with_raw_response.cancel(
+ "",
+ )
diff --git a/tests/api_resources/test_completions.py b/tests/api_resources/test_completions.py
new file mode 100644
index 00000000..af7af678
--- /dev/null
+++ b/tests/api_resources/test_completions.py
@@ -0,0 +1,71 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestCompletions:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ completion = client.completions.create()
+ assert_matches_type(object, completion, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.completions.with_raw_response.create()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ completion = response.parse()
+ assert_matches_type(object, completion, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.completions.with_streaming_response.create() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ completion = response.parse()
+ assert_matches_type(object, completion, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncCompletions:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ completion = await async_client.completions.create()
+ assert_matches_type(object, completion, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.completions.with_raw_response.create()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ completion = await response.parse()
+ assert_matches_type(object, completion, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.completions.with_streaming_response.create() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ completion = await response.parse()
+ assert_matches_type(object, completion, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 9303bdc2..42856259 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -222,6 +222,92 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
"",
)
+ @parametrize
+ def test_method_question_answering(self, client: Mixedbread) -> None:
+ vector_store = client.vector_stores.question_answering(
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
+ assert_matches_type(object, vector_store, path=["response"])
+
+ @parametrize
+ def test_method_question_answering_with_all_params(self, client: Mixedbread) -> None:
+ vector_store = client.vector_stores.question_answering(
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ },
+ qa_options={"cite": True},
+ query="x",
+ search_options={
+ "return_chunks": True,
+ "return_metadata": True,
+ "rewrite_query": True,
+ "score_threshold": 0,
+ },
+ stream=True,
+ top_k=1,
+ )
+ assert_matches_type(object, vector_store, path=["response"])
+
+ @parametrize
+ def test_raw_response_question_answering(self, client: Mixedbread) -> None:
+ response = client.vector_stores.with_raw_response.question_answering(
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vector_store = response.parse()
+ assert_matches_type(object, vector_store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_question_answering(self, client: Mixedbread) -> None:
+ with client.vector_stores.with_streaming_response.question_answering(
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vector_store = response.parse()
+ assert_matches_type(object, vector_store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
@parametrize
def test_method_search(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.search(
@@ -235,6 +321,44 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.search(
query="how to configure SSL",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ },
search_options={
"return_chunks": True,
"return_metadata": True,
@@ -475,6 +599,92 @@ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
"",
)
+ @parametrize
+ async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
+ vector_store = await async_client.vector_stores.question_answering(
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
+ assert_matches_type(object, vector_store, path=["response"])
+
+ @parametrize
+ async def test_method_question_answering_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ vector_store = await async_client.vector_stores.question_answering(
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ },
+ qa_options={"cite": True},
+ query="x",
+ search_options={
+ "return_chunks": True,
+ "return_metadata": True,
+ "rewrite_query": True,
+ "score_threshold": 0,
+ },
+ stream=True,
+ top_k=1,
+ )
+ assert_matches_type(object, vector_store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_question_answering(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.vector_stores.with_raw_response.question_answering(
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vector_store = await response.parse()
+ assert_matches_type(object, vector_store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_question_answering(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.with_streaming_response.question_answering(
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vector_store = await response.parse()
+ assert_matches_type(object, vector_store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
@parametrize
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.search(
@@ -488,6 +698,44 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store = await async_client.vector_stores.search(
query="how to configure SSL",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ },
search_options={
"return_chunks": True,
"return_metadata": True,
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 60027b49..a4725cff 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -229,6 +229,44 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.search(
query="how to configure SSL",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ },
search_options={
"return_chunks": True,
"return_metadata": True,
@@ -476,6 +514,44 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.vector_stores.files.search(
query="how to configure SSL",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "operator": "eq",
+ "value": "100",
+ },
+ {
+ "key": "color",
+ "operator": "eq",
+ "value": "red",
+ },
+ ],
+ },
search_options={
"return_chunks": True,
"return_metadata": True,
From 126a27a643969b0d84ece44809692517f77349a6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 22 Jan 2025 06:54:42 +0000
Subject: [PATCH 006/375] chore(internal): codegen related update (#69)
---
pyproject.toml | 1 +
src/mixedbread/resources/completions.py | 4 +--
src/mixedbread/resources/embeddings.py | 4 +--
.../resources/extractions/content.py | 4 +--
.../resources/extractions/extractions.py | 4 +--
src/mixedbread/resources/extractions/jobs.py | 4 +--
.../resources/extractions/schema.py | 4 +--
src/mixedbread/resources/files.py | 4 +--
src/mixedbread/resources/parsing/jobs.py | 4 +--
src/mixedbread/resources/parsing/parsing.py | 4 +--
src/mixedbread/resources/reranking.py | 4 +--
.../resources/vector_stores/files.py | 4 +--
.../resources/vector_stores/vector_stores.py | 4 +--
tests/test_client.py | 25 +++++++++++++------
14 files changed, 43 insertions(+), 31 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index a8a45c6e..dbbd2fbf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -129,6 +129,7 @@ testpaths = ["tests"]
addopts = "--tb=short"
xfail_strict = true
asyncio_mode = "auto"
+asyncio_default_fixture_loop_scope = "session"
filterwarnings = [
"error"
]
diff --git a/src/mixedbread/resources/completions.py b/src/mixedbread/resources/completions.py
index 0446e5ae..52d605b6 100644
--- a/src/mixedbread/resources/completions.py
+++ b/src/mixedbread/resources/completions.py
@@ -22,7 +22,7 @@ class CompletionsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> CompletionsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -77,7 +77,7 @@ class AsyncCompletionsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncCompletionsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index 15f1e35f..1a6ecfe0 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -31,7 +31,7 @@ class EmbeddingsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> EmbeddingsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -120,7 +120,7 @@ class AsyncEmbeddingsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncEmbeddingsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
index 83b139ef..cacd55a6 100644
--- a/src/mixedbread/resources/extractions/content.py
+++ b/src/mixedbread/resources/extractions/content.py
@@ -28,7 +28,7 @@ class ContentResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> ContentResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -96,7 +96,7 @@ class AsyncContentResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncContentResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/extractions/extractions.py b/src/mixedbread/resources/extractions/extractions.py
index eb34814c..eebb3e40 100644
--- a/src/mixedbread/resources/extractions/extractions.py
+++ b/src/mixedbread/resources/extractions/extractions.py
@@ -48,7 +48,7 @@ def content(self) -> ContentResource:
@cached_property
def with_raw_response(self) -> ExtractionsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -81,7 +81,7 @@ def content(self) -> AsyncContentResource:
@cached_property
def with_raw_response(self) -> AsyncExtractionsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py
index 62a86477..3abc64f9 100644
--- a/src/mixedbread/resources/extractions/jobs.py
+++ b/src/mixedbread/resources/extractions/jobs.py
@@ -28,7 +28,7 @@ class JobsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> JobsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -135,7 +135,7 @@ class AsyncJobsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncJobsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py
index 501865f8..60ee00a5 100644
--- a/src/mixedbread/resources/extractions/schema.py
+++ b/src/mixedbread/resources/extractions/schema.py
@@ -30,7 +30,7 @@ class SchemaResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> SchemaResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -165,7 +165,7 @@ class AsyncSchemaResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncSchemaResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py
index 1eeb5722..49d4e39b 100644
--- a/src/mixedbread/resources/files.py
+++ b/src/mixedbread/resources/files.py
@@ -42,7 +42,7 @@ class FilesResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> FilesResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -327,7 +327,7 @@ class AsyncFilesResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncFilesResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index b9244f18..806c9df9 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -32,7 +32,7 @@ class JobsResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> JobsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -255,7 +255,7 @@ class AsyncJobsResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncJobsResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/parsing/parsing.py b/src/mixedbread/resources/parsing/parsing.py
index e6875462..069df23c 100644
--- a/src/mixedbread/resources/parsing/parsing.py
+++ b/src/mixedbread/resources/parsing/parsing.py
@@ -24,7 +24,7 @@ def jobs(self) -> JobsResource:
@cached_property
def with_raw_response(self) -> ParsingResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -49,7 +49,7 @@ def jobs(self) -> AsyncJobsResource:
@cached_property
def with_raw_response(self) -> AsyncParsingResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/reranking.py b/src/mixedbread/resources/reranking.py
index cead6c07..1c55f421 100644
--- a/src/mixedbread/resources/reranking.py
+++ b/src/mixedbread/resources/reranking.py
@@ -30,7 +30,7 @@ class RerankingResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> RerankingResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -114,7 +114,7 @@ class AsyncRerankingResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncRerankingResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index f475f18d..ca063858 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -34,7 +34,7 @@ class FilesResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> FilesResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -324,7 +324,7 @@ class AsyncFilesResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncFilesResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 4ef578b6..606e2b24 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -53,7 +53,7 @@ def files(self) -> FilesResource:
@cached_property
def with_raw_response(self) -> VectorStoresResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
@@ -462,7 +462,7 @@ def files(self) -> AsyncFilesResource:
@cached_property
def with_raw_response(self) -> AsyncVectorStoresResourceWithRawResponse:
"""
- This property can be used as a prefix for any HTTP method call to return the
+ This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.
For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
diff --git a/tests/test_client.py b/tests/test_client.py
index b8ca316a..e0f59191 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -6,6 +6,7 @@
import os
import sys
import json
+import time
import asyncio
import inspect
import subprocess
@@ -1651,10 +1652,20 @@ async def test_main() -> None:
[sys.executable, "-c", test_code],
text=True,
) as process:
- try:
- process.wait(2)
- if process.returncode:
- raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
- except subprocess.TimeoutExpired as e:
- process.kill()
- raise AssertionError("calling get_platform using asyncify resulted in a hung process") from e
+ timeout = 10 # seconds
+
+ start_time = time.monotonic()
+ while True:
+ return_code = process.poll()
+ if return_code is not None:
+ if return_code != 0:
+ raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
+
+ # success
+ break
+
+ if time.monotonic() - start_time > timeout:
+ process.kill()
+ raise AssertionError("calling get_platform using asyncify resulted in a hung process")
+
+ time.sleep(0.1)
From e84f4c9244ab68d80f751f8acd2f108ff6926ed0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 23 Jan 2025 04:32:37 +0000
Subject: [PATCH 007/375] chore(internal): codegen related update (#70)
---
src/mixedbread/_response.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_response.py b/src/mixedbread/_response.py
index 58b6c8ce..82f0f3ce 100644
--- a/src/mixedbread/_response.py
+++ b/src/mixedbread/_response.py
@@ -136,6 +136,8 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
if cast_to and is_annotated_type(cast_to):
cast_to = extract_type_arg(cast_to, 0)
+ origin = get_origin(cast_to) or cast_to
+
if self._is_sse_stream:
if to:
if not is_stream_class_type(to):
@@ -195,8 +197,6 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
if cast_to == bool:
return cast(R, response.text.lower() == "true")
- origin = get_origin(cast_to) or cast_to
-
if origin == APIResponse:
raise RuntimeError("Unexpected state - cast_to is `APIResponse`")
From fb359fbae96635d2cc553037f894484a95064f5e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 24 Jan 2025 05:13:20 +0000
Subject: [PATCH 008/375] chore(internal): minor formatting changes (#71)
---
.github/workflows/ci.yml | 3 +--
scripts/bootstrap | 2 +-
scripts/lint | 1 -
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 40293964..c8a8a4f7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -12,7 +12,6 @@ jobs:
lint:
name: lint
runs-on: ubuntu-latest
-
steps:
- uses: actions/checkout@v4
@@ -30,6 +29,7 @@ jobs:
- name: Run lints
run: ./scripts/lint
+
test:
name: test
runs-on: ubuntu-latest
@@ -50,4 +50,3 @@ jobs:
- name: Run tests
run: ./scripts/test
-
diff --git a/scripts/bootstrap b/scripts/bootstrap
index 8c5c60eb..e84fe62c 100755
--- a/scripts/bootstrap
+++ b/scripts/bootstrap
@@ -4,7 +4,7 @@ set -e
cd "$(dirname "$0")/.."
-if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
+if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
diff --git a/scripts/lint b/scripts/lint
index 75fa7747..58dce445 100755
--- a/scripts/lint
+++ b/scripts/lint
@@ -9,4 +9,3 @@ rye run lint
echo "==> Making sure it imports"
rye run python -c 'import mixedbread'
-
From 977fb87dc28f3381e3ab047d3cc659abaafb146c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 27 Jan 2025 10:35:16 +0000
Subject: [PATCH 009/375] feat(api): update via SDK Studio (#72)
---
.stats.yml | 2 +-
api.md | 6 +--
src/mixedbread/resources/parsing/jobs.py | 38 ++++++++++---------
src/mixedbread/types/expires_after.py | 2 +-
src/mixedbread/types/expires_after_param.py | 2 +-
src/mixedbread/types/file_counts.py | 8 ++--
src/mixedbread/types/parsing/__init__.py | 2 +
.../types/parsing/job_cancel_response.py | 19 ++++++++++
.../types/parsing/job_list_response.py | 32 ++++++++++++++++
src/mixedbread/types/parsing/parsing_job.py | 4 +-
src/mixedbread/types/vector_store.py | 3 ++
.../vector_stores/scored_vector_store_file.py | 33 ++++++++--------
.../types/vector_stores/vector_store_file.py | 8 ----
tests/api_resources/parsing/test_jobs.py | 30 +++++++--------
tests/api_resources/test_vector_stores.py | 8 ++--
15 files changed, 125 insertions(+), 72 deletions(-)
create mode 100644 src/mixedbread/types/parsing/job_cancel_response.py
create mode 100644 src/mixedbread/types/parsing/job_list_response.py
diff --git a/.stats.yml b/.stats.yml
index 25121c1f..1777b3df 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 32
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-973fae5ec9e58a3ce2621748fda3601cb95ea7ee7c44fc8514eb6ea9f0861bbe.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-43906e7132098c54e8b761fa3bd67fbd9174894faeb22367a681e92f60f6445f.yml
diff --git a/api.md b/api.md
index 96450b8d..99f8593d 100644
--- a/api.md
+++ b/api.md
@@ -47,15 +47,15 @@ Methods:
Types:
```python
-from mixedbread.types.parsing import ParsingJob
+from mixedbread.types.parsing import ParsingJob, JobListResponse, JobCancelResponse
```
Methods:
- client.parsing.jobs.create(\*\*params) -> ParsingJob
- client.parsing.jobs.retrieve(job_id) -> ParsingJob
-- client.parsing.jobs.list(\*\*params) -> SyncLimitOffset[ParsingJob]
-- client.parsing.jobs.cancel(job_id) -> ParsingJob
+- client.parsing.jobs.list(\*\*params) -> SyncLimitOffset[JobListResponse]
+- client.parsing.jobs.cancel(job_id) -> JobCancelResponse
# Files
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 806c9df9..2d41c14b 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -24,6 +24,8 @@
from ..._base_client import AsyncPaginator, make_request_options
from ...types.parsing import job_list_params, job_create_params
from ...types.parsing.parsing_job import ParsingJob
+from ...types.parsing.job_list_response import JobListResponse
+from ...types.parsing.job_cancel_response import JobCancelResponse
__all__ = ["JobsResource", "AsyncJobsResource"]
@@ -170,7 +172,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[ParsingJob]:
+ ) -> SyncLimitOffset[JobListResponse]:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -194,7 +196,7 @@ def list(
"""
return self._get_api_list(
"/v1/parsing/jobs",
- page=SyncLimitOffset[ParsingJob],
+ page=SyncLimitOffset[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -208,7 +210,7 @@ def list(
job_list_params.JobListParams,
),
),
- model=ParsingJob,
+ model=JobListResponse,
)
def cancel(
@@ -221,16 +223,16 @@ def cancel(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ParsingJob:
+ ) -> JobCancelResponse:
"""
- Cancel a specific parse job.
+ Delete a specific parse job.
- Args: job_id: The ID of the parse job to cancel.
+ Args: job_id: The ID of the parse job to delete.
- Returns: The cancelled parsing job.
+ Returns: The deleted parsing job.
Args:
- job_id: The ID of the parse job to cancel
+ job_id: The ID of the parse job to delete
extra_headers: Send extra headers
@@ -247,7 +249,7 @@ def cancel(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ParsingJob,
+ cast_to=JobCancelResponse,
)
@@ -393,7 +395,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[ParsingJob, AsyncLimitOffset[ParsingJob]]:
+ ) -> AsyncPaginator[JobListResponse, AsyncLimitOffset[JobListResponse]]:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -417,7 +419,7 @@ def list(
"""
return self._get_api_list(
"/v1/parsing/jobs",
- page=AsyncLimitOffset[ParsingJob],
+ page=AsyncLimitOffset[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -431,7 +433,7 @@ def list(
job_list_params.JobListParams,
),
),
- model=ParsingJob,
+ model=JobListResponse,
)
async def cancel(
@@ -444,16 +446,16 @@ async def cancel(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ParsingJob:
+ ) -> JobCancelResponse:
"""
- Cancel a specific parse job.
+ Delete a specific parse job.
- Args: job_id: The ID of the parse job to cancel.
+ Args: job_id: The ID of the parse job to delete.
- Returns: The cancelled parsing job.
+ Returns: The deleted parsing job.
Args:
- job_id: The ID of the parse job to cancel
+ job_id: The ID of the parse job to delete
extra_headers: Send extra headers
@@ -470,7 +472,7 @@ async def cancel(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ParsingJob,
+ cast_to=JobCancelResponse,
)
diff --git a/src/mixedbread/types/expires_after.py b/src/mixedbread/types/expires_after.py
index 5401efb9..8550ad0a 100644
--- a/src/mixedbread/types/expires_after.py
+++ b/src/mixedbread/types/expires_after.py
@@ -9,7 +9,7 @@
class ExpiresAfter(BaseModel):
- anchor: Optional[Literal["last_used_at"]] = None
+ anchor: Optional[Literal["last_active_at"]] = None
"""Anchor date for the expiration policy"""
days: Optional[int] = None
diff --git a/src/mixedbread/types/expires_after_param.py b/src/mixedbread/types/expires_after_param.py
index 6ea61fe9..e7b4bee0 100644
--- a/src/mixedbread/types/expires_after_param.py
+++ b/src/mixedbread/types/expires_after_param.py
@@ -8,7 +8,7 @@
class ExpiresAfterParam(TypedDict, total=False):
- anchor: Literal["last_used_at"]
+ anchor: Literal["last_active_at"]
"""Anchor date for the expiration policy"""
days: int
diff --git a/src/mixedbread/types/file_counts.py b/src/mixedbread/types/file_counts.py
index 8166d0bb..baad15f5 100644
--- a/src/mixedbread/types/file_counts.py
+++ b/src/mixedbread/types/file_counts.py
@@ -8,17 +8,17 @@
class FileCounts(BaseModel):
- canceled: Optional[int] = None
+ cancelled: Optional[int] = None
"""Number of files whose processing was canceled"""
+ completed: Optional[int] = None
+ """Number of successfully processed files"""
+
failed: Optional[int] = None
"""Number of files that failed processing"""
in_progress: Optional[int] = None
"""Number of files currently being processed"""
- successful: Optional[int] = None
- """Number of successfully processed files"""
-
total: Optional[int] = None
"""Total number of files"""
diff --git a/src/mixedbread/types/parsing/__init__.py b/src/mixedbread/types/parsing/__init__.py
index f399fb3e..38bfcb66 100644
--- a/src/mixedbread/types/parsing/__init__.py
+++ b/src/mixedbread/types/parsing/__init__.py
@@ -5,3 +5,5 @@
from .parsing_job import ParsingJob as ParsingJob
from .job_list_params import JobListParams as JobListParams
from .job_create_params import JobCreateParams as JobCreateParams
+from .job_list_response import JobListResponse as JobListResponse
+from .job_cancel_response import JobCancelResponse as JobCancelResponse
diff --git a/src/mixedbread/types/parsing/job_cancel_response.py b/src/mixedbread/types/parsing/job_cancel_response.py
new file mode 100644
index 00000000..56782f09
--- /dev/null
+++ b/src/mixedbread/types/parsing/job_cancel_response.py
@@ -0,0 +1,19 @@
+# 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__ = ["JobCancelResponse"]
+
+
+class JobCancelResponse(BaseModel):
+ id: str
+ """The ID of the deleted job"""
+
+ deleted: Optional[bool] = None
+ """Whether the job was deleted"""
+
+ object: Optional[Literal["parsing_job"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
new file mode 100644
index 00000000..3f16c84b
--- /dev/null
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -0,0 +1,32 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["JobListResponse"]
+
+
+class JobListResponse(BaseModel):
+ id: str
+ """The ID of the job"""
+
+ status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
+ """The status of the job"""
+
+ created_at: Optional[datetime] = None
+ """The creation time of the job"""
+
+ finished_at: Optional[datetime] = None
+ """The finished time of the job"""
+
+ object: Optional[Literal["parsing_job"]] = None
+ """The type of the object"""
+
+ started_at: Optional[datetime] = None
+ """The started time of the job"""
+
+ updated_at: Optional[datetime] = None
+ """The updated time of the job"""
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index ef52023e..69a6beee 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -84,13 +84,13 @@ class ParsingJob(BaseModel):
id: str
"""The ID of the job"""
- status: Literal["PENDING", "RUNNING", "CANCELLED", "FAILED", "SUCCESSFUL"]
+ status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
"""The status of the job"""
created_at: Optional[datetime] = None
"""The creation time of the job"""
- error: Optional[str] = None
+ error: Optional[object] = None
"""The error of the job"""
finished_at: Optional[datetime] = None
diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py
index e6e381ac..870e7e7d 100644
--- a/src/mixedbread/types/vector_store.py
+++ b/src/mixedbread/types/vector_store.py
@@ -44,3 +44,6 @@ class VectorStore(BaseModel):
object: Optional[Literal["vector_store"]] = None
"""Type of the object"""
+
+ status: Optional[Literal["expired", "in_progress", "completed"]] = None
+ """Processing status of the vector store"""
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 7b3d09c9..02df064c 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -12,7 +12,10 @@
class ScoredVectorStoreFile(BaseModel):
id: str
- """file id"""
+ """Unique identifier for the file"""
+
+ chunks: List[ScoredVectorStoreChunk]
+ """chunks"""
created_at: datetime
"""Timestamp of vector store file creation"""
@@ -20,23 +23,23 @@ class ScoredVectorStoreFile(BaseModel):
score: float
"""score of the file"""
- usage_bytes: int
- """usage in bytes"""
-
vector_store_id: str
- """vector store id"""
-
- version: int
- """version of the file"""
-
- chunks: Optional[List[ScoredVectorStoreChunk]] = None
- """chunks"""
+ """ID of the containing vector store"""
last_error: Optional[object] = None
- """last error"""
+ """Last error message if processing failed"""
metadata: Optional[object] = None
- """metadata"""
+ """Optional file metadata"""
+
+ object: Optional[Literal["vector_store.file"]] = None
+ """Type of the object"""
+
+ status: Optional[str] = None
+ """Processing status of the file"""
+
+ usage_bytes: Optional[int] = None
+ """Storage usage in bytes"""
- status: Optional[Literal["in_progress", "completed", "failed", "cancelled"]] = None
- """status of the file"""
+ version: Optional[int] = None
+ """Version number of the file"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index a0389c4d..d926ce73 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -5,7 +5,6 @@
from typing_extensions import Literal
from ..._models import BaseModel
-from ..file_object import FileObject
__all__ = ["VectorStoreFile"]
@@ -20,13 +19,6 @@ class VectorStoreFile(BaseModel):
vector_store_id: str
"""ID of the containing vector store"""
- file_object: Optional[FileObject] = None
- """A model representing a file object in the system.
-
- This model contains metadata about files stored in the system, including
- identifiers, size information, and timestamps.
- """
-
last_error: Optional[object] = None
"""Last error message if processing failed"""
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 964950ba..811a4650 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -10,7 +10,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
-from mixedbread.types.parsing import ParsingJob
+from mixedbread.types.parsing import ParsingJob, JobListResponse, JobCancelResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list()
- assert_matches_type(SyncLimitOffset[ParsingJob], job, path=["response"])
+ assert_matches_type(SyncLimitOffset[JobListResponse], job, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -108,7 +108,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
limit=0,
offset=0,
)
- assert_matches_type(SyncLimitOffset[ParsingJob], job, path=["response"])
+ assert_matches_type(SyncLimitOffset[JobListResponse], job, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -117,7 +117,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(SyncLimitOffset[ParsingJob], job, path=["response"])
+ assert_matches_type(SyncLimitOffset[JobListResponse], job, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -126,7 +126,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(SyncLimitOffset[ParsingJob], job, path=["response"])
+ assert_matches_type(SyncLimitOffset[JobListResponse], job, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -135,7 +135,7 @@ def test_method_cancel(self, client: Mixedbread) -> None:
job = client.parsing.jobs.cancel(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ParsingJob, job, path=["response"])
+ assert_matches_type(JobCancelResponse, job, path=["response"])
@parametrize
def test_raw_response_cancel(self, client: Mixedbread) -> None:
@@ -146,7 +146,7 @@ def test_raw_response_cancel(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(ParsingJob, job, path=["response"])
+ assert_matches_type(JobCancelResponse, job, path=["response"])
@parametrize
def test_streaming_response_cancel(self, client: Mixedbread) -> None:
@@ -157,7 +157,7 @@ def test_streaming_response_cancel(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(ParsingJob, job, path=["response"])
+ assert_matches_type(JobCancelResponse, job, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -254,7 +254,7 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list()
- assert_matches_type(AsyncLimitOffset[ParsingJob], job, path=["response"])
+ assert_matches_type(AsyncLimitOffset[JobListResponse], job, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -262,7 +262,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
limit=0,
offset=0,
)
- assert_matches_type(AsyncLimitOffset[ParsingJob], job, path=["response"])
+ assert_matches_type(AsyncLimitOffset[JobListResponse], job, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -271,7 +271,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(AsyncLimitOffset[ParsingJob], job, path=["response"])
+ assert_matches_type(AsyncLimitOffset[JobListResponse], job, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -280,7 +280,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(AsyncLimitOffset[ParsingJob], job, path=["response"])
+ assert_matches_type(AsyncLimitOffset[JobListResponse], job, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -289,7 +289,7 @@ async def test_method_cancel(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.cancel(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ParsingJob, job, path=["response"])
+ assert_matches_type(JobCancelResponse, job, path=["response"])
@parametrize
async def test_raw_response_cancel(self, async_client: AsyncMixedbread) -> None:
@@ -300,7 +300,7 @@ async def test_raw_response_cancel(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(ParsingJob, job, path=["response"])
+ assert_matches_type(JobCancelResponse, job, path=["response"])
@parametrize
async def test_streaming_response_cancel(self, async_client: AsyncMixedbread) -> None:
@@ -311,7 +311,7 @@ async def test_streaming_response_cancel(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(ParsingJob, job, path=["response"])
+ assert_matches_type(JobCancelResponse, job, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 42856259..ef7104b8 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -32,7 +32,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.create(
description="Contains technical specifications and guides",
expires_after={
- "anchor": "last_used_at",
+ "anchor": "last_active_at",
"days": 0,
},
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
@@ -112,7 +112,7 @@ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
description="x",
expires_after={
- "anchor": "last_used_at",
+ "anchor": "last_active_at",
"days": 0,
},
metadata={},
@@ -409,7 +409,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
vector_store = await async_client.vector_stores.create(
description="Contains technical specifications and guides",
expires_after={
- "anchor": "last_used_at",
+ "anchor": "last_active_at",
"days": 0,
},
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
@@ -489,7 +489,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
description="x",
expires_after={
- "anchor": "last_used_at",
+ "anchor": "last_active_at",
"days": 0,
},
metadata={},
From 21c074375f875aa614ecfb4bde6a148ac3ca2cc2 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 27 Jan 2025 10:42:14 +0000
Subject: [PATCH 010/375] chore(internal): version bump (#73)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index fd0ccba9..000572ec 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.12"
+ ".": "0.1.0-alpha.13"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index dbbd2fbf..18c2c952 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.12"
+version = "0.1.0-alpha.13"
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 052bfe42..c8635dfa 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.1.0-alpha.12" # x-release-please-version
+__version__ = "0.1.0-alpha.13" # x-release-please-version
From 53d070838013a0722dbfd00b6cddc5230e0475e0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 27 Jan 2025 13:03:12 +0000
Subject: [PATCH 011/375] feat(api): update via SDK Studio (#74)
---
.stats.yml | 2 +-
api.md | 5 +-
src/mixedbread/resources/parsing/jobs.py | 104 ++++++++++++++++--
src/mixedbread/types/parsing/__init__.py | 2 +-
...cel_response.py => job_delete_response.py} | 4 +-
tests/api_resources/parsing/test_jobs.py | 90 +++++++++++++--
6 files changed, 187 insertions(+), 20 deletions(-)
rename src/mixedbread/types/parsing/{job_cancel_response.py => job_delete_response.py} (85%)
diff --git a/.stats.yml b/.stats.yml
index 1777b3df..2ace8ae2 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 32
+configured_endpoints: 33
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-43906e7132098c54e8b761fa3bd67fbd9174894faeb22367a681e92f60f6445f.yml
diff --git a/api.md b/api.md
index 99f8593d..c5994fc6 100644
--- a/api.md
+++ b/api.md
@@ -47,7 +47,7 @@ Methods:
Types:
```python
-from mixedbread.types.parsing import ParsingJob, JobListResponse, JobCancelResponse
+from mixedbread.types.parsing import ParsingJob, JobListResponse, JobDeleteResponse
```
Methods:
@@ -55,7 +55,8 @@ Methods:
- client.parsing.jobs.create(\*\*params) -> ParsingJob
- client.parsing.jobs.retrieve(job_id) -> ParsingJob
- client.parsing.jobs.list(\*\*params) -> SyncLimitOffset[JobListResponse]
-- client.parsing.jobs.cancel(job_id) -> JobCancelResponse
+- client.parsing.jobs.delete(job_id) -> JobDeleteResponse
+- client.parsing.jobs.cancel(job_id) -> ParsingJob
# Files
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 2d41c14b..f2697023 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -25,7 +25,7 @@
from ...types.parsing import job_list_params, job_create_params
from ...types.parsing.parsing_job import ParsingJob
from ...types.parsing.job_list_response import JobListResponse
-from ...types.parsing.job_cancel_response import JobCancelResponse
+from ...types.parsing.job_delete_response import JobDeleteResponse
__all__ = ["JobsResource", "AsyncJobsResource"]
@@ -213,7 +213,7 @@ def list(
model=JobListResponse,
)
- def cancel(
+ def delete(
self,
job_id: str,
*,
@@ -223,7 +223,7 @@ def cancel(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> JobCancelResponse:
+ ) -> JobDeleteResponse:
"""
Delete a specific parse job.
@@ -249,7 +249,46 @@ def cancel(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=JobCancelResponse,
+ cast_to=JobDeleteResponse,
+ )
+
+ def cancel(
+ self,
+ job_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ParsingJob:
+ """
+ Cancel a specific parse job.
+
+ Args: job_id: The ID of the parse job to cancel.
+
+ Returns: The cancelled parsing job.
+
+ Args:
+ job_id: The ID of the parse job to cancel
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return self._patch(
+ f"/v1/parsing/jobs/{job_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ParsingJob,
)
@@ -436,7 +475,7 @@ def list(
model=JobListResponse,
)
- async def cancel(
+ async def delete(
self,
job_id: str,
*,
@@ -446,7 +485,7 @@ async def cancel(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> JobCancelResponse:
+ ) -> JobDeleteResponse:
"""
Delete a specific parse job.
@@ -472,7 +511,46 @@ async def cancel(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=JobCancelResponse,
+ cast_to=JobDeleteResponse,
+ )
+
+ async def cancel(
+ self,
+ job_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ParsingJob:
+ """
+ Cancel a specific parse job.
+
+ Args: job_id: The ID of the parse job to cancel.
+
+ Returns: The cancelled parsing job.
+
+ Args:
+ job_id: The ID of the parse job to cancel
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return await self._patch(
+ f"/v1/parsing/jobs/{job_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ParsingJob,
)
@@ -489,6 +567,9 @@ def __init__(self, jobs: JobsResource) -> None:
self.list = to_raw_response_wrapper(
jobs.list,
)
+ self.delete = to_raw_response_wrapper(
+ jobs.delete,
+ )
self.cancel = to_raw_response_wrapper(
jobs.cancel,
)
@@ -507,6 +588,9 @@ def __init__(self, jobs: AsyncJobsResource) -> None:
self.list = async_to_raw_response_wrapper(
jobs.list,
)
+ self.delete = async_to_raw_response_wrapper(
+ jobs.delete,
+ )
self.cancel = async_to_raw_response_wrapper(
jobs.cancel,
)
@@ -525,6 +609,9 @@ def __init__(self, jobs: JobsResource) -> None:
self.list = to_streamed_response_wrapper(
jobs.list,
)
+ self.delete = to_streamed_response_wrapper(
+ jobs.delete,
+ )
self.cancel = to_streamed_response_wrapper(
jobs.cancel,
)
@@ -543,6 +630,9 @@ def __init__(self, jobs: AsyncJobsResource) -> None:
self.list = async_to_streamed_response_wrapper(
jobs.list,
)
+ self.delete = async_to_streamed_response_wrapper(
+ jobs.delete,
+ )
self.cancel = async_to_streamed_response_wrapper(
jobs.cancel,
)
diff --git a/src/mixedbread/types/parsing/__init__.py b/src/mixedbread/types/parsing/__init__.py
index 38bfcb66..da250167 100644
--- a/src/mixedbread/types/parsing/__init__.py
+++ b/src/mixedbread/types/parsing/__init__.py
@@ -6,4 +6,4 @@
from .job_list_params import JobListParams as JobListParams
from .job_create_params import JobCreateParams as JobCreateParams
from .job_list_response import JobListResponse as JobListResponse
-from .job_cancel_response import JobCancelResponse as JobCancelResponse
+from .job_delete_response import JobDeleteResponse as JobDeleteResponse
diff --git a/src/mixedbread/types/parsing/job_cancel_response.py b/src/mixedbread/types/parsing/job_delete_response.py
similarity index 85%
rename from src/mixedbread/types/parsing/job_cancel_response.py
rename to src/mixedbread/types/parsing/job_delete_response.py
index 56782f09..a6fcab70 100644
--- a/src/mixedbread/types/parsing/job_cancel_response.py
+++ b/src/mixedbread/types/parsing/job_delete_response.py
@@ -5,10 +5,10 @@
from ..._models import BaseModel
-__all__ = ["JobCancelResponse"]
+__all__ = ["JobDeleteResponse"]
-class JobCancelResponse(BaseModel):
+class JobDeleteResponse(BaseModel):
id: str
"""The ID of the deleted job"""
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 811a4650..03ca1f84 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -10,7 +10,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
-from mixedbread.types.parsing import ParsingJob, JobListResponse, JobCancelResponse
+from mixedbread.types.parsing import ParsingJob, JobListResponse, JobDeleteResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -130,12 +130,50 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert cast(Any, response.is_closed) is True
+ @parametrize
+ def test_method_delete(self, client: Mixedbread) -> None:
+ job = client.parsing.jobs.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(JobDeleteResponse, job, path=["response"])
+
+ @parametrize
+ def test_raw_response_delete(self, client: Mixedbread) -> None:
+ response = client.parsing.jobs.with_raw_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = response.parse()
+ assert_matches_type(JobDeleteResponse, job, path=["response"])
+
+ @parametrize
+ def test_streaming_response_delete(self, client: Mixedbread) -> None:
+ with client.parsing.jobs.with_streaming_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = response.parse()
+ assert_matches_type(JobDeleteResponse, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_delete(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
+ client.parsing.jobs.with_raw_response.delete(
+ "",
+ )
+
@parametrize
def test_method_cancel(self, client: Mixedbread) -> None:
job = client.parsing.jobs.cancel(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(JobCancelResponse, job, path=["response"])
+ assert_matches_type(ParsingJob, job, path=["response"])
@parametrize
def test_raw_response_cancel(self, client: Mixedbread) -> None:
@@ -146,7 +184,7 @@ def test_raw_response_cancel(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(JobCancelResponse, job, path=["response"])
+ assert_matches_type(ParsingJob, job, path=["response"])
@parametrize
def test_streaming_response_cancel(self, client: Mixedbread) -> None:
@@ -157,7 +195,7 @@ def test_streaming_response_cancel(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(JobCancelResponse, job, path=["response"])
+ assert_matches_type(ParsingJob, job, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -284,12 +322,50 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert cast(Any, response.is_closed) is True
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
+ job = await async_client.parsing.jobs.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(JobDeleteResponse, job, path=["response"])
+
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.parsing.jobs.with_raw_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = await response.parse()
+ assert_matches_type(JobDeleteResponse, job, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.parsing.jobs.with_streaming_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = await response.parse()
+ assert_matches_type(JobDeleteResponse, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
+ await async_client.parsing.jobs.with_raw_response.delete(
+ "",
+ )
+
@parametrize
async def test_method_cancel(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.cancel(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(JobCancelResponse, job, path=["response"])
+ assert_matches_type(ParsingJob, job, path=["response"])
@parametrize
async def test_raw_response_cancel(self, async_client: AsyncMixedbread) -> None:
@@ -300,7 +376,7 @@ async def test_raw_response_cancel(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(JobCancelResponse, job, path=["response"])
+ assert_matches_type(ParsingJob, job, path=["response"])
@parametrize
async def test_streaming_response_cancel(self, async_client: AsyncMixedbread) -> None:
@@ -311,7 +387,7 @@ async def test_streaming_response_cancel(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(JobCancelResponse, job, path=["response"])
+ assert_matches_type(ParsingJob, job, path=["response"])
assert cast(Any, response.is_closed) is True
From b9217a446cff22e178223e1d8185067cfa2bee5c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 27 Jan 2025 13:41:00 +0000
Subject: [PATCH 012/375] chore(internal): version bump (#76)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 000572ec..b0699969 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.13"
+ ".": "0.1.0-alpha.14"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 18c2c952..7e826cff 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.13"
+version = "0.1.0-alpha.14"
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 c8635dfa..b7f02dac 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.1.0-alpha.13" # x-release-please-version
+__version__ = "0.1.0-alpha.14" # x-release-please-version
From 08c4eb7d0e9154c3379abc3c7de0909e6b5bb354 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 28 Jan 2025 06:01:46 +0000
Subject: [PATCH 013/375] chore(internal): codegen related update (#78)
---
tests/api_resources/parsing/test_jobs.py | 4 ++--
tests/api_resources/test_files.py | 4 ++--
tests/api_resources/test_vector_stores.py | 4 ++--
tests/api_resources/vector_stores/test_files.py | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 03ca1f84..33a8b99c 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -105,7 +105,7 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list(
- limit=0,
+ limit=1000,
offset=0,
)
assert_matches_type(SyncLimitOffset[JobListResponse], job, path=["response"])
@@ -297,7 +297,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list(
- limit=0,
+ limit=1000,
offset=0,
)
assert_matches_type(AsyncLimitOffset[JobListResponse], job, path=["response"])
diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py
index 459804aa..3df12533 100644
--- a/tests/api_resources/test_files.py
+++ b/tests/api_resources/test_files.py
@@ -145,7 +145,7 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.files.list(
- limit=0,
+ limit=1000,
offset=0,
)
assert_matches_type(SyncLimitOffset[FileObject], file, path=["response"])
@@ -387,7 +387,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list(
- limit=0,
+ limit=1000,
offset=0,
)
assert_matches_type(AsyncLimitOffset[FileObject], file, path=["response"])
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index ef7104b8..2362af46 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -159,7 +159,7 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list(
- limit=0,
+ limit=1000,
offset=0,
)
assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
@@ -536,7 +536,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list(
- limit=0,
+ limit=1000,
offset=0,
)
assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index a4725cff..fd783df7 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -132,7 +132,7 @@ def test_method_list(self, client: Mixedbread) -> None:
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=0,
+ limit=1000,
offset=0,
)
assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
@@ -417,7 +417,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=0,
+ limit=1000,
offset=0,
)
assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
From e0f13db8a09e03906d654722f3ef9c4a0e007890 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 28 Jan 2025 10:59:17 +0000
Subject: [PATCH 014/375] feat(api): update via SDK Studio (#79)
---
.stats.yml | 2 +-
api.md | 77 ----
src/mixedbread/_client.py | 35 +-
src/mixedbread/resources/__init__.py | 56 ---
src/mixedbread/resources/completions.py | 164 --------
src/mixedbread/resources/embeddings.py | 241 ------------
.../resources/extractions/__init__.py | 61 ---
.../resources/extractions/content.py | 196 ----------
.../resources/extractions/extractions.py | 166 --------
src/mixedbread/resources/extractions/jobs.py | 286 --------------
.../resources/extractions/schema.py | 356 ------------------
src/mixedbread/resources/reranking.py | 230 -----------
src/mixedbread/types/__init__.py | 5 -
src/mixedbread/types/embedding.py | 19 -
.../types/embedding_create_params.py | 55 ---
.../types/embedding_create_response.py | 88 -----
src/mixedbread/types/extractions/__init__.py | 14 -
.../extractions/content_create_params.py | 15 -
.../types/extractions/created_json_schema.py | 11 -
.../types/extractions/enhanced_json_schema.py | 11 -
.../types/extractions/extraction_job.py | 13 -
.../types/extractions/extraction_result.py | 11 -
.../types/extractions/job_create_params.py | 15 -
.../types/extractions/schema_create_params.py | 12 -
.../extractions/schema_enhance_params.py | 12 -
.../extractions/schema_validate_params.py | 12 -
.../extractions/validated_json_schema.py | 18 -
.../types/reranking_create_params.py | 28 --
.../types/reranking_create_response.py | 78 ----
tests/api_resources/extractions/__init__.py | 1 -
.../api_resources/extractions/test_content.py | 90 -----
tests/api_resources/extractions/test_jobs.py | 166 --------
.../api_resources/extractions/test_schema.py | 212 -----------
tests/api_resources/test_completions.py | 71 ----
tests/api_resources/test_embeddings.py | 114 ------
tests/api_resources/test_reranking.py | 114 ------
36 files changed, 2 insertions(+), 3053 deletions(-)
delete mode 100644 src/mixedbread/resources/completions.py
delete mode 100644 src/mixedbread/resources/embeddings.py
delete mode 100644 src/mixedbread/resources/extractions/__init__.py
delete mode 100644 src/mixedbread/resources/extractions/content.py
delete mode 100644 src/mixedbread/resources/extractions/extractions.py
delete mode 100644 src/mixedbread/resources/extractions/jobs.py
delete mode 100644 src/mixedbread/resources/extractions/schema.py
delete mode 100644 src/mixedbread/resources/reranking.py
delete mode 100644 src/mixedbread/types/embedding.py
delete mode 100644 src/mixedbread/types/embedding_create_params.py
delete mode 100644 src/mixedbread/types/embedding_create_response.py
delete mode 100644 src/mixedbread/types/extractions/__init__.py
delete mode 100644 src/mixedbread/types/extractions/content_create_params.py
delete mode 100644 src/mixedbread/types/extractions/created_json_schema.py
delete mode 100644 src/mixedbread/types/extractions/enhanced_json_schema.py
delete mode 100644 src/mixedbread/types/extractions/extraction_job.py
delete mode 100644 src/mixedbread/types/extractions/extraction_result.py
delete mode 100644 src/mixedbread/types/extractions/job_create_params.py
delete mode 100644 src/mixedbread/types/extractions/schema_create_params.py
delete mode 100644 src/mixedbread/types/extractions/schema_enhance_params.py
delete mode 100644 src/mixedbread/types/extractions/schema_validate_params.py
delete mode 100644 src/mixedbread/types/extractions/validated_json_schema.py
delete mode 100644 src/mixedbread/types/reranking_create_params.py
delete mode 100644 src/mixedbread/types/reranking_create_response.py
delete mode 100644 tests/api_resources/extractions/__init__.py
delete mode 100644 tests/api_resources/extractions/test_content.py
delete mode 100644 tests/api_resources/extractions/test_jobs.py
delete mode 100644 tests/api_resources/extractions/test_schema.py
delete mode 100644 tests/api_resources/test_completions.py
delete mode 100644 tests/api_resources/test_embeddings.py
delete mode 100644 tests/api_resources/test_reranking.py
diff --git a/.stats.yml b/.stats.yml
index 2ace8ae2..89832423 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 33
+configured_endpoints: 24
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-43906e7132098c54e8b761fa3bd67fbd9174894faeb22367a681e92f60f6445f.yml
diff --git a/api.md b/api.md
index c5994fc6..c19bfce7 100644
--- a/api.md
+++ b/api.md
@@ -16,30 +16,6 @@ Methods:
- client.info() -> InfoResponse
-# Embeddings
-
-Types:
-
-```python
-from mixedbread.types import Embedding, EmbeddingCreateResponse
-```
-
-Methods:
-
-- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
-
-# Reranking
-
-Types:
-
-```python
-from mixedbread.types import RerankingCreateResponse
-```
-
-Methods:
-
-- client.reranking.create(\*\*params) -> RerankingCreateResponse
-
# Parsing
## Jobs
@@ -122,56 +98,3 @@ Methods:
- client.vector_stores.files.list(vector_store_id, \*\*params) -> SyncLimitOffset[VectorStoreFile]
- client.vector_stores.files.delete(file_id, \*, vector_store_id) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
-
-# Completions
-
-Types:
-
-```python
-from mixedbread.types import CompletionCreateResponse
-```
-
-Methods:
-
-- client.completions.create() -> object
-
-# Extractions
-
-## Jobs
-
-Types:
-
-```python
-from mixedbread.types.extractions import ExtractionJob
-```
-
-Methods:
-
-- client.extractions.jobs.create(\*\*params) -> ExtractionJob
-- client.extractions.jobs.retrieve(job_id) -> ExtractionJob
-
-## Schema
-
-Types:
-
-```python
-from mixedbread.types.extractions import CreatedJsonSchema, EnhancedJsonSchema, ValidatedJsonSchema
-```
-
-Methods:
-
-- client.extractions.schema.create(\*\*params) -> CreatedJsonSchema
-- client.extractions.schema.enhance(\*\*params) -> EnhancedJsonSchema
-- client.extractions.schema.validate(\*\*params) -> ValidatedJsonSchema
-
-## Content
-
-Types:
-
-```python
-from mixedbread.types.extractions import ExtractionResult
-```
-
-Methods:
-
-- client.extractions.content.create(\*\*params) -> ExtractionResult
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 1fcffdbb..9358b2b4 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -33,7 +33,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from .resources import files, reranking, embeddings, completions
+from .resources import files
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, MixedbreadError
from ._base_client import (
@@ -44,7 +44,6 @@
)
from .resources.parsing import parsing
from .types.info_response import InfoResponse
-from .resources.extractions import extractions
from .resources.vector_stores import vector_stores
__all__ = [
@@ -66,13 +65,9 @@
class Mixedbread(SyncAPIClient):
- embeddings: embeddings.EmbeddingsResource
- reranking: reranking.RerankingResource
parsing: parsing.ParsingResource
files: files.FilesResource
vector_stores: vector_stores.VectorStoresResource
- completions: completions.CompletionsResource
- extractions: extractions.ExtractionsResource
with_raw_response: MixedbreadWithRawResponse
with_streaming_response: MixedbreadWithStreamedResponse
@@ -154,13 +149,9 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.embeddings = embeddings.EmbeddingsResource(self)
- self.reranking = reranking.RerankingResource(self)
self.parsing = parsing.ParsingResource(self)
self.files = files.FilesResource(self)
self.vector_stores = vector_stores.VectorStoresResource(self)
- self.completions = completions.CompletionsResource(self)
- self.extractions = extractions.ExtractionsResource(self)
self.with_raw_response = MixedbreadWithRawResponse(self)
self.with_streaming_response = MixedbreadWithStreamedResponse(self)
@@ -295,13 +286,9 @@ def _make_status_error(
class AsyncMixedbread(AsyncAPIClient):
- embeddings: embeddings.AsyncEmbeddingsResource
- reranking: reranking.AsyncRerankingResource
parsing: parsing.AsyncParsingResource
files: files.AsyncFilesResource
vector_stores: vector_stores.AsyncVectorStoresResource
- completions: completions.AsyncCompletionsResource
- extractions: extractions.AsyncExtractionsResource
with_raw_response: AsyncMixedbreadWithRawResponse
with_streaming_response: AsyncMixedbreadWithStreamedResponse
@@ -383,13 +370,9 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.embeddings = embeddings.AsyncEmbeddingsResource(self)
- self.reranking = reranking.AsyncRerankingResource(self)
self.parsing = parsing.AsyncParsingResource(self)
self.files = files.AsyncFilesResource(self)
self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
- self.completions = completions.AsyncCompletionsResource(self)
- self.extractions = extractions.AsyncExtractionsResource(self)
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)
@@ -525,13 +508,9 @@ def _make_status_error(
class MixedbreadWithRawResponse:
def __init__(self, client: Mixedbread) -> None:
- self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
- self.reranking = reranking.RerankingResourceWithRawResponse(client.reranking)
self.parsing = parsing.ParsingResourceWithRawResponse(client.parsing)
self.files = files.FilesResourceWithRawResponse(client.files)
self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
- self.completions = completions.CompletionsResourceWithRawResponse(client.completions)
- self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
self.info = to_raw_response_wrapper(
client.info,
@@ -540,13 +519,9 @@ def __init__(self, client: Mixedbread) -> None:
class AsyncMixedbreadWithRawResponse:
def __init__(self, client: AsyncMixedbread) -> None:
- self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
- self.reranking = reranking.AsyncRerankingResourceWithRawResponse(client.reranking)
self.parsing = parsing.AsyncParsingResourceWithRawResponse(client.parsing)
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
- self.completions = completions.AsyncCompletionsResourceWithRawResponse(client.completions)
- self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
self.info = async_to_raw_response_wrapper(
client.info,
@@ -555,13 +530,9 @@ def __init__(self, client: AsyncMixedbread) -> None:
class MixedbreadWithStreamedResponse:
def __init__(self, client: Mixedbread) -> None:
- self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
- self.reranking = reranking.RerankingResourceWithStreamingResponse(client.reranking)
self.parsing = parsing.ParsingResourceWithStreamingResponse(client.parsing)
self.files = files.FilesResourceWithStreamingResponse(client.files)
self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
- self.completions = completions.CompletionsResourceWithStreamingResponse(client.completions)
- self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
self.info = to_streamed_response_wrapper(
client.info,
@@ -570,13 +541,9 @@ def __init__(self, client: Mixedbread) -> None:
class AsyncMixedbreadWithStreamedResponse:
def __init__(self, client: AsyncMixedbread) -> None:
- self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
- self.reranking = reranking.AsyncRerankingResourceWithStreamingResponse(client.reranking)
self.parsing = parsing.AsyncParsingResourceWithStreamingResponse(client.parsing)
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
- self.completions = completions.AsyncCompletionsResourceWithStreamingResponse(client.completions)
- self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
self.info = async_to_streamed_response_wrapper(
client.info,
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index 1cca98be..d1fe9468 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -16,38 +16,6 @@
ParsingResourceWithStreamingResponse,
AsyncParsingResourceWithStreamingResponse,
)
-from .reranking import (
- RerankingResource,
- AsyncRerankingResource,
- RerankingResourceWithRawResponse,
- AsyncRerankingResourceWithRawResponse,
- RerankingResourceWithStreamingResponse,
- AsyncRerankingResourceWithStreamingResponse,
-)
-from .embeddings import (
- EmbeddingsResource,
- AsyncEmbeddingsResource,
- EmbeddingsResourceWithRawResponse,
- AsyncEmbeddingsResourceWithRawResponse,
- EmbeddingsResourceWithStreamingResponse,
- AsyncEmbeddingsResourceWithStreamingResponse,
-)
-from .completions import (
- CompletionsResource,
- AsyncCompletionsResource,
- CompletionsResourceWithRawResponse,
- AsyncCompletionsResourceWithRawResponse,
- CompletionsResourceWithStreamingResponse,
- AsyncCompletionsResourceWithStreamingResponse,
-)
-from .extractions import (
- ExtractionsResource,
- AsyncExtractionsResource,
- ExtractionsResourceWithRawResponse,
- AsyncExtractionsResourceWithRawResponse,
- ExtractionsResourceWithStreamingResponse,
- AsyncExtractionsResourceWithStreamingResponse,
-)
from .vector_stores import (
VectorStoresResource,
AsyncVectorStoresResource,
@@ -58,18 +26,6 @@
)
__all__ = [
- "EmbeddingsResource",
- "AsyncEmbeddingsResource",
- "EmbeddingsResourceWithRawResponse",
- "AsyncEmbeddingsResourceWithRawResponse",
- "EmbeddingsResourceWithStreamingResponse",
- "AsyncEmbeddingsResourceWithStreamingResponse",
- "RerankingResource",
- "AsyncRerankingResource",
- "RerankingResourceWithRawResponse",
- "AsyncRerankingResourceWithRawResponse",
- "RerankingResourceWithStreamingResponse",
- "AsyncRerankingResourceWithStreamingResponse",
"ParsingResource",
"AsyncParsingResource",
"ParsingResourceWithRawResponse",
@@ -88,16 +44,4 @@
"AsyncVectorStoresResourceWithRawResponse",
"VectorStoresResourceWithStreamingResponse",
"AsyncVectorStoresResourceWithStreamingResponse",
- "CompletionsResource",
- "AsyncCompletionsResource",
- "CompletionsResourceWithRawResponse",
- "AsyncCompletionsResourceWithRawResponse",
- "CompletionsResourceWithStreamingResponse",
- "AsyncCompletionsResourceWithStreamingResponse",
- "ExtractionsResource",
- "AsyncExtractionsResource",
- "ExtractionsResourceWithRawResponse",
- "AsyncExtractionsResourceWithRawResponse",
- "ExtractionsResourceWithStreamingResponse",
- "AsyncExtractionsResourceWithStreamingResponse",
]
diff --git a/src/mixedbread/resources/completions.py b/src/mixedbread/resources/completions.py
deleted file mode 100644
index 52d605b6..00000000
--- a/src/mixedbread/resources/completions.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from .._compat import cached_property
-from .._resource import SyncAPIResource, AsyncAPIResource
-from .._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from .._base_client import make_request_options
-
-__all__ = ["CompletionsResource", "AsyncCompletionsResource"]
-
-
-class CompletionsResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> CompletionsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return CompletionsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> CompletionsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return CompletionsResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
- """
- Create a chat completion using the provided parameters.
-
- Generates a completion response based on the chat messages and model parameters
- provided. The response can be either a full completion or streamed chunks
- depending on the request parameters.
-
- Args: params: Parameters for creating the chat completion including messages,
- model selection, and generation settings user: The authenticated user making the
- request
-
- Returns: Either a ChatCompletion containing the full response, or
- ChatCompletionChunk for streaming
-
- Raises: HTTPException: If there is an error creating the completion (500)
- """
- return self._post(
- "/v1/chat/completions",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=object,
- )
-
-
-class AsyncCompletionsResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncCompletionsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncCompletionsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncCompletionsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncCompletionsResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
- """
- Create a chat completion using the provided parameters.
-
- Generates a completion response based on the chat messages and model parameters
- provided. The response can be either a full completion or streamed chunks
- depending on the request parameters.
-
- Args: params: Parameters for creating the chat completion including messages,
- model selection, and generation settings user: The authenticated user making the
- request
-
- Returns: Either a ChatCompletion containing the full response, or
- ChatCompletionChunk for streaming
-
- Raises: HTTPException: If there is an error creating the completion (500)
- """
- return await self._post(
- "/v1/chat/completions",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=object,
- )
-
-
-class CompletionsResourceWithRawResponse:
- def __init__(self, completions: CompletionsResource) -> None:
- self._completions = completions
-
- self.create = to_raw_response_wrapper(
- completions.create,
- )
-
-
-class AsyncCompletionsResourceWithRawResponse:
- def __init__(self, completions: AsyncCompletionsResource) -> None:
- self._completions = completions
-
- self.create = async_to_raw_response_wrapper(
- completions.create,
- )
-
-
-class CompletionsResourceWithStreamingResponse:
- def __init__(self, completions: CompletionsResource) -> None:
- self._completions = completions
-
- self.create = to_streamed_response_wrapper(
- completions.create,
- )
-
-
-class AsyncCompletionsResourceWithStreamingResponse:
- def __init__(self, completions: AsyncCompletionsResource) -> None:
- self._completions = completions
-
- self.create = async_to_streamed_response_wrapper(
- completions.create,
- )
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
deleted file mode 100644
index 1a6ecfe0..00000000
--- a/src/mixedbread/resources/embeddings.py
+++ /dev/null
@@ -1,241 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import List, Union, Optional
-from typing_extensions import Literal
-
-import httpx
-
-from ..types import embedding_create_params
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from .._utils import (
- maybe_transform,
- async_maybe_transform,
-)
-from .._compat import cached_property
-from .._resource import SyncAPIResource, AsyncAPIResource
-from .._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from .._base_client import make_request_options
-from ..types.embedding_create_response import EmbeddingCreateResponse
-
-__all__ = ["EmbeddingsResource", "AsyncEmbeddingsResource"]
-
-
-class EmbeddingsResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> EmbeddingsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return EmbeddingsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> EmbeddingsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return EmbeddingsResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- input: embedding_create_params.Input,
- model: str,
- dimensions: Optional[int] | NotGiven = NOT_GIVEN,
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- | NotGiven = NOT_GIVEN,
- normalized: bool | NotGiven = NOT_GIVEN,
- prompt: Optional[str] | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbeddingCreateResponse:
- """
- Create embeddings for text or images using the specified model, encoding format,
- and normalization.
-
- Args: params: The parameters for creating embeddings.
-
- Returns: EmbeddingCreateResponse: The response containing the embeddings.
-
- Args:
- input: The input to create embeddings for.
-
- model: The model to use for creating embeddings.
-
- dimensions: The number of dimensions to use for the embeddings.
-
- encoding_format: The encoding format of the embeddings.
-
- normalized: Whether to normalize the embeddings.
-
- prompt: The prompt to use for the embedding creation.
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/embeddings",
- body=maybe_transform(
- {
- "input": input,
- "model": model,
- "dimensions": dimensions,
- "encoding_format": encoding_format,
- "normalized": normalized,
- "prompt": prompt,
- },
- embedding_create_params.EmbeddingCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=EmbeddingCreateResponse,
- )
-
-
-class AsyncEmbeddingsResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncEmbeddingsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncEmbeddingsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncEmbeddingsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncEmbeddingsResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- input: embedding_create_params.Input,
- model: str,
- dimensions: Optional[int] | NotGiven = NOT_GIVEN,
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- | NotGiven = NOT_GIVEN,
- normalized: bool | NotGiven = NOT_GIVEN,
- prompt: Optional[str] | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbeddingCreateResponse:
- """
- Create embeddings for text or images using the specified model, encoding format,
- and normalization.
-
- Args: params: The parameters for creating embeddings.
-
- Returns: EmbeddingCreateResponse: The response containing the embeddings.
-
- Args:
- input: The input to create embeddings for.
-
- model: The model to use for creating embeddings.
-
- dimensions: The number of dimensions to use for the embeddings.
-
- encoding_format: The encoding format of the embeddings.
-
- normalized: Whether to normalize the embeddings.
-
- prompt: The prompt to use for the embedding creation.
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/embeddings",
- body=await async_maybe_transform(
- {
- "input": input,
- "model": model,
- "dimensions": dimensions,
- "encoding_format": encoding_format,
- "normalized": normalized,
- "prompt": prompt,
- },
- embedding_create_params.EmbeddingCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=EmbeddingCreateResponse,
- )
-
-
-class EmbeddingsResourceWithRawResponse:
- def __init__(self, embeddings: EmbeddingsResource) -> None:
- self._embeddings = embeddings
-
- self.create = to_raw_response_wrapper(
- embeddings.create,
- )
-
-
-class AsyncEmbeddingsResourceWithRawResponse:
- def __init__(self, embeddings: AsyncEmbeddingsResource) -> None:
- self._embeddings = embeddings
-
- self.create = async_to_raw_response_wrapper(
- embeddings.create,
- )
-
-
-class EmbeddingsResourceWithStreamingResponse:
- def __init__(self, embeddings: EmbeddingsResource) -> None:
- self._embeddings = embeddings
-
- self.create = to_streamed_response_wrapper(
- embeddings.create,
- )
-
-
-class AsyncEmbeddingsResourceWithStreamingResponse:
- def __init__(self, embeddings: AsyncEmbeddingsResource) -> None:
- self._embeddings = embeddings
-
- self.create = async_to_streamed_response_wrapper(
- embeddings.create,
- )
diff --git a/src/mixedbread/resources/extractions/__init__.py b/src/mixedbread/resources/extractions/__init__.py
deleted file mode 100644
index d9a42002..00000000
--- a/src/mixedbread/resources/extractions/__init__.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from .jobs import (
- JobsResource,
- AsyncJobsResource,
- JobsResourceWithRawResponse,
- AsyncJobsResourceWithRawResponse,
- JobsResourceWithStreamingResponse,
- AsyncJobsResourceWithStreamingResponse,
-)
-from .schema import (
- SchemaResource,
- AsyncSchemaResource,
- SchemaResourceWithRawResponse,
- AsyncSchemaResourceWithRawResponse,
- SchemaResourceWithStreamingResponse,
- AsyncSchemaResourceWithStreamingResponse,
-)
-from .content import (
- ContentResource,
- AsyncContentResource,
- ContentResourceWithRawResponse,
- AsyncContentResourceWithRawResponse,
- ContentResourceWithStreamingResponse,
- AsyncContentResourceWithStreamingResponse,
-)
-from .extractions import (
- ExtractionsResource,
- AsyncExtractionsResource,
- ExtractionsResourceWithRawResponse,
- AsyncExtractionsResourceWithRawResponse,
- ExtractionsResourceWithStreamingResponse,
- AsyncExtractionsResourceWithStreamingResponse,
-)
-
-__all__ = [
- "JobsResource",
- "AsyncJobsResource",
- "JobsResourceWithRawResponse",
- "AsyncJobsResourceWithRawResponse",
- "JobsResourceWithStreamingResponse",
- "AsyncJobsResourceWithStreamingResponse",
- "SchemaResource",
- "AsyncSchemaResource",
- "SchemaResourceWithRawResponse",
- "AsyncSchemaResourceWithRawResponse",
- "SchemaResourceWithStreamingResponse",
- "AsyncSchemaResourceWithStreamingResponse",
- "ContentResource",
- "AsyncContentResource",
- "ContentResourceWithRawResponse",
- "AsyncContentResourceWithRawResponse",
- "ContentResourceWithStreamingResponse",
- "AsyncContentResourceWithStreamingResponse",
- "ExtractionsResource",
- "AsyncExtractionsResource",
- "ExtractionsResourceWithRawResponse",
- "AsyncExtractionsResourceWithRawResponse",
- "ExtractionsResourceWithStreamingResponse",
- "AsyncExtractionsResourceWithStreamingResponse",
-]
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
deleted file mode 100644
index cacd55a6..00000000
--- a/src/mixedbread/resources/extractions/content.py
+++ /dev/null
@@ -1,196 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from ..._base_client import make_request_options
-from ...types.extractions import content_create_params
-from ...types.extractions.extraction_result import ExtractionResult
-
-__all__ = ["ContentResource", "AsyncContentResource"]
-
-
-class ContentResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> ContentResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return ContentResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> ContentResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return ContentResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- content: str,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionResult:
- """
- Extract content from a string using the provided schema.
-
- Args: params: The parameters for extracting content from a string.
-
- Returns: The extracted content.
-
- Args:
- content: The content to extract from
-
- json_schema: The JSON schema to use for extraction
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/content",
- body=maybe_transform(
- {
- "content": content,
- "json_schema": json_schema,
- },
- content_create_params.ContentCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionResult,
- )
-
-
-class AsyncContentResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncContentResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncContentResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncContentResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncContentResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- content: str,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionResult:
- """
- Extract content from a string using the provided schema.
-
- Args: params: The parameters for extracting content from a string.
-
- Returns: The extracted content.
-
- Args:
- content: The content to extract from
-
- json_schema: The JSON schema to use for extraction
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/content",
- body=await async_maybe_transform(
- {
- "content": content,
- "json_schema": json_schema,
- },
- content_create_params.ContentCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionResult,
- )
-
-
-class ContentResourceWithRawResponse:
- def __init__(self, content: ContentResource) -> None:
- self._content = content
-
- self.create = to_raw_response_wrapper(
- content.create,
- )
-
-
-class AsyncContentResourceWithRawResponse:
- def __init__(self, content: AsyncContentResource) -> None:
- self._content = content
-
- self.create = async_to_raw_response_wrapper(
- content.create,
- )
-
-
-class ContentResourceWithStreamingResponse:
- def __init__(self, content: ContentResource) -> None:
- self._content = content
-
- self.create = to_streamed_response_wrapper(
- content.create,
- )
-
-
-class AsyncContentResourceWithStreamingResponse:
- def __init__(self, content: AsyncContentResource) -> None:
- self._content = content
-
- self.create = async_to_streamed_response_wrapper(
- content.create,
- )
diff --git a/src/mixedbread/resources/extractions/extractions.py b/src/mixedbread/resources/extractions/extractions.py
deleted file mode 100644
index eebb3e40..00000000
--- a/src/mixedbread/resources/extractions/extractions.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from .jobs import (
- JobsResource,
- AsyncJobsResource,
- JobsResourceWithRawResponse,
- AsyncJobsResourceWithRawResponse,
- JobsResourceWithStreamingResponse,
- AsyncJobsResourceWithStreamingResponse,
-)
-from .schema import (
- SchemaResource,
- AsyncSchemaResource,
- SchemaResourceWithRawResponse,
- AsyncSchemaResourceWithRawResponse,
- SchemaResourceWithStreamingResponse,
- AsyncSchemaResourceWithStreamingResponse,
-)
-from .content import (
- ContentResource,
- AsyncContentResource,
- ContentResourceWithRawResponse,
- AsyncContentResourceWithRawResponse,
- ContentResourceWithStreamingResponse,
- AsyncContentResourceWithStreamingResponse,
-)
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-
-__all__ = ["ExtractionsResource", "AsyncExtractionsResource"]
-
-
-class ExtractionsResource(SyncAPIResource):
- @cached_property
- def jobs(self) -> JobsResource:
- return JobsResource(self._client)
-
- @cached_property
- def schema(self) -> SchemaResource:
- return SchemaResource(self._client)
-
- @cached_property
- def content(self) -> ContentResource:
- return ContentResource(self._client)
-
- @cached_property
- def with_raw_response(self) -> ExtractionsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return ExtractionsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> ExtractionsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return ExtractionsResourceWithStreamingResponse(self)
-
-
-class AsyncExtractionsResource(AsyncAPIResource):
- @cached_property
- def jobs(self) -> AsyncJobsResource:
- return AsyncJobsResource(self._client)
-
- @cached_property
- def schema(self) -> AsyncSchemaResource:
- return AsyncSchemaResource(self._client)
-
- @cached_property
- def content(self) -> AsyncContentResource:
- return AsyncContentResource(self._client)
-
- @cached_property
- def with_raw_response(self) -> AsyncExtractionsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncExtractionsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncExtractionsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncExtractionsResourceWithStreamingResponse(self)
-
-
-class ExtractionsResourceWithRawResponse:
- def __init__(self, extractions: ExtractionsResource) -> None:
- self._extractions = extractions
-
- @cached_property
- def jobs(self) -> JobsResourceWithRawResponse:
- return JobsResourceWithRawResponse(self._extractions.jobs)
-
- @cached_property
- def schema(self) -> SchemaResourceWithRawResponse:
- return SchemaResourceWithRawResponse(self._extractions.schema)
-
- @cached_property
- def content(self) -> ContentResourceWithRawResponse:
- return ContentResourceWithRawResponse(self._extractions.content)
-
-
-class AsyncExtractionsResourceWithRawResponse:
- def __init__(self, extractions: AsyncExtractionsResource) -> None:
- self._extractions = extractions
-
- @cached_property
- def jobs(self) -> AsyncJobsResourceWithRawResponse:
- return AsyncJobsResourceWithRawResponse(self._extractions.jobs)
-
- @cached_property
- def schema(self) -> AsyncSchemaResourceWithRawResponse:
- return AsyncSchemaResourceWithRawResponse(self._extractions.schema)
-
- @cached_property
- def content(self) -> AsyncContentResourceWithRawResponse:
- return AsyncContentResourceWithRawResponse(self._extractions.content)
-
-
-class ExtractionsResourceWithStreamingResponse:
- def __init__(self, extractions: ExtractionsResource) -> None:
- self._extractions = extractions
-
- @cached_property
- def jobs(self) -> JobsResourceWithStreamingResponse:
- return JobsResourceWithStreamingResponse(self._extractions.jobs)
-
- @cached_property
- def schema(self) -> SchemaResourceWithStreamingResponse:
- return SchemaResourceWithStreamingResponse(self._extractions.schema)
-
- @cached_property
- def content(self) -> ContentResourceWithStreamingResponse:
- return ContentResourceWithStreamingResponse(self._extractions.content)
-
-
-class AsyncExtractionsResourceWithStreamingResponse:
- def __init__(self, extractions: AsyncExtractionsResource) -> None:
- self._extractions = extractions
-
- @cached_property
- def jobs(self) -> AsyncJobsResourceWithStreamingResponse:
- return AsyncJobsResourceWithStreamingResponse(self._extractions.jobs)
-
- @cached_property
- def schema(self) -> AsyncSchemaResourceWithStreamingResponse:
- return AsyncSchemaResourceWithStreamingResponse(self._extractions.schema)
-
- @cached_property
- def content(self) -> AsyncContentResourceWithStreamingResponse:
- return AsyncContentResourceWithStreamingResponse(self._extractions.content)
diff --git a/src/mixedbread/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py
deleted file mode 100644
index 3abc64f9..00000000
--- a/src/mixedbread/resources/extractions/jobs.py
+++ /dev/null
@@ -1,286 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from ..._base_client import make_request_options
-from ...types.extractions import job_create_params
-from ...types.extractions.extraction_job import ExtractionJob
-
-__all__ = ["JobsResource", "AsyncJobsResource"]
-
-
-class JobsResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> JobsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return JobsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> JobsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return JobsResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- file_id: str,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionJob:
- """
- Start an extraction job for the provided file and schema.
-
- Args: params: The parameters for creating an extraction job.
-
- Returns: The created extraction job.
-
- Args:
- file_id: The ID of the file to extract from
-
- json_schema: The JSON schema to use for extraction
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/jobs",
- body=maybe_transform(
- {
- "file_id": file_id,
- "json_schema": json_schema,
- },
- job_create_params.JobCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionJob,
- )
-
- def retrieve(
- self,
- job_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionJob:
- """
- Get detailed information about a specific extraction job.
-
- Args: job_id: The ID of the extraction job.
-
- Returns: Detailed information about the extraction job.
-
- Args:
- job_id: The ID of the extraction job to retrieve
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not job_id:
- raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
- return self._get(
- f"/v1/extractions/jobs/{job_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionJob,
- )
-
-
-class AsyncJobsResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncJobsResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncJobsResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncJobsResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- file_id: str,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionJob:
- """
- Start an extraction job for the provided file and schema.
-
- Args: params: The parameters for creating an extraction job.
-
- Returns: The created extraction job.
-
- Args:
- file_id: The ID of the file to extract from
-
- json_schema: The JSON schema to use for extraction
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/jobs",
- body=await async_maybe_transform(
- {
- "file_id": file_id,
- "json_schema": json_schema,
- },
- job_create_params.JobCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionJob,
- )
-
- async def retrieve(
- self,
- job_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ExtractionJob:
- """
- Get detailed information about a specific extraction job.
-
- Args: job_id: The ID of the extraction job.
-
- Returns: Detailed information about the extraction job.
-
- Args:
- job_id: The ID of the extraction job to retrieve
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not job_id:
- raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
- return await self._get(
- f"/v1/extractions/jobs/{job_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ExtractionJob,
- )
-
-
-class JobsResourceWithRawResponse:
- def __init__(self, jobs: JobsResource) -> None:
- self._jobs = jobs
-
- self.create = to_raw_response_wrapper(
- jobs.create,
- )
- self.retrieve = to_raw_response_wrapper(
- jobs.retrieve,
- )
-
-
-class AsyncJobsResourceWithRawResponse:
- def __init__(self, jobs: AsyncJobsResource) -> None:
- self._jobs = jobs
-
- self.create = async_to_raw_response_wrapper(
- jobs.create,
- )
- self.retrieve = async_to_raw_response_wrapper(
- jobs.retrieve,
- )
-
-
-class JobsResourceWithStreamingResponse:
- def __init__(self, jobs: JobsResource) -> None:
- self._jobs = jobs
-
- self.create = to_streamed_response_wrapper(
- jobs.create,
- )
- self.retrieve = to_streamed_response_wrapper(
- jobs.retrieve,
- )
-
-
-class AsyncJobsResourceWithStreamingResponse:
- def __init__(self, jobs: AsyncJobsResource) -> None:
- self._jobs = jobs
-
- self.create = async_to_streamed_response_wrapper(
- jobs.create,
- )
- self.retrieve = async_to_streamed_response_wrapper(
- jobs.retrieve,
- )
diff --git a/src/mixedbread/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py
deleted file mode 100644
index 60ee00a5..00000000
--- a/src/mixedbread/resources/extractions/schema.py
+++ /dev/null
@@ -1,356 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from ..._base_client import make_request_options
-from ...types.extractions import schema_create_params, schema_enhance_params, schema_validate_params
-from ...types.extractions.created_json_schema import CreatedJsonSchema
-from ...types.extractions.enhanced_json_schema import EnhancedJsonSchema
-from ...types.extractions.validated_json_schema import ValidatedJsonSchema
-
-__all__ = ["SchemaResource", "AsyncSchemaResource"]
-
-
-class SchemaResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> SchemaResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return SchemaResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> SchemaResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return SchemaResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- description: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> CreatedJsonSchema:
- """
- Create a schema with the provided parameters.
-
- Args: params: The parameters for creating a schema.
-
- Returns: The created schema.
-
- Args:
- description: Description of the data to extract
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/schema",
- body=maybe_transform({"description": description}, schema_create_params.SchemaCreateParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=CreatedJsonSchema,
- )
-
- def enhance(
- self,
- *,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EnhancedJsonSchema:
- """
- Enhance a schema by enriching the descriptions to aid extraction.
-
- Args: params: The parameters for enhancing a schema.
-
- Returns: The enhanced schema.
-
- Args:
- json_schema: The JSON schema to enhance
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/schema/enhance",
- body=maybe_transform({"json_schema": json_schema}, schema_enhance_params.SchemaEnhanceParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=EnhancedJsonSchema,
- )
-
- def validate(
- self,
- *,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ValidatedJsonSchema:
- """
- Validate a schema.
-
- Args: params: The parameters for validating a schema.
-
- Returns: The validation result.
-
- Args:
- json_schema: The JSON schema to validate
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/extractions/schema/validate",
- body=maybe_transform({"json_schema": json_schema}, schema_validate_params.SchemaValidateParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ValidatedJsonSchema,
- )
-
-
-class AsyncSchemaResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncSchemaResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncSchemaResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncSchemaResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- description: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> CreatedJsonSchema:
- """
- Create a schema with the provided parameters.
-
- Args: params: The parameters for creating a schema.
-
- Returns: The created schema.
-
- Args:
- description: Description of the data to extract
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/schema",
- body=await async_maybe_transform({"description": description}, schema_create_params.SchemaCreateParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=CreatedJsonSchema,
- )
-
- async def enhance(
- self,
- *,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EnhancedJsonSchema:
- """
- Enhance a schema by enriching the descriptions to aid extraction.
-
- Args: params: The parameters for enhancing a schema.
-
- Returns: The enhanced schema.
-
- Args:
- json_schema: The JSON schema to enhance
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/schema/enhance",
- body=await async_maybe_transform({"json_schema": json_schema}, schema_enhance_params.SchemaEnhanceParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=EnhancedJsonSchema,
- )
-
- async def validate(
- self,
- *,
- json_schema: object,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ValidatedJsonSchema:
- """
- Validate a schema.
-
- Args: params: The parameters for validating a schema.
-
- Returns: The validation result.
-
- Args:
- json_schema: The JSON schema to validate
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/extractions/schema/validate",
- body=await async_maybe_transform({"json_schema": json_schema}, schema_validate_params.SchemaValidateParams),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=ValidatedJsonSchema,
- )
-
-
-class SchemaResourceWithRawResponse:
- def __init__(self, schema: SchemaResource) -> None:
- self._schema = schema
-
- self.create = to_raw_response_wrapper(
- schema.create,
- )
- self.enhance = to_raw_response_wrapper(
- schema.enhance,
- )
- self.validate = to_raw_response_wrapper(
- schema.validate,
- )
-
-
-class AsyncSchemaResourceWithRawResponse:
- def __init__(self, schema: AsyncSchemaResource) -> None:
- self._schema = schema
-
- self.create = async_to_raw_response_wrapper(
- schema.create,
- )
- self.enhance = async_to_raw_response_wrapper(
- schema.enhance,
- )
- self.validate = async_to_raw_response_wrapper(
- schema.validate,
- )
-
-
-class SchemaResourceWithStreamingResponse:
- def __init__(self, schema: SchemaResource) -> None:
- self._schema = schema
-
- self.create = to_streamed_response_wrapper(
- schema.create,
- )
- self.enhance = to_streamed_response_wrapper(
- schema.enhance,
- )
- self.validate = to_streamed_response_wrapper(
- schema.validate,
- )
-
-
-class AsyncSchemaResourceWithStreamingResponse:
- def __init__(self, schema: AsyncSchemaResource) -> None:
- self._schema = schema
-
- self.create = async_to_streamed_response_wrapper(
- schema.create,
- )
- self.enhance = async_to_streamed_response_wrapper(
- schema.enhance,
- )
- self.validate = async_to_streamed_response_wrapper(
- schema.validate,
- )
diff --git a/src/mixedbread/resources/reranking.py b/src/mixedbread/resources/reranking.py
deleted file mode 100644
index 1c55f421..00000000
--- a/src/mixedbread/resources/reranking.py
+++ /dev/null
@@ -1,230 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import List, Union, Optional
-
-import httpx
-
-from ..types import reranking_create_params
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from .._utils import (
- maybe_transform,
- async_maybe_transform,
-)
-from .._compat import cached_property
-from .._resource import SyncAPIResource, AsyncAPIResource
-from .._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from .._base_client import make_request_options
-from ..types.reranking_create_response import RerankingCreateResponse
-
-__all__ = ["RerankingResource", "AsyncRerankingResource"]
-
-
-class RerankingResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> RerankingResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return RerankingResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> RerankingResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return RerankingResourceWithStreamingResponse(self)
-
- def create(
- self,
- *,
- input: List[Union[str, object]],
- query: str,
- model: str | NotGiven = NOT_GIVEN,
- rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
- return_input: bool | NotGiven = NOT_GIVEN,
- top_k: int | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> RerankingCreateResponse:
- """
- Rerank different kind of documents for a given query.
-
- Args: params: RerankingCreateParams: The parameters for reranking.
-
- Returns: RerankingCreateResponse: The reranked documents for the input query.
-
- Args:
- input: The input documents to rerank.
-
- query: The query to rerank the documents.
-
- model: The model to use for reranking documents.
-
- rank_fields: The fields of the documents to rank.
-
- return_input: Whether to return the documents.
-
- top_k: The number of documents to return.
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/reranking",
- body=maybe_transform(
- {
- "input": input,
- "query": query,
- "model": model,
- "rank_fields": rank_fields,
- "return_input": return_input,
- "top_k": top_k,
- },
- reranking_create_params.RerankingCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=RerankingCreateResponse,
- )
-
-
-class AsyncRerankingResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncRerankingResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncRerankingResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncRerankingResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncRerankingResourceWithStreamingResponse(self)
-
- async def create(
- self,
- *,
- input: List[Union[str, object]],
- query: str,
- model: str | NotGiven = NOT_GIVEN,
- rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
- return_input: bool | NotGiven = NOT_GIVEN,
- top_k: int | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> RerankingCreateResponse:
- """
- Rerank different kind of documents for a given query.
-
- Args: params: RerankingCreateParams: The parameters for reranking.
-
- Returns: RerankingCreateResponse: The reranked documents for the input query.
-
- Args:
- input: The input documents to rerank.
-
- query: The query to rerank the documents.
-
- model: The model to use for reranking documents.
-
- rank_fields: The fields of the documents to rank.
-
- return_input: Whether to return the documents.
-
- top_k: The number of documents to return.
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/reranking",
- body=await async_maybe_transform(
- {
- "input": input,
- "query": query,
- "model": model,
- "rank_fields": rank_fields,
- "return_input": return_input,
- "top_k": top_k,
- },
- reranking_create_params.RerankingCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=RerankingCreateResponse,
- )
-
-
-class RerankingResourceWithRawResponse:
- def __init__(self, reranking: RerankingResource) -> None:
- self._reranking = reranking
-
- self.create = to_raw_response_wrapper(
- reranking.create,
- )
-
-
-class AsyncRerankingResourceWithRawResponse:
- def __init__(self, reranking: AsyncRerankingResource) -> None:
- self._reranking = reranking
-
- self.create = async_to_raw_response_wrapper(
- reranking.create,
- )
-
-
-class RerankingResourceWithStreamingResponse:
- def __init__(self, reranking: RerankingResource) -> None:
- self._reranking = reranking
-
- self.create = to_streamed_response_wrapper(
- reranking.create,
- )
-
-
-class AsyncRerankingResourceWithStreamingResponse:
- def __init__(self, reranking: AsyncRerankingResource) -> None:
- self._reranking = reranking
-
- self.create = async_to_streamed_response_wrapper(
- reranking.create,
- )
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index a426aa67..782a1804 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -3,7 +3,6 @@
from __future__ import annotations
from .shared import SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
-from .embedding import Embedding as Embedding
from .file_counts import FileCounts as FileCounts
from .file_object import FileObject as FileObject
from .vector_store import VectorStore as VectorStore
@@ -14,11 +13,7 @@
from .file_update_params import FileUpdateParams as FileUpdateParams
from .expires_after_param import ExpiresAfterParam as ExpiresAfterParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
-from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
-from .reranking_create_params import RerankingCreateParams as RerankingCreateParams
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
-from .embedding_create_response import EmbeddingCreateResponse as EmbeddingCreateResponse
-from .reranking_create_response import RerankingCreateResponse as RerankingCreateResponse
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
diff --git a/src/mixedbread/types/embedding.py b/src/mixedbread/types/embedding.py
deleted file mode 100644
index ad8cd3f0..00000000
--- a/src/mixedbread/types/embedding.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Union
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["Embedding"]
-
-
-class Embedding(BaseModel):
- embedding: Union[List[float], List[int], str]
- """The encoded embedding."""
-
- index: int
- """The index of the embedding."""
-
- object: Literal["embedding"]
- """The object type of the embedding."""
diff --git a/src/mixedbread/types/embedding_create_params.py b/src/mixedbread/types/embedding_create_params.py
deleted file mode 100644
index 6ca77dcf..00000000
--- a/src/mixedbread/types/embedding_create_params.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import List, Union, Optional
-from typing_extensions import Literal, Required, TypeAlias, TypedDict
-
-__all__ = ["EmbeddingCreateParams", "Input", "InputImageURLInput", "InputImageURLInputImage", "InputTextInput"]
-
-
-class EmbeddingCreateParams(TypedDict, total=False):
- input: Required[Input]
- """The input to create embeddings for."""
-
- model: Required[str]
- """The model to use for creating embeddings."""
-
- dimensions: Optional[int]
- """The number of dimensions to use for the embeddings."""
-
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- """The encoding format of the embeddings."""
-
- normalized: bool
- """Whether to normalize the embeddings."""
-
- prompt: Optional[str]
- """The prompt to use for the embedding creation."""
-
-
-class InputImageURLInputImage(TypedDict, total=False):
- url: Required[str]
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class InputImageURLInput(TypedDict, total=False):
- image: Required[InputImageURLInputImage]
- """The image input specification."""
-
- type: Literal["image_url"]
- """Input type identifier"""
-
-
-class InputTextInput(TypedDict, total=False):
- text: Required[str]
- """Text content to process"""
-
- type: Literal["text"]
- """Input type identifier"""
-
-
-Input: TypeAlias = Union[str, InputImageURLInput, InputTextInput]
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
deleted file mode 100644
index d31d69b4..00000000
--- a/src/mixedbread/types/embedding_create_response.py
+++ /dev/null
@@ -1,88 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-import builtins
-from typing import List, Union, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .embedding import Embedding
-
-__all__ = ["EmbeddingCreateResponse", "DataUnionMember1", "DataUnionMember1Embedding", "Usage"]
-
-
-class DataUnionMember1Embedding(BaseModel):
- base64: Optional[List[str]] = None
-
- binary: Optional[List[int]] = None
-
- float: Optional[List[builtins.float]] = None
-
- int8: Optional[List[int]] = None
-
- ubinary: Optional[List[int]] = None
-
- uint8: Optional[List[int]] = None
-
-
-class DataUnionMember1(BaseModel):
- embedding: DataUnionMember1Embedding
- """
- The encoded embedding data by encoding format.Returned, if more than one
- encoding format is used.
- """
-
- index: int
- """The index of the embedding."""
-
- object: Literal["embedding_dict"]
- """The object type of the embedding."""
-
-
-class Usage(BaseModel):
- prompt_tokens: int
- """The number of tokens used for the prompt"""
-
- total_tokens: int
- """The total number of tokens used"""
-
- completion_tokens: Optional[int] = None
- """The number of tokens used for the completion"""
-
-
-class EmbeddingCreateResponse(BaseModel):
- data: Union[List[Embedding], List[DataUnionMember1]]
- """The created embeddings."""
-
- dimensions: Optional[int] = None
- """The number of dimensions used for the embeddings."""
-
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- """The encoding format of the embeddings."""
-
- model: str
- """The model used"""
-
- normalized: bool
- """Whether the embeddings are normalized."""
-
- usage: Usage
- """The usage of the model"""
-
- object: Optional[
- Literal[
- "list",
- "parsing_job",
- "job",
- "embedding",
- "embedding_dict",
- "text_document",
- "file",
- "vector_store",
- "vector_store.file",
- "api_key",
- ]
- ] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/extractions/__init__.py b/src/mixedbread/types/extractions/__init__.py
deleted file mode 100644
index 6457c670..00000000
--- a/src/mixedbread/types/extractions/__init__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from .extraction_job import ExtractionJob as ExtractionJob
-from .extraction_result import ExtractionResult as ExtractionResult
-from .job_create_params import JobCreateParams as JobCreateParams
-from .created_json_schema import CreatedJsonSchema as CreatedJsonSchema
-from .enhanced_json_schema import EnhancedJsonSchema as EnhancedJsonSchema
-from .schema_create_params import SchemaCreateParams as SchemaCreateParams
-from .content_create_params import ContentCreateParams as ContentCreateParams
-from .schema_enhance_params import SchemaEnhanceParams as SchemaEnhanceParams
-from .validated_json_schema import ValidatedJsonSchema as ValidatedJsonSchema
-from .schema_validate_params import SchemaValidateParams as SchemaValidateParams
diff --git a/src/mixedbread/types/extractions/content_create_params.py b/src/mixedbread/types/extractions/content_create_params.py
deleted file mode 100644
index 2bbdada2..00000000
--- a/src/mixedbread/types/extractions/content_create_params.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["ContentCreateParams"]
-
-
-class ContentCreateParams(TypedDict, total=False):
- content: Required[str]
- """The content to extract from"""
-
- json_schema: Required[object]
- """The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/created_json_schema.py b/src/mixedbread/types/extractions/created_json_schema.py
deleted file mode 100644
index 4b50c4c6..00000000
--- a/src/mixedbread/types/extractions/created_json_schema.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-
-from ..._models import BaseModel
-
-__all__ = ["CreatedJsonSchema"]
-
-
-class CreatedJsonSchema(BaseModel):
- json_schema: object
- """The created JSON schema"""
diff --git a/src/mixedbread/types/extractions/enhanced_json_schema.py b/src/mixedbread/types/extractions/enhanced_json_schema.py
deleted file mode 100644
index 7b2ab04a..00000000
--- a/src/mixedbread/types/extractions/enhanced_json_schema.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-
-from ..._models import BaseModel
-
-__all__ = ["EnhancedJsonSchema"]
-
-
-class EnhancedJsonSchema(BaseModel):
- json_schema: object
- """The enhanced JSON schema"""
diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py
deleted file mode 100644
index 5d8a1604..00000000
--- a/src/mixedbread/types/extractions/extraction_job.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-
-from ..._models import BaseModel
-from .extraction_result import ExtractionResult
-
-__all__ = ["ExtractionJob"]
-
-
-class ExtractionJob(BaseModel):
- result: Optional[ExtractionResult] = None
- """Result of an extraction operation."""
diff --git a/src/mixedbread/types/extractions/extraction_result.py b/src/mixedbread/types/extractions/extraction_result.py
deleted file mode 100644
index fbac5d5f..00000000
--- a/src/mixedbread/types/extractions/extraction_result.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-
-from ..._models import BaseModel
-
-__all__ = ["ExtractionResult"]
-
-
-class ExtractionResult(BaseModel):
- data: object
- """The extracted data"""
diff --git a/src/mixedbread/types/extractions/job_create_params.py b/src/mixedbread/types/extractions/job_create_params.py
deleted file mode 100644
index 476154b2..00000000
--- a/src/mixedbread/types/extractions/job_create_params.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["JobCreateParams"]
-
-
-class JobCreateParams(TypedDict, total=False):
- file_id: Required[str]
- """The ID of the file to extract from"""
-
- json_schema: Required[object]
- """The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/schema_create_params.py b/src/mixedbread/types/extractions/schema_create_params.py
deleted file mode 100644
index 8625ea66..00000000
--- a/src/mixedbread/types/extractions/schema_create_params.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["SchemaCreateParams"]
-
-
-class SchemaCreateParams(TypedDict, total=False):
- description: Required[str]
- """Description of the data to extract"""
diff --git a/src/mixedbread/types/extractions/schema_enhance_params.py b/src/mixedbread/types/extractions/schema_enhance_params.py
deleted file mode 100644
index e0facf34..00000000
--- a/src/mixedbread/types/extractions/schema_enhance_params.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["SchemaEnhanceParams"]
-
-
-class SchemaEnhanceParams(TypedDict, total=False):
- json_schema: Required[object]
- """The JSON schema to enhance"""
diff --git a/src/mixedbread/types/extractions/schema_validate_params.py b/src/mixedbread/types/extractions/schema_validate_params.py
deleted file mode 100644
index 947182ca..00000000
--- a/src/mixedbread/types/extractions/schema_validate_params.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Required, TypedDict
-
-__all__ = ["SchemaValidateParams"]
-
-
-class SchemaValidateParams(TypedDict, total=False):
- json_schema: Required[object]
- """The JSON schema to validate"""
diff --git a/src/mixedbread/types/extractions/validated_json_schema.py b/src/mixedbread/types/extractions/validated_json_schema.py
deleted file mode 100644
index 42e6da5b..00000000
--- a/src/mixedbread/types/extractions/validated_json_schema.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List
-
-from ..._models import BaseModel
-
-__all__ = ["ValidatedJsonSchema"]
-
-
-class ValidatedJsonSchema(BaseModel):
- errors: List[str]
- """List of validation errors"""
-
- is_valid: bool
- """Whether the schema is valid"""
-
- json_schema: object
- """The validated JSON schema"""
diff --git a/src/mixedbread/types/reranking_create_params.py b/src/mixedbread/types/reranking_create_params.py
deleted file mode 100644
index cbf9514e..00000000
--- a/src/mixedbread/types/reranking_create_params.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import List, Union, Optional
-from typing_extensions import Required, TypedDict
-
-__all__ = ["RerankingCreateParams"]
-
-
-class RerankingCreateParams(TypedDict, total=False):
- input: Required[List[Union[str, object]]]
- """The input documents to rerank."""
-
- query: Required[str]
- """The query to rerank the documents."""
-
- model: str
- """The model to use for reranking documents."""
-
- rank_fields: Optional[List[str]]
- """The fields of the documents to rank."""
-
- return_input: bool
- """Whether to return the documents."""
-
- top_k: int
- """The number of documents to return."""
diff --git a/src/mixedbread/types/reranking_create_response.py b/src/mixedbread/types/reranking_create_response.py
deleted file mode 100644
index a9d91d9c..00000000
--- a/src/mixedbread/types/reranking_create_response.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["RerankingCreateResponse", "Data", "Usage"]
-
-
-class Data(BaseModel):
- index: int
-
- input: object
- """The input document."""
-
- score: float
- """The score of the document."""
-
- object: Optional[
- Literal[
- "list",
- "parsing_job",
- "job",
- "embedding",
- "embedding_dict",
- "text_document",
- "file",
- "vector_store",
- "vector_store.file",
- "api_key",
- ]
- ] = None
- """The object type."""
-
-
-class Usage(BaseModel):
- prompt_tokens: int
- """The number of tokens used for the prompt"""
-
- total_tokens: int
- """The total number of tokens used"""
-
- completion_tokens: Optional[int] = None
- """The number of tokens used for the completion"""
-
-
-class RerankingCreateResponse(BaseModel):
- data: List[Data]
- """The ranked documents."""
-
- model: str
- """The model used"""
-
- return_input: bool
- """Whether to return the documents."""
-
- top_k: int
- """The number of documents to return."""
-
- usage: Usage
- """The usage of the model"""
-
- object: Optional[
- Literal[
- "list",
- "parsing_job",
- "job",
- "embedding",
- "embedding_dict",
- "text_document",
- "file",
- "vector_store",
- "vector_store.file",
- "api_key",
- ]
- ] = None
- """The object type of the response"""
diff --git a/tests/api_resources/extractions/__init__.py b/tests/api_resources/extractions/__init__.py
deleted file mode 100644
index fd8019a9..00000000
--- a/tests/api_resources/extractions/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
diff --git a/tests/api_resources/extractions/test_content.py b/tests/api_resources/extractions/test_content.py
deleted file mode 100644
index 7beb468b..00000000
--- a/tests/api_resources/extractions/test_content.py
+++ /dev/null
@@ -1,90 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types.extractions import ExtractionResult
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestContent:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- content = client.extractions.content.create(
- content="content",
- json_schema={},
- )
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.extractions.content.with_raw_response.create(
- content="content",
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- content = response.parse()
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.extractions.content.with_streaming_response.create(
- content="content",
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- content = response.parse()
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncContent:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- content = await async_client.extractions.content.create(
- content="content",
- json_schema={},
- )
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.content.with_raw_response.create(
- content="content",
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- content = await response.parse()
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.content.with_streaming_response.create(
- content="content",
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- content = await response.parse()
- assert_matches_type(ExtractionResult, content, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/extractions/test_jobs.py b/tests/api_resources/extractions/test_jobs.py
deleted file mode 100644
index bb055ba7..00000000
--- a/tests/api_resources/extractions/test_jobs.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types.extractions import ExtractionJob
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestJobs:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- job = client.extractions.jobs.create(
- file_id="file_id",
- json_schema={},
- )
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.extractions.jobs.with_raw_response.create(
- file_id="file_id",
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- job = response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.extractions.jobs.with_streaming_response.create(
- file_id="file_id",
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- job = response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_method_retrieve(self, client: Mixedbread) -> None:
- job = client.extractions.jobs.retrieve(
- "job_id",
- )
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- def test_raw_response_retrieve(self, client: Mixedbread) -> None:
- response = client.extractions.jobs.with_raw_response.retrieve(
- "job_id",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- job = response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with client.extractions.jobs.with_streaming_response.retrieve(
- "job_id",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- job = response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
- client.extractions.jobs.with_raw_response.retrieve(
- "",
- )
-
-
-class TestAsyncJobs:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- job = await async_client.extractions.jobs.create(
- file_id="file_id",
- json_schema={},
- )
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.jobs.with_raw_response.create(
- file_id="file_id",
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- job = await response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.jobs.with_streaming_response.create(
- file_id="file_id",
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- job = await response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
- job = await async_client.extractions.jobs.retrieve(
- "job_id",
- )
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.jobs.with_raw_response.retrieve(
- "job_id",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- job = await response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- @parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.jobs.with_streaming_response.retrieve(
- "job_id",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- job = await response.parse()
- assert_matches_type(ExtractionJob, job, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
- await async_client.extractions.jobs.with_raw_response.retrieve(
- "",
- )
diff --git a/tests/api_resources/extractions/test_schema.py b/tests/api_resources/extractions/test_schema.py
deleted file mode 100644
index 5bff1298..00000000
--- a/tests/api_resources/extractions/test_schema.py
+++ /dev/null
@@ -1,212 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types.extractions import (
- CreatedJsonSchema,
- EnhancedJsonSchema,
- ValidatedJsonSchema,
-)
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestSchema:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- schema = client.extractions.schema.create(
- description="description",
- )
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.extractions.schema.with_raw_response.create(
- description="description",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = response.parse()
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.extractions.schema.with_streaming_response.create(
- description="description",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = response.parse()
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_method_enhance(self, client: Mixedbread) -> None:
- schema = client.extractions.schema.enhance(
- json_schema={},
- )
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_raw_response_enhance(self, client: Mixedbread) -> None:
- response = client.extractions.schema.with_raw_response.enhance(
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = response.parse()
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_streaming_response_enhance(self, client: Mixedbread) -> None:
- with client.extractions.schema.with_streaming_response.enhance(
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = response.parse()
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_method_validate(self, client: Mixedbread) -> None:
- schema = client.extractions.schema.validate(
- json_schema={},
- )
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_raw_response_validate(self, client: Mixedbread) -> None:
- response = client.extractions.schema.with_raw_response.validate(
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = response.parse()
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- @parametrize
- def test_streaming_response_validate(self, client: Mixedbread) -> None:
- with client.extractions.schema.with_streaming_response.validate(
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = response.parse()
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncSchema:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- schema = await async_client.extractions.schema.create(
- description="description",
- )
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.schema.with_raw_response.create(
- description="description",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = await response.parse()
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.schema.with_streaming_response.create(
- description="description",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = await response.parse()
- assert_matches_type(CreatedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_method_enhance(self, async_client: AsyncMixedbread) -> None:
- schema = await async_client.extractions.schema.enhance(
- json_schema={},
- )
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_raw_response_enhance(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.schema.with_raw_response.enhance(
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = await response.parse()
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_streaming_response_enhance(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.schema.with_streaming_response.enhance(
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = await response.parse()
- assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_method_validate(self, async_client: AsyncMixedbread) -> None:
- schema = await async_client.extractions.schema.validate(
- json_schema={},
- )
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_raw_response_validate(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.extractions.schema.with_raw_response.validate(
- json_schema={},
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- schema = await response.parse()
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- @parametrize
- async def test_streaming_response_validate(self, async_client: AsyncMixedbread) -> None:
- async with async_client.extractions.schema.with_streaming_response.validate(
- json_schema={},
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- schema = await response.parse()
- assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_completions.py b/tests/api_resources/test_completions.py
deleted file mode 100644
index af7af678..00000000
--- a/tests/api_resources/test_completions.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestCompletions:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- completion = client.completions.create()
- assert_matches_type(object, completion, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.completions.with_raw_response.create()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- completion = response.parse()
- assert_matches_type(object, completion, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.completions.with_streaming_response.create() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- completion = response.parse()
- assert_matches_type(object, completion, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncCompletions:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- completion = await async_client.completions.create()
- assert_matches_type(object, completion, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.completions.with_raw_response.create()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- completion = await response.parse()
- assert_matches_type(object, completion, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.completions.with_streaming_response.create() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- completion = await response.parse()
- assert_matches_type(object, completion, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py
deleted file mode 100644
index 62648a38..00000000
--- a/tests/api_resources/test_embeddings.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types import EmbeddingCreateResponse
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestEmbeddings:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- embedding = client.embeddings.create(
- input="This is a sample text input.",
- model="mixedbread-ai/mxbai-embed-large-v1",
- )
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
-
- @parametrize
- def test_method_create_with_all_params(self, client: Mixedbread) -> None:
- embedding = client.embeddings.create(
- input="This is a sample text input.",
- model="mixedbread-ai/mxbai-embed-large-v1",
- dimensions=768,
- encoding_format="float",
- normalized=True,
- prompt="Provide a detailed summary of the following text.",
- )
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.embeddings.with_raw_response.create(
- input="This is a sample text input.",
- model="mixedbread-ai/mxbai-embed-large-v1",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- embedding = response.parse()
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.embeddings.with_streaming_response.create(
- input="This is a sample text input.",
- model="mixedbread-ai/mxbai-embed-large-v1",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- embedding = response.parse()
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncEmbeddings:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- embedding = await async_client.embeddings.create(
- input="This is a sample text input.",
- model="mixedbread-ai/mxbai-embed-large-v1",
- )
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
-
- @parametrize
- async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
- embedding = await async_client.embeddings.create(
- input="This is a sample text input.",
- model="mixedbread-ai/mxbai-embed-large-v1",
- dimensions=768,
- encoding_format="float",
- normalized=True,
- prompt="Provide a detailed summary of the following text.",
- )
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.embeddings.with_raw_response.create(
- input="This is a sample text input.",
- model="mixedbread-ai/mxbai-embed-large-v1",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- embedding = await response.parse()
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.embeddings.with_streaming_response.create(
- input="This is a sample text input.",
- model="mixedbread-ai/mxbai-embed-large-v1",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- embedding = await response.parse()
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_reranking.py b/tests/api_resources/test_reranking.py
deleted file mode 100644
index 009148f5..00000000
--- a/tests/api_resources/test_reranking.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types import RerankingCreateResponse
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestReranking:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- reranking = client.reranking.create(
- input=["Document 1", "Document 2"],
- query="What is mixedbread ai?",
- )
- assert_matches_type(RerankingCreateResponse, reranking, path=["response"])
-
- @parametrize
- def test_method_create_with_all_params(self, client: Mixedbread) -> None:
- reranking = client.reranking.create(
- input=["Document 1", "Document 2"],
- query="What is mixedbread ai?",
- model="x",
- rank_fields=["field1", "field2"],
- return_input=False,
- top_k=10,
- )
- assert_matches_type(RerankingCreateResponse, reranking, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.reranking.with_raw_response.create(
- input=["Document 1", "Document 2"],
- query="What is mixedbread ai?",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- reranking = response.parse()
- assert_matches_type(RerankingCreateResponse, reranking, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.reranking.with_streaming_response.create(
- input=["Document 1", "Document 2"],
- query="What is mixedbread ai?",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- reranking = response.parse()
- assert_matches_type(RerankingCreateResponse, reranking, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncReranking:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- reranking = await async_client.reranking.create(
- input=["Document 1", "Document 2"],
- query="What is mixedbread ai?",
- )
- assert_matches_type(RerankingCreateResponse, reranking, path=["response"])
-
- @parametrize
- async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
- reranking = await async_client.reranking.create(
- input=["Document 1", "Document 2"],
- query="What is mixedbread ai?",
- model="x",
- rank_fields=["field1", "field2"],
- return_input=False,
- top_k=10,
- )
- assert_matches_type(RerankingCreateResponse, reranking, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.reranking.with_raw_response.create(
- input=["Document 1", "Document 2"],
- query="What is mixedbread ai?",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- reranking = await response.parse()
- assert_matches_type(RerankingCreateResponse, reranking, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.reranking.with_streaming_response.create(
- input=["Document 1", "Document 2"],
- query="What is mixedbread ai?",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- reranking = await response.parse()
- assert_matches_type(RerankingCreateResponse, reranking, path=["response"])
-
- assert cast(Any, response.is_closed) is True
From 5db0c4457a2fe972c4b7395a4f4b8883be107b61 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 28 Jan 2025 11:00:29 +0000
Subject: [PATCH 015/375] chore(internal): version bump (#80)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index b0699969..08e82c45 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.14"
+ ".": "0.1.0-alpha.15"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 7e826cff..d0f9be87 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.14"
+version = "0.1.0-alpha.15"
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 b7f02dac..0b722267 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.1.0-alpha.14" # x-release-please-version
+__version__ = "0.1.0-alpha.15" # x-release-please-version
From b70b2149c4782ab26ca8b053da7f528521e1fcb8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 14:12:28 +0000
Subject: [PATCH 016/375] feat(api): update via SDK Studio (#81)
---
.stats.yml | 2 +-
src/mixedbread/resources/vector_stores/files.py | 8 ++++++++
src/mixedbread/types/file_counts.py | 2 +-
.../types/vector_stores/file_create_params.py | 12 ++++++++++--
tests/api_resources/vector_stores/test_files.py | 2 ++
5 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 89832423..16f6a666 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 24
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-43906e7132098c54e8b761fa3bd67fbd9174894faeb22367a681e92f60f6445f.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-073867bf61fcd7c956b54d9c1ecb04dafa75523d10b3f25f2dcee85725184f1a.yml
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index ca063858..47a6cb4e 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -55,6 +55,7 @@ def create(
vector_store_id: str,
*,
file_id: str,
+ experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -76,6 +77,8 @@ def create(
file_id: ID of the file to add
+ experimental: Strategy for adding the file
+
metadata: Optional metadata for the file
extra_headers: Send extra headers
@@ -93,6 +96,7 @@ def create(
body=maybe_transform(
{
"file_id": file_id,
+ "experimental": experimental,
"metadata": metadata,
},
file_create_params.FileCreateParams,
@@ -345,6 +349,7 @@ async def create(
vector_store_id: str,
*,
file_id: str,
+ experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -366,6 +371,8 @@ async def create(
file_id: ID of the file to add
+ experimental: Strategy for adding the file
+
metadata: Optional metadata for the file
extra_headers: Send extra headers
@@ -383,6 +390,7 @@ async def create(
body=await async_maybe_transform(
{
"file_id": file_id,
+ "experimental": experimental,
"metadata": metadata,
},
file_create_params.FileCreateParams,
diff --git a/src/mixedbread/types/file_counts.py b/src/mixedbread/types/file_counts.py
index baad15f5..7da15d7e 100644
--- a/src/mixedbread/types/file_counts.py
+++ b/src/mixedbread/types/file_counts.py
@@ -9,7 +9,7 @@
class FileCounts(BaseModel):
cancelled: Optional[int] = None
- """Number of files whose processing was canceled"""
+ """Number of files whose processing was cancelled"""
completed: Optional[int] = None
"""Number of successfully processed files"""
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
index 930996a7..bed257a3 100644
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -2,14 +2,22 @@
from __future__ import annotations
-from typing_extensions import Required, TypedDict
+from typing_extensions import Literal, Required, TypedDict
-__all__ = ["FileCreateParams"]
+__all__ = ["FileCreateParams", "Experimental"]
class FileCreateParams(TypedDict, total=False):
file_id: Required[str]
"""ID of the file to add"""
+ experimental: Experimental
+ """Strategy for adding the file"""
+
metadata: object
"""Optional metadata for the file"""
+
+
+class Experimental(TypedDict, total=False):
+ parsing_strategy: Literal["fast", "high_quality"]
+ """Strategy for adding the file"""
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index fd783df7..d65933c9 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.create(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ experimental={"parsing_strategy": "fast"},
metadata={},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -320,6 +321,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.vector_stores.files.create(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ experimental={"parsing_strategy": "fast"},
metadata={},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
From f84812c433d66229315b8d6a654d3541c864b86c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 14:13:30 +0000
Subject: [PATCH 017/375] chore(internal): version bump (#83)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 08e82c45..7e56fe29 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.15"
+ ".": "0.1.0-alpha.16"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index d0f9be87..40cbc801 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.15"
+version = "0.1.0-alpha.16"
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 0b722267..66351393 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.1.0-alpha.15" # x-release-please-version
+__version__ = "0.1.0-alpha.16" # x-release-please-version
From 7c0cf836ebdd5a8bfc040cd2b72f6cc4fb0b12c2 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 14:28:18 +0000
Subject: [PATCH 018/375] chore: update SDK settings (#84)
---
README.md | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 6340a1c1..8351cc88 100644
--- a/README.md
+++ b/README.md
@@ -15,13 +15,10 @@ The REST API documentation can be found on [mixedbread.ai](https://mixedbread.ai
## Installation
```sh
-# install from the production repo
-pip install git+ssh://git@github.com/mixedbread-ai/mixedbread-python.git
+# install from PyPI
+pip install --pre mixedbread
```
-> [!NOTE]
-> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre mixedbread`
-
## Usage
The full API of this library can be found in [api.md](api.md).
From 98de476b51160c730142134fe7fbc6cfc5b691f9 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 14:38:31 +0000
Subject: [PATCH 019/375] chore(internal): version bump (#86)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 7e56fe29..e2f2c074 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.16"
+ ".": "0.1.0-alpha.17"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 40cbc801..68238354 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.16"
+version = "0.1.0-alpha.17"
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 66351393..42dcd22c 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.1.0-alpha.16" # x-release-please-version
+__version__ = "0.1.0-alpha.17" # x-release-please-version
From 856f40eb6be0be78309a57912aca6ca90f30708b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 14:59:07 +0000
Subject: [PATCH 020/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 16f6a666..87bccfa5 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 24
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-073867bf61fcd7c956b54d9c1ecb04dafa75523d10b3f25f2dcee85725184f1a.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-8d823477cb6d9c193492b79d7a52280e76535d9171df279807e4c145c29737e6.yml
From e61f74ab40fe05c9e57a4590e70e985ed3efe024 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 15:02:52 +0000
Subject: [PATCH 021/375] feat(api): update via SDK Studio (#87)
---
.stats.yml | 2 +-
src/mixedbread/resources/vector_stores/files.py | 8 --------
.../types/vector_stores/file_create_params.py | 12 ++----------
tests/api_resources/vector_stores/test_files.py | 2 --
4 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 87bccfa5..969910e7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 24
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-8d823477cb6d9c193492b79d7a52280e76535d9171df279807e4c145c29737e6.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-c3794b6810eb0c64f6393bd65a5413cf7f10c2cd89302724e170b1dfabbd241f.yml
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 47a6cb4e..ca063858 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -55,7 +55,6 @@ def create(
vector_store_id: str,
*,
file_id: str,
- experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -77,8 +76,6 @@ def create(
file_id: ID of the file to add
- experimental: Strategy for adding the file
-
metadata: Optional metadata for the file
extra_headers: Send extra headers
@@ -96,7 +93,6 @@ def create(
body=maybe_transform(
{
"file_id": file_id,
- "experimental": experimental,
"metadata": metadata,
},
file_create_params.FileCreateParams,
@@ -349,7 +345,6 @@ async def create(
vector_store_id: str,
*,
file_id: str,
- experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -371,8 +366,6 @@ async def create(
file_id: ID of the file to add
- experimental: Strategy for adding the file
-
metadata: Optional metadata for the file
extra_headers: Send extra headers
@@ -390,7 +383,6 @@ async def create(
body=await async_maybe_transform(
{
"file_id": file_id,
- "experimental": experimental,
"metadata": metadata,
},
file_create_params.FileCreateParams,
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
index bed257a3..930996a7 100644
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -2,22 +2,14 @@
from __future__ import annotations
-from typing_extensions import Literal, Required, TypedDict
+from typing_extensions import Required, TypedDict
-__all__ = ["FileCreateParams", "Experimental"]
+__all__ = ["FileCreateParams"]
class FileCreateParams(TypedDict, total=False):
file_id: Required[str]
"""ID of the file to add"""
- experimental: Experimental
- """Strategy for adding the file"""
-
metadata: object
"""Optional metadata for the file"""
-
-
-class Experimental(TypedDict, total=False):
- parsing_strategy: Literal["fast", "high_quality"]
- """Strategy for adding the file"""
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index d65933c9..fd783df7 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -35,7 +35,6 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.create(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={"parsing_strategy": "fast"},
metadata={},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -321,7 +320,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.vector_stores.files.create(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={"parsing_strategy": "fast"},
metadata={},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
From 62a397226839e3a11ae075bde9012a21e5eacb75 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 15:03:48 +0000
Subject: [PATCH 022/375] chore(internal): version bump (#89)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index e2f2c074..3cf71e62 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.17"
+ ".": "0.1.0-alpha.18"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 68238354..a560df63 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.17"
+version = "0.1.0-alpha.18"
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 42dcd22c..b99071d5 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.1.0-alpha.17" # x-release-please-version
+__version__ = "0.1.0-alpha.18" # x-release-please-version
From 200e5ee54f147afd7a63cc5c7c635e3034b3c24f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 15:04:17 +0000
Subject: [PATCH 023/375] feat(api): update via SDK Studio (#90)
---
.stats.yml | 2 +-
src/mixedbread/resources/vector_stores/files.py | 8 ++++++++
.../types/vector_stores/file_create_params.py | 12 ++++++++++--
tests/api_resources/vector_stores/test_files.py | 2 ++
4 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 969910e7..87bccfa5 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 24
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-c3794b6810eb0c64f6393bd65a5413cf7f10c2cd89302724e170b1dfabbd241f.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-8d823477cb6d9c193492b79d7a52280e76535d9171df279807e4c145c29737e6.yml
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index ca063858..47a6cb4e 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -55,6 +55,7 @@ def create(
vector_store_id: str,
*,
file_id: str,
+ experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -76,6 +77,8 @@ def create(
file_id: ID of the file to add
+ experimental: Strategy for adding the file
+
metadata: Optional metadata for the file
extra_headers: Send extra headers
@@ -93,6 +96,7 @@ def create(
body=maybe_transform(
{
"file_id": file_id,
+ "experimental": experimental,
"metadata": metadata,
},
file_create_params.FileCreateParams,
@@ -345,6 +349,7 @@ async def create(
vector_store_id: str,
*,
file_id: str,
+ experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -366,6 +371,8 @@ async def create(
file_id: ID of the file to add
+ experimental: Strategy for adding the file
+
metadata: Optional metadata for the file
extra_headers: Send extra headers
@@ -383,6 +390,7 @@ async def create(
body=await async_maybe_transform(
{
"file_id": file_id,
+ "experimental": experimental,
"metadata": metadata,
},
file_create_params.FileCreateParams,
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
index 930996a7..bed257a3 100644
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -2,14 +2,22 @@
from __future__ import annotations
-from typing_extensions import Required, TypedDict
+from typing_extensions import Literal, Required, TypedDict
-__all__ = ["FileCreateParams"]
+__all__ = ["FileCreateParams", "Experimental"]
class FileCreateParams(TypedDict, total=False):
file_id: Required[str]
"""ID of the file to add"""
+ experimental: Experimental
+ """Strategy for adding the file"""
+
metadata: object
"""Optional metadata for the file"""
+
+
+class Experimental(TypedDict, total=False):
+ parsing_strategy: Literal["fast", "high_quality"]
+ """Strategy for adding the file"""
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index fd783df7..d65933c9 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.create(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ experimental={"parsing_strategy": "fast"},
metadata={},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -320,6 +321,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.vector_stores.files.create(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ experimental={"parsing_strategy": "fast"},
metadata={},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
From 346267246daa03c788e1c60d477ea7416629d17a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 15:05:08 +0000
Subject: [PATCH 024/375] chore(internal): version bump (#92)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3cf71e62..b386befd 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.18"
+ ".": "0.1.0-alpha.19"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index a560df63..f9f90374 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.18"
+version = "0.1.0-alpha.19"
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 b99071d5..2ed661a0 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.1.0-alpha.18" # x-release-please-version
+__version__ = "0.1.0-alpha.19" # x-release-please-version
From 84baa875bfd98de823ad9f3650f731999cc58331 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 15:22:26 +0000
Subject: [PATCH 025/375] chore(internal): version bump (#95)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index b386befd..fac14074 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.19"
+ ".": "0.1.0-alpha.20"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index f9f90374..de0b01c9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.19"
+version = "0.1.0-alpha.20"
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 2ed661a0..2b98958f 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.1.0-alpha.19" # x-release-please-version
+__version__ = "0.1.0-alpha.20" # x-release-please-version
From bae2975c5f7929f54bcd79bd8b19d58858c716d4 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 21:07:23 +0000
Subject: [PATCH 026/375] feat(api): update via SDK Studio (#96)
---
SECURITY.md | 2 +-
pyproject.toml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/SECURITY.md b/SECURITY.md
index 83c8a2fe..dfffd682 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -20,7 +20,7 @@ or products provided by Mixedbread please follow the respective company's securi
### Mixedbread Terms and Policies
-Please contact support@mixedbread.ai for any questions or concerns regarding security of our services.
+Please contact support@mixedbread.ait for any questions or concerns regarding security of our services.
---
diff --git a/pyproject.toml b/pyproject.toml
index de0b01c9..02d937bf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,7 +5,7 @@ description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
-{ name = "Mixedbread", email = "support@mixedbread.ai" },
+{ name = "Mixedbread", email = "support@mixedbread.ait" },
]
dependencies = [
"httpx>=0.23.0, <1",
From 6d400f8b002dc5fad026e37b40a5dc606593995e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 21:08:18 +0000
Subject: [PATCH 027/375] chore(internal): version bump (#98)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index fac14074..7c31fce2 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.20"
+ ".": "0.1.0-alpha.21"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 02d937bf..615298e7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.20"
+version = "0.1.0-alpha.21"
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 2b98958f..95c9a01b 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.1.0-alpha.20" # x-release-please-version
+__version__ = "0.1.0-alpha.21" # x-release-please-version
From 2cb956f39c957b76824b69d5a72c75efd7ae8a1d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 21:08:45 +0000
Subject: [PATCH 028/375] feat(api): update via SDK Studio (#99)
---
SECURITY.md | 2 +-
pyproject.toml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/SECURITY.md b/SECURITY.md
index dfffd682..83c8a2fe 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -20,7 +20,7 @@ or products provided by Mixedbread please follow the respective company's securi
### Mixedbread Terms and Policies
-Please contact support@mixedbread.ait for any questions or concerns regarding security of our services.
+Please contact support@mixedbread.ai for any questions or concerns regarding security of our services.
---
diff --git a/pyproject.toml b/pyproject.toml
index 615298e7..76df44f5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,7 +5,7 @@ description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
-{ name = "Mixedbread", email = "support@mixedbread.ait" },
+{ name = "Mixedbread", email = "support@mixedbread.ai" },
]
dependencies = [
"httpx>=0.23.0, <1",
From 75fffdd03602beb0236ad72a7ba63a70f2c92c0b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 21:09:43 +0000
Subject: [PATCH 029/375] chore(internal): version bump (#101)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 7c31fce2..aa848759 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.21"
+ ".": "0.1.0-alpha.22"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 76df44f5..1f579185 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.21"
+version = "0.1.0-alpha.22"
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 95c9a01b..b630e2a9 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.1.0-alpha.21" # x-release-please-version
+__version__ = "0.1.0-alpha.22" # x-release-please-version
From 44807fb7b4f2de341911f912889a2ede3155f3bd Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 23:38:15 +0000
Subject: [PATCH 030/375] feat(api): update via SDK Studio (#102)
---
src/mixedbread/pagination.py | 28 +----
src/mixedbread/resources/parsing/jobs.py | 16 +--
.../resources/vector_stores/files.py | 32 ++---
.../resources/vector_stores/vector_stores.py | 118 +++++++++---------
src/mixedbread/types/file_counts.py | 6 +-
src/mixedbread/types/file_object.py | 18 +--
.../types/parsing/job_create_params.py | 6 +-
.../types/parsing/job_list_response.py | 14 +--
src/mixedbread/types/parsing/parsing_job.py | 50 ++++----
.../types/scored_vector_store_chunk.py | 30 ++---
.../types/shared/search_filter_condition.py | 6 +-
.../shared_params/search_filter_condition.py | 6 +-
src/mixedbread/types/vector_store.py | 30 ++---
.../types/vector_store_create_params.py | 10 +-
.../vector_store_question_answering_params.py | 22 ++--
.../vector_store_search_options_param.py | 10 +-
.../types/vector_store_search_params.py | 6 +-
.../types/vector_store_search_response.py | 6 +-
.../types/vector_store_update_params.py | 6 +-
.../types/vector_stores/file_create_params.py | 6 +-
.../types/vector_stores/file_search_params.py | 6 +-
.../vector_stores/file_search_response.py | 6 +-
.../vector_stores/scored_vector_store_file.py | 34 ++---
.../types/vector_stores/vector_store_file.py | 24 ++--
tests/api_resources/parsing/test_jobs.py | 4 +-
tests/api_resources/test_vector_stores.py | 92 +++++++-------
.../api_resources/vector_stores/test_files.py | 40 +++---
27 files changed, 307 insertions(+), 325 deletions(-)
diff --git a/src/mixedbread/pagination.py b/src/mixedbread/pagination.py
index b72f9fcc..8aeee17b 100644
--- a/src/mixedbread/pagination.py
+++ b/src/mixedbread/pagination.py
@@ -12,10 +12,10 @@
class LimitOffsetPagination(BaseModel):
- offset: Optional[int] = None
-
total: Optional[int] = None
+ offset: Optional[int] = None
+
class SyncLimitOffset(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
data: List[_T]
@@ -40,17 +40,7 @@ def next_page_info(self) -> Optional[PageInfo]:
length = len(self._get_page_items())
current_count = offset + length
- total = None
- if self.pagination is not None:
- if self.pagination.total is not None:
- total = self.pagination.total
- if total is None:
- return None
-
- if current_count < total:
- return PageInfo(params={"offset": current_count})
-
- return None
+ return PageInfo(params={"offset": current_count})
class AsyncLimitOffset(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
@@ -76,14 +66,4 @@ def next_page_info(self) -> Optional[PageInfo]:
length = len(self._get_page_items())
current_count = offset + length
- total = None
- if self.pagination is not None:
- if self.pagination.total is not None:
- total = self.pagination.total
- if total is None:
- return None
-
- if current_count < total:
- return PageInfo(params={"offset": current_count})
-
- return None
+ return PageInfo(params={"offset": current_count})
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index f2697023..24c214ef 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -54,7 +54,6 @@ def create(
self,
*,
file_id: str,
- chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN,
element_types: Optional[
List[
Literal[
@@ -73,6 +72,7 @@ def create(
]
]
| NotGiven = NOT_GIVEN,
+ chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN,
return_format: Literal["html", "markdown", "plain"] | 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.
@@ -91,10 +91,10 @@ def create(
Args:
file_id: The ID of the file to parse
- chunking_strategy: The strategy to use for chunking the content
-
element_types: The elements to extract from the document
+ chunking_strategy: The strategy to use for chunking the content
+
return_format: The format of the returned content
extra_headers: Send extra headers
@@ -110,8 +110,8 @@ def create(
body=maybe_transform(
{
"file_id": file_id,
- "chunking_strategy": chunking_strategy,
"element_types": element_types,
+ "chunking_strategy": chunking_strategy,
"return_format": return_format,
},
job_create_params.JobCreateParams,
@@ -316,7 +316,6 @@ async def create(
self,
*,
file_id: str,
- chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN,
element_types: Optional[
List[
Literal[
@@ -335,6 +334,7 @@ async def create(
]
]
| NotGiven = NOT_GIVEN,
+ chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN,
return_format: Literal["html", "markdown", "plain"] | 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.
@@ -353,10 +353,10 @@ async def create(
Args:
file_id: The ID of the file to parse
- chunking_strategy: The strategy to use for chunking the content
-
element_types: The elements to extract from the document
+ chunking_strategy: The strategy to use for chunking the content
+
return_format: The format of the returned content
extra_headers: Send extra headers
@@ -372,8 +372,8 @@ async def create(
body=await async_maybe_transform(
{
"file_id": file_id,
- "chunking_strategy": chunking_strategy,
"element_types": element_types,
+ "chunking_strategy": chunking_strategy,
"return_format": return_format,
},
job_create_params.JobCreateParams,
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 47a6cb4e..c02f54a4 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -55,8 +55,8 @@ def create(
vector_store_id: str,
*,
file_id: str,
- experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
+ experimental: file_create_params.Experimental | 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,
@@ -77,10 +77,10 @@ def create(
file_id: ID of the file to add
- experimental: Strategy for adding the file
-
metadata: Optional metadata for the file
+ experimental: Strategy for adding the file
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -96,8 +96,8 @@ def create(
body=maybe_transform(
{
"file_id": file_id,
- "experimental": experimental,
"metadata": metadata,
+ "experimental": experimental,
},
file_create_params.FileCreateParams,
),
@@ -258,9 +258,9 @@ def search(
*,
query: str,
vector_store_ids: List[str],
+ top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
- top_k: int | 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,
@@ -291,12 +291,12 @@ def search(
vector_store_ids: IDs of vector stores to search
+ top_k: Number of results to return
+
filters: Optional filter conditions
search_options: Search configuration options
- top_k: Number of results to return
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -311,9 +311,9 @@ def search(
{
"query": query,
"vector_store_ids": vector_store_ids,
+ "top_k": top_k,
"filters": filters,
"search_options": search_options,
- "top_k": top_k,
},
file_search_params.FileSearchParams,
),
@@ -349,8 +349,8 @@ async def create(
vector_store_id: str,
*,
file_id: str,
- experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
+ experimental: file_create_params.Experimental | 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,
@@ -371,10 +371,10 @@ async def create(
file_id: ID of the file to add
- experimental: Strategy for adding the file
-
metadata: Optional metadata for the file
+ experimental: Strategy for adding the file
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -390,8 +390,8 @@ async def create(
body=await async_maybe_transform(
{
"file_id": file_id,
- "experimental": experimental,
"metadata": metadata,
+ "experimental": experimental,
},
file_create_params.FileCreateParams,
),
@@ -552,9 +552,9 @@ async def search(
*,
query: str,
vector_store_ids: List[str],
+ top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
- top_k: int | 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,
@@ -585,12 +585,12 @@ async def search(
vector_store_ids: IDs of vector stores to search
+ top_k: Number of results to return
+
filters: Optional filter conditions
search_options: Search configuration options
- top_k: Number of results to return
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -605,9 +605,9 @@ async def search(
{
"query": query,
"vector_store_ids": vector_store_ids,
+ "top_k": top_k,
"filters": filters,
"search_options": search_options,
- "top_k": top_k,
},
file_search_params.FileSearchParams,
),
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 606e2b24..935d7335 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -72,11 +72,11 @@ def with_streaming_response(self) -> VectorStoresResourceWithStreamingResponse:
def create(
self,
*,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
- file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- name: Optional[str] | NotGiven = NOT_GIVEN,
+ file_ids: Optional[List[str]] | 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,
@@ -93,15 +93,15 @@ def create(
Returns: VectorStore: The response containing the created vector store details.
Args:
+ name: Name for the new vector store
+
description: Description of the vector store
expires_after: Represents an expiration policy for a vector store.
- file_ids: Optional list of file IDs
-
metadata: Optional metadata key-value pairs
- name: Name for the new vector store
+ file_ids: Optional list of file IDs
extra_headers: Send extra headers
@@ -115,11 +115,11 @@ def create(
"/v1/vector_stores",
body=maybe_transform(
{
+ "name": name,
"description": description,
"expires_after": expires_after,
- "file_ids": file_ids,
"metadata": metadata,
- "name": name,
+ "file_ids": file_ids,
},
vector_store_create_params.VectorStoreCreateParams,
),
@@ -172,10 +172,10 @@ def update(
self,
vector_store_id: str,
*,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- name: Optional[str] | 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,
@@ -195,14 +195,14 @@ def update(
Args:
vector_store_id: The ID of the vector store
+ name: New name for the vector store
+
description: New description
expires_after: Represents an expiration policy for a vector store.
metadata: Optional metadata key-value pairs
- name: New name for the vector store
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -217,10 +217,10 @@ def update(
f"/v1/vector_stores/{vector_store_id}",
body=maybe_transform(
{
+ "name": name,
"description": description,
"expires_after": expires_after,
"metadata": metadata,
- "name": name,
},
vector_store_update_params.VectorStoreUpdateParams,
),
@@ -323,13 +323,13 @@ def delete(
def question_answering(
self,
*,
+ query: str | NotGiven = NOT_GIVEN,
vector_store_ids: List[str],
+ top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
- query: str | NotGiven = NOT_GIVEN,
search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
- top_k: int | NotGiven = NOT_GIVEN,
+ qa_options: vector_store_question_answering_params.QaOptions | 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,
@@ -337,24 +337,25 @@ def question_answering(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
- """
- Question answering
+ """Question answering
Args:
- vector_store_ids: IDs of vector stores to search
+ query: Question to answer.
- filters: Optional filter conditions
+ If not provided, the question will be extracted from the
+ passed messages.
- qa_options: Question answering configuration options
+ vector_store_ids: IDs of vector stores to search
- query: Question to answer. If not provided, the question will be extracted from the
- passed messages.
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
search_options: Search configuration options
stream: Whether to stream the answer
- top_k: Number of results to return
+ qa_options: Question answering configuration options
extra_headers: Send extra headers
@@ -368,13 +369,13 @@ def question_answering(
"/v1/vector_stores/question-answering",
body=maybe_transform(
{
+ "query": query,
"vector_store_ids": vector_store_ids,
+ "top_k": top_k,
"filters": filters,
- "qa_options": qa_options,
- "query": query,
"search_options": search_options,
"stream": stream,
- "top_k": top_k,
+ "qa_options": qa_options,
},
vector_store_question_answering_params.VectorStoreQuestionAnsweringParams,
),
@@ -389,9 +390,9 @@ def search(
*,
query: str,
vector_store_ids: List[str],
+ top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
- top_k: int | 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,
@@ -421,12 +422,12 @@ def search(
vector_store_ids: IDs of vector stores to search
+ top_k: Number of results to return
+
filters: Optional filter conditions
search_options: Search configuration options
- top_k: Number of results to return
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -441,9 +442,9 @@ def search(
{
"query": query,
"vector_store_ids": vector_store_ids,
+ "top_k": top_k,
"filters": filters,
"search_options": search_options,
- "top_k": top_k,
},
vector_store_search_params.VectorStoreSearchParams,
),
@@ -481,11 +482,11 @@ def with_streaming_response(self) -> AsyncVectorStoresResourceWithStreamingRespo
async def create(
self,
*,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
- file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- name: Optional[str] | NotGiven = NOT_GIVEN,
+ file_ids: Optional[List[str]] | 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,
@@ -502,15 +503,15 @@ async def create(
Returns: VectorStore: The response containing the created vector store details.
Args:
+ name: Name for the new vector store
+
description: Description of the vector store
expires_after: Represents an expiration policy for a vector store.
- file_ids: Optional list of file IDs
-
metadata: Optional metadata key-value pairs
- name: Name for the new vector store
+ file_ids: Optional list of file IDs
extra_headers: Send extra headers
@@ -524,11 +525,11 @@ async def create(
"/v1/vector_stores",
body=await async_maybe_transform(
{
+ "name": name,
"description": description,
"expires_after": expires_after,
- "file_ids": file_ids,
"metadata": metadata,
- "name": name,
+ "file_ids": file_ids,
},
vector_store_create_params.VectorStoreCreateParams,
),
@@ -581,10 +582,10 @@ async def update(
self,
vector_store_id: str,
*,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- name: Optional[str] | 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,
@@ -604,14 +605,14 @@ async def update(
Args:
vector_store_id: The ID of the vector store
+ name: New name for the vector store
+
description: New description
expires_after: Represents an expiration policy for a vector store.
metadata: Optional metadata key-value pairs
- name: New name for the vector store
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -626,10 +627,10 @@ async def update(
f"/v1/vector_stores/{vector_store_id}",
body=await async_maybe_transform(
{
+ "name": name,
"description": description,
"expires_after": expires_after,
"metadata": metadata,
- "name": name,
},
vector_store_update_params.VectorStoreUpdateParams,
),
@@ -732,13 +733,13 @@ async def delete(
async def question_answering(
self,
*,
+ query: str | NotGiven = NOT_GIVEN,
vector_store_ids: List[str],
+ top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
- query: str | NotGiven = NOT_GIVEN,
search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
- top_k: int | NotGiven = NOT_GIVEN,
+ qa_options: vector_store_question_answering_params.QaOptions | 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,
@@ -746,24 +747,25 @@ async def question_answering(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
- """
- Question answering
+ """Question answering
Args:
- vector_store_ids: IDs of vector stores to search
+ query: Question to answer.
- filters: Optional filter conditions
+ If not provided, the question will be extracted from the
+ passed messages.
- qa_options: Question answering configuration options
+ vector_store_ids: IDs of vector stores to search
- query: Question to answer. If not provided, the question will be extracted from the
- passed messages.
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
search_options: Search configuration options
stream: Whether to stream the answer
- top_k: Number of results to return
+ qa_options: Question answering configuration options
extra_headers: Send extra headers
@@ -777,13 +779,13 @@ async def question_answering(
"/v1/vector_stores/question-answering",
body=await async_maybe_transform(
{
+ "query": query,
"vector_store_ids": vector_store_ids,
+ "top_k": top_k,
"filters": filters,
- "qa_options": qa_options,
- "query": query,
"search_options": search_options,
"stream": stream,
- "top_k": top_k,
+ "qa_options": qa_options,
},
vector_store_question_answering_params.VectorStoreQuestionAnsweringParams,
),
@@ -798,9 +800,9 @@ async def search(
*,
query: str,
vector_store_ids: List[str],
+ top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
- top_k: int | 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,
@@ -830,12 +832,12 @@ async def search(
vector_store_ids: IDs of vector stores to search
+ top_k: Number of results to return
+
filters: Optional filter conditions
search_options: Search configuration options
- top_k: Number of results to return
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -850,9 +852,9 @@ async def search(
{
"query": query,
"vector_store_ids": vector_store_ids,
+ "top_k": top_k,
"filters": filters,
"search_options": search_options,
- "top_k": top_k,
},
vector_store_search_params.VectorStoreSearchParams,
),
diff --git a/src/mixedbread/types/file_counts.py b/src/mixedbread/types/file_counts.py
index 7da15d7e..05ff3f63 100644
--- a/src/mixedbread/types/file_counts.py
+++ b/src/mixedbread/types/file_counts.py
@@ -8,6 +8,9 @@
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"""
@@ -17,8 +20,5 @@ class FileCounts(BaseModel):
failed: Optional[int] = None
"""Number of files that failed processing"""
- in_progress: Optional[int] = None
- """Number of files currently being processed"""
-
total: Optional[int] = None
"""Total number of files"""
diff --git a/src/mixedbread/types/file_object.py b/src/mixedbread/types/file_object.py
index 0b20b6fe..a237cc0d 100644
--- a/src/mixedbread/types/file_object.py
+++ b/src/mixedbread/types/file_object.py
@@ -11,20 +11,20 @@ class FileObject(BaseModel):
id: str
"""Unique identifier for the file"""
- bytes: int
- """Size of the file in bytes"""
-
- created_at: datetime
- """Timestamp when the file was created"""
-
filename: str
"""Name of the file including extension"""
+ bytes: int
+ """Size of the file in bytes"""
+
mime_type: str
"""MIME type of the file"""
- updated_at: datetime
- """Timestamp when the file was last updated"""
-
version: int
"""Version of the file"""
+
+ created_at: datetime
+ """Timestamp when the file was created"""
+
+ updated_at: datetime
+ """Timestamp when the file was last updated"""
diff --git a/src/mixedbread/types/parsing/job_create_params.py b/src/mixedbread/types/parsing/job_create_params.py
index a0d4602d..13ca1743 100644
--- a/src/mixedbread/types/parsing/job_create_params.py
+++ b/src/mixedbread/types/parsing/job_create_params.py
@@ -12,9 +12,6 @@ class JobCreateParams(TypedDict, total=False):
file_id: Required[str]
"""The ID of the file to parse"""
- chunking_strategy: Literal["page"]
- """The strategy to use for chunking the content"""
-
element_types: Optional[
List[
Literal[
@@ -34,5 +31,8 @@ class JobCreateParams(TypedDict, total=False):
]
"""The elements to extract from the document"""
+ chunking_strategy: Literal["page"]
+ """The strategy to use for chunking the content"""
+
return_format: Literal["html", "markdown", "plain"]
"""The format of the returned content"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index 3f16c84b..95bda9c8 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -16,17 +16,17 @@ class JobListResponse(BaseModel):
status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
"""The status of the job"""
- created_at: Optional[datetime] = None
- """The creation time of the job"""
+ started_at: Optional[datetime] = None
+ """The started time of the job"""
finished_at: Optional[datetime] = None
"""The finished time of the job"""
- object: Optional[Literal["parsing_job"]] = None
- """The type of the object"""
-
- started_at: Optional[datetime] = None
- """The started time of the job"""
+ created_at: Optional[datetime] = None
+ """The creation time of the job"""
updated_at: Optional[datetime] = None
"""The updated time of the job"""
+
+ object: Optional[Literal["parsing_job"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index 69a6beee..24882163 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -10,18 +10,6 @@
class ResultChunkElement(BaseModel):
- bbox: List[object]
- """The bounding box coordinates [x1, y1, x2, y2]"""
-
- confidence: float
- """The confidence score of the extraction"""
-
- content: str
- """The full content of the extracted element"""
-
- page: int
- """The page number where the element was found"""
-
type: Literal[
"caption",
"footnote",
@@ -37,6 +25,18 @@ class ResultChunkElement(BaseModel):
]
"""The type of the extracted element"""
+ confidence: float
+ """The confidence score of the extraction"""
+
+ bbox: List[object]
+ """The bounding box coordinates [x1, y1, x2, y2]"""
+
+ page: int
+ """The page number where the element was found"""
+
+ content: str
+ """The full content of the extracted element"""
+
summary: Optional[str] = None
"""A brief summary of the element's content"""
@@ -56,8 +56,8 @@ class Result(BaseModel):
chunking_strategy: Literal["page"]
"""The strategy used for chunking the document"""
- chunks: List[ResultChunk]
- """List of extracted chunks from the document"""
+ return_format: Literal["html", "markdown", "plain"]
+ """The format of the returned content"""
element_types: List[
Literal[
@@ -76,8 +76,8 @@ class Result(BaseModel):
]
"""The types of elements extracted"""
- return_format: Literal["html", "markdown", "plain"]
- """The format of the returned content"""
+ chunks: List[ResultChunk]
+ """List of extracted chunks from the document"""
class ParsingJob(BaseModel):
@@ -87,23 +87,23 @@ class ParsingJob(BaseModel):
status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
"""The status of the job"""
- created_at: Optional[datetime] = None
- """The creation time of the job"""
-
error: Optional[object] = None
"""The error of the job"""
- finished_at: Optional[datetime] = None
- """The finished time of the job"""
-
- object: Optional[Literal["parsing_job"]] = None
- """The type of the object"""
-
result: Optional[Result] = None
"""Result of document parsing operation."""
started_at: Optional[datetime] = None
"""The started time of the job"""
+ finished_at: Optional[datetime] = None
+ """The finished time of the job"""
+
+ created_at: Optional[datetime] = None
+ """The creation time of the job"""
+
updated_at: Optional[datetime] = None
"""The updated time of the job"""
+
+ object: Optional[Literal["parsing_job"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/scored_vector_store_chunk.py b/src/mixedbread/types/scored_vector_store_chunk.py
index 4ef37030..51a04ced 100644
--- a/src/mixedbread/types/scored_vector_store_chunk.py
+++ b/src/mixedbread/types/scored_vector_store_chunk.py
@@ -14,42 +14,42 @@ class ValueImageURLInputImage(BaseModel):
class ValueImageURLInput(BaseModel):
- image: ValueImageURLInputImage
- """The image input specification."""
-
type: Optional[Literal["image_url"]] = None
"""Input type identifier"""
+ image: ValueImageURLInputImage
+ """The image input specification."""
-class ValueTextInput(BaseModel):
- text: str
- """Text content to process"""
+class ValueTextInput(BaseModel):
type: Optional[Literal["text"]] = None
"""Input type identifier"""
+ text: str
+ """Text content to process"""
+
Value: TypeAlias = Union[str, ValueImageURLInput, ValueTextInput, Dict[str, object], None]
class ScoredVectorStoreChunk(BaseModel):
- file_id: str
- """file id"""
-
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"""
+
vector_store_id: str
"""vector store id"""
- content: Optional[str] = None
- """content of the chunk"""
-
metadata: Optional[object] = None
"""file metadata"""
-
- value: Optional[Value] = None
- """value of the chunk"""
diff --git a/src/mixedbread/types/shared/search_filter_condition.py b/src/mixedbread/types/shared/search_filter_condition.py
index 176185a7..9e6f8c6e 100644
--- a/src/mixedbread/types/shared/search_filter_condition.py
+++ b/src/mixedbread/types/shared/search_filter_condition.py
@@ -11,8 +11,8 @@ class SearchFilterCondition(BaseModel):
key: str
"""The field to apply the condition on"""
- operator: Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "not_like"]
- """The operator for the condition"""
-
value: object
"""The value to compare against"""
+
+ operator: Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "not_like"]
+ """The operator for the condition"""
diff --git a/src/mixedbread/types/shared_params/search_filter_condition.py b/src/mixedbread/types/shared_params/search_filter_condition.py
index 0d8ff30f..f2241f70 100644
--- a/src/mixedbread/types/shared_params/search_filter_condition.py
+++ b/src/mixedbread/types/shared_params/search_filter_condition.py
@@ -11,8 +11,8 @@ class SearchFilterCondition(TypedDict, total=False):
key: Required[str]
"""The field to apply the condition on"""
- operator: Required[Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "not_like"]]
- """The operator for the condition"""
-
value: Required[object]
"""The value to compare against"""
+
+ operator: Required[Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "not_like"]]
+ """The operator for the condition"""
diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py
index 870e7e7d..728e6f38 100644
--- a/src/mixedbread/types/vector_store.py
+++ b/src/mixedbread/types/vector_store.py
@@ -15,35 +15,35 @@ class VectorStore(BaseModel):
id: str
"""Unique identifier for the vector store"""
- created_at: datetime
- """Timestamp when the vector store was created"""
-
name: str
"""Name of the vector store"""
- updated_at: datetime
- """Timestamp when the vector store was last updated"""
-
description: Optional[str] = None
"""Detailed description of the vector store's purpose and contents"""
+ metadata: Optional[object] = None
+ """Additional metadata associated with the vector store"""
+
+ file_counts: Optional[FileCounts] = None
+ """Counts of files in different states"""
+
expires_after: Optional[ExpiresAfter] = None
"""Represents an expiration policy for a vector store."""
- expires_at: Optional[datetime] = None
- """Optional expiration timestamp for the vector store"""
+ status: Optional[Literal["expired", "in_progress", "completed"]] = None
+ """Processing status of the vector store"""
- file_counts: Optional[FileCounts] = None
- """Counts of files in different states"""
+ created_at: datetime
+ """Timestamp when the vector store was created"""
+
+ updated_at: datetime
+ """Timestamp when the vector store was last updated"""
last_active_at: Optional[datetime] = None
"""Timestamp when the vector store was last used"""
- metadata: Optional[object] = None
- """Additional metadata associated with the vector store"""
+ expires_at: Optional[datetime] = None
+ """Optional expiration timestamp for the vector store"""
object: Optional[Literal["vector_store"]] = None
"""Type of the object"""
-
- status: Optional[Literal["expired", "in_progress", "completed"]] = None
- """Processing status of the vector store"""
diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py
index c7b919c1..3013c59c 100644
--- a/src/mixedbread/types/vector_store_create_params.py
+++ b/src/mixedbread/types/vector_store_create_params.py
@@ -11,17 +11,17 @@
class VectorStoreCreateParams(TypedDict, total=False):
+ name: Optional[str]
+ """Name for the new vector store"""
+
description: Optional[str]
"""Description of the vector store"""
expires_after: Optional[ExpiresAfterParam]
"""Represents an expiration policy for a vector store."""
- file_ids: Optional[List[str]]
- """Optional list of file IDs"""
-
metadata: object
"""Optional metadata key-value pairs"""
- name: Optional[str]
- """Name for the new vector store"""
+ file_ids: Optional[List[str]]
+ """Optional list of file IDs"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index d74241b3..e64939de 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -12,29 +12,29 @@
class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
- vector_store_ids: Required[List[str]]
- """IDs of vector stores to search"""
-
- filters: Optional[Filters]
- """Optional filter conditions"""
-
- qa_options: QaOptions
- """Question answering configuration options"""
-
query: str
"""Question to answer.
If not provided, the question will be extracted from the passed messages.
"""
+ vector_store_ids: Required[List[str]]
+ """IDs of vector stores to search"""
+
+ top_k: int
+ """Number of results to return"""
+
+ filters: Optional[Filters]
+ """Optional filter conditions"""
+
search_options: VectorStoreSearchOptionsParam
"""Search configuration options"""
stream: bool
"""Whether to stream the answer"""
- top_k: int
- """Number of results to return"""
+ qa_options: QaOptions
+ """Question answering configuration options"""
FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
diff --git a/src/mixedbread/types/vector_store_search_options_param.py b/src/mixedbread/types/vector_store_search_options_param.py
index 8fbf7f0d..ed577188 100644
--- a/src/mixedbread/types/vector_store_search_options_param.py
+++ b/src/mixedbread/types/vector_store_search_options_param.py
@@ -8,14 +8,14 @@
class VectorStoreSearchOptionsParam(TypedDict, total=False):
- return_chunks: bool
- """Whether to return matching text chunks"""
-
return_metadata: bool
"""Whether to return file metadata"""
- rewrite_query: bool
- """Whether to rewrite the query"""
+ return_chunks: bool
+ """Whether to return matching text chunks"""
score_threshold: float
"""Minimum similarity score threshold"""
+
+ rewrite_query: bool
+ """Whether to rewrite the query"""
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 81559a57..137de12a 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -18,15 +18,15 @@ class VectorStoreSearchParams(TypedDict, total=False):
vector_store_ids: Required[List[str]]
"""IDs of vector stores to search"""
+ top_k: int
+ """Number of results to return"""
+
filters: Optional[Filters]
"""Optional filter conditions"""
search_options: VectorStoreSearchOptionsParam
"""Search configuration options"""
- top_k: int
- """Number of results to return"""
-
FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py
index ad653c35..bc7b860a 100644
--- a/src/mixedbread/types/vector_store_search_response.py
+++ b/src/mixedbread/types/vector_store_search_response.py
@@ -10,8 +10,8 @@
class VectorStoreSearchResponse(BaseModel):
- data: List[ScoredVectorStoreChunk]
- """The list of scored vector store file chunks"""
-
object: Optional[Literal["list"]] = None
"""The object type of the response"""
+
+ data: List[ScoredVectorStoreChunk]
+ """The list of scored vector store file chunks"""
diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py
index 3acbde1d..d8e6a83b 100644
--- a/src/mixedbread/types/vector_store_update_params.py
+++ b/src/mixedbread/types/vector_store_update_params.py
@@ -11,6 +11,9 @@
class VectorStoreUpdateParams(TypedDict, total=False):
+ name: Optional[str]
+ """New name for the vector store"""
+
description: Optional[str]
"""New description"""
@@ -19,6 +22,3 @@ class VectorStoreUpdateParams(TypedDict, total=False):
metadata: object
"""Optional metadata key-value pairs"""
-
- name: Optional[str]
- """New name for the vector store"""
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
index bed257a3..a64ff551 100644
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -11,12 +11,12 @@ class FileCreateParams(TypedDict, total=False):
file_id: Required[str]
"""ID of the file to add"""
- experimental: Experimental
- """Strategy for adding the file"""
-
metadata: object
"""Optional metadata for the file"""
+ experimental: Experimental
+ """Strategy for adding the file"""
+
class Experimental(TypedDict, total=False):
parsing_strategy: Literal["fast", "high_quality"]
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 246e52a6..726f2eec 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -18,15 +18,15 @@ class FileSearchParams(TypedDict, total=False):
vector_store_ids: Required[List[str]]
"""IDs of vector stores to search"""
+ top_k: int
+ """Number of results to return"""
+
filters: Optional[Filters]
"""Optional filter conditions"""
search_options: VectorStoreSearchOptionsParam
"""Search configuration options"""
- top_k: int
- """Number of results to return"""
-
FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
diff --git a/src/mixedbread/types/vector_stores/file_search_response.py b/src/mixedbread/types/vector_stores/file_search_response.py
index 338a98da..a7432675 100644
--- a/src/mixedbread/types/vector_stores/file_search_response.py
+++ b/src/mixedbread/types/vector_stores/file_search_response.py
@@ -10,8 +10,8 @@
class FileSearchResponse(BaseModel):
- data: List[ScoredVectorStoreFile]
- """The list of scored vector store files"""
-
object: Optional[Literal["list"]] = None
"""The object type of the response"""
+
+ data: List[ScoredVectorStoreFile]
+ """The list of scored vector store files"""
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 02df064c..9949b8c9 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -14,32 +14,32 @@ class ScoredVectorStoreFile(BaseModel):
id: str
"""Unique identifier for the file"""
- chunks: List[ScoredVectorStoreChunk]
- """chunks"""
+ metadata: Optional[object] = None
+ """Optional file metadata"""
- created_at: datetime
- """Timestamp of vector store file creation"""
+ status: Optional[str] = None
+ """Processing status of the file"""
- score: float
- """score of the file"""
+ last_error: Optional[object] = None
+ """Last error message if processing failed"""
vector_store_id: str
"""ID of the containing vector store"""
- last_error: Optional[object] = None
- """Last error message if processing failed"""
+ created_at: datetime
+ """Timestamp of vector store file creation"""
- metadata: Optional[object] = None
- """Optional file metadata"""
+ version: Optional[int] = None
+ """Version number of the file"""
+
+ usage_bytes: Optional[int] = None
+ """Storage usage in bytes"""
object: Optional[Literal["vector_store.file"]] = None
"""Type of the object"""
- status: Optional[str] = None
- """Processing status of the file"""
-
- usage_bytes: Optional[int] = None
- """Storage usage in bytes"""
+ score: float
+ """score of the file"""
- version: Optional[int] = None
- """Version number of the file"""
+ chunks: List[ScoredVectorStoreChunk]
+ """chunks"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index d926ce73..18c28ce0 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -13,26 +13,26 @@ class VectorStoreFile(BaseModel):
id: str
"""Unique identifier for the file"""
- created_at: datetime
- """Timestamp of vector store file creation"""
+ metadata: Optional[object] = None
+ """Optional file metadata"""
- vector_store_id: str
- """ID of the containing vector store"""
+ status: Optional[str] = None
+ """Processing status of the file"""
last_error: Optional[object] = None
"""Last error message if processing failed"""
- metadata: Optional[object] = None
- """Optional file metadata"""
+ vector_store_id: str
+ """ID of the containing vector store"""
- object: Optional[Literal["vector_store.file"]] = None
- """Type of the object"""
+ created_at: datetime
+ """Timestamp of vector store file creation"""
- status: Optional[str] = None
- """Processing status of the file"""
+ version: Optional[int] = None
+ """Version number of the file"""
usage_bytes: Optional[int] = None
"""Storage usage in bytes"""
- version: Optional[int] = None
- """Version number of the file"""
+ object: Optional[Literal["vector_store.file"]] = None
+ """Type of the object"""
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 33a8b99c..55cd95bc 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -29,8 +29,8 @@ def test_method_create(self, client: Mixedbread) -> None:
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
job = client.parsing.jobs.create(
file_id="file_id",
- chunking_strategy="page",
element_types=["caption"],
+ chunking_strategy="page",
return_format="html",
)
assert_matches_type(ParsingJob, job, path=["response"])
@@ -221,8 +221,8 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.create(
file_id="file_id",
- chunking_strategy="page",
element_types=["caption"],
+ chunking_strategy="page",
return_format="html",
)
assert_matches_type(ParsingJob, job, path=["response"])
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 2362af46..3e587708 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -30,14 +30,14 @@ def test_method_create(self, client: Mixedbread) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.create(
+ name="Technical Documentation",
description="Contains technical specifications and guides",
expires_after={
"anchor": "last_active_at",
"days": 0,
},
- file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
metadata={},
- name="Technical Documentation",
+ file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(VectorStore, vector_store, path=["response"])
@@ -110,13 +110,13 @@ def test_method_update(self, client: Mixedbread) -> None:
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",
expires_after={
"anchor": "last_active_at",
"days": 0,
},
metadata={},
- name="x",
)
assert_matches_type(VectorStore, vector_store, path=["response"])
@@ -232,55 +232,55 @@ def test_method_question_answering(self, client: Mixedbread) -> None:
@parametrize
def test_method_question_answering_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.question_answering(
+ query="x",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ top_k=1,
filters={
"all": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"any": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"none": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
},
- qa_options={"cite": True},
- query="x",
search_options={
- "return_chunks": True,
"return_metadata": True,
- "rewrite_query": True,
+ "return_chunks": True,
"score_threshold": 0,
+ "rewrite_query": True,
},
stream=True,
- top_k=1,
+ qa_options={"cite": True},
)
assert_matches_type(object, vector_store, path=["response"])
@@ -321,51 +321,51 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.search(
query="how to configure SSL",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ top_k=1,
filters={
"all": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"any": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"none": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
},
search_options={
- "return_chunks": True,
"return_metadata": True,
- "rewrite_query": True,
+ "return_chunks": True,
"score_threshold": 0,
+ "rewrite_query": True,
},
- top_k=1,
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@@ -407,14 +407,14 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.create(
+ name="Technical Documentation",
description="Contains technical specifications and guides",
expires_after={
"anchor": "last_active_at",
"days": 0,
},
- file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
metadata={},
- name="Technical Documentation",
+ file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(VectorStore, vector_store, path=["response"])
@@ -487,13 +487,13 @@ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.update(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="x",
description="x",
expires_after={
"anchor": "last_active_at",
"days": 0,
},
metadata={},
- name="x",
)
assert_matches_type(VectorStore, vector_store, path=["response"])
@@ -609,55 +609,55 @@ async def test_method_question_answering(self, async_client: AsyncMixedbread) ->
@parametrize
async def test_method_question_answering_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.question_answering(
+ query="x",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ top_k=1,
filters={
"all": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"any": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"none": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
},
- qa_options={"cite": True},
- query="x",
search_options={
- "return_chunks": True,
"return_metadata": True,
- "rewrite_query": True,
+ "return_chunks": True,
"score_threshold": 0,
+ "rewrite_query": True,
},
stream=True,
- top_k=1,
+ qa_options={"cite": True},
)
assert_matches_type(object, vector_store, path=["response"])
@@ -698,51 +698,51 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store = await async_client.vector_stores.search(
query="how to configure SSL",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ top_k=1,
filters={
"all": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"any": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"none": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
},
search_options={
- "return_chunks": True,
"return_metadata": True,
- "rewrite_query": True,
+ "return_chunks": True,
"score_threshold": 0,
+ "rewrite_query": True,
},
- top_k=1,
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index d65933c9..3aafe3e6 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -35,8 +35,8 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.create(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={"parsing_strategy": "fast"},
metadata={},
+ experimental={"parsing_strategy": "fast"},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -230,51 +230,51 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.search(
query="how to configure SSL",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ top_k=1,
filters={
"all": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"any": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"none": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
},
search_options={
- "return_chunks": True,
"return_metadata": True,
- "rewrite_query": True,
+ "return_chunks": True,
"score_threshold": 0,
+ "rewrite_query": True,
},
- top_k=1,
)
assert_matches_type(FileSearchResponse, file, path=["response"])
@@ -321,8 +321,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.vector_stores.files.create(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={"parsing_strategy": "fast"},
metadata={},
+ experimental={"parsing_strategy": "fast"},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -516,51 +516,51 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.vector_stores.files.search(
query="how to configure SSL",
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ top_k=1,
filters={
"all": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"any": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
"none": [
{
"key": "price",
- "operator": "eq",
"value": "100",
+ "operator": "eq",
},
{
"key": "color",
- "operator": "eq",
"value": "red",
+ "operator": "eq",
},
],
},
search_options={
- "return_chunks": True,
"return_metadata": True,
- "rewrite_query": True,
+ "return_chunks": True,
"score_threshold": 0,
+ "rewrite_query": True,
},
- top_k=1,
)
assert_matches_type(FileSearchResponse, file, path=["response"])
From 590b39312f8d74badca3ab94daa7699c22bfa9f3 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 29 Jan 2025 23:39:08 +0000
Subject: [PATCH 031/375] chore(internal): version bump (#104)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index aa848759..1c0bb885 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.22"
+ ".": "0.1.0-alpha.23"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 1f579185..8c8e2df9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.22"
+version = "0.1.0-alpha.23"
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 b630e2a9..cfa5102a 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.1.0-alpha.22" # x-release-please-version
+__version__ = "0.1.0-alpha.23" # x-release-please-version
From e74d487a70f08dcfb586f0a5cce52bfbe22780f8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 31 Jan 2025 03:20:12 +0000
Subject: [PATCH 032/375] chore(internal): codegen related update (#105)
---
src/mixedbread/pagination.py | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/pagination.py b/src/mixedbread/pagination.py
index 8aeee17b..b7df01d1 100644
--- a/src/mixedbread/pagination.py
+++ b/src/mixedbread/pagination.py
@@ -40,7 +40,17 @@ def next_page_info(self) -> Optional[PageInfo]:
length = len(self._get_page_items())
current_count = offset + length
- return PageInfo(params={"offset": current_count})
+ total = None
+ if self.pagination is not None:
+ if self.pagination.total is not None:
+ total = self.pagination.total
+ if total is None:
+ return None
+
+ if current_count < total:
+ return PageInfo(params={"offset": current_count})
+
+ return None
class AsyncLimitOffset(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
@@ -66,4 +76,14 @@ def next_page_info(self) -> Optional[PageInfo]:
length = len(self._get_page_items())
current_count = offset + length
- return PageInfo(params={"offset": current_count})
+ total = None
+ if self.pagination is not None:
+ if self.pagination.total is not None:
+ total = self.pagination.total
+ if total is None:
+ return None
+
+ if current_count < total:
+ return PageInfo(params={"offset": current_count})
+
+ return None
From 0a0906fff6e75742938b87cc5722d2dcfb70c420 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 4 Feb 2025 03:19:21 +0000
Subject: [PATCH 033/375] chore(internal): change default timeout to an int
(#107)
---
src/mixedbread/_constants.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mixedbread/_constants.py b/src/mixedbread/_constants.py
index a2ac3b6f..6ddf2c71 100644
--- a/src/mixedbread/_constants.py
+++ b/src/mixedbread/_constants.py
@@ -6,7 +6,7 @@
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"
# default timeout is 1 minute
-DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0)
+DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0)
DEFAULT_MAX_RETRIES = 2
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)
From 96fc558b36825d153ef6c7b25d2b6e3af11761fc Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 4 Feb 2025 03:21:02 +0000
Subject: [PATCH 034/375] chore(internal): bummp ruff dependency (#108)
---
pyproject.toml | 2 +-
requirements-dev.lock | 2 +-
scripts/utils/ruffen-docs.py | 4 ++--
src/mixedbread/_models.py | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 8c8e2df9..f8d4b9f7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -177,7 +177,7 @@ select = [
"T201",
"T203",
# misuse of typing.TYPE_CHECKING
- "TCH004",
+ "TC004",
# import rules
"TID251",
]
diff --git a/requirements-dev.lock b/requirements-dev.lock
index c8c44ee4..932688f2 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -78,7 +78,7 @@ pytz==2023.3.post1
# via dirty-equals
respx==0.22.0
rich==13.7.1
-ruff==0.6.9
+ruff==0.9.4
setuptools==68.2.2
# via nodeenv
six==1.16.0
diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py
index 37b3d94f..0cf2bd2f 100644
--- a/scripts/utils/ruffen-docs.py
+++ b/scripts/utils/ruffen-docs.py
@@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str:
with _collect_error(match):
code = format_code_block(code)
code = textwrap.indent(code, match["indent"])
- return f'{match["before"]}{code}{match["after"]}'
+ return f"{match['before']}{code}{match['after']}"
def _pycon_match(match: Match[str]) -> str:
code = ""
@@ -97,7 +97,7 @@ def finish_fragment() -> None:
def _md_pycon_match(match: Match[str]) -> str:
code = _pycon_match(match)
code = textwrap.indent(code, match["indent"])
- return f'{match["before"]}{code}{match["after"]}'
+ return f"{match['before']}{code}{match['after']}"
src = MD_RE.sub(_md_match, src)
src = MD_PYCON_RE.sub(_md_pycon_match, src)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 9a918aab..12c34b7d 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -172,7 +172,7 @@ def to_json(
@override
def __str__(self) -> str:
# mypy complains about an invalid self arg
- return f'{self.__repr_name__()}({self.__repr_str__(", ")})' # type: ignore[misc]
+ return f"{self.__repr_name__()}({self.__repr_str__(', ')})" # type: ignore[misc]
# Override the 'construct' method in a way that supports recursive parsing without validation.
# Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836.
From a768c182aa3af5a703d801c7ef71a0862b30becf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 4 Feb 2025 03:22:54 +0000
Subject: [PATCH 035/375] chore(internal): use TypeAliasType for type aliases
(#109)
---
src/mixedbread/types/shared/search_filter.py | 19 +++++++++++++-----
.../types/shared_params/search_filter.py | 20 ++++++++++++++-----
2 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py
index 76eaab35..4835d18d 100644
--- a/src/mixedbread/types/shared/search_filter.py
+++ b/src/mixedbread/types/shared/search_filter.py
@@ -2,8 +2,8 @@
from __future__ import annotations
-from typing import List, Union, Optional
-from typing_extensions import TypeAlias
+from typing import TYPE_CHECKING, List, Union, Optional
+from typing_extensions import TypeAlias, TypeAliasType
from ..._compat import PYDANTIC_V2
from ..._models import BaseModel
@@ -11,11 +11,20 @@
__all__ = ["SearchFilter", "All", "Any", "NoneType"]
-All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+if TYPE_CHECKING or PYDANTIC_V2:
+ All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
+else:
+ All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+if TYPE_CHECKING or PYDANTIC_V2:
+ Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
+else:
+ Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+if TYPE_CHECKING or PYDANTIC_V2:
+ NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
+else:
+ NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
class SearchFilter(BaseModel):
diff --git a/src/mixedbread/types/shared_params/search_filter.py b/src/mixedbread/types/shared_params/search_filter.py
index 455119db..a952a27a 100644
--- a/src/mixedbread/types/shared_params/search_filter.py
+++ b/src/mixedbread/types/shared_params/search_filter.py
@@ -2,18 +2,28 @@
from __future__ import annotations
-from typing import Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict
+from typing import TYPE_CHECKING, Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict, TypeAliasType
+from ..._compat import PYDANTIC_V2
from .search_filter_condition import SearchFilterCondition
__all__ = ["SearchFilter", "All", "Any", "NoneType"]
-All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+if TYPE_CHECKING or PYDANTIC_V2:
+ All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
+else:
+ All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+if TYPE_CHECKING or PYDANTIC_V2:
+ Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
+else:
+ Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+if TYPE_CHECKING or PYDANTIC_V2:
+ NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
+else:
+ NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
class SearchFilter(TypedDict, total=False):
From 470dd46e7a368b28e264391b44e865dd4e053cac Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 6 Feb 2025 03:41:49 +0000
Subject: [PATCH 036/375] feat(client): send `X-Stainless-Read-Timeout` header
(#110)
---
src/mixedbread/_base_client.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 0be06c72..318d56dc 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -418,10 +418,17 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0
if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers:
headers[idempotency_header] = options.idempotency_key or self._idempotency_key()
- # Don't set the retry count header if it was already set or removed by the caller. We check
+ # Don't set these headers if they were already set or removed by the caller. We check
# `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
- if "x-stainless-retry-count" not in (header.lower() for header in custom_headers):
+ lower_custom_headers = [header.lower() for header in custom_headers]
+ if "x-stainless-retry-count" not in lower_custom_headers:
headers["x-stainless-retry-count"] = str(retries_taken)
+ if "x-stainless-read-timeout" not in lower_custom_headers:
+ timeout = self.timeout if isinstance(options.timeout, NotGiven) else options.timeout
+ if isinstance(timeout, Timeout):
+ timeout = timeout.read
+ if timeout is not None:
+ headers["x-stainless-read-timeout"] = str(timeout)
return headers
From 4b5b8c5b0eae3efc766f2673da2292641c343646 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 6 Feb 2025 07:38:03 +0000
Subject: [PATCH 037/375] feat(api): update via SDK Studio (#111)
---
.stats.yml | 2 +-
api.md | 41 ++
src/mixedbread/_client.py | 9 +
src/mixedbread/resources/__init__.py | 14 +
.../resources/extractions/__init__.py | 61 +++
.../resources/extractions/content.py | 196 ++++++++++
.../resources/extractions/extractions.py | 166 ++++++++
src/mixedbread/resources/extractions/jobs.py | 286 ++++++++++++++
.../resources/extractions/schema.py | 356 ++++++++++++++++++
src/mixedbread/types/extractions/__init__.py | 14 +
.../extractions/content_create_params.py | 15 +
.../types/extractions/created_json_schema.py | 11 +
.../types/extractions/enhanced_json_schema.py | 11 +
.../types/extractions/extraction_job.py | 13 +
.../types/extractions/extraction_result.py | 11 +
.../types/extractions/job_create_params.py | 15 +
.../types/extractions/schema_create_params.py | 12 +
.../extractions/schema_enhance_params.py | 12 +
.../extractions/schema_validate_params.py | 12 +
.../extractions/validated_json_schema.py | 18 +
tests/api_resources/extractions/__init__.py | 1 +
.../api_resources/extractions/test_content.py | 90 +++++
tests/api_resources/extractions/test_jobs.py | 166 ++++++++
.../api_resources/extractions/test_schema.py | 212 +++++++++++
24 files changed, 1743 insertions(+), 1 deletion(-)
create mode 100644 src/mixedbread/resources/extractions/__init__.py
create mode 100644 src/mixedbread/resources/extractions/content.py
create mode 100644 src/mixedbread/resources/extractions/extractions.py
create mode 100644 src/mixedbread/resources/extractions/jobs.py
create mode 100644 src/mixedbread/resources/extractions/schema.py
create mode 100644 src/mixedbread/types/extractions/__init__.py
create mode 100644 src/mixedbread/types/extractions/content_create_params.py
create mode 100644 src/mixedbread/types/extractions/created_json_schema.py
create mode 100644 src/mixedbread/types/extractions/enhanced_json_schema.py
create mode 100644 src/mixedbread/types/extractions/extraction_job.py
create mode 100644 src/mixedbread/types/extractions/extraction_result.py
create mode 100644 src/mixedbread/types/extractions/job_create_params.py
create mode 100644 src/mixedbread/types/extractions/schema_create_params.py
create mode 100644 src/mixedbread/types/extractions/schema_enhance_params.py
create mode 100644 src/mixedbread/types/extractions/schema_validate_params.py
create mode 100644 src/mixedbread/types/extractions/validated_json_schema.py
create mode 100644 tests/api_resources/extractions/__init__.py
create mode 100644 tests/api_resources/extractions/test_content.py
create mode 100644 tests/api_resources/extractions/test_jobs.py
create mode 100644 tests/api_resources/extractions/test_schema.py
diff --git a/.stats.yml b/.stats.yml
index 87bccfa5..7e00acb0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 24
+configured_endpoints: 30
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-8d823477cb6d9c193492b79d7a52280e76535d9171df279807e4c145c29737e6.yml
diff --git a/api.md b/api.md
index c19bfce7..be50ff97 100644
--- a/api.md
+++ b/api.md
@@ -98,3 +98,44 @@ Methods:
- client.vector_stores.files.list(vector_store_id, \*\*params) -> SyncLimitOffset[VectorStoreFile]
- client.vector_stores.files.delete(file_id, \*, vector_store_id) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
+
+# Extractions
+
+## Jobs
+
+Types:
+
+```python
+from mixedbread.types.extractions import ExtractionJob
+```
+
+Methods:
+
+- client.extractions.jobs.create(\*\*params) -> ExtractionJob
+- client.extractions.jobs.retrieve(job_id) -> ExtractionJob
+
+## Schema
+
+Types:
+
+```python
+from mixedbread.types.extractions import CreatedJsonSchema, EnhancedJsonSchema, ValidatedJsonSchema
+```
+
+Methods:
+
+- client.extractions.schema.create(\*\*params) -> CreatedJsonSchema
+- client.extractions.schema.enhance(\*\*params) -> EnhancedJsonSchema
+- client.extractions.schema.validate(\*\*params) -> ValidatedJsonSchema
+
+## Content
+
+Types:
+
+```python
+from mixedbread.types.extractions import ExtractionResult
+```
+
+Methods:
+
+- client.extractions.content.create(\*\*params) -> ExtractionResult
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 9358b2b4..9b142105 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -44,6 +44,7 @@
)
from .resources.parsing import parsing
from .types.info_response import InfoResponse
+from .resources.extractions import extractions
from .resources.vector_stores import vector_stores
__all__ = [
@@ -68,6 +69,7 @@ class Mixedbread(SyncAPIClient):
parsing: parsing.ParsingResource
files: files.FilesResource
vector_stores: vector_stores.VectorStoresResource
+ extractions: extractions.ExtractionsResource
with_raw_response: MixedbreadWithRawResponse
with_streaming_response: MixedbreadWithStreamedResponse
@@ -152,6 +154,7 @@ def __init__(
self.parsing = parsing.ParsingResource(self)
self.files = files.FilesResource(self)
self.vector_stores = vector_stores.VectorStoresResource(self)
+ self.extractions = extractions.ExtractionsResource(self)
self.with_raw_response = MixedbreadWithRawResponse(self)
self.with_streaming_response = MixedbreadWithStreamedResponse(self)
@@ -289,6 +292,7 @@ class AsyncMixedbread(AsyncAPIClient):
parsing: parsing.AsyncParsingResource
files: files.AsyncFilesResource
vector_stores: vector_stores.AsyncVectorStoresResource
+ extractions: extractions.AsyncExtractionsResource
with_raw_response: AsyncMixedbreadWithRawResponse
with_streaming_response: AsyncMixedbreadWithStreamedResponse
@@ -373,6 +377,7 @@ def __init__(
self.parsing = parsing.AsyncParsingResource(self)
self.files = files.AsyncFilesResource(self)
self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
+ self.extractions = extractions.AsyncExtractionsResource(self)
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)
@@ -511,6 +516,7 @@ def __init__(self, client: Mixedbread) -> None:
self.parsing = parsing.ParsingResourceWithRawResponse(client.parsing)
self.files = files.FilesResourceWithRawResponse(client.files)
self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
+ self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
self.info = to_raw_response_wrapper(
client.info,
@@ -522,6 +528,7 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.parsing = parsing.AsyncParsingResourceWithRawResponse(client.parsing)
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
+ self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
self.info = async_to_raw_response_wrapper(
client.info,
@@ -533,6 +540,7 @@ def __init__(self, client: Mixedbread) -> None:
self.parsing = parsing.ParsingResourceWithStreamingResponse(client.parsing)
self.files = files.FilesResourceWithStreamingResponse(client.files)
self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
+ self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
self.info = to_streamed_response_wrapper(
client.info,
@@ -544,6 +552,7 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.parsing = parsing.AsyncParsingResourceWithStreamingResponse(client.parsing)
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
+ self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
self.info = async_to_streamed_response_wrapper(
client.info,
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index d1fe9468..3aac6ed5 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -16,6 +16,14 @@
ParsingResourceWithStreamingResponse,
AsyncParsingResourceWithStreamingResponse,
)
+from .extractions import (
+ ExtractionsResource,
+ AsyncExtractionsResource,
+ ExtractionsResourceWithRawResponse,
+ AsyncExtractionsResourceWithRawResponse,
+ ExtractionsResourceWithStreamingResponse,
+ AsyncExtractionsResourceWithStreamingResponse,
+)
from .vector_stores import (
VectorStoresResource,
AsyncVectorStoresResource,
@@ -44,4 +52,10 @@
"AsyncVectorStoresResourceWithRawResponse",
"VectorStoresResourceWithStreamingResponse",
"AsyncVectorStoresResourceWithStreamingResponse",
+ "ExtractionsResource",
+ "AsyncExtractionsResource",
+ "ExtractionsResourceWithRawResponse",
+ "AsyncExtractionsResourceWithRawResponse",
+ "ExtractionsResourceWithStreamingResponse",
+ "AsyncExtractionsResourceWithStreamingResponse",
]
diff --git a/src/mixedbread/resources/extractions/__init__.py b/src/mixedbread/resources/extractions/__init__.py
new file mode 100644
index 00000000..d9a42002
--- /dev/null
+++ b/src/mixedbread/resources/extractions/__init__.py
@@ -0,0 +1,61 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .jobs import (
+ JobsResource,
+ AsyncJobsResource,
+ JobsResourceWithRawResponse,
+ AsyncJobsResourceWithRawResponse,
+ JobsResourceWithStreamingResponse,
+ AsyncJobsResourceWithStreamingResponse,
+)
+from .schema import (
+ SchemaResource,
+ AsyncSchemaResource,
+ SchemaResourceWithRawResponse,
+ AsyncSchemaResourceWithRawResponse,
+ SchemaResourceWithStreamingResponse,
+ AsyncSchemaResourceWithStreamingResponse,
+)
+from .content import (
+ ContentResource,
+ AsyncContentResource,
+ ContentResourceWithRawResponse,
+ AsyncContentResourceWithRawResponse,
+ ContentResourceWithStreamingResponse,
+ AsyncContentResourceWithStreamingResponse,
+)
+from .extractions import (
+ ExtractionsResource,
+ AsyncExtractionsResource,
+ ExtractionsResourceWithRawResponse,
+ AsyncExtractionsResourceWithRawResponse,
+ ExtractionsResourceWithStreamingResponse,
+ AsyncExtractionsResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "JobsResource",
+ "AsyncJobsResource",
+ "JobsResourceWithRawResponse",
+ "AsyncJobsResourceWithRawResponse",
+ "JobsResourceWithStreamingResponse",
+ "AsyncJobsResourceWithStreamingResponse",
+ "SchemaResource",
+ "AsyncSchemaResource",
+ "SchemaResourceWithRawResponse",
+ "AsyncSchemaResourceWithRawResponse",
+ "SchemaResourceWithStreamingResponse",
+ "AsyncSchemaResourceWithStreamingResponse",
+ "ContentResource",
+ "AsyncContentResource",
+ "ContentResourceWithRawResponse",
+ "AsyncContentResourceWithRawResponse",
+ "ContentResourceWithStreamingResponse",
+ "AsyncContentResourceWithStreamingResponse",
+ "ExtractionsResource",
+ "AsyncExtractionsResource",
+ "ExtractionsResourceWithRawResponse",
+ "AsyncExtractionsResourceWithRawResponse",
+ "ExtractionsResourceWithStreamingResponse",
+ "AsyncExtractionsResourceWithStreamingResponse",
+]
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
new file mode 100644
index 00000000..cacd55a6
--- /dev/null
+++ b/src/mixedbread/resources/extractions/content.py
@@ -0,0 +1,196 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import (
+ maybe_transform,
+ async_maybe_transform,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._base_client import make_request_options
+from ...types.extractions import content_create_params
+from ...types.extractions.extraction_result import ExtractionResult
+
+__all__ = ["ContentResource", "AsyncContentResource"]
+
+
+class ContentResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> ContentResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return ContentResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ContentResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return ContentResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ content: str,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionResult:
+ """
+ Extract content from a string using the provided schema.
+
+ Args: params: The parameters for extracting content from a string.
+
+ Returns: The extracted content.
+
+ Args:
+ content: The content to extract from
+
+ json_schema: The JSON schema to use for extraction
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/content",
+ body=maybe_transform(
+ {
+ "content": content,
+ "json_schema": json_schema,
+ },
+ content_create_params.ContentCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionResult,
+ )
+
+
+class AsyncContentResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncContentResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncContentResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncContentResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncContentResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ content: str,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionResult:
+ """
+ Extract content from a string using the provided schema.
+
+ Args: params: The parameters for extracting content from a string.
+
+ Returns: The extracted content.
+
+ Args:
+ content: The content to extract from
+
+ json_schema: The JSON schema to use for extraction
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/content",
+ body=await async_maybe_transform(
+ {
+ "content": content,
+ "json_schema": json_schema,
+ },
+ content_create_params.ContentCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionResult,
+ )
+
+
+class ContentResourceWithRawResponse:
+ def __init__(self, content: ContentResource) -> None:
+ self._content = content
+
+ self.create = to_raw_response_wrapper(
+ content.create,
+ )
+
+
+class AsyncContentResourceWithRawResponse:
+ def __init__(self, content: AsyncContentResource) -> None:
+ self._content = content
+
+ self.create = async_to_raw_response_wrapper(
+ content.create,
+ )
+
+
+class ContentResourceWithStreamingResponse:
+ def __init__(self, content: ContentResource) -> None:
+ self._content = content
+
+ self.create = to_streamed_response_wrapper(
+ content.create,
+ )
+
+
+class AsyncContentResourceWithStreamingResponse:
+ def __init__(self, content: AsyncContentResource) -> None:
+ self._content = content
+
+ self.create = async_to_streamed_response_wrapper(
+ content.create,
+ )
diff --git a/src/mixedbread/resources/extractions/extractions.py b/src/mixedbread/resources/extractions/extractions.py
new file mode 100644
index 00000000..eebb3e40
--- /dev/null
+++ b/src/mixedbread/resources/extractions/extractions.py
@@ -0,0 +1,166 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .jobs import (
+ JobsResource,
+ AsyncJobsResource,
+ JobsResourceWithRawResponse,
+ AsyncJobsResourceWithRawResponse,
+ JobsResourceWithStreamingResponse,
+ AsyncJobsResourceWithStreamingResponse,
+)
+from .schema import (
+ SchemaResource,
+ AsyncSchemaResource,
+ SchemaResourceWithRawResponse,
+ AsyncSchemaResourceWithRawResponse,
+ SchemaResourceWithStreamingResponse,
+ AsyncSchemaResourceWithStreamingResponse,
+)
+from .content import (
+ ContentResource,
+ AsyncContentResource,
+ ContentResourceWithRawResponse,
+ AsyncContentResourceWithRawResponse,
+ ContentResourceWithStreamingResponse,
+ AsyncContentResourceWithStreamingResponse,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+
+__all__ = ["ExtractionsResource", "AsyncExtractionsResource"]
+
+
+class ExtractionsResource(SyncAPIResource):
+ @cached_property
+ def jobs(self) -> JobsResource:
+ return JobsResource(self._client)
+
+ @cached_property
+ def schema(self) -> SchemaResource:
+ return SchemaResource(self._client)
+
+ @cached_property
+ def content(self) -> ContentResource:
+ return ContentResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> ExtractionsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return ExtractionsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ExtractionsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return ExtractionsResourceWithStreamingResponse(self)
+
+
+class AsyncExtractionsResource(AsyncAPIResource):
+ @cached_property
+ def jobs(self) -> AsyncJobsResource:
+ return AsyncJobsResource(self._client)
+
+ @cached_property
+ def schema(self) -> AsyncSchemaResource:
+ return AsyncSchemaResource(self._client)
+
+ @cached_property
+ def content(self) -> AsyncContentResource:
+ return AsyncContentResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncExtractionsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncExtractionsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncExtractionsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncExtractionsResourceWithStreamingResponse(self)
+
+
+class ExtractionsResourceWithRawResponse:
+ def __init__(self, extractions: ExtractionsResource) -> None:
+ self._extractions = extractions
+
+ @cached_property
+ def jobs(self) -> JobsResourceWithRawResponse:
+ return JobsResourceWithRawResponse(self._extractions.jobs)
+
+ @cached_property
+ def schema(self) -> SchemaResourceWithRawResponse:
+ return SchemaResourceWithRawResponse(self._extractions.schema)
+
+ @cached_property
+ def content(self) -> ContentResourceWithRawResponse:
+ return ContentResourceWithRawResponse(self._extractions.content)
+
+
+class AsyncExtractionsResourceWithRawResponse:
+ def __init__(self, extractions: AsyncExtractionsResource) -> None:
+ self._extractions = extractions
+
+ @cached_property
+ def jobs(self) -> AsyncJobsResourceWithRawResponse:
+ return AsyncJobsResourceWithRawResponse(self._extractions.jobs)
+
+ @cached_property
+ def schema(self) -> AsyncSchemaResourceWithRawResponse:
+ return AsyncSchemaResourceWithRawResponse(self._extractions.schema)
+
+ @cached_property
+ def content(self) -> AsyncContentResourceWithRawResponse:
+ return AsyncContentResourceWithRawResponse(self._extractions.content)
+
+
+class ExtractionsResourceWithStreamingResponse:
+ def __init__(self, extractions: ExtractionsResource) -> None:
+ self._extractions = extractions
+
+ @cached_property
+ def jobs(self) -> JobsResourceWithStreamingResponse:
+ return JobsResourceWithStreamingResponse(self._extractions.jobs)
+
+ @cached_property
+ def schema(self) -> SchemaResourceWithStreamingResponse:
+ return SchemaResourceWithStreamingResponse(self._extractions.schema)
+
+ @cached_property
+ def content(self) -> ContentResourceWithStreamingResponse:
+ return ContentResourceWithStreamingResponse(self._extractions.content)
+
+
+class AsyncExtractionsResourceWithStreamingResponse:
+ def __init__(self, extractions: AsyncExtractionsResource) -> None:
+ self._extractions = extractions
+
+ @cached_property
+ def jobs(self) -> AsyncJobsResourceWithStreamingResponse:
+ return AsyncJobsResourceWithStreamingResponse(self._extractions.jobs)
+
+ @cached_property
+ def schema(self) -> AsyncSchemaResourceWithStreamingResponse:
+ return AsyncSchemaResourceWithStreamingResponse(self._extractions.schema)
+
+ @cached_property
+ def content(self) -> AsyncContentResourceWithStreamingResponse:
+ return AsyncContentResourceWithStreamingResponse(self._extractions.content)
diff --git a/src/mixedbread/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py
new file mode 100644
index 00000000..3abc64f9
--- /dev/null
+++ b/src/mixedbread/resources/extractions/jobs.py
@@ -0,0 +1,286 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import (
+ maybe_transform,
+ async_maybe_transform,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._base_client import make_request_options
+from ...types.extractions import job_create_params
+from ...types.extractions.extraction_job import ExtractionJob
+
+__all__ = ["JobsResource", "AsyncJobsResource"]
+
+
+class JobsResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> JobsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return JobsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> JobsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return JobsResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ file_id: str,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionJob:
+ """
+ Start an extraction job for the provided file and schema.
+
+ Args: params: The parameters for creating an extraction job.
+
+ Returns: The created extraction job.
+
+ Args:
+ file_id: The ID of the file to extract from
+
+ json_schema: The JSON schema to use for extraction
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/jobs",
+ body=maybe_transform(
+ {
+ "file_id": file_id,
+ "json_schema": json_schema,
+ },
+ job_create_params.JobCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionJob,
+ )
+
+ def retrieve(
+ self,
+ job_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionJob:
+ """
+ Get detailed information about a specific extraction job.
+
+ Args: job_id: The ID of the extraction job.
+
+ Returns: Detailed information about the extraction job.
+
+ Args:
+ job_id: The ID of the extraction job to retrieve
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return self._get(
+ f"/v1/extractions/jobs/{job_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionJob,
+ )
+
+
+class AsyncJobsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncJobsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncJobsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncJobsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncJobsResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ file_id: str,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionJob:
+ """
+ Start an extraction job for the provided file and schema.
+
+ Args: params: The parameters for creating an extraction job.
+
+ Returns: The created extraction job.
+
+ Args:
+ file_id: The ID of the file to extract from
+
+ json_schema: The JSON schema to use for extraction
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/jobs",
+ body=await async_maybe_transform(
+ {
+ "file_id": file_id,
+ "json_schema": json_schema,
+ },
+ job_create_params.JobCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionJob,
+ )
+
+ async def retrieve(
+ self,
+ job_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ExtractionJob:
+ """
+ Get detailed information about a specific extraction job.
+
+ Args: job_id: The ID of the extraction job.
+
+ Returns: Detailed information about the extraction job.
+
+ Args:
+ job_id: The ID of the extraction job to retrieve
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not job_id:
+ raise ValueError(f"Expected a non-empty value for `job_id` but received {job_id!r}")
+ return await self._get(
+ f"/v1/extractions/jobs/{job_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ExtractionJob,
+ )
+
+
+class JobsResourceWithRawResponse:
+ def __init__(self, jobs: JobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = to_raw_response_wrapper(
+ jobs.create,
+ )
+ self.retrieve = to_raw_response_wrapper(
+ jobs.retrieve,
+ )
+
+
+class AsyncJobsResourceWithRawResponse:
+ def __init__(self, jobs: AsyncJobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = async_to_raw_response_wrapper(
+ jobs.create,
+ )
+ self.retrieve = async_to_raw_response_wrapper(
+ jobs.retrieve,
+ )
+
+
+class JobsResourceWithStreamingResponse:
+ def __init__(self, jobs: JobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = to_streamed_response_wrapper(
+ jobs.create,
+ )
+ self.retrieve = to_streamed_response_wrapper(
+ jobs.retrieve,
+ )
+
+
+class AsyncJobsResourceWithStreamingResponse:
+ def __init__(self, jobs: AsyncJobsResource) -> None:
+ self._jobs = jobs
+
+ self.create = async_to_streamed_response_wrapper(
+ jobs.create,
+ )
+ self.retrieve = async_to_streamed_response_wrapper(
+ jobs.retrieve,
+ )
diff --git a/src/mixedbread/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py
new file mode 100644
index 00000000..60ee00a5
--- /dev/null
+++ b/src/mixedbread/resources/extractions/schema.py
@@ -0,0 +1,356 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import (
+ maybe_transform,
+ async_maybe_transform,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._base_client import make_request_options
+from ...types.extractions import schema_create_params, schema_enhance_params, schema_validate_params
+from ...types.extractions.created_json_schema import CreatedJsonSchema
+from ...types.extractions.enhanced_json_schema import EnhancedJsonSchema
+from ...types.extractions.validated_json_schema import ValidatedJsonSchema
+
+__all__ = ["SchemaResource", "AsyncSchemaResource"]
+
+
+class SchemaResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> SchemaResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return SchemaResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> SchemaResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return SchemaResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ description: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> CreatedJsonSchema:
+ """
+ Create a schema with the provided parameters.
+
+ Args: params: The parameters for creating a schema.
+
+ Returns: The created schema.
+
+ Args:
+ description: Description of the data to extract
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/schema",
+ body=maybe_transform({"description": description}, schema_create_params.SchemaCreateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=CreatedJsonSchema,
+ )
+
+ def enhance(
+ self,
+ *,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> EnhancedJsonSchema:
+ """
+ Enhance a schema by enriching the descriptions to aid extraction.
+
+ Args: params: The parameters for enhancing a schema.
+
+ Returns: The enhanced schema.
+
+ Args:
+ json_schema: The JSON schema to enhance
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/schema/enhance",
+ body=maybe_transform({"json_schema": json_schema}, schema_enhance_params.SchemaEnhanceParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=EnhancedJsonSchema,
+ )
+
+ def validate(
+ self,
+ *,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ValidatedJsonSchema:
+ """
+ Validate a schema.
+
+ Args: params: The parameters for validating a schema.
+
+ Returns: The validation result.
+
+ Args:
+ json_schema: The JSON schema to validate
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/extractions/schema/validate",
+ body=maybe_transform({"json_schema": json_schema}, schema_validate_params.SchemaValidateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ValidatedJsonSchema,
+ )
+
+
+class AsyncSchemaResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncSchemaResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncSchemaResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncSchemaResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncSchemaResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ description: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> CreatedJsonSchema:
+ """
+ Create a schema with the provided parameters.
+
+ Args: params: The parameters for creating a schema.
+
+ Returns: The created schema.
+
+ Args:
+ description: Description of the data to extract
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/schema",
+ body=await async_maybe_transform({"description": description}, schema_create_params.SchemaCreateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=CreatedJsonSchema,
+ )
+
+ async def enhance(
+ self,
+ *,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> EnhancedJsonSchema:
+ """
+ Enhance a schema by enriching the descriptions to aid extraction.
+
+ Args: params: The parameters for enhancing a schema.
+
+ Returns: The enhanced schema.
+
+ Args:
+ json_schema: The JSON schema to enhance
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/schema/enhance",
+ body=await async_maybe_transform({"json_schema": json_schema}, schema_enhance_params.SchemaEnhanceParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=EnhancedJsonSchema,
+ )
+
+ async def validate(
+ self,
+ *,
+ json_schema: object,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ValidatedJsonSchema:
+ """
+ Validate a schema.
+
+ Args: params: The parameters for validating a schema.
+
+ Returns: The validation result.
+
+ Args:
+ json_schema: The JSON schema to validate
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/extractions/schema/validate",
+ body=await async_maybe_transform({"json_schema": json_schema}, schema_validate_params.SchemaValidateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ValidatedJsonSchema,
+ )
+
+
+class SchemaResourceWithRawResponse:
+ def __init__(self, schema: SchemaResource) -> None:
+ self._schema = schema
+
+ self.create = to_raw_response_wrapper(
+ schema.create,
+ )
+ self.enhance = to_raw_response_wrapper(
+ schema.enhance,
+ )
+ self.validate = to_raw_response_wrapper(
+ schema.validate,
+ )
+
+
+class AsyncSchemaResourceWithRawResponse:
+ def __init__(self, schema: AsyncSchemaResource) -> None:
+ self._schema = schema
+
+ self.create = async_to_raw_response_wrapper(
+ schema.create,
+ )
+ self.enhance = async_to_raw_response_wrapper(
+ schema.enhance,
+ )
+ self.validate = async_to_raw_response_wrapper(
+ schema.validate,
+ )
+
+
+class SchemaResourceWithStreamingResponse:
+ def __init__(self, schema: SchemaResource) -> None:
+ self._schema = schema
+
+ self.create = to_streamed_response_wrapper(
+ schema.create,
+ )
+ self.enhance = to_streamed_response_wrapper(
+ schema.enhance,
+ )
+ self.validate = to_streamed_response_wrapper(
+ schema.validate,
+ )
+
+
+class AsyncSchemaResourceWithStreamingResponse:
+ def __init__(self, schema: AsyncSchemaResource) -> None:
+ self._schema = schema
+
+ self.create = async_to_streamed_response_wrapper(
+ schema.create,
+ )
+ self.enhance = async_to_streamed_response_wrapper(
+ schema.enhance,
+ )
+ self.validate = async_to_streamed_response_wrapper(
+ schema.validate,
+ )
diff --git a/src/mixedbread/types/extractions/__init__.py b/src/mixedbread/types/extractions/__init__.py
new file mode 100644
index 00000000..6457c670
--- /dev/null
+++ b/src/mixedbread/types/extractions/__init__.py
@@ -0,0 +1,14 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .extraction_job import ExtractionJob as ExtractionJob
+from .extraction_result import ExtractionResult as ExtractionResult
+from .job_create_params import JobCreateParams as JobCreateParams
+from .created_json_schema import CreatedJsonSchema as CreatedJsonSchema
+from .enhanced_json_schema import EnhancedJsonSchema as EnhancedJsonSchema
+from .schema_create_params import SchemaCreateParams as SchemaCreateParams
+from .content_create_params import ContentCreateParams as ContentCreateParams
+from .schema_enhance_params import SchemaEnhanceParams as SchemaEnhanceParams
+from .validated_json_schema import ValidatedJsonSchema as ValidatedJsonSchema
+from .schema_validate_params import SchemaValidateParams as SchemaValidateParams
diff --git a/src/mixedbread/types/extractions/content_create_params.py b/src/mixedbread/types/extractions/content_create_params.py
new file mode 100644
index 00000000..2bbdada2
--- /dev/null
+++ b/src/mixedbread/types/extractions/content_create_params.py
@@ -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__ = ["ContentCreateParams"]
+
+
+class ContentCreateParams(TypedDict, total=False):
+ content: Required[str]
+ """The content to extract from"""
+
+ json_schema: Required[object]
+ """The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/created_json_schema.py b/src/mixedbread/types/extractions/created_json_schema.py
new file mode 100644
index 00000000..4b50c4c6
--- /dev/null
+++ b/src/mixedbread/types/extractions/created_json_schema.py
@@ -0,0 +1,11 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+
+from ..._models import BaseModel
+
+__all__ = ["CreatedJsonSchema"]
+
+
+class CreatedJsonSchema(BaseModel):
+ json_schema: object
+ """The created JSON schema"""
diff --git a/src/mixedbread/types/extractions/enhanced_json_schema.py b/src/mixedbread/types/extractions/enhanced_json_schema.py
new file mode 100644
index 00000000..7b2ab04a
--- /dev/null
+++ b/src/mixedbread/types/extractions/enhanced_json_schema.py
@@ -0,0 +1,11 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+
+from ..._models import BaseModel
+
+__all__ = ["EnhancedJsonSchema"]
+
+
+class EnhancedJsonSchema(BaseModel):
+ json_schema: object
+ """The enhanced JSON schema"""
diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py
new file mode 100644
index 00000000..5d8a1604
--- /dev/null
+++ b/src/mixedbread/types/extractions/extraction_job.py
@@ -0,0 +1,13 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+
+from ..._models import BaseModel
+from .extraction_result import ExtractionResult
+
+__all__ = ["ExtractionJob"]
+
+
+class ExtractionJob(BaseModel):
+ result: Optional[ExtractionResult] = None
+ """Result of an extraction operation."""
diff --git a/src/mixedbread/types/extractions/extraction_result.py b/src/mixedbread/types/extractions/extraction_result.py
new file mode 100644
index 00000000..fbac5d5f
--- /dev/null
+++ b/src/mixedbread/types/extractions/extraction_result.py
@@ -0,0 +1,11 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+
+from ..._models import BaseModel
+
+__all__ = ["ExtractionResult"]
+
+
+class ExtractionResult(BaseModel):
+ data: object
+ """The extracted data"""
diff --git a/src/mixedbread/types/extractions/job_create_params.py b/src/mixedbread/types/extractions/job_create_params.py
new file mode 100644
index 00000000..476154b2
--- /dev/null
+++ b/src/mixedbread/types/extractions/job_create_params.py
@@ -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__ = ["JobCreateParams"]
+
+
+class JobCreateParams(TypedDict, total=False):
+ file_id: Required[str]
+ """The ID of the file to extract from"""
+
+ json_schema: Required[object]
+ """The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/schema_create_params.py b/src/mixedbread/types/extractions/schema_create_params.py
new file mode 100644
index 00000000..8625ea66
--- /dev/null
+++ b/src/mixedbread/types/extractions/schema_create_params.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Required, TypedDict
+
+__all__ = ["SchemaCreateParams"]
+
+
+class SchemaCreateParams(TypedDict, total=False):
+ description: Required[str]
+ """Description of the data to extract"""
diff --git a/src/mixedbread/types/extractions/schema_enhance_params.py b/src/mixedbread/types/extractions/schema_enhance_params.py
new file mode 100644
index 00000000..e0facf34
--- /dev/null
+++ b/src/mixedbread/types/extractions/schema_enhance_params.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Required, TypedDict
+
+__all__ = ["SchemaEnhanceParams"]
+
+
+class SchemaEnhanceParams(TypedDict, total=False):
+ json_schema: Required[object]
+ """The JSON schema to enhance"""
diff --git a/src/mixedbread/types/extractions/schema_validate_params.py b/src/mixedbread/types/extractions/schema_validate_params.py
new file mode 100644
index 00000000..947182ca
--- /dev/null
+++ b/src/mixedbread/types/extractions/schema_validate_params.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Required, TypedDict
+
+__all__ = ["SchemaValidateParams"]
+
+
+class SchemaValidateParams(TypedDict, total=False):
+ json_schema: Required[object]
+ """The JSON schema to validate"""
diff --git a/src/mixedbread/types/extractions/validated_json_schema.py b/src/mixedbread/types/extractions/validated_json_schema.py
new file mode 100644
index 00000000..cb021c31
--- /dev/null
+++ b/src/mixedbread/types/extractions/validated_json_schema.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List
+
+from ..._models import BaseModel
+
+__all__ = ["ValidatedJsonSchema"]
+
+
+class ValidatedJsonSchema(BaseModel):
+ is_valid: bool
+ """Whether the schema is valid"""
+
+ errors: List[str]
+ """List of validation errors"""
+
+ json_schema: object
+ """The validated JSON schema"""
diff --git a/tests/api_resources/extractions/__init__.py b/tests/api_resources/extractions/__init__.py
new file mode 100644
index 00000000..fd8019a9
--- /dev/null
+++ b/tests/api_resources/extractions/__init__.py
@@ -0,0 +1 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
diff --git a/tests/api_resources/extractions/test_content.py b/tests/api_resources/extractions/test_content.py
new file mode 100644
index 00000000..7beb468b
--- /dev/null
+++ b/tests/api_resources/extractions/test_content.py
@@ -0,0 +1,90 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types.extractions import ExtractionResult
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestContent:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ content = client.extractions.content.create(
+ content="content",
+ json_schema={},
+ )
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.extractions.content.with_raw_response.create(
+ content="content",
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ content = response.parse()
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.extractions.content.with_streaming_response.create(
+ content="content",
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ content = response.parse()
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncContent:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ content = await async_client.extractions.content.create(
+ content="content",
+ json_schema={},
+ )
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.content.with_raw_response.create(
+ content="content",
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ content = await response.parse()
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.content.with_streaming_response.create(
+ content="content",
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ content = await response.parse()
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/extractions/test_jobs.py b/tests/api_resources/extractions/test_jobs.py
new file mode 100644
index 00000000..bb055ba7
--- /dev/null
+++ b/tests/api_resources/extractions/test_jobs.py
@@ -0,0 +1,166 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types.extractions import ExtractionJob
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestJobs:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ job = client.extractions.jobs.create(
+ file_id="file_id",
+ json_schema={},
+ )
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.extractions.jobs.with_raw_response.create(
+ file_id="file_id",
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.extractions.jobs.with_streaming_response.create(
+ file_id="file_id",
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ job = client.extractions.jobs.retrieve(
+ "job_id",
+ )
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
+ response = client.extractions.jobs.with_raw_response.retrieve(
+ "job_id",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.extractions.jobs.with_streaming_response.retrieve(
+ "job_id",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
+ client.extractions.jobs.with_raw_response.retrieve(
+ "",
+ )
+
+
+class TestAsyncJobs:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ job = await async_client.extractions.jobs.create(
+ file_id="file_id",
+ json_schema={},
+ )
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.jobs.with_raw_response.create(
+ file_id="file_id",
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = await response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.jobs.with_streaming_response.create(
+ file_id="file_id",
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = await response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
+ job = await async_client.extractions.jobs.retrieve(
+ "job_id",
+ )
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.jobs.with_raw_response.retrieve(
+ "job_id",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ job = await response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.jobs.with_streaming_response.retrieve(
+ "job_id",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ job = await response.parse()
+ assert_matches_type(ExtractionJob, job, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_id` but received ''"):
+ await async_client.extractions.jobs.with_raw_response.retrieve(
+ "",
+ )
diff --git a/tests/api_resources/extractions/test_schema.py b/tests/api_resources/extractions/test_schema.py
new file mode 100644
index 00000000..5bff1298
--- /dev/null
+++ b/tests/api_resources/extractions/test_schema.py
@@ -0,0 +1,212 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types.extractions import (
+ CreatedJsonSchema,
+ EnhancedJsonSchema,
+ ValidatedJsonSchema,
+)
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestSchema:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ schema = client.extractions.schema.create(
+ description="description",
+ )
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.extractions.schema.with_raw_response.create(
+ description="description",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = response.parse()
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.extractions.schema.with_streaming_response.create(
+ description="description",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = response.parse()
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_enhance(self, client: Mixedbread) -> None:
+ schema = client.extractions.schema.enhance(
+ json_schema={},
+ )
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_raw_response_enhance(self, client: Mixedbread) -> None:
+ response = client.extractions.schema.with_raw_response.enhance(
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = response.parse()
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_streaming_response_enhance(self, client: Mixedbread) -> None:
+ with client.extractions.schema.with_streaming_response.enhance(
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = response.parse()
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_validate(self, client: Mixedbread) -> None:
+ schema = client.extractions.schema.validate(
+ json_schema={},
+ )
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_raw_response_validate(self, client: Mixedbread) -> None:
+ response = client.extractions.schema.with_raw_response.validate(
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = response.parse()
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ def test_streaming_response_validate(self, client: Mixedbread) -> None:
+ with client.extractions.schema.with_streaming_response.validate(
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = response.parse()
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncSchema:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ schema = await async_client.extractions.schema.create(
+ description="description",
+ )
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.schema.with_raw_response.create(
+ description="description",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = await response.parse()
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.schema.with_streaming_response.create(
+ description="description",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = await response.parse()
+ assert_matches_type(CreatedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_enhance(self, async_client: AsyncMixedbread) -> None:
+ schema = await async_client.extractions.schema.enhance(
+ json_schema={},
+ )
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_raw_response_enhance(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.schema.with_raw_response.enhance(
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = await response.parse()
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_enhance(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.schema.with_streaming_response.enhance(
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = await response.parse()
+ assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_validate(self, async_client: AsyncMixedbread) -> None:
+ schema = await async_client.extractions.schema.validate(
+ json_schema={},
+ )
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_raw_response_validate(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.extractions.schema.with_raw_response.validate(
+ json_schema={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ schema = await response.parse()
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_validate(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.extractions.schema.with_streaming_response.validate(
+ json_schema={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ schema = await response.parse()
+ assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
From 8fee278b0eafeaae2988e5ddb744ce99b4046d1d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 6 Feb 2025 07:38:55 +0000
Subject: [PATCH 038/375] chore(internal): version bump (#112)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 1c0bb885..380b6f91 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.23"
+ ".": "0.1.0-alpha.24"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index f8d4b9f7..45324497 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.23"
+version = "0.1.0-alpha.24"
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 cfa5102a..d2402587 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.1.0-alpha.23" # x-release-please-version
+__version__ = "0.1.0-alpha.24" # x-release-please-version
From c2fb7633cc8c8ec1495ff566cb456afa2d719b76 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 7 Feb 2025 03:26:13 +0000
Subject: [PATCH 039/375] chore(internal): fix type traversing dictionary
params (#113)
---
src/mixedbread/_utils/_transform.py | 12 +++++++++++-
tests/test_transform.py | 11 ++++++++++-
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_utils/_transform.py b/src/mixedbread/_utils/_transform.py
index a6b62cad..18afd9d8 100644
--- a/src/mixedbread/_utils/_transform.py
+++ b/src/mixedbread/_utils/_transform.py
@@ -25,7 +25,7 @@
is_annotated_type,
strip_annotated_type,
)
-from .._compat import model_dump, is_typeddict
+from .._compat import get_origin, model_dump, is_typeddict
_T = TypeVar("_T")
@@ -164,9 +164,14 @@ def _transform_recursive(
inner_type = annotation
stripped_type = strip_annotated_type(inner_type)
+ origin = get_origin(stripped_type) or stripped_type
if is_typeddict(stripped_type) and is_mapping(data):
return _transform_typeddict(data, stripped_type)
+ if origin == dict and is_mapping(data):
+ items_type = get_args(stripped_type)[1]
+ return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()}
+
if (
# List[T]
(is_list_type(stripped_type) and is_list(data))
@@ -307,9 +312,14 @@ async def _async_transform_recursive(
inner_type = annotation
stripped_type = strip_annotated_type(inner_type)
+ origin = get_origin(stripped_type) or stripped_type
if is_typeddict(stripped_type) and is_mapping(data):
return await _async_transform_typeddict(data, stripped_type)
+ if origin == dict and is_mapping(data):
+ items_type = get_args(stripped_type)[1]
+ return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()}
+
if (
# List[T]
(is_list_type(stripped_type) and is_list(data))
diff --git a/tests/test_transform.py b/tests/test_transform.py
index 67fec2f4..4cedd6a2 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -2,7 +2,7 @@
import io
import pathlib
-from typing import Any, List, Union, TypeVar, Iterable, Optional, cast
+from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast
from datetime import date, datetime
from typing_extensions import Required, Annotated, TypedDict
@@ -388,6 +388,15 @@ def my_iter() -> Iterable[Baz8]:
}
+@parametrize
+@pytest.mark.asyncio
+async def test_dictionary_items(use_async: bool) -> None:
+ class DictItems(TypedDict):
+ foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")]
+
+ assert await transform({"foo": {"foo_baz": "bar"}}, Dict[str, DictItems], use_async) == {"foo": {"fooBaz": "bar"}}
+
+
class TypedDictIterableUnionStr(TypedDict):
foo: Annotated[Union[str, Iterable[Baz8]], PropertyInfo(alias="FOO")]
From 4fd5fd03e4040a5b3e095a1c0b35c436071379b1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 7 Feb 2025 03:29:45 +0000
Subject: [PATCH 040/375] chore(internal): minor type handling changes (#115)
---
src/mixedbread/_models.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 12c34b7d..c4401ff8 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -426,10 +426,16 @@ def construct_type(*, value: object, type_: object) -> object:
If the given value does not match the expected type then it is returned as-is.
"""
+
+ # store a reference to the original type we were given before we extract any inner
+ # types so that we can properly resolve forward references in `TypeAliasType` annotations
+ original_type = None
+
# we allow `object` as the input type because otherwise, passing things like
# `Literal['value']` will be reported as a type error by type checkers
type_ = cast("type[object]", type_)
if is_type_alias_type(type_):
+ original_type = type_ # type: ignore[unreachable]
type_ = type_.__value__ # type: ignore[unreachable]
# unwrap `Annotated[T, ...]` -> `T`
@@ -446,7 +452,7 @@ def construct_type(*, value: object, type_: object) -> object:
if is_union(origin):
try:
- return validate_type(type_=cast("type[object]", type_), value=value)
+ return validate_type(type_=cast("type[object]", original_type or type_), value=value)
except Exception:
pass
From b0251bafdb1a62f732c50a3e5d317a388463a3f6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 13 Feb 2025 04:16:29 +0000
Subject: [PATCH 041/375] chore(internal): update client tests (#116)
---
tests/test_client.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tests/test_client.py b/tests/test_client.py
index e0f59191..bd431562 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -23,6 +23,7 @@
from mixedbread import Mixedbread, AsyncMixedbread, APIResponseValidationError
from mixedbread._types import Omit
+from mixedbread._utils import maybe_transform
from mixedbread._models import BaseModel, FinalRequestOptions
from mixedbread._constants import RAW_RESPONSE_HEADER
from mixedbread._exceptions import APIStatusError, APITimeoutError, MixedbreadError, APIResponseValidationError
@@ -32,6 +33,7 @@
BaseClient,
make_request_options,
)
+from mixedbread.types.vector_store_create_params import VectorStoreCreateParams
from .utils import update_env
@@ -735,7 +737,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
with pytest.raises(APITimeoutError):
self.client.post(
"/v1/vector_stores",
- body=cast(object, dict()),
+ body=cast(object, maybe_transform(dict(), VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -750,7 +752,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
with pytest.raises(APIStatusError):
self.client.post(
"/v1/vector_stores",
- body=cast(object, dict()),
+ body=cast(object, maybe_transform(dict(), VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1521,7 +1523,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
with pytest.raises(APITimeoutError):
await self.client.post(
"/v1/vector_stores",
- body=cast(object, dict()),
+ body=cast(object, maybe_transform(dict(), VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1536,7 +1538,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
with pytest.raises(APIStatusError):
await self.client.post(
"/v1/vector_stores",
- body=cast(object, dict()),
+ body=cast(object, maybe_transform(dict(), VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
From 5283cfb0b1e201cb5c053a21545b5d6afe2cc13a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 14 Feb 2025 03:57:25 +0000
Subject: [PATCH 042/375] fix: asyncify on non-asyncio runtimes (#117)
---
src/mixedbread/_utils/_sync.py | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_utils/_sync.py b/src/mixedbread/_utils/_sync.py
index 8b3aaf2b..ad7ec71b 100644
--- a/src/mixedbread/_utils/_sync.py
+++ b/src/mixedbread/_utils/_sync.py
@@ -7,16 +7,20 @@
from typing import Any, TypeVar, Callable, Awaitable
from typing_extensions import ParamSpec
+import anyio
+import sniffio
+import anyio.to_thread
+
T_Retval = TypeVar("T_Retval")
T_ParamSpec = ParamSpec("T_ParamSpec")
if sys.version_info >= (3, 9):
- to_thread = asyncio.to_thread
+ _asyncio_to_thread = asyncio.to_thread
else:
# backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
# for Python 3.8 support
- async def to_thread(
+ async def _asyncio_to_thread(
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
) -> Any:
"""Asynchronously run function *func* in a separate thread.
@@ -34,6 +38,17 @@ async def to_thread(
return await loop.run_in_executor(None, func_call)
+async def to_thread(
+ func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
+) -> T_Retval:
+ if sniffio.current_async_library() == "asyncio":
+ return await _asyncio_to_thread(func, *args, **kwargs)
+
+ return await anyio.to_thread.run_sync(
+ functools.partial(func, *args, **kwargs),
+ )
+
+
# inspired by `asyncer`, https://github.com/tiangolo/asyncer
def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
"""
From 15aa737b61367654041637b9b787c525f6c23e5b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 14 Feb 2025 03:58:37 +0000
Subject: [PATCH 043/375] chore(internal): codegen related update (#118)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 380b6f91..3188cedb 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.24"
+ ".": "0.1.0-alpha.25"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 45324497..15c2bedf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.24"
+version = "0.1.0-alpha.25"
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 d2402587..978b97ce 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.1.0-alpha.24" # x-release-please-version
+__version__ = "0.1.0-alpha.25" # x-release-please-version
From 39cd2a6c42ec113ad6f5253935c06a2939eaf8ea Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 14 Feb 2025 04:01:19 +0000
Subject: [PATCH 044/375] chore(internal): update client tests (#119)
---
tests/test_client.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/test_client.py b/tests/test_client.py
index bd431562..cb1a8039 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -737,7 +737,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
with pytest.raises(APITimeoutError):
self.client.post(
"/v1/vector_stores",
- body=cast(object, maybe_transform(dict(), VectorStoreCreateParams)),
+ body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -752,7 +752,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
with pytest.raises(APIStatusError):
self.client.post(
"/v1/vector_stores",
- body=cast(object, maybe_transform(dict(), VectorStoreCreateParams)),
+ body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1523,7 +1523,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
with pytest.raises(APITimeoutError):
await self.client.post(
"/v1/vector_stores",
- body=cast(object, maybe_transform(dict(), VectorStoreCreateParams)),
+ body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1538,7 +1538,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
with pytest.raises(APIStatusError):
await self.client.post(
"/v1/vector_stores",
- body=cast(object, maybe_transform(dict(), VectorStoreCreateParams)),
+ body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
From 50f36420ef563acef543cb6a21c6aa8fbf412c16 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 19 Feb 2025 04:22:29 +0000
Subject: [PATCH 045/375] chore(internal): codegen related update (#121)
---
README.md | 17 +++++++++++++++++
src/mixedbread/_files.py | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 8351cc88..2b96941f 100644
--- a/README.md
+++ b/README.md
@@ -142,6 +142,23 @@ for vector_store in first_page.data:
# Remove `await` for non-async usage.
```
+## File uploads
+
+Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
+
+```python
+from pathlib import Path
+from mixedbread import Mixedbread
+
+client = Mixedbread()
+
+client.files.create(
+ file=Path("/path/to/file"),
+)
+```
+
+The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically.
+
## Handling errors
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `mixedbread.APIConnectionError` is raised.
diff --git a/src/mixedbread/_files.py b/src/mixedbread/_files.py
index 715cc207..3bef9c34 100644
--- a/src/mixedbread/_files.py
+++ b/src/mixedbread/_files.py
@@ -34,7 +34,7 @@ def assert_is_file_content(obj: object, *, key: str | None = None) -> None:
if not is_file_content(obj):
prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`"
raise RuntimeError(
- f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead."
+ f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/mixedbread-ai/mixedbread-python/tree/main#file-uploads"
) from None
From 9c791041a7d75cc90ac848adfe18207307112ea3 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 21 Feb 2025 05:54:38 +0000
Subject: [PATCH 046/375] feat(client): allow passing `NotGiven` for body
(#122)
fix(client): mark some request bodies as optional
---
src/mixedbread/_base_client.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 318d56dc..ebaf57c8 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -518,7 +518,7 @@ def _build_request(
# so that passing a `TypedDict` doesn't cause an error.
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
- json=json_data,
+ json=json_data if is_given(json_data) else None,
files=files,
**kwargs,
)
From 2879969fdbc14ef775c0d75c1aee4c6cb396b6d3 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 21 Feb 2025 05:55:38 +0000
Subject: [PATCH 047/375] chore(internal): codegen related update (#123)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3188cedb..315f7d30 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.25"
+ ".": "0.1.0-alpha.26"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 15c2bedf..8b8c6e90 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.25"
+version = "0.1.0-alpha.26"
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 978b97ce..6b66fc5c 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.1.0-alpha.25" # x-release-please-version
+__version__ = "0.1.0-alpha.26" # x-release-please-version
From 94d2f8f0bc8d8ccc7cdb938aa3a965f8cb37f865 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 22 Feb 2025 04:28:05 +0000
Subject: [PATCH 048/375] chore(internal): fix devcontainers setup (#124)
---
.devcontainer/Dockerfile | 2 +-
.devcontainer/devcontainer.json | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index ac9a2e75..55d20255 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -6,4 +6,4 @@ USER vscode
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH
-RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
+RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index bbeb30b1..c17fdc16 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -24,6 +24,9 @@
}
}
}
+ },
+ "features": {
+ "ghcr.io/devcontainers/features/node:1": {}
}
// Features to add to the dev container. More info: https://containers.dev/features.
From c8acb589d8bdcb44021f3034d4fad14fa3df29dd Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 26 Feb 2025 03:46:36 +0000
Subject: [PATCH 049/375] chore(internal): properly set __pydantic_private__
(#126)
---
src/mixedbread/_base_client.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index ebaf57c8..aa97e747 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -63,7 +63,7 @@
ModelBuilderProtocol,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
-from ._compat import model_copy, model_dump
+from ._compat import PYDANTIC_V2, model_copy, model_dump
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
from ._response import (
APIResponse,
@@ -207,6 +207,9 @@ def _set_private_attributes(
model: Type[_T],
options: FinalRequestOptions,
) -> None:
+ if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
+ self.__pydantic_private__ = {}
+
self._model = model
self._client = client
self._options = options
@@ -292,6 +295,9 @@ def _set_private_attributes(
client: AsyncAPIClient,
options: FinalRequestOptions,
) -> None:
+ if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
+ self.__pydantic_private__ = {}
+
self._model = model
self._client = client
self._options = options
From 4cc9566c014ab4b167b9d2daf3abe9f5ec48131c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 28 Feb 2025 03:11:22 +0000
Subject: [PATCH 050/375] docs: update URLs from stainlessapi.com to
stainless.com (#127)
More details at https://www.stainless.com/changelog/stainless-com
---
README.md | 2 +-
SECURITY.md | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 2b96941f..405d1360 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ The Mixedbread Python library provides convenient access to the Mixedbread REST
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
-It is generated with [Stainless](https://www.stainlessapi.com/).
+It is generated with [Stainless](https://www.stainless.com/).
## Documentation
diff --git a/SECURITY.md b/SECURITY.md
index 83c8a2fe..b074529d 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -2,9 +2,9 @@
## Reporting Security Issues
-This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
+This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
-To report a security issue, please contact the Stainless team at security@stainlessapi.com.
+To report a security issue, please contact the Stainless team at security@stainless.com.
## Responsible Disclosure
From 5bdb9efb3661a3f36143fe51026dc7f1a110627e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 28 Feb 2025 03:11:59 +0000
Subject: [PATCH 051/375] chore(docs): update client docstring (#128)
---
src/mixedbread/_client.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 9b142105..60a8893e 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -325,7 +325,7 @@ def __init__(
# part of our public interface in the future.
_strict_response_validation: bool = False,
) -> None:
- """Construct a new async Mixedbread client instance.
+ """Construct a new async AsyncMixedbread client instance.
This automatically infers the `api_key` argument from the `MXBAI_API_KEY` environment variable if it is not provided.
"""
From 8c59af5d0cf556276cafad9aea72b4f0d471d5cf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 4 Mar 2025 03:44:11 +0000
Subject: [PATCH 052/375] feat(api): update via SDK Studio (#129)
---
SECURITY.md | 2 +-
pyproject.toml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/SECURITY.md b/SECURITY.md
index b074529d..6ccfcf0f 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -20,7 +20,7 @@ or products provided by Mixedbread please follow the respective company's securi
### Mixedbread Terms and Policies
-Please contact support@mixedbread.ai for any questions or concerns regarding security of our services.
+Please contact support@mixedbread.com for any questions or concerns regarding security of our services.
---
diff --git a/pyproject.toml b/pyproject.toml
index 8b8c6e90..0a8b4012 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,7 +5,7 @@ description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
authors = [
-{ name = "Mixedbread", email = "support@mixedbread.ai" },
+{ name = "Mixedbread", email = "support@mixedbread.com" },
]
dependencies = [
"httpx>=0.23.0, <1",
From 33202285a280e0bda655884449c83435666eda86 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 4 Mar 2025 03:49:06 +0000
Subject: [PATCH 053/375] chore(internal): version bump (#130)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 315f7d30..7657c56b 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.26"
+ ".": "0.1.0-alpha.27"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 0a8b4012..a991dca3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.26"
+version = "0.1.0-alpha.27"
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 6b66fc5c..d41c9caa 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.1.0-alpha.26" # x-release-please-version
+__version__ = "0.1.0-alpha.27" # x-release-please-version
From 02f0cbf6823715434f800dd65c6f3ed0d4e9d4b7 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 4 Mar 2025 04:57:03 +0000
Subject: [PATCH 054/375] chore(internal): remove unused http client options
forwarding (#131)
---
src/mixedbread/_base_client.py | 97 +---------------------------------
1 file changed, 1 insertion(+), 96 deletions(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index aa97e747..b206ef2e 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -9,7 +9,6 @@
import inspect
import logging
import platform
-import warnings
import email.utils
from types import TracebackType
from random import random
@@ -36,7 +35,7 @@
import httpx
import distro
import pydantic
-from httpx import URL, Limits
+from httpx import URL
from pydantic import PrivateAttr
from . import _exceptions
@@ -51,13 +50,10 @@
Timeout,
NotGiven,
ResponseT,
- Transport,
AnyMapping,
PostParser,
- ProxiesTypes,
RequestFiles,
HttpxSendArgs,
- AsyncTransport,
RequestOptions,
HttpxRequestFiles,
ModelBuilderProtocol,
@@ -337,9 +333,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
_base_url: URL
max_retries: int
timeout: Union[float, Timeout, None]
- _limits: httpx.Limits
- _proxies: ProxiesTypes | None
- _transport: Transport | AsyncTransport | None
_strict_response_validation: bool
_idempotency_header: str | None
_default_stream_cls: type[_DefaultStreamT] | None = None
@@ -352,9 +345,6 @@ def __init__(
_strict_response_validation: bool,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None = DEFAULT_TIMEOUT,
- limits: httpx.Limits,
- transport: Transport | AsyncTransport | None,
- proxies: ProxiesTypes | None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
) -> None:
@@ -362,9 +352,6 @@ def __init__(
self._base_url = self._enforce_trailing_slash(URL(base_url))
self.max_retries = max_retries
self.timeout = timeout
- self._limits = limits
- self._proxies = proxies
- self._transport = transport
self._custom_headers = custom_headers or {}
self._custom_query = custom_query or {}
self._strict_response_validation = _strict_response_validation
@@ -800,46 +787,11 @@ def __init__(
base_url: str | URL,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
- transport: Transport | None = None,
- proxies: ProxiesTypes | None = None,
- limits: Limits | None = None,
http_client: httpx.Client | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
_strict_response_validation: bool,
) -> None:
- kwargs: dict[str, Any] = {}
- if limits is not None:
- warnings.warn(
- "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
- category=DeprecationWarning,
- stacklevel=3,
- )
- if http_client is not None:
- raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
- else:
- limits = DEFAULT_CONNECTION_LIMITS
-
- if transport is not None:
- kwargs["transport"] = transport
- warnings.warn(
- "The `transport` argument is deprecated. The `http_client` argument should be passed instead",
- category=DeprecationWarning,
- stacklevel=3,
- )
- if http_client is not None:
- raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
-
- if proxies is not None:
- kwargs["proxies"] = proxies
- warnings.warn(
- "The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
- category=DeprecationWarning,
- stacklevel=3,
- )
- if http_client is not None:
- raise ValueError("The `http_client` argument is mutually exclusive with `proxies`")
-
if not is_given(timeout):
# if the user passed in a custom http client with a non-default
# timeout set then we use that timeout.
@@ -860,12 +812,9 @@ def __init__(
super().__init__(
version=version,
- limits=limits,
# cast to a valid type because mypy doesn't understand our type narrowing
timeout=cast(Timeout, timeout),
- proxies=proxies,
base_url=base_url,
- transport=transport,
max_retries=max_retries,
custom_query=custom_query,
custom_headers=custom_headers,
@@ -875,9 +824,6 @@ def __init__(
base_url=base_url,
# cast to a valid type because mypy doesn't understand our type narrowing
timeout=cast(Timeout, timeout),
- limits=limits,
- follow_redirects=True,
- **kwargs, # type: ignore
)
def is_closed(self) -> bool:
@@ -1372,45 +1318,10 @@ def __init__(
_strict_response_validation: bool,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
- transport: AsyncTransport | None = None,
- proxies: ProxiesTypes | None = None,
- limits: Limits | None = None,
http_client: httpx.AsyncClient | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
) -> None:
- kwargs: dict[str, Any] = {}
- if limits is not None:
- warnings.warn(
- "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
- category=DeprecationWarning,
- stacklevel=3,
- )
- if http_client is not None:
- raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`")
- else:
- limits = DEFAULT_CONNECTION_LIMITS
-
- if transport is not None:
- kwargs["transport"] = transport
- warnings.warn(
- "The `transport` argument is deprecated. The `http_client` argument should be passed instead",
- category=DeprecationWarning,
- stacklevel=3,
- )
- if http_client is not None:
- raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
-
- if proxies is not None:
- kwargs["proxies"] = proxies
- warnings.warn(
- "The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
- category=DeprecationWarning,
- stacklevel=3,
- )
- if http_client is not None:
- raise ValueError("The `http_client` argument is mutually exclusive with `proxies`")
-
if not is_given(timeout):
# if the user passed in a custom http client with a non-default
# timeout set then we use that timeout.
@@ -1432,11 +1343,8 @@ def __init__(
super().__init__(
version=version,
base_url=base_url,
- limits=limits,
# cast to a valid type because mypy doesn't understand our type narrowing
timeout=cast(Timeout, timeout),
- proxies=proxies,
- transport=transport,
max_retries=max_retries,
custom_query=custom_query,
custom_headers=custom_headers,
@@ -1446,9 +1354,6 @@ def __init__(
base_url=base_url,
# cast to a valid type because mypy doesn't understand our type narrowing
timeout=cast(Timeout, timeout),
- limits=limits,
- follow_redirects=True,
- **kwargs, # type: ignore
)
def is_closed(self) -> bool:
From 373ef67ff40b65918b0b6c047cf932e94cc61b04 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 7 Mar 2025 23:12:38 +0000
Subject: [PATCH 055/375] feat(api): update via SDK Studio (#133)
---
.stats.yml | 2 +-
api.md | 1 -
.../resources/vector_stores/files.py | 5 ++-
.../resources/vector_stores/vector_stores.py | 9 +++--
src/mixedbread/types/__init__.py | 1 -
.../types/extractions/extraction_job.py | 34 ++++++++++++++++++-
.../types/extractions/extraction_result.py | 4 ++-
src/mixedbread/types/parsing/parsing_job.py | 3 ++
src/mixedbread/types/vector_store.py | 3 ++
.../vector_store_question_answering_params.py | 22 ++++++++++--
.../vector_store_search_options_param.py | 21 ------------
.../types/vector_store_search_params.py | 17 ++++++++--
.../types/vector_stores/file_search_params.py | 23 +++++++++++--
.../vector_stores/scored_vector_store_file.py | 2 +-
tests/api_resources/test_vector_stores.py | 16 ++++-----
.../api_resources/vector_stores/test_files.py | 10 +++---
16 files changed, 117 insertions(+), 56 deletions(-)
delete mode 100644 src/mixedbread/types/vector_store_search_options_param.py
diff --git a/.stats.yml b/.stats.yml
index 7e00acb0..e094fdf2 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 30
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-8d823477cb6d9c193492b79d7a52280e76535d9171df279807e4c145c29737e6.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-685da6b55a1d55f4aa19a9901f49a1dfc191125331565af01aa0c86a0a13428a.yml
diff --git a/api.md b/api.md
index be50ff97..7e4ff004 100644
--- a/api.md
+++ b/api.md
@@ -61,7 +61,6 @@ from mixedbread.types import (
FileCounts,
ScoredVectorStoreChunk,
VectorStore,
- VectorStoreSearchOptions,
VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index c02f54a4..ce984220 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -23,7 +23,6 @@
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.vector_store_file import VectorStoreFile
-from ...types.vector_store_search_options_param import VectorStoreSearchOptionsParam
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
@@ -260,7 +259,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: VectorStoreSearchOptionsParam | 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,
@@ -554,7 +553,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: VectorStoreSearchOptionsParam | 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/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 935d7335..6560d067 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -40,7 +40,6 @@
from ...types.expires_after_param import ExpiresAfterParam
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
-from ...types.vector_store_search_options_param import VectorStoreSearchOptionsParam
__all__ = ["VectorStoresResource", "AsyncVectorStoresResource"]
@@ -327,7 +326,7 @@ def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -392,7 +391,7 @@ def search(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: vector_store_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,
@@ -737,7 +736,7 @@ async def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -802,7 +801,7 @@ async def search(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: vector_store_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 782a1804..279eec83 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -20,7 +20,6 @@
from .vector_store_update_params import VectorStoreUpdateParams as VectorStoreUpdateParams
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
-from .vector_store_search_options_param import VectorStoreSearchOptionsParam as VectorStoreSearchOptionsParam
from .vector_store_question_answering_params import (
VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams,
)
diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py
index 5d8a1604..437f4f89 100644
--- a/src/mixedbread/types/extractions/extraction_job.py
+++ b/src/mixedbread/types/extractions/extraction_job.py
@@ -1,6 +1,8 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
from ..._models import BaseModel
from .extraction_result import ExtractionResult
@@ -9,5 +11,35 @@
class ExtractionJob(BaseModel):
+ id: str
+ """Unique identifier for the extraction job"""
+
+ organization_id: str
+ """ID of the organization that owns this job"""
+
+ file_id: str
+ """ID of the file being extracted"""
+
+ created_at: datetime
+ """When the job was created"""
+
+ updated_at: datetime
+ """When the job was last updated"""
+
+ started_at: Optional[datetime] = None
+ """When the job started processing"""
+
+ finished_at: Optional[datetime] = None
+ """When the job finished processing"""
+
+ status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
+ """Current status of the job"""
+
result: Optional[ExtractionResult] = None
- """Result of an extraction operation."""
+ """The result of an extraction job."""
+
+ error: Optional[object] = None
+ """Error information if failed"""
+
+ json_schema: object
+ """The JSON schema used for extraction"""
diff --git a/src/mixedbread/types/extractions/extraction_result.py b/src/mixedbread/types/extractions/extraction_result.py
index fbac5d5f..11a31990 100644
--- a/src/mixedbread/types/extractions/extraction_result.py
+++ b/src/mixedbread/types/extractions/extraction_result.py
@@ -1,5 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from typing import List
from ..._models import BaseModel
@@ -8,4 +9,5 @@
class ExtractionResult(BaseModel):
data: object
- """The extracted data"""
+
+ warnings: List[str]
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index 24882163..45f57310 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -79,6 +79,9 @@ class Result(BaseModel):
chunks: List[ResultChunk]
"""List of extracted chunks from the document"""
+ page_sizes: Optional[List[List[object]]] = None
+ """List of (width, height) tuples for each page"""
+
class ParsingJob(BaseModel):
id: str
diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py
index 728e6f38..b310d3e6 100644
--- a/src/mixedbread/types/vector_store.py
+++ b/src/mixedbread/types/vector_store.py
@@ -42,6 +42,9 @@ class VectorStore(BaseModel):
last_active_at: Optional[datetime] = None
"""Timestamp when the vector store was last used"""
+ usage_bytes: Optional[int] = None
+ """Total storage usage in bytes"""
+
expires_at: Optional[datetime] = None
"""Optional expiration timestamp for the vector store"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index e64939de..f381f5c1 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -5,10 +5,9 @@
from typing import List, Union, Iterable, Optional
from typing_extensions import Required, TypeAlias, TypedDict
-from .vector_store_search_options_param import VectorStoreSearchOptionsParam
from .shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
+__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "SearchOptions", "QaOptions"]
class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
@@ -27,7 +26,7 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: VectorStoreSearchOptionsParam
+ search_options: SearchOptions
"""Search configuration options"""
stream: bool
@@ -42,6 +41,23 @@ class VectorStoreQuestionAnsweringParams(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"""
+
+
class QaOptions(TypedDict, total=False):
cite: bool
"""Whether to use citations"""
diff --git a/src/mixedbread/types/vector_store_search_options_param.py b/src/mixedbread/types/vector_store_search_options_param.py
deleted file mode 100644
index ed577188..00000000
--- a/src/mixedbread/types/vector_store_search_options_param.py
+++ /dev/null
@@ -1,21 +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__ = ["VectorStoreSearchOptionsParam"]
-
-
-class VectorStoreSearchOptionsParam(TypedDict, total=False):
- return_metadata: bool
- """Whether to return file metadata"""
-
- return_chunks: bool
- """Whether to return matching text chunks"""
-
- score_threshold: float
- """Minimum similarity score threshold"""
-
- rewrite_query: bool
- """Whether to rewrite the query"""
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 137de12a..7a28385c 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -5,10 +5,9 @@
from typing import List, Union, Iterable, Optional
from typing_extensions import Required, TypeAlias, TypedDict
-from .vector_store_search_options_param import VectorStoreSearchOptionsParam
from .shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
+__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions"]
class VectorStoreSearchParams(TypedDict, total=False):
@@ -24,7 +23,7 @@ class VectorStoreSearchParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: VectorStoreSearchOptionsParam
+ search_options: SearchOptions
"""Search configuration options"""
@@ -32,4 +31,16 @@ class VectorStoreSearchParams(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"""
+
+
from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 726f2eec..c34d7611 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -5,10 +5,9 @@
from typing import List, Union, Iterable, Optional
from typing_extensions import Required, TypeAlias, TypedDict
-from ..vector_store_search_options_param import VectorStoreSearchOptionsParam
from ..shared_params.search_filter_condition import SearchFilterCondition
-__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: VectorStoreSearchOptionsParam
+ 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 9949b8c9..1e672b4a 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -41,5 +41,5 @@ class ScoredVectorStoreFile(BaseModel):
score: float
"""score of the file"""
- chunks: List[ScoredVectorStoreChunk]
+ chunks: Optional[List[ScoredVectorStoreChunk]] = None
"""chunks"""
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 3e587708..bc9e0ab3 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -274,10 +274,11 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
],
},
search_options={
- "return_metadata": True,
- "return_chunks": True,
"score_threshold": 0,
"rewrite_query": True,
+ "return_metadata": True,
+ "return_chunks": True,
+ "chunks_per_file": 0,
},
stream=True,
qa_options={"cite": True},
@@ -361,10 +362,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
],
},
search_options={
- "return_metadata": True,
- "return_chunks": True,
"score_threshold": 0,
"rewrite_query": True,
+ "return_metadata": True,
},
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@@ -651,10 +651,11 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
],
},
search_options={
- "return_metadata": True,
- "return_chunks": True,
"score_threshold": 0,
"rewrite_query": True,
+ "return_metadata": True,
+ "return_chunks": True,
+ "chunks_per_file": 0,
},
stream=True,
qa_options={"cite": True},
@@ -738,10 +739,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
],
},
search_options={
- "return_metadata": True,
- "return_chunks": True,
"score_threshold": 0,
"rewrite_query": True,
+ "return_metadata": True,
},
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 3aafe3e6..452ba22b 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -270,10 +270,11 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
],
},
search_options={
- "return_metadata": True,
- "return_chunks": True,
"score_threshold": 0,
"rewrite_query": True,
+ "return_metadata": True,
+ "return_chunks": True,
+ "chunks_per_file": 0,
},
)
assert_matches_type(FileSearchResponse, file, path=["response"])
@@ -556,10 +557,11 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
],
},
search_options={
- "return_metadata": True,
- "return_chunks": True,
"score_threshold": 0,
"rewrite_query": True,
+ "return_metadata": True,
+ "return_chunks": True,
+ "chunks_per_file": 0,
},
)
assert_matches_type(FileSearchResponse, file, path=["response"])
From b035fbf90f827fa706b63c8649869d050bc8a6d8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 7 Mar 2025 23:13:35 +0000
Subject: [PATCH 056/375] chore(internal): version bump (#134)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 7657c56b..f4710698 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.27"
+ ".": "0.1.0-alpha.28"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index a991dca3..5d3adfd2 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.27"
+version = "0.1.0-alpha.28"
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 d41c9caa..1c9503e1 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.1.0-alpha.27" # x-release-please-version
+__version__ = "0.1.0-alpha.28" # x-release-please-version
From b60fcc34912213fd3587d3811eef7c6bf7b52c6c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 7 Mar 2025 23:43:55 +0000
Subject: [PATCH 057/375] feat(api): update via SDK Studio (#135)
---
api.md | 2 ++
.../resources/vector_stores/files.py | 5 ++--
.../resources/vector_stores/vector_stores.py | 10 ++++----
src/mixedbread/types/__init__.py | 6 +++++
...vector_store_chunk_search_options_param.py | 18 ++++++++++++++
.../vector_store_file_search_options_param.py | 24 +++++++++++++++++++
.../vector_store_question_answering_params.py | 22 +++--------------
.../types/vector_store_search_params.py | 17 +++----------
.../types/vector_stores/file_search_params.py | 23 +++---------------
9 files changed, 68 insertions(+), 59 deletions(-)
create mode 100644 src/mixedbread/types/vector_store_chunk_search_options_param.py
create mode 100644 src/mixedbread/types/vector_store_file_search_options_param.py
diff --git a/api.md b/api.md
index 7e4ff004..610b9f66 100644
--- a/api.md
+++ b/api.md
@@ -61,6 +61,8 @@ from mixedbread.types import (
FileCounts,
ScoredVectorStoreChunk,
VectorStore,
+ VectorStoreChunkSearchOptions,
+ VectorStoreFileSearchOptions,
VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index ce984220..cb9c7be8 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -25,6 +25,7 @@
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 +260,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: file_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreFileSearchOptionsParam | 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,
@@ -553,7 +554,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: file_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreFileSearchOptionsParam | 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/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 6560d067..1efaec37 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -40,6 +40,8 @@
from ...types.expires_after_param import ExpiresAfterParam
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
+from ...types.vector_store_file_search_options_param import VectorStoreFileSearchOptionsParam
+from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
__all__ = ["VectorStoresResource", "AsyncVectorStoresResource"]
@@ -326,7 +328,7 @@ def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreFileSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -391,7 +393,7 @@ def search(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: vector_store_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreChunkSearchOptionsParam | 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,
@@ -736,7 +738,7 @@ async def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreFileSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -801,7 +803,7 @@ async def search(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: vector_store_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreChunkSearchOptionsParam | 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 279eec83..5c36f338 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -20,6 +20,12 @@
from .vector_store_update_params import VectorStoreUpdateParams as VectorStoreUpdateParams
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
+from .vector_store_file_search_options_param import (
+ VectorStoreFileSearchOptionsParam as VectorStoreFileSearchOptionsParam,
+)
from .vector_store_question_answering_params import (
VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams,
)
+from .vector_store_chunk_search_options_param import (
+ VectorStoreChunkSearchOptionsParam as VectorStoreChunkSearchOptionsParam,
+)
diff --git a/src/mixedbread/types/vector_store_chunk_search_options_param.py b/src/mixedbread/types/vector_store_chunk_search_options_param.py
new file mode 100644
index 00000000..a2396bec
--- /dev/null
+++ b/src/mixedbread/types/vector_store_chunk_search_options_param.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import TypedDict
+
+__all__ = ["VectorStoreChunkSearchOptionsParam"]
+
+
+class VectorStoreChunkSearchOptionsParam(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"""
diff --git a/src/mixedbread/types/vector_store_file_search_options_param.py b/src/mixedbread/types/vector_store_file_search_options_param.py
new file mode 100644
index 00000000..13ed8e95
--- /dev/null
+++ b/src/mixedbread/types/vector_store_file_search_options_param.py
@@ -0,0 +1,24 @@
+# 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 f381f5c1..d91524df 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -6,8 +6,9 @@
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__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "SearchOptions", "QaOptions"]
+__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
@@ -26,7 +27,7 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: SearchOptions
+ search_options: VectorStoreFileSearchOptionsParam
"""Search configuration options"""
stream: bool
@@ -41,23 +42,6 @@ class VectorStoreQuestionAnsweringParams(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"""
-
-
class QaOptions(TypedDict, total=False):
cite: bool
"""Whether to use citations"""
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 7a28385c..e0edc1bb 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -6,8 +6,9 @@
from typing_extensions import Required, TypeAlias, TypedDict
from .shared_params.search_filter_condition import SearchFilterCondition
+from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions"]
+__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
class VectorStoreSearchParams(TypedDict, total=False):
@@ -23,7 +24,7 @@ class VectorStoreSearchParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: SearchOptions
+ search_options: VectorStoreChunkSearchOptionsParam
"""Search configuration options"""
@@ -31,16 +32,4 @@ class VectorStoreSearchParams(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"""
-
-
from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index c34d7611..d7569c39 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -6,8 +6,9 @@
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", "SearchOptions"]
+__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2"]
class FileSearchParams(TypedDict, total=False):
@@ -23,7 +24,7 @@ class FileSearchParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: SearchOptions
+ search_options: VectorStoreFileSearchOptionsParam
"""Search configuration options"""
@@ -31,22 +32,4 @@ 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
From 2938a3f45c0ddbca39144f0ea9a0d74f61d0eff6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 7 Mar 2025 23:44:47 +0000
Subject: [PATCH 058/375] chore(internal): version bump (#137)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index f4710698..c412e974 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.28"
+ ".": "0.1.0-alpha.29"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 5d3adfd2..e2ed741c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.28"
+version = "0.1.0-alpha.29"
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 1c9503e1..731968e3 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.1.0-alpha.28" # x-release-please-version
+__version__ = "0.1.0-alpha.29" # x-release-please-version
From 4ac81fba2517d356584d967569afb381e60cb13a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 11 Mar 2025 07:41:04 +0000
Subject: [PATCH 059/375] docs: revise readme docs about nested params (#138)
---
README.md | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/README.md b/README.md
index 405d1360..2bdd40c4 100644
--- a/README.md
+++ b/README.md
@@ -142,6 +142,24 @@ for vector_store in first_page.data:
# Remove `await` for non-async usage.
```
+## Nested params
+
+Nested parameters are dictionaries, typed using `TypedDict`, for example:
+
+```python
+from mixedbread import Mixedbread
+
+client = Mixedbread()
+
+vector_store = client.vector_stores.create(
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+)
+print(vector_store.expires_after)
+```
+
## File uploads
Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
From cc2dbf6a959589b6c1ad3e9bfdc5c08edf6510c8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 11 Mar 2025 08:01:13 +0000
Subject: [PATCH 060/375] test: add DEFER_PYDANTIC_BUILD=false flag to tests
(#140)
---
scripts/test | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/test b/scripts/test
index 4fa5698b..2b878456 100755
--- a/scripts/test
+++ b/scripts/test
@@ -52,6 +52,8 @@ else
echo
fi
+export DEFER_PYDANTIC_BUILD=false
+
echo "==> Running tests"
rye run pytest "$@"
From 6e08a829f097a1778ca8afe868596f76dfc5a578 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 12 Mar 2025 00:37:08 +0000
Subject: [PATCH 061/375] feat(api): update via SDK Studio (#141)
---
.stats.yml | 2 +-
api.md | 16 +-
src/mixedbread/_client.py | 303 +++++++++++++++++-
src/mixedbread/resources/__init__.py | 14 +
src/mixedbread/resources/embeddings.py | 241 ++++++++++++++
src/mixedbread/types/__init__.py | 6 +
src/mixedbread/types/client_embed_params.py | 55 ++++
src/mixedbread/types/client_rerank_params.py | 28 ++
src/mixedbread/types/embedding.py | 19 ++
.../types/embedding_create_params.py | 55 ++++
.../types/embedding_create_response.py | 88 +++++
src/mixedbread/types/rerank_response.py | 78 +++++
tests/api_resources/test_client.py | 190 ++++++++++-
tests/api_resources/test_embeddings.py | 114 +++++++
14 files changed, 1204 insertions(+), 5 deletions(-)
create mode 100644 src/mixedbread/resources/embeddings.py
create mode 100644 src/mixedbread/types/client_embed_params.py
create mode 100644 src/mixedbread/types/client_rerank_params.py
create mode 100644 src/mixedbread/types/embedding.py
create mode 100644 src/mixedbread/types/embedding_create_params.py
create mode 100644 src/mixedbread/types/embedding_create_response.py
create mode 100644 src/mixedbread/types/rerank_response.py
create mode 100644 tests/api_resources/test_embeddings.py
diff --git a/.stats.yml b/.stats.yml
index e094fdf2..d898cf0d 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
-configured_endpoints: 30
+configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-685da6b55a1d55f4aa19a9901f49a1dfc191125331565af01aa0c86a0a13428a.yml
diff --git a/api.md b/api.md
index 610b9f66..60da71e9 100644
--- a/api.md
+++ b/api.md
@@ -9,12 +9,26 @@ from mixedbread.types import SearchFilter, SearchFilterCondition
Types:
```python
-from mixedbread.types import InfoResponse
+from mixedbread.types import InfoResponse, RerankResponse
```
Methods:
+- client.embed(\*\*params) -> EmbeddingCreateResponse
- client.info() -> InfoResponse
+- client.rerank(\*\*params) -> RerankResponse
+
+# Embeddings
+
+Types:
+
+```python
+from mixedbread.types import Embedding, EmbeddingCreateResponse
+```
+
+Methods:
+
+- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
# Parsing
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 60a8893e..80110af9 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -3,13 +3,14 @@
from __future__ import annotations
import os
-from typing import Any, Dict, Union, Mapping, cast
+from typing import Any, Dict, List, Union, Mapping, Optional, cast
from typing_extensions import Self, Literal, override
import httpx
from . import _exceptions
from ._qs import Querystring
+from .types import client_embed_params, client_rerank_params
from ._types import (
NOT_GIVEN,
Body,
@@ -24,7 +25,9 @@
)
from ._utils import (
is_given,
+ maybe_transform,
get_async_library,
+ async_maybe_transform,
)
from ._version import __version__
from ._response import (
@@ -33,7 +36,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from .resources import files
+from .resources import files, embeddings
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, MixedbreadError
from ._base_client import (
@@ -45,7 +48,9 @@
from .resources.parsing import parsing
from .types.info_response import InfoResponse
from .resources.extractions import extractions
+from .types.rerank_response import RerankResponse
from .resources.vector_stores import vector_stores
+from .types.embedding_create_response import EmbeddingCreateResponse
__all__ = [
"ENVIRONMENTS",
@@ -66,6 +71,7 @@
class Mixedbread(SyncAPIClient):
+ embeddings: embeddings.EmbeddingsResource
parsing: parsing.ParsingResource
files: files.FilesResource
vector_stores: vector_stores.VectorStoresResource
@@ -151,6 +157,7 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
+ self.embeddings = embeddings.EmbeddingsResource(self)
self.parsing = parsing.ParsingResource(self)
self.files = files.FilesResource(self)
self.vector_stores = vector_stores.VectorStoresResource(self)
@@ -231,6 +238,74 @@ def copy(
# client.with_options(timeout=10).foo.create(...)
with_options = copy
+ def embed(
+ self,
+ *,
+ model: str,
+ input: client_embed_params.Input,
+ dimensions: Optional[int] | NotGiven = NOT_GIVEN,
+ prompt: Optional[str] | NotGiven = NOT_GIVEN,
+ normalized: bool | NotGiven = NOT_GIVEN,
+ encoding_format: Union[
+ Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
+ List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
+ ]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> EmbeddingCreateResponse:
+ """
+ Create embeddings for text or images using the specified model, encoding format,
+ and normalization.
+
+ Args: params: The parameters for creating embeddings.
+
+ Returns: EmbeddingCreateResponse: The response containing the embeddings.
+
+ Args:
+ model: The model to use for creating embeddings.
+
+ input: The input to create embeddings for.
+
+ dimensions: The number of dimensions to use for the embeddings.
+
+ prompt: The prompt to use for the embedding creation.
+
+ normalized: Whether to normalize the embeddings.
+
+ encoding_format: The encoding format of the embeddings.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self.post(
+ "/v1/embeddings",
+ body=maybe_transform(
+ {
+ "model": model,
+ "input": input,
+ "dimensions": dimensions,
+ "prompt": prompt,
+ "normalized": normalized,
+ "encoding_format": encoding_format,
+ },
+ client_embed_params.ClientEmbedParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=EmbeddingCreateResponse,
+ )
+
def info(
self,
*,
@@ -254,6 +329,69 @@ def info(
cast_to=InfoResponse,
)
+ def rerank(
+ self,
+ *,
+ model: str | NotGiven = NOT_GIVEN,
+ query: str,
+ input: List[Union[str, object]],
+ rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ top_k: int | NotGiven = NOT_GIVEN,
+ return_input: 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> RerankResponse:
+ """
+ Rerank different kind of documents for a given query.
+
+ Args: params: RerankingCreateParams: The parameters for reranking.
+
+ Returns: RerankingCreateResponse: The reranked documents for the input query.
+
+ Args:
+ model: The model to use for reranking documents.
+
+ query: The query to rerank the documents.
+
+ input: The input documents to rerank.
+
+ rank_fields: The fields of the documents to rank.
+
+ top_k: The number of documents to return.
+
+ return_input: Whether to return the documents.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self.post(
+ "/v1/reranking",
+ body=maybe_transform(
+ {
+ "model": model,
+ "query": query,
+ "input": input,
+ "rank_fields": rank_fields,
+ "top_k": top_k,
+ "return_input": return_input,
+ },
+ client_rerank_params.ClientRerankParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=RerankResponse,
+ )
+
@override
def _make_status_error(
self,
@@ -289,6 +427,7 @@ def _make_status_error(
class AsyncMixedbread(AsyncAPIClient):
+ embeddings: embeddings.AsyncEmbeddingsResource
parsing: parsing.AsyncParsingResource
files: files.AsyncFilesResource
vector_stores: vector_stores.AsyncVectorStoresResource
@@ -374,6 +513,7 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
+ self.embeddings = embeddings.AsyncEmbeddingsResource(self)
self.parsing = parsing.AsyncParsingResource(self)
self.files = files.AsyncFilesResource(self)
self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
@@ -454,6 +594,74 @@ def copy(
# client.with_options(timeout=10).foo.create(...)
with_options = copy
+ async def embed(
+ self,
+ *,
+ model: str,
+ input: client_embed_params.Input,
+ dimensions: Optional[int] | NotGiven = NOT_GIVEN,
+ prompt: Optional[str] | NotGiven = NOT_GIVEN,
+ normalized: bool | NotGiven = NOT_GIVEN,
+ encoding_format: Union[
+ Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
+ List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
+ ]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> EmbeddingCreateResponse:
+ """
+ Create embeddings for text or images using the specified model, encoding format,
+ and normalization.
+
+ Args: params: The parameters for creating embeddings.
+
+ Returns: EmbeddingCreateResponse: The response containing the embeddings.
+
+ Args:
+ model: The model to use for creating embeddings.
+
+ input: The input to create embeddings for.
+
+ dimensions: The number of dimensions to use for the embeddings.
+
+ prompt: The prompt to use for the embedding creation.
+
+ normalized: Whether to normalize the embeddings.
+
+ encoding_format: The encoding format of the embeddings.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self.post(
+ "/v1/embeddings",
+ body=await async_maybe_transform(
+ {
+ "model": model,
+ "input": input,
+ "dimensions": dimensions,
+ "prompt": prompt,
+ "normalized": normalized,
+ "encoding_format": encoding_format,
+ },
+ client_embed_params.ClientEmbedParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=EmbeddingCreateResponse,
+ )
+
async def info(
self,
*,
@@ -477,6 +685,69 @@ async def info(
cast_to=InfoResponse,
)
+ async def rerank(
+ self,
+ *,
+ model: str | NotGiven = NOT_GIVEN,
+ query: str,
+ input: List[Union[str, object]],
+ rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ top_k: int | NotGiven = NOT_GIVEN,
+ return_input: 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> RerankResponse:
+ """
+ Rerank different kind of documents for a given query.
+
+ Args: params: RerankingCreateParams: The parameters for reranking.
+
+ Returns: RerankingCreateResponse: The reranked documents for the input query.
+
+ Args:
+ model: The model to use for reranking documents.
+
+ query: The query to rerank the documents.
+
+ input: The input documents to rerank.
+
+ rank_fields: The fields of the documents to rank.
+
+ top_k: The number of documents to return.
+
+ return_input: Whether to return the documents.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self.post(
+ "/v1/reranking",
+ body=await async_maybe_transform(
+ {
+ "model": model,
+ "query": query,
+ "input": input,
+ "rank_fields": rank_fields,
+ "top_k": top_k,
+ "return_input": return_input,
+ },
+ client_rerank_params.ClientRerankParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=RerankResponse,
+ )
+
@override
def _make_status_error(
self,
@@ -513,50 +784,78 @@ def _make_status_error(
class MixedbreadWithRawResponse:
def __init__(self, client: Mixedbread) -> None:
+ self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
self.parsing = parsing.ParsingResourceWithRawResponse(client.parsing)
self.files = files.FilesResourceWithRawResponse(client.files)
self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
+ self.embed = to_raw_response_wrapper(
+ client.embed,
+ )
self.info = to_raw_response_wrapper(
client.info,
)
+ self.rerank = to_raw_response_wrapper(
+ client.rerank,
+ )
class AsyncMixedbreadWithRawResponse:
def __init__(self, client: AsyncMixedbread) -> None:
+ self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
self.parsing = parsing.AsyncParsingResourceWithRawResponse(client.parsing)
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
+ self.embed = async_to_raw_response_wrapper(
+ client.embed,
+ )
self.info = async_to_raw_response_wrapper(
client.info,
)
+ self.rerank = async_to_raw_response_wrapper(
+ client.rerank,
+ )
class MixedbreadWithStreamedResponse:
def __init__(self, client: Mixedbread) -> None:
+ self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
self.parsing = parsing.ParsingResourceWithStreamingResponse(client.parsing)
self.files = files.FilesResourceWithStreamingResponse(client.files)
self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
+ self.embed = to_streamed_response_wrapper(
+ client.embed,
+ )
self.info = to_streamed_response_wrapper(
client.info,
)
+ self.rerank = to_streamed_response_wrapper(
+ client.rerank,
+ )
class AsyncMixedbreadWithStreamedResponse:
def __init__(self, client: AsyncMixedbread) -> None:
+ self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
self.parsing = parsing.AsyncParsingResourceWithStreamingResponse(client.parsing)
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
+ self.embed = async_to_streamed_response_wrapper(
+ client.embed,
+ )
self.info = async_to_streamed_response_wrapper(
client.info,
)
+ self.rerank = async_to_streamed_response_wrapper(
+ client.rerank,
+ )
Client = Mixedbread
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index 3aac6ed5..e98cf7b8 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -16,6 +16,14 @@
ParsingResourceWithStreamingResponse,
AsyncParsingResourceWithStreamingResponse,
)
+from .embeddings import (
+ EmbeddingsResource,
+ AsyncEmbeddingsResource,
+ EmbeddingsResourceWithRawResponse,
+ AsyncEmbeddingsResourceWithRawResponse,
+ EmbeddingsResourceWithStreamingResponse,
+ AsyncEmbeddingsResourceWithStreamingResponse,
+)
from .extractions import (
ExtractionsResource,
AsyncExtractionsResource,
@@ -34,6 +42,12 @@
)
__all__ = [
+ "EmbeddingsResource",
+ "AsyncEmbeddingsResource",
+ "EmbeddingsResourceWithRawResponse",
+ "AsyncEmbeddingsResourceWithRawResponse",
+ "EmbeddingsResourceWithStreamingResponse",
+ "AsyncEmbeddingsResourceWithStreamingResponse",
"ParsingResource",
"AsyncParsingResource",
"ParsingResourceWithRawResponse",
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
new file mode 100644
index 00000000..1b128973
--- /dev/null
+++ b/src/mixedbread/resources/embeddings.py
@@ -0,0 +1,241 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Optional
+from typing_extensions import Literal
+
+import httpx
+
+from ..types import embedding_create_params
+from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._utils import (
+ maybe_transform,
+ async_maybe_transform,
+)
+from .._compat import cached_property
+from .._resource import SyncAPIResource, AsyncAPIResource
+from .._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from .._base_client import make_request_options
+from ..types.embedding_create_response import EmbeddingCreateResponse
+
+__all__ = ["EmbeddingsResource", "AsyncEmbeddingsResource"]
+
+
+class EmbeddingsResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> EmbeddingsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return EmbeddingsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> EmbeddingsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return EmbeddingsResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ model: str,
+ input: embedding_create_params.Input,
+ dimensions: Optional[int] | NotGiven = NOT_GIVEN,
+ prompt: Optional[str] | NotGiven = NOT_GIVEN,
+ normalized: bool | NotGiven = NOT_GIVEN,
+ encoding_format: Union[
+ Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
+ List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
+ ]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> EmbeddingCreateResponse:
+ """
+ Create embeddings for text or images using the specified model, encoding format,
+ and normalization.
+
+ Args: params: The parameters for creating embeddings.
+
+ Returns: EmbeddingCreateResponse: The response containing the embeddings.
+
+ Args:
+ model: The model to use for creating embeddings.
+
+ input: The input to create embeddings for.
+
+ dimensions: The number of dimensions to use for the embeddings.
+
+ prompt: The prompt to use for the embedding creation.
+
+ normalized: Whether to normalize the embeddings.
+
+ encoding_format: The encoding format of the embeddings.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/embeddings",
+ body=maybe_transform(
+ {
+ "model": model,
+ "input": input,
+ "dimensions": dimensions,
+ "prompt": prompt,
+ "normalized": normalized,
+ "encoding_format": encoding_format,
+ },
+ embedding_create_params.EmbeddingCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=EmbeddingCreateResponse,
+ )
+
+
+class AsyncEmbeddingsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncEmbeddingsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncEmbeddingsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncEmbeddingsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncEmbeddingsResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ model: str,
+ input: embedding_create_params.Input,
+ dimensions: Optional[int] | NotGiven = NOT_GIVEN,
+ prompt: Optional[str] | NotGiven = NOT_GIVEN,
+ normalized: bool | NotGiven = NOT_GIVEN,
+ encoding_format: Union[
+ Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
+ List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
+ ]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> EmbeddingCreateResponse:
+ """
+ Create embeddings for text or images using the specified model, encoding format,
+ and normalization.
+
+ Args: params: The parameters for creating embeddings.
+
+ Returns: EmbeddingCreateResponse: The response containing the embeddings.
+
+ Args:
+ model: The model to use for creating embeddings.
+
+ input: The input to create embeddings for.
+
+ dimensions: The number of dimensions to use for the embeddings.
+
+ prompt: The prompt to use for the embedding creation.
+
+ normalized: Whether to normalize the embeddings.
+
+ encoding_format: The encoding format of the embeddings.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/embeddings",
+ body=await async_maybe_transform(
+ {
+ "model": model,
+ "input": input,
+ "dimensions": dimensions,
+ "prompt": prompt,
+ "normalized": normalized,
+ "encoding_format": encoding_format,
+ },
+ embedding_create_params.EmbeddingCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=EmbeddingCreateResponse,
+ )
+
+
+class EmbeddingsResourceWithRawResponse:
+ def __init__(self, embeddings: EmbeddingsResource) -> None:
+ self._embeddings = embeddings
+
+ self.create = to_raw_response_wrapper(
+ embeddings.create,
+ )
+
+
+class AsyncEmbeddingsResourceWithRawResponse:
+ def __init__(self, embeddings: AsyncEmbeddingsResource) -> None:
+ self._embeddings = embeddings
+
+ self.create = async_to_raw_response_wrapper(
+ embeddings.create,
+ )
+
+
+class EmbeddingsResourceWithStreamingResponse:
+ def __init__(self, embeddings: EmbeddingsResource) -> None:
+ self._embeddings = embeddings
+
+ self.create = to_streamed_response_wrapper(
+ embeddings.create,
+ )
+
+
+class AsyncEmbeddingsResourceWithStreamingResponse:
+ def __init__(self, embeddings: AsyncEmbeddingsResource) -> None:
+ self._embeddings = embeddings
+
+ self.create = async_to_streamed_response_wrapper(
+ embeddings.create,
+ )
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 5c36f338..18991940 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -3,17 +3,23 @@
from __future__ import annotations
from .shared import SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
+from .embedding import Embedding as Embedding
from .file_counts import FileCounts as FileCounts
from .file_object import FileObject as FileObject
from .vector_store import VectorStore as VectorStore
from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
+from .rerank_response import RerankResponse as RerankResponse
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
from .file_update_params import FileUpdateParams as FileUpdateParams
+from .client_embed_params import ClientEmbedParams as ClientEmbedParams
from .expires_after_param import ExpiresAfterParam as ExpiresAfterParam
+from .client_rerank_params import ClientRerankParams as ClientRerankParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
+from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
+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
diff --git a/src/mixedbread/types/client_embed_params.py b/src/mixedbread/types/client_embed_params.py
new file mode 100644
index 00000000..e216a9f7
--- /dev/null
+++ b/src/mixedbread/types/client_embed_params.py
@@ -0,0 +1,55 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Optional
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
+
+__all__ = ["ClientEmbedParams", "Input", "InputImageURLInput", "InputImageURLInputImage", "InputTextInput"]
+
+
+class ClientEmbedParams(TypedDict, total=False):
+ model: Required[str]
+ """The model to use for creating embeddings."""
+
+ input: Required[Input]
+ """The input to create embeddings for."""
+
+ dimensions: Optional[int]
+ """The number of dimensions to use for the embeddings."""
+
+ prompt: Optional[str]
+ """The prompt to use for the embedding creation."""
+
+ normalized: bool
+ """Whether to normalize the embeddings."""
+
+ encoding_format: Union[
+ Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
+ List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
+ ]
+ """The encoding format of the embeddings."""
+
+
+class InputImageURLInputImage(TypedDict, total=False):
+ url: Required[str]
+ """The image URL. Can be either a URL or a Data URI."""
+
+
+class InputImageURLInput(TypedDict, total=False):
+ type: Literal["image_url"]
+ """Input type identifier"""
+
+ image: Required[InputImageURLInputImage]
+ """The image input specification."""
+
+
+class InputTextInput(TypedDict, total=False):
+ type: Literal["text"]
+ """Input type identifier"""
+
+ text: Required[str]
+ """Text content to process"""
+
+
+Input: TypeAlias = Union[str, InputImageURLInput, InputTextInput]
diff --git a/src/mixedbread/types/client_rerank_params.py b/src/mixedbread/types/client_rerank_params.py
new file mode 100644
index 00000000..85b40928
--- /dev/null
+++ b/src/mixedbread/types/client_rerank_params.py
@@ -0,0 +1,28 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Optional
+from typing_extensions import Required, TypedDict
+
+__all__ = ["ClientRerankParams"]
+
+
+class ClientRerankParams(TypedDict, total=False):
+ model: str
+ """The model to use for reranking documents."""
+
+ query: Required[str]
+ """The query to rerank the documents."""
+
+ input: Required[List[Union[str, object]]]
+ """The input documents to rerank."""
+
+ rank_fields: Optional[List[str]]
+ """The fields of the documents to rank."""
+
+ top_k: int
+ """The number of documents to return."""
+
+ return_input: bool
+ """Whether to return the documents."""
diff --git a/src/mixedbread/types/embedding.py b/src/mixedbread/types/embedding.py
new file mode 100644
index 00000000..ad8cd3f0
--- /dev/null
+++ b/src/mixedbread/types/embedding.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["Embedding"]
+
+
+class Embedding(BaseModel):
+ embedding: Union[List[float], List[int], str]
+ """The encoded embedding."""
+
+ index: int
+ """The index of the embedding."""
+
+ object: Literal["embedding"]
+ """The object type of the embedding."""
diff --git a/src/mixedbread/types/embedding_create_params.py b/src/mixedbread/types/embedding_create_params.py
new file mode 100644
index 00000000..271ac261
--- /dev/null
+++ b/src/mixedbread/types/embedding_create_params.py
@@ -0,0 +1,55 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Optional
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
+
+__all__ = ["EmbeddingCreateParams", "Input", "InputImageURLInput", "InputImageURLInputImage", "InputTextInput"]
+
+
+class EmbeddingCreateParams(TypedDict, total=False):
+ model: Required[str]
+ """The model to use for creating embeddings."""
+
+ input: Required[Input]
+ """The input to create embeddings for."""
+
+ dimensions: Optional[int]
+ """The number of dimensions to use for the embeddings."""
+
+ prompt: Optional[str]
+ """The prompt to use for the embedding creation."""
+
+ normalized: bool
+ """Whether to normalize the embeddings."""
+
+ encoding_format: Union[
+ Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
+ List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
+ ]
+ """The encoding format of the embeddings."""
+
+
+class InputImageURLInputImage(TypedDict, total=False):
+ url: Required[str]
+ """The image URL. Can be either a URL or a Data URI."""
+
+
+class InputImageURLInput(TypedDict, total=False):
+ type: Literal["image_url"]
+ """Input type identifier"""
+
+ image: Required[InputImageURLInputImage]
+ """The image input specification."""
+
+
+class InputTextInput(TypedDict, total=False):
+ type: Literal["text"]
+ """Input type identifier"""
+
+ text: Required[str]
+ """Text content to process"""
+
+
+Input: TypeAlias = Union[str, InputImageURLInput, InputTextInput]
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
new file mode 100644
index 00000000..ccd043b9
--- /dev/null
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -0,0 +1,88 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import builtins
+from typing import List, Union, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .embedding import Embedding
+
+__all__ = ["EmbeddingCreateResponse", "Usage", "DataUnionMember1", "DataUnionMember1Embedding"]
+
+
+class Usage(BaseModel):
+ prompt_tokens: int
+ """The number of tokens used for the prompt"""
+
+ total_tokens: int
+ """The total number of tokens used"""
+
+ completion_tokens: Optional[int] = None
+ """The number of tokens used for the completion"""
+
+
+class DataUnionMember1Embedding(BaseModel):
+ float: Optional[List[builtins.float]] = None
+
+ int8: Optional[List[int]] = None
+
+ uint8: Optional[List[int]] = None
+
+ binary: Optional[List[int]] = None
+
+ ubinary: Optional[List[int]] = None
+
+ base64: Optional[List[str]] = None
+
+
+class DataUnionMember1(BaseModel):
+ embedding: DataUnionMember1Embedding
+ """
+ The encoded embedding data by encoding format.Returned, if more than one
+ encoding format is used.
+ """
+
+ index: int
+ """The index of the embedding."""
+
+ object: Literal["embedding_dict"]
+ """The object type of the embedding."""
+
+
+class EmbeddingCreateResponse(BaseModel):
+ usage: Usage
+ """The usage of the model"""
+
+ model: str
+ """The model used"""
+
+ data: Union[List[Embedding], List[DataUnionMember1]]
+ """The created embeddings."""
+
+ object: Optional[
+ Literal[
+ "list",
+ "parsing_job",
+ "job",
+ "embedding",
+ "embedding_dict",
+ "text_document",
+ "file",
+ "vector_store",
+ "vector_store.file",
+ "api_key",
+ ]
+ ] = None
+ """The object type of the response"""
+
+ normalized: bool
+ """Whether the embeddings are normalized."""
+
+ encoding_format: Union[
+ Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
+ List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
+ ]
+ """The encoding format of the embeddings."""
+
+ dimensions: Optional[int] = None
+ """The number of dimensions used for the embeddings."""
diff --git a/src/mixedbread/types/rerank_response.py b/src/mixedbread/types/rerank_response.py
new file mode 100644
index 00000000..70121831
--- /dev/null
+++ b/src/mixedbread/types/rerank_response.py
@@ -0,0 +1,78 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["RerankResponse", "Usage", "Data"]
+
+
+class Usage(BaseModel):
+ prompt_tokens: int
+ """The number of tokens used for the prompt"""
+
+ total_tokens: int
+ """The total number of tokens used"""
+
+ completion_tokens: Optional[int] = None
+ """The number of tokens used for the completion"""
+
+
+class Data(BaseModel):
+ index: int
+
+ score: float
+ """The score of the document."""
+
+ input: object
+ """The input document."""
+
+ object: Optional[
+ Literal[
+ "list",
+ "parsing_job",
+ "job",
+ "embedding",
+ "embedding_dict",
+ "text_document",
+ "file",
+ "vector_store",
+ "vector_store.file",
+ "api_key",
+ ]
+ ] = None
+ """The object type."""
+
+
+class RerankResponse(BaseModel):
+ usage: Usage
+ """The usage of the model"""
+
+ model: str
+ """The model used"""
+
+ data: List[Data]
+ """The ranked documents."""
+
+ object: Optional[
+ Literal[
+ "list",
+ "parsing_job",
+ "job",
+ "embedding",
+ "embedding_dict",
+ "text_document",
+ "file",
+ "vector_store",
+ "vector_store.file",
+ "api_key",
+ ]
+ ] = None
+ """The object type of the response"""
+
+ top_k: int
+ """The number of documents to return."""
+
+ return_input: bool
+ """Whether to return the documents."""
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index 6b84bb7a..9052c3be 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -9,7 +9,11 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import InfoResponse
+from mixedbread.types import (
+ InfoResponse,
+ RerankResponse,
+ EmbeddingCreateResponse,
+)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -17,6 +21,52 @@
class TestClient:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+ @parametrize
+ def test_method_embed(self, client: Mixedbread) -> None:
+ client_ = client.embed(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ )
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+
+ @parametrize
+ def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
+ client_ = client.embed(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ dimensions=768,
+ prompt="Provide a detailed summary of the following text.",
+ normalized=True,
+ encoding_format="float",
+ )
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+
+ @parametrize
+ def test_raw_response_embed(self, client: Mixedbread) -> None:
+ response = client.with_raw_response.embed(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ client_ = response.parse()
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+
+ @parametrize
+ def test_streaming_response_embed(self, client: Mixedbread) -> None:
+ with client.with_streaming_response.embed(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ client_ = response.parse()
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
@parametrize
def test_method_info(self, client: Mixedbread) -> None:
client_ = client.info()
@@ -42,10 +92,102 @@ def test_streaming_response_info(self, client: Mixedbread) -> None:
assert cast(Any, response.is_closed) is True
+ @parametrize
+ def test_method_rerank(self, client: Mixedbread) -> None:
+ client_ = client.rerank(
+ query="What is mixedbread ai?",
+ input=["Document 1", "Document 2"],
+ )
+ assert_matches_type(RerankResponse, client_, path=["response"])
+
+ @parametrize
+ def test_method_rerank_with_all_params(self, client: Mixedbread) -> None:
+ client_ = client.rerank(
+ model="x",
+ query="What is mixedbread ai?",
+ input=["Document 1", "Document 2"],
+ rank_fields=["field1", "field2"],
+ top_k=10,
+ return_input=False,
+ )
+ assert_matches_type(RerankResponse, client_, path=["response"])
+
+ @parametrize
+ def test_raw_response_rerank(self, client: Mixedbread) -> None:
+ response = client.with_raw_response.rerank(
+ query="What is mixedbread ai?",
+ input=["Document 1", "Document 2"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ client_ = response.parse()
+ assert_matches_type(RerankResponse, client_, path=["response"])
+
+ @parametrize
+ def test_streaming_response_rerank(self, client: Mixedbread) -> None:
+ with client.with_streaming_response.rerank(
+ query="What is mixedbread ai?",
+ input=["Document 1", "Document 2"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ client_ = response.parse()
+ assert_matches_type(RerankResponse, client_, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
class TestAsyncClient:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ @parametrize
+ async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
+ client = await async_client.embed(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ )
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+
+ @parametrize
+ async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ client = await async_client.embed(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ dimensions=768,
+ prompt="Provide a detailed summary of the following text.",
+ normalized=True,
+ encoding_format="float",
+ )
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+
+ @parametrize
+ async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.with_raw_response.embed(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ client = await response.parse()
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_embed(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.with_streaming_response.embed(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ client = await response.parse()
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
@parametrize
async def test_method_info(self, async_client: AsyncMixedbread) -> None:
client = await async_client.info()
@@ -70,3 +212,49 @@ async def test_streaming_response_info(self, async_client: AsyncMixedbread) -> N
assert_matches_type(InfoResponse, client, path=["response"])
assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_rerank(self, async_client: AsyncMixedbread) -> None:
+ client = await async_client.rerank(
+ query="What is mixedbread ai?",
+ input=["Document 1", "Document 2"],
+ )
+ assert_matches_type(RerankResponse, client, path=["response"])
+
+ @parametrize
+ async def test_method_rerank_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ client = await async_client.rerank(
+ model="x",
+ query="What is mixedbread ai?",
+ input=["Document 1", "Document 2"],
+ rank_fields=["field1", "field2"],
+ top_k=10,
+ return_input=False,
+ )
+ assert_matches_type(RerankResponse, client, path=["response"])
+
+ @parametrize
+ async def test_raw_response_rerank(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.with_raw_response.rerank(
+ query="What is mixedbread ai?",
+ input=["Document 1", "Document 2"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ client = await response.parse()
+ assert_matches_type(RerankResponse, client, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_rerank(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.with_streaming_response.rerank(
+ query="What is mixedbread ai?",
+ input=["Document 1", "Document 2"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ client = await response.parse()
+ assert_matches_type(RerankResponse, client, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py
new file mode 100644
index 00000000..38ff5153
--- /dev/null
+++ b/tests/api_resources/test_embeddings.py
@@ -0,0 +1,114 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types import EmbeddingCreateResponse
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestEmbeddings:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ embedding = client.embeddings.create(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ )
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
+ embedding = client.embeddings.create(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ dimensions=768,
+ prompt="Provide a detailed summary of the following text.",
+ normalized=True,
+ encoding_format="float",
+ )
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.embeddings.with_raw_response.create(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ embedding = response.parse()
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.embeddings.with_streaming_response.create(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ embedding = response.parse()
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncEmbeddings:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ embedding = await async_client.embeddings.create(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ )
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ embedding = await async_client.embeddings.create(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ dimensions=768,
+ prompt="Provide a detailed summary of the following text.",
+ normalized=True,
+ encoding_format="float",
+ )
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.embeddings.with_raw_response.create(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ embedding = await response.parse()
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.embeddings.with_streaming_response.create(
+ model="mixedbread-ai/mxbai-embed-large-v1",
+ input="This is a sample text input.",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ embedding = await response.parse()
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
From 526df5a5359d0a82f0006290440834f3a29e4278 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 12 Mar 2025 00:38:01 +0000
Subject: [PATCH 062/375] chore(internal): version bump (#142)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index c412e974..52b3e834 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.29"
+ ".": "0.1.0-alpha.30"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index e2ed741c..becc1be9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.29"
+version = "0.1.0-alpha.30"
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 731968e3..9bdf7f0a 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.1.0-alpha.29" # x-release-please-version
+__version__ = "0.1.0-alpha.30" # x-release-please-version
From e5c22931a8205ed1b6a6e6ebb337a0d3979998b4 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 12 Mar 2025 17:42:19 +0000
Subject: [PATCH 063/375] feat(api): update via SDK Studio (#143)
---
.stats.yml | 2 +-
src/mixedbread/types/parsing/job_list_response.py | 3 +++
src/mixedbread/types/parsing/parsing_job.py | 3 +++
.../types/vector_stores/file_create_params.py | 3 +++
tests/api_resources/vector_stores/test_files.py | 10 ++++++++--
5 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index d898cf0d..040e2b9d 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 32
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-685da6b55a1d55f4aa19a9901f49a1dfc191125331565af01aa0c86a0a13428a.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-2ef86079ac853f4d03a966ed6b8407bc42c01a5bc8ec89070ebaf5c49e4f56b8.yml
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index 95bda9c8..c9136d2f 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -13,6 +13,9 @@ class JobListResponse(BaseModel):
id: str
"""The ID of the job"""
+ file_id: str
+ """The ID of the file to parse"""
+
status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
"""The status of the job"""
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index 45f57310..9e9bb92c 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -87,6 +87,9 @@ class ParsingJob(BaseModel):
id: str
"""The ID of the job"""
+ file_id: str
+ """The ID of the file to parse"""
+
status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
"""The status of the job"""
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
index a64ff551..e94f5505 100644
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -21,3 +21,6 @@ class FileCreateParams(TypedDict, total=False):
class Experimental(TypedDict, total=False):
parsing_strategy: Literal["fast", "high_quality"]
"""Strategy for adding the file"""
+
+ contextualization: bool
+ """Whether to contextualize the file"""
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 452ba22b..ff4d7a91 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -36,7 +36,10 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
metadata={},
- experimental={"parsing_strategy": "fast"},
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -323,7 +326,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
metadata={},
- experimental={"parsing_strategy": "fast"},
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
)
assert_matches_type(VectorStoreFile, file, path=["response"])
From 37388f9e9384b2c1dd3625e2a2f56ab7b27afc87 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 12 Mar 2025 17:43:28 +0000
Subject: [PATCH 064/375] chore(internal): version bump (#145)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 52b3e834..a899ac74 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.30"
+ ".": "0.1.0-alpha.31"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index becc1be9..2a0fd448 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.30"
+version = "0.1.0-alpha.31"
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 9bdf7f0a..b935be8c 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.1.0-alpha.30" # x-release-please-version
+__version__ = "0.1.0-alpha.31" # x-release-please-version
From 94a0ecd63443d21b7c9712b027debf1fdbc05e35 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 14 Mar 2025 05:45:01 +0000
Subject: [PATCH 065/375] chore(internal): remove extra empty newlines (#146)
---
pyproject.toml | 2 --
1 file changed, 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 2a0fd448..e62b5265 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -38,7 +38,6 @@ Homepage = "https://github.com/mixedbread-ai/mixedbread-python"
Repository = "https://github.com/mixedbread-ai/mixedbread-python"
-
[tool.rye]
managed = true
# version pins are in requirements-dev.lock
@@ -152,7 +151,6 @@ reportImplicitOverride = true
reportImportCycles = false
reportPrivateUsage = false
-
[tool.ruff]
line-length = 120
output-format = "grouped"
From c9575ccd1d931428299b399742dbeb6032a0e0c1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 15 Mar 2025 04:32:17 +0000
Subject: [PATCH 066/375] chore(internal): codegen related update (#148)
---
requirements-dev.lock | 1 +
requirements.lock | 1 +
2 files changed, 2 insertions(+)
diff --git a/requirements-dev.lock b/requirements-dev.lock
index 932688f2..6dbb147d 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -7,6 +7,7 @@
# all-features: true
# with-sources: false
# generate-hashes: false
+# universal: false
-e file:.
annotated-types==0.6.0
diff --git a/requirements.lock b/requirements.lock
index 69e71cb9..f81f62cc 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -7,6 +7,7 @@
# all-features: true
# with-sources: false
# generate-hashes: false
+# universal: false
-e file:.
annotated-types==0.6.0
From 6e1b27e6fe009f6397e834c5a3b09b00bd4646c9 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 15 Mar 2025 04:40:14 +0000
Subject: [PATCH 067/375] chore(internal): bump rye to 0.44.0 (#149)
---
.devcontainer/Dockerfile | 2 +-
.github/workflows/ci.yml | 4 ++--
.github/workflows/publish-pypi.yml | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 55d20255..ff261bad 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
USER vscode
-RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
+RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c8a8a4f7..3b286e5a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -21,7 +21,7 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
- RYE_VERSION: '0.35.0'
+ RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install dependencies
@@ -42,7 +42,7 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
- RYE_VERSION: '0.35.0'
+ RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Bootstrap
diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml
index 467239d4..1198ae86 100644
--- a/.github/workflows/publish-pypi.yml
+++ b/.github/workflows/publish-pypi.yml
@@ -21,7 +21,7 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
- RYE_VERSION: '0.35.0'
+ RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'
- name: Publish to PyPI
From 3edef656300d012732b82a953e9be44d8b46f39f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 15 Mar 2025 04:46:23 +0000
Subject: [PATCH 068/375] fix(types): handle more discriminated union shapes
(#150)
---
src/mixedbread/_models.py | 7 +++++--
tests/test_models.py | 32 ++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index c4401ff8..b51a1bf5 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -65,7 +65,7 @@
from ._constants import RAW_RESPONSE_HEADER
if TYPE_CHECKING:
- from pydantic_core.core_schema import ModelField, LiteralSchema, ModelFieldsSchema
+ from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema
__all__ = ["BaseModel", "GenericModel"]
@@ -646,15 +646,18 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
def _extract_field_schema_pv2(model: type[BaseModel], field_name: str) -> ModelField | None:
schema = model.__pydantic_core_schema__
+ if schema["type"] == "definitions":
+ schema = schema["schema"]
+
if schema["type"] != "model":
return None
+ schema = cast("ModelSchema", schema)
fields_schema = schema["schema"]
if fields_schema["type"] != "model-fields":
return None
fields_schema = cast("ModelFieldsSchema", fields_schema)
-
field = fields_schema["fields"].get(field_name)
if not field:
return None
diff --git a/tests/test_models.py b/tests/test_models.py
index 0176e2e8..fa8f6491 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -854,3 +854,35 @@ class Model(BaseModel):
m = construct_type(value={"cls": "foo"}, type_=Model)
assert isinstance(m, Model)
assert isinstance(m.cls, str)
+
+
+def test_discriminated_union_case() -> None:
+ class A(BaseModel):
+ type: Literal["a"]
+
+ data: bool
+
+ class B(BaseModel):
+ type: Literal["b"]
+
+ data: List[Union[A, object]]
+
+ class ModelA(BaseModel):
+ type: Literal["modelA"]
+
+ data: int
+
+ class ModelB(BaseModel):
+ type: Literal["modelB"]
+
+ required: str
+
+ data: Union[A, B]
+
+ # when constructing ModelA | ModelB, value data doesn't match ModelB exactly - missing `required`
+ m = construct_type(
+ value={"type": "modelB", "data": {"type": "a", "data": True}},
+ type_=cast(Any, Annotated[Union[ModelA, ModelB], PropertyInfo(discriminator="type")]),
+ )
+
+ assert isinstance(m, ModelB)
From d60406b7875bbcef124646da1d90ec9c2312ba66 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 17 Mar 2025 16:20:45 +0000
Subject: [PATCH 069/375] fix(ci): ensure pip is always available (#151)
---
bin/publish-pypi | 1 +
1 file changed, 1 insertion(+)
diff --git a/bin/publish-pypi b/bin/publish-pypi
index 05bfccbb..ebebf916 100644
--- a/bin/publish-pypi
+++ b/bin/publish-pypi
@@ -5,5 +5,6 @@ mkdir -p dist
rye build --clean
# Patching importlib-metadata version until upstream library version is updated
# https://github.com/pypa/twine/issues/977#issuecomment-2189800841
+"$HOME/.rye/self/bin/python3" -m ensurepip
"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1'
rye publish --yes --token=$PYPI_TOKEN
From adb7170eb8b3729773a7dd94a01b077173068fee Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 17 Mar 2025 16:21:47 +0000
Subject: [PATCH 070/375] chore(internal): version bump (#152)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index a899ac74..2ce25fec 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.31"
+ ".": "0.1.0-alpha.32"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index e62b5265..34ad5da4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.31"
+version = "0.1.0-alpha.32"
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 b935be8c..bfe62c40 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.1.0-alpha.31" # x-release-please-version
+__version__ = "0.1.0-alpha.32" # x-release-please-version
From de09fa53fd8dff8fc9e2a91b0607ddd15bdb7f0f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 17 Mar 2025 16:28:10 +0000
Subject: [PATCH 071/375] fix(ci): remove publishing patch (#153)
---
bin/publish-pypi | 4 ----
pyproject.toml | 2 +-
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/bin/publish-pypi b/bin/publish-pypi
index ebebf916..826054e9 100644
--- a/bin/publish-pypi
+++ b/bin/publish-pypi
@@ -3,8 +3,4 @@
set -eux
mkdir -p dist
rye build --clean
-# Patching importlib-metadata version until upstream library version is updated
-# https://github.com/pypa/twine/issues/977#issuecomment-2189800841
-"$HOME/.rye/self/bin/python3" -m ensurepip
-"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1'
rye publish --yes --token=$PYPI_TOKEN
diff --git a/pyproject.toml b/pyproject.toml
index 34ad5da4..ec1413e8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -86,7 +86,7 @@ typecheck = { chain = [
"typecheck:mypy" = "mypy ."
[build-system]
-requires = ["hatchling", "hatch-fancy-pypi-readme"]
+requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
[tool.hatch.build]
From 635d275f7fbc92afacb0cc24f1776bc93802c99e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 27 Mar 2025 03:50:12 +0000
Subject: [PATCH 072/375] chore: fix typos (#155)
---
src/mixedbread/_models.py | 2 +-
src/mixedbread/_utils/_transform.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index b51a1bf5..34935716 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -681,7 +681,7 @@ def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None:
setattr(typ, "__pydantic_config__", config) # noqa: B010
-# our use of subclasssing here causes weirdness for type checkers,
+# our use of subclassing here causes weirdness for type checkers,
# so we just pretend that we don't subclass
if TYPE_CHECKING:
GenericModel = BaseModel
diff --git a/src/mixedbread/_utils/_transform.py b/src/mixedbread/_utils/_transform.py
index 18afd9d8..7ac2e17f 100644
--- a/src/mixedbread/_utils/_transform.py
+++ b/src/mixedbread/_utils/_transform.py
@@ -126,7 +126,7 @@ def _get_annotated_type(type_: type) -> type | None:
def _maybe_transform_key(key: str, type_: type) -> str:
"""Transform the given `data` based on the annotations provided in `type_`.
- Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata.
+ Note: this function only looks at `Annotated` types that contain `PropertyInfo` metadata.
"""
annotated_type = _get_annotated_type(type_)
if annotated_type is None:
From 75e2be45c77a19e34d42049b5ce503d80bbf8a41 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 27 Mar 2025 03:51:18 +0000
Subject: [PATCH 073/375] chore: add hash of OpenAPI spec/config inputs to
.stats.yml (#156)
---
.release-please-manifest.json | 2 +-
.stats.yml | 2 ++
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 2ce25fec..ff4f9a50 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.32"
+ ".": "0.1.0-alpha.33"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 040e2b9d..0a58ef4e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-2ef86079ac853f4d03a966ed6b8407bc42c01a5bc8ec89070ebaf5c49e4f56b8.yml
+openapi_spec_hash: fbba387d4317317aed486fb160a63797
+config_hash: 52e7472faf7b81b5fda98bd67bd7d0d9
diff --git a/pyproject.toml b/pyproject.toml
index ec1413e8..6e74aa36 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.32"
+version = "0.1.0-alpha.33"
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 bfe62c40..d11bb72a 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.1.0-alpha.32" # x-release-please-version
+__version__ = "0.1.0-alpha.33" # x-release-please-version
From cdf975907737a349f108223818e0411c34a76f5b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 28 Mar 2025 21:11:43 +0000
Subject: [PATCH 074/375] feat(api): update via SDK Studio (#158)
---
.stats.yml | 4 ++--
src/mixedbread/types/scored_vector_store_chunk.py | 3 +++
.../types/vector_stores/scored_vector_store_file.py | 3 +++
src/mixedbread/types/vector_stores/vector_store_file.py | 3 +++
4 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 0a58ef4e..eb0b804e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-2ef86079ac853f4d03a966ed6b8407bc42c01a5bc8ec89070ebaf5c49e4f56b8.yml
-openapi_spec_hash: fbba387d4317317aed486fb160a63797
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e49fa63938c7d1a40e291d7b3f486a09b88afbbecb89bb42e4f06438a1ea9f21.yml
+openapi_spec_hash: 09cf222f034cb196974b7c7c131cc860
config_hash: 52e7472faf7b81b5fda98bd67bd7d0d9
diff --git a/src/mixedbread/types/scored_vector_store_chunk.py b/src/mixedbread/types/scored_vector_store_chunk.py
index 51a04ced..33a37463 100644
--- a/src/mixedbread/types/scored_vector_store_chunk.py
+++ b/src/mixedbread/types/scored_vector_store_chunk.py
@@ -48,6 +48,9 @@ class ScoredVectorStoreChunk(BaseModel):
file_id: str
"""file id"""
+ filename: str
+ """filename"""
+
vector_store_id: str
"""vector store id"""
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 1e672b4a..72d6b8bc 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -14,6 +14,9 @@ class ScoredVectorStoreFile(BaseModel):
id: str
"""Unique identifier for the file"""
+ filename: Optional[str] = None
+ """Name of the file"""
+
metadata: Optional[object] = None
"""Optional file metadata"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 18c28ce0..39bdb685 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -13,6 +13,9 @@ class VectorStoreFile(BaseModel):
id: str
"""Unique identifier for the file"""
+ filename: Optional[str] = None
+ """Name of the file"""
+
metadata: Optional[object] = None
"""Optional file metadata"""
From 805f799e353aee49e743a512147f4395ff79e061 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 28 Mar 2025 21:12:47 +0000
Subject: [PATCH 075/375] chore(internal): version bump (#159)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index ff4f9a50..36b2affb 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.33"
+ ".": "0.1.0-alpha.34"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 6e74aa36..ab490eae 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.33"
+version = "0.1.0-alpha.34"
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 d11bb72a..0304e57a 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.1.0-alpha.33" # x-release-please-version
+__version__ = "0.1.0-alpha.34" # x-release-please-version
From cb224d5535ef13a756bed888370bd549950e9e30 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 29 Mar 2025 07:25:48 +0000
Subject: [PATCH 076/375] feat(api): update via SDK Studio (#160)
---
.stats.yml | 4 +--
src/mixedbread/_client.py | 10 +++---
src/mixedbread/resources/embeddings.py | 10 +++---
.../resources/extractions/content.py | 6 ++--
src/mixedbread/resources/extractions/jobs.py | 6 ++--
.../resources/extractions/schema.py | 10 +++---
src/mixedbread/types/client_embed_params.py | 33 ++++---------------
src/mixedbread/types/embedding.py | 4 +--
.../types/embedding_create_params.py | 33 ++++---------------
.../types/embedding_create_response.py | 8 ++---
.../extractions/content_create_params.py | 3 +-
.../types/extractions/created_json_schema.py | 3 +-
.../types/extractions/enhanced_json_schema.py | 3 +-
.../types/extractions/extraction_job.py | 6 ++--
.../types/extractions/extraction_result.py | 4 +--
.../types/extractions/job_create_params.py | 3 +-
.../extractions/schema_enhance_params.py | 3 +-
.../extractions/schema_validate_params.py | 3 +-
.../extractions/validated_json_schema.py | 4 +--
src/mixedbread/types/rerank_response.py | 20 +++--------
.../api_resources/extractions/test_content.py | 12 +++----
tests/api_resources/extractions/test_jobs.py | 12 +++----
.../api_resources/extractions/test_schema.py | 24 +++++++-------
tests/api_resources/test_client.py | 16 ++++-----
tests/api_resources/test_embeddings.py | 16 ++++-----
25 files changed, 109 insertions(+), 147 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index eb0b804e..d87685dc 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e49fa63938c7d1a40e291d7b3f486a09b88afbbecb89bb42e4f06438a1ea9f21.yml
-openapi_spec_hash: 09cf222f034cb196974b7c7c131cc860
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
+openapi_spec_hash: bfb0b19d1094dc80774c752f9b84185e
config_hash: 52e7472faf7b81b5fda98bd67bd7d0d9
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 80110af9..e2ce4c5f 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -242,7 +242,7 @@ def embed(
self,
*,
model: str,
- input: client_embed_params.Input,
+ input: List[str],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
@@ -277,7 +277,8 @@ def embed(
normalized: Whether to normalize the embeddings.
- encoding_format: The encoding format of the embeddings.
+ encoding_format: The encoding format(s) of the embeddings. Can be a single format or a list of
+ formats.
extra_headers: Send extra headers
@@ -598,7 +599,7 @@ async def embed(
self,
*,
model: str,
- input: client_embed_params.Input,
+ input: List[str],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
@@ -633,7 +634,8 @@ async def embed(
normalized: Whether to normalize the embeddings.
- encoding_format: The encoding format of the embeddings.
+ encoding_format: The encoding format(s) of the embeddings. Can be a single format or a list of
+ formats.
extra_headers: Send extra headers
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index 1b128973..d7390eda 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -51,7 +51,7 @@ def create(
self,
*,
model: str,
- input: embedding_create_params.Input,
+ input: List[str],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
@@ -86,7 +86,8 @@ def create(
normalized: Whether to normalize the embeddings.
- encoding_format: The encoding format of the embeddings.
+ encoding_format: The encoding format(s) of the embeddings. Can be a single format or a list of
+ formats.
extra_headers: Send extra headers
@@ -140,7 +141,7 @@ async def create(
self,
*,
model: str,
- input: embedding_create_params.Input,
+ input: List[str],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
@@ -175,7 +176,8 @@ async def create(
normalized: Whether to normalize the embeddings.
- encoding_format: The encoding format of the embeddings.
+ encoding_format: The encoding format(s) of the embeddings. Can be a single format or a list of
+ formats.
extra_headers: Send extra headers
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
index cacd55a6..2d1b896f 100644
--- a/src/mixedbread/resources/extractions/content.py
+++ b/src/mixedbread/resources/extractions/content.py
@@ -2,6 +2,8 @@
from __future__ import annotations
+from typing import Dict
+
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -48,7 +50,7 @@ def create(
self,
*,
content: str,
- json_schema: object,
+ json_schema: Dict[str, object],
# 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,
@@ -116,7 +118,7 @@ async def create(
self,
*,
content: str,
- json_schema: object,
+ json_schema: Dict[str, object],
# 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/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py
index 3abc64f9..d127824c 100644
--- a/src/mixedbread/resources/extractions/jobs.py
+++ b/src/mixedbread/resources/extractions/jobs.py
@@ -2,6 +2,8 @@
from __future__ import annotations
+from typing import Dict
+
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -48,7 +50,7 @@ def create(
self,
*,
file_id: str,
- json_schema: object,
+ json_schema: Dict[str, object],
# 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,
@@ -155,7 +157,7 @@ async def create(
self,
*,
file_id: str,
- json_schema: object,
+ json_schema: Dict[str, object],
# 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/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py
index 60ee00a5..d92032fa 100644
--- a/src/mixedbread/resources/extractions/schema.py
+++ b/src/mixedbread/resources/extractions/schema.py
@@ -2,6 +2,8 @@
from __future__ import annotations
+from typing import Dict
+
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -87,7 +89,7 @@ def create(
def enhance(
self,
*,
- json_schema: object,
+ json_schema: Dict[str, object],
# 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,
@@ -125,7 +127,7 @@ def enhance(
def validate(
self,
*,
- json_schema: object,
+ json_schema: Dict[str, object],
# 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,
@@ -222,7 +224,7 @@ async def create(
async def enhance(
self,
*,
- json_schema: object,
+ json_schema: Dict[str, object],
# 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,
@@ -260,7 +262,7 @@ async def enhance(
async def validate(
self,
*,
- json_schema: object,
+ json_schema: Dict[str, object],
# 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/client_embed_params.py b/src/mixedbread/types/client_embed_params.py
index e216a9f7..ec6a6e8b 100644
--- a/src/mixedbread/types/client_embed_params.py
+++ b/src/mixedbread/types/client_embed_params.py
@@ -3,16 +3,16 @@
from __future__ import annotations
from typing import List, Union, Optional
-from typing_extensions import Literal, Required, TypeAlias, TypedDict
+from typing_extensions import Literal, Required, TypedDict
-__all__ = ["ClientEmbedParams", "Input", "InputImageURLInput", "InputImageURLInputImage", "InputTextInput"]
+__all__ = ["ClientEmbedParams"]
class ClientEmbedParams(TypedDict, total=False):
model: Required[str]
"""The model to use for creating embeddings."""
- input: Required[Input]
+ input: Required[List[str]]
"""The input to create embeddings for."""
dimensions: Optional[int]
@@ -28,28 +28,7 @@ class ClientEmbedParams(TypedDict, total=False):
Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
]
- """The encoding format of the embeddings."""
+ """The encoding format(s) of the embeddings.
-
-class InputImageURLInputImage(TypedDict, total=False):
- url: Required[str]
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class InputImageURLInput(TypedDict, total=False):
- type: Literal["image_url"]
- """Input type identifier"""
-
- image: Required[InputImageURLInputImage]
- """The image input specification."""
-
-
-class InputTextInput(TypedDict, total=False):
- type: Literal["text"]
- """Input type identifier"""
-
- text: Required[str]
- """Text content to process"""
-
-
-Input: TypeAlias = Union[str, InputImageURLInput, InputTextInput]
+ Can be a single format or a list of formats.
+ """
diff --git a/src/mixedbread/types/embedding.py b/src/mixedbread/types/embedding.py
index ad8cd3f0..19fd8136 100644
--- a/src/mixedbread/types/embedding.py
+++ b/src/mixedbread/types/embedding.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union
+from typing import List, Union, Optional
from typing_extensions import Literal
from .._models import BaseModel
@@ -15,5 +15,5 @@ class Embedding(BaseModel):
index: int
"""The index of the embedding."""
- object: Literal["embedding"]
+ object: Optional[Literal["embedding"]] = None
"""The object type of the embedding."""
diff --git a/src/mixedbread/types/embedding_create_params.py b/src/mixedbread/types/embedding_create_params.py
index 271ac261..534982e3 100644
--- a/src/mixedbread/types/embedding_create_params.py
+++ b/src/mixedbread/types/embedding_create_params.py
@@ -3,16 +3,16 @@
from __future__ import annotations
from typing import List, Union, Optional
-from typing_extensions import Literal, Required, TypeAlias, TypedDict
+from typing_extensions import Literal, Required, TypedDict
-__all__ = ["EmbeddingCreateParams", "Input", "InputImageURLInput", "InputImageURLInputImage", "InputTextInput"]
+__all__ = ["EmbeddingCreateParams"]
class EmbeddingCreateParams(TypedDict, total=False):
model: Required[str]
"""The model to use for creating embeddings."""
- input: Required[Input]
+ input: Required[List[str]]
"""The input to create embeddings for."""
dimensions: Optional[int]
@@ -28,28 +28,7 @@ class EmbeddingCreateParams(TypedDict, total=False):
Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
]
- """The encoding format of the embeddings."""
+ """The encoding format(s) of the embeddings.
-
-class InputImageURLInputImage(TypedDict, total=False):
- url: Required[str]
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class InputImageURLInput(TypedDict, total=False):
- type: Literal["image_url"]
- """Input type identifier"""
-
- image: Required[InputImageURLInputImage]
- """The image input specification."""
-
-
-class InputTextInput(TypedDict, total=False):
- type: Literal["text"]
- """Input type identifier"""
-
- text: Required[str]
- """Text content to process"""
-
-
-Input: TypeAlias = Union[str, InputImageURLInput, InputTextInput]
+ Can be a single format or a list of formats.
+ """
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index ccd043b9..c72e68cb 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -32,7 +32,7 @@ class DataUnionMember1Embedding(BaseModel):
ubinary: Optional[List[int]] = None
- base64: Optional[List[str]] = None
+ base64: Optional[str] = None
class DataUnionMember1(BaseModel):
@@ -45,7 +45,7 @@ class DataUnionMember1(BaseModel):
index: int
"""The index of the embedding."""
- object: Literal["embedding_dict"]
+ object: Optional[Literal["embedding_dict"]] = None
"""The object type of the embedding."""
@@ -66,7 +66,7 @@ class EmbeddingCreateResponse(BaseModel):
"job",
"embedding",
"embedding_dict",
- "text_document",
+ "rank_result",
"file",
"vector_store",
"vector_store.file",
@@ -82,7 +82,7 @@ class EmbeddingCreateResponse(BaseModel):
Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
]
- """The encoding format of the embeddings."""
+ """The encoding formats of the embeddings."""
dimensions: Optional[int] = None
"""The number of dimensions used for the embeddings."""
diff --git a/src/mixedbread/types/extractions/content_create_params.py b/src/mixedbread/types/extractions/content_create_params.py
index 2bbdada2..372051b0 100644
--- a/src/mixedbread/types/extractions/content_create_params.py
+++ b/src/mixedbread/types/extractions/content_create_params.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Dict
from typing_extensions import Required, TypedDict
__all__ = ["ContentCreateParams"]
@@ -11,5 +12,5 @@ class ContentCreateParams(TypedDict, total=False):
content: Required[str]
"""The content to extract from"""
- json_schema: Required[object]
+ json_schema: Required[Dict[str, object]]
"""The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/created_json_schema.py b/src/mixedbread/types/extractions/created_json_schema.py
index 4b50c4c6..7208722b 100644
--- a/src/mixedbread/types/extractions/created_json_schema.py
+++ b/src/mixedbread/types/extractions/created_json_schema.py
@@ -1,5 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from typing import Dict
from ..._models import BaseModel
@@ -7,5 +8,5 @@
class CreatedJsonSchema(BaseModel):
- json_schema: object
+ json_schema: Dict[str, object]
"""The created JSON schema"""
diff --git a/src/mixedbread/types/extractions/enhanced_json_schema.py b/src/mixedbread/types/extractions/enhanced_json_schema.py
index 7b2ab04a..f555a7c0 100644
--- a/src/mixedbread/types/extractions/enhanced_json_schema.py
+++ b/src/mixedbread/types/extractions/enhanced_json_schema.py
@@ -1,5 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from typing import Dict
from ..._models import BaseModel
@@ -7,5 +8,5 @@
class EnhancedJsonSchema(BaseModel):
- json_schema: object
+ json_schema: Dict[str, object]
"""The enhanced JSON schema"""
diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py
index 437f4f89..d6430d4b 100644
--- a/src/mixedbread/types/extractions/extraction_job.py
+++ b/src/mixedbread/types/extractions/extraction_job.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
@@ -38,8 +38,8 @@ class ExtractionJob(BaseModel):
result: Optional[ExtractionResult] = None
"""The result of an extraction job."""
- error: Optional[object] = None
+ error: Optional[Dict[str, object]] = None
"""Error information if failed"""
- json_schema: object
+ json_schema: Dict[str, object]
"""The JSON schema used for extraction"""
diff --git a/src/mixedbread/types/extractions/extraction_result.py b/src/mixedbread/types/extractions/extraction_result.py
index 11a31990..b5206a09 100644
--- a/src/mixedbread/types/extractions/extraction_result.py
+++ b/src/mixedbread/types/extractions/extraction_result.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List
+from typing import Dict, List
from ..._models import BaseModel
@@ -8,6 +8,6 @@
class ExtractionResult(BaseModel):
- data: object
+ data: Dict[str, object]
warnings: List[str]
diff --git a/src/mixedbread/types/extractions/job_create_params.py b/src/mixedbread/types/extractions/job_create_params.py
index 476154b2..a252df4a 100644
--- a/src/mixedbread/types/extractions/job_create_params.py
+++ b/src/mixedbread/types/extractions/job_create_params.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Dict
from typing_extensions import Required, TypedDict
__all__ = ["JobCreateParams"]
@@ -11,5 +12,5 @@ class JobCreateParams(TypedDict, total=False):
file_id: Required[str]
"""The ID of the file to extract from"""
- json_schema: Required[object]
+ json_schema: Required[Dict[str, object]]
"""The JSON schema to use for extraction"""
diff --git a/src/mixedbread/types/extractions/schema_enhance_params.py b/src/mixedbread/types/extractions/schema_enhance_params.py
index e0facf34..8526c898 100644
--- a/src/mixedbread/types/extractions/schema_enhance_params.py
+++ b/src/mixedbread/types/extractions/schema_enhance_params.py
@@ -2,11 +2,12 @@
from __future__ import annotations
+from typing import Dict
from typing_extensions import Required, TypedDict
__all__ = ["SchemaEnhanceParams"]
class SchemaEnhanceParams(TypedDict, total=False):
- json_schema: Required[object]
+ json_schema: Required[Dict[str, object]]
"""The JSON schema to enhance"""
diff --git a/src/mixedbread/types/extractions/schema_validate_params.py b/src/mixedbread/types/extractions/schema_validate_params.py
index 947182ca..96a31b4f 100644
--- a/src/mixedbread/types/extractions/schema_validate_params.py
+++ b/src/mixedbread/types/extractions/schema_validate_params.py
@@ -2,11 +2,12 @@
from __future__ import annotations
+from typing import Dict
from typing_extensions import Required, TypedDict
__all__ = ["SchemaValidateParams"]
class SchemaValidateParams(TypedDict, total=False):
- json_schema: Required[object]
+ json_schema: Required[Dict[str, object]]
"""The JSON schema to validate"""
diff --git a/src/mixedbread/types/extractions/validated_json_schema.py b/src/mixedbread/types/extractions/validated_json_schema.py
index cb021c31..784c4983 100644
--- a/src/mixedbread/types/extractions/validated_json_schema.py
+++ b/src/mixedbread/types/extractions/validated_json_schema.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List
+from typing import Dict, List
from ..._models import BaseModel
@@ -14,5 +14,5 @@ class ValidatedJsonSchema(BaseModel):
errors: List[str]
"""List of validation errors"""
- json_schema: object
+ json_schema: Dict[str, object]
"""The validated JSON schema"""
diff --git a/src/mixedbread/types/rerank_response.py b/src/mixedbread/types/rerank_response.py
index 70121831..5cf151fc 100644
--- a/src/mixedbread/types/rerank_response.py
+++ b/src/mixedbread/types/rerank_response.py
@@ -21,27 +21,15 @@ class Usage(BaseModel):
class Data(BaseModel):
index: int
+ """The index of the document."""
score: float
"""The score of the document."""
- input: object
+ input: Optional[object] = None
"""The input document."""
- object: Optional[
- Literal[
- "list",
- "parsing_job",
- "job",
- "embedding",
- "embedding_dict",
- "text_document",
- "file",
- "vector_store",
- "vector_store.file",
- "api_key",
- ]
- ] = None
+ object: Optional[Literal["rank_result"]] = None
"""The object type."""
@@ -62,7 +50,7 @@ class RerankResponse(BaseModel):
"job",
"embedding",
"embedding_dict",
- "text_document",
+ "rank_result",
"file",
"vector_store",
"vector_store.file",
diff --git a/tests/api_resources/extractions/test_content.py b/tests/api_resources/extractions/test_content.py
index 7beb468b..923d1cf5 100644
--- a/tests/api_resources/extractions/test_content.py
+++ b/tests/api_resources/extractions/test_content.py
@@ -21,7 +21,7 @@ class TestContent:
def test_method_create(self, client: Mixedbread) -> None:
content = client.extractions.content.create(
content="content",
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert_matches_type(ExtractionResult, content, path=["response"])
@@ -29,7 +29,7 @@ def test_method_create(self, client: Mixedbread) -> None:
def test_raw_response_create(self, client: Mixedbread) -> None:
response = client.extractions.content.with_raw_response.create(
content="content",
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert response.is_closed is True
@@ -41,7 +41,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
def test_streaming_response_create(self, client: Mixedbread) -> None:
with client.extractions.content.with_streaming_response.create(
content="content",
- json_schema={},
+ json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -59,7 +59,7 @@ class TestAsyncContent:
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
content = await async_client.extractions.content.create(
content="content",
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert_matches_type(ExtractionResult, content, path=["response"])
@@ -67,7 +67,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
response = await async_client.extractions.content.with_raw_response.create(
content="content",
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert response.is_closed is True
@@ -79,7 +79,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
async with async_client.extractions.content.with_streaming_response.create(
content="content",
- json_schema={},
+ json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
diff --git a/tests/api_resources/extractions/test_jobs.py b/tests/api_resources/extractions/test_jobs.py
index bb055ba7..312512c7 100644
--- a/tests/api_resources/extractions/test_jobs.py
+++ b/tests/api_resources/extractions/test_jobs.py
@@ -21,7 +21,7 @@ class TestJobs:
def test_method_create(self, client: Mixedbread) -> None:
job = client.extractions.jobs.create(
file_id="file_id",
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert_matches_type(ExtractionJob, job, path=["response"])
@@ -29,7 +29,7 @@ def test_method_create(self, client: Mixedbread) -> None:
def test_raw_response_create(self, client: Mixedbread) -> None:
response = client.extractions.jobs.with_raw_response.create(
file_id="file_id",
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert response.is_closed is True
@@ -41,7 +41,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
def test_streaming_response_create(self, client: Mixedbread) -> None:
with client.extractions.jobs.with_streaming_response.create(
file_id="file_id",
- json_schema={},
+ json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -97,7 +97,7 @@ class TestAsyncJobs:
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
job = await async_client.extractions.jobs.create(
file_id="file_id",
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert_matches_type(ExtractionJob, job, path=["response"])
@@ -105,7 +105,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
response = await async_client.extractions.jobs.with_raw_response.create(
file_id="file_id",
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert response.is_closed is True
@@ -117,7 +117,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
async with async_client.extractions.jobs.with_streaming_response.create(
file_id="file_id",
- json_schema={},
+ json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
diff --git a/tests/api_resources/extractions/test_schema.py b/tests/api_resources/extractions/test_schema.py
index 5bff1298..9e538d07 100644
--- a/tests/api_resources/extractions/test_schema.py
+++ b/tests/api_resources/extractions/test_schema.py
@@ -55,14 +55,14 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
@parametrize
def test_method_enhance(self, client: Mixedbread) -> None:
schema = client.extractions.schema.enhance(
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
@parametrize
def test_raw_response_enhance(self, client: Mixedbread) -> None:
response = client.extractions.schema.with_raw_response.enhance(
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert response.is_closed is True
@@ -73,7 +73,7 @@ def test_raw_response_enhance(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_enhance(self, client: Mixedbread) -> None:
with client.extractions.schema.with_streaming_response.enhance(
- json_schema={},
+ json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -86,14 +86,14 @@ def test_streaming_response_enhance(self, client: Mixedbread) -> None:
@parametrize
def test_method_validate(self, client: Mixedbread) -> None:
schema = client.extractions.schema.validate(
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
@parametrize
def test_raw_response_validate(self, client: Mixedbread) -> None:
response = client.extractions.schema.with_raw_response.validate(
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert response.is_closed is True
@@ -104,7 +104,7 @@ def test_raw_response_validate(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_validate(self, client: Mixedbread) -> None:
with client.extractions.schema.with_streaming_response.validate(
- json_schema={},
+ json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -152,14 +152,14 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
@parametrize
async def test_method_enhance(self, async_client: AsyncMixedbread) -> None:
schema = await async_client.extractions.schema.enhance(
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert_matches_type(EnhancedJsonSchema, schema, path=["response"])
@parametrize
async def test_raw_response_enhance(self, async_client: AsyncMixedbread) -> None:
response = await async_client.extractions.schema.with_raw_response.enhance(
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert response.is_closed is True
@@ -170,7 +170,7 @@ async def test_raw_response_enhance(self, async_client: AsyncMixedbread) -> None
@parametrize
async def test_streaming_response_enhance(self, async_client: AsyncMixedbread) -> None:
async with async_client.extractions.schema.with_streaming_response.enhance(
- json_schema={},
+ json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -183,14 +183,14 @@ async def test_streaming_response_enhance(self, async_client: AsyncMixedbread) -
@parametrize
async def test_method_validate(self, async_client: AsyncMixedbread) -> None:
schema = await async_client.extractions.schema.validate(
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert_matches_type(ValidatedJsonSchema, schema, path=["response"])
@parametrize
async def test_raw_response_validate(self, async_client: AsyncMixedbread) -> None:
response = await async_client.extractions.schema.with_raw_response.validate(
- json_schema={},
+ json_schema={"foo": "bar"},
)
assert response.is_closed is True
@@ -201,7 +201,7 @@ async def test_raw_response_validate(self, async_client: AsyncMixedbread) -> Non
@parametrize
async def test_streaming_response_validate(self, async_client: AsyncMixedbread) -> None:
async with async_client.extractions.schema.with_streaming_response.validate(
- json_schema={},
+ json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index 9052c3be..1c38d8ba 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -25,7 +25,7 @@ class TestClient:
def test_method_embed(self, client: Mixedbread) -> None:
client_ = client.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
)
assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
@@ -33,7 +33,7 @@ def test_method_embed(self, client: Mixedbread) -> None:
def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
client_ = client.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
dimensions=768,
prompt="Provide a detailed summary of the following text.",
normalized=True,
@@ -45,7 +45,7 @@ def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
def test_raw_response_embed(self, client: Mixedbread) -> None:
response = client.with_raw_response.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
)
assert response.is_closed is True
@@ -57,7 +57,7 @@ def test_raw_response_embed(self, client: Mixedbread) -> None:
def test_streaming_response_embed(self, client: Mixedbread) -> None:
with client.with_streaming_response.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -146,7 +146,7 @@ class TestAsyncClient:
async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
client = await async_client.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
)
assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
@@ -154,7 +154,7 @@ async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) -> None:
client = await async_client.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
dimensions=768,
prompt="Provide a detailed summary of the following text.",
normalized=True,
@@ -166,7 +166,7 @@ async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread)
async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
response = await async_client.with_raw_response.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
)
assert response.is_closed is True
@@ -178,7 +178,7 @@ async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_embed(self, async_client: AsyncMixedbread) -> None:
async with async_client.with_streaming_response.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py
index 38ff5153..ffe758eb 100644
--- a/tests/api_resources/test_embeddings.py
+++ b/tests/api_resources/test_embeddings.py
@@ -21,7 +21,7 @@ class TestEmbeddings:
def test_method_create(self, client: Mixedbread) -> None:
embedding = client.embeddings.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
)
assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@@ -29,7 +29,7 @@ def test_method_create(self, client: Mixedbread) -> None:
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
embedding = client.embeddings.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
dimensions=768,
prompt="Provide a detailed summary of the following text.",
normalized=True,
@@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
def test_raw_response_create(self, client: Mixedbread) -> None:
response = client.embeddings.with_raw_response.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
)
assert response.is_closed is True
@@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
def test_streaming_response_create(self, client: Mixedbread) -> None:
with client.embeddings.with_streaming_response.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -71,7 +71,7 @@ class TestAsyncEmbeddings:
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
embedding = await async_client.embeddings.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
)
assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@@ -79,7 +79,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
embedding = await async_client.embeddings.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
dimensions=768,
prompt="Provide a detailed summary of the following text.",
normalized=True,
@@ -91,7 +91,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
response = await async_client.embeddings.with_raw_response.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
)
assert response.is_closed is True
@@ -103,7 +103,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
async with async_client.embeddings.with_streaming_response.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input="This is a sample text input.",
+ input=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
From a877a8a12bbc5641f1956a860fe7cde98a74739e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 29 Mar 2025 07:27:00 +0000
Subject: [PATCH 077/375] chore(internal): version bump (#162)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 36b2affb..f9963500 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.34"
+ ".": "0.1.0-alpha.35"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index ab490eae..404a177d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.34"
+version = "0.1.0-alpha.35"
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 0304e57a..cf408422 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.1.0-alpha.34" # x-release-please-version
+__version__ = "0.1.0-alpha.35" # x-release-please-version
From dfb21d4f4b10a7b24b45e18f6a50e002fcf5b6b8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 19:48:44 +0000
Subject: [PATCH 078/375] feat(api): update via SDK Studio (#163)
---
.stats.yml | 2 +-
README.md | 8 ++++----
src/mixedbread/_client.py | 14 +++++++-------
tests/test_client.py | 8 ++++----
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index d87685dc..e15c1ab2 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: bfb0b19d1094dc80774c752f9b84185e
-config_hash: 52e7472faf7b81b5fda98bd67bd7d0d9
+config_hash: 3fa8ca8b7bc0d9e1997e20d7a2e4d22c
diff --git a/README.md b/README.md
index 2bdd40c4..a822dd97 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ It is generated with [Stainless](https://www.stainless.com/).
## Documentation
-The REST API documentation can be found on [mixedbread.ai](https://mixedbread.ai/docs). The full API of this library can be found in [api.md](api.md).
+The REST API documentation can be found on [mixedbread.com](https://mixedbread.com/docs). The full API of this library can be found in [api.md](api.md).
## Installation
@@ -28,7 +28,7 @@ import os
from mixedbread import Mixedbread
client = Mixedbread(
- api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
+ api_key=os.environ.get("MIXEDBREAD_API_KEY"), # This is the default and can be omitted
# defaults to "production".
environment="local",
)
@@ -39,7 +39,7 @@ print(vector_store.id)
While you can provide an `api_key` keyword argument,
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
-to add `MXBAI_API_KEY="My API Key"` to your `.env` file
+to add `MIXEDBREAD_API_KEY="My API Key"` to your `.env` file
so that your API Key is not stored in source control.
## Async usage
@@ -52,7 +52,7 @@ import asyncio
from mixedbread import AsyncMixedbread
client = AsyncMixedbread(
- api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
+ api_key=os.environ.get("MIXEDBREAD_API_KEY"), # This is the default and can be omitted
# defaults to "production".
environment="local",
)
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index e2ce4c5f..506a0e3b 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -65,7 +65,7 @@
]
ENVIRONMENTS: Dict[str, str] = {
- "production": "https://api.mixedbread.ai",
+ "production": "https://api.mixedbread.com",
"local": "http://127.0.0.1:8000",
}
@@ -110,13 +110,13 @@ def __init__(
) -> None:
"""Construct a new synchronous Mixedbread client instance.
- This automatically infers the `api_key` argument from the `MXBAI_API_KEY` environment variable if it is not provided.
+ This automatically infers the `api_key` argument from the `MIXEDBREAD_API_KEY` environment variable if it is not provided.
"""
if api_key is None:
- api_key = os.environ.get("MXBAI_API_KEY")
+ api_key = os.environ.get("MIXEDBREAD_API_KEY")
if api_key is None:
raise MixedbreadError(
- "The api_key client option must be set either by passing api_key to the client or by setting the MXBAI_API_KEY environment variable"
+ "The api_key client option must be set either by passing api_key to the client or by setting the MIXEDBREAD_API_KEY environment variable"
)
self.api_key = api_key
@@ -467,13 +467,13 @@ def __init__(
) -> None:
"""Construct a new async AsyncMixedbread client instance.
- This automatically infers the `api_key` argument from the `MXBAI_API_KEY` environment variable if it is not provided.
+ This automatically infers the `api_key` argument from the `MIXEDBREAD_API_KEY` environment variable if it is not provided.
"""
if api_key is None:
- api_key = os.environ.get("MXBAI_API_KEY")
+ api_key = os.environ.get("MIXEDBREAD_API_KEY")
if api_key is None:
raise MixedbreadError(
- "The api_key client option must be set either by passing api_key to the client or by setting the MXBAI_API_KEY environment variable"
+ "The api_key client option must be set either by passing api_key to the client or by setting the MIXEDBREAD_API_KEY environment variable"
)
self.api_key = api_key
diff --git a/tests/test_client.py b/tests/test_client.py
index cb1a8039..9a2b23af 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -342,7 +342,7 @@ def test_validate_headers(self) -> None:
assert request.headers.get("Authorization") == f"Bearer {api_key}"
with pytest.raises(MixedbreadError):
- with update_env(**{"MXBAI_API_KEY": Omit()}):
+ with update_env(**{"MIXEDBREAD_API_KEY": Omit()}):
client2 = Mixedbread(base_url=base_url, api_key=None, _strict_response_validation=True)
_ = client2
@@ -568,7 +568,7 @@ def test_base_url_env(self) -> None:
client = Mixedbread(
base_url=None, api_key=api_key, _strict_response_validation=True, environment="production"
)
- assert str(client.base_url).startswith("https://api.mixedbread.ai")
+ assert str(client.base_url).startswith("https://api.mixedbread.com")
@pytest.mark.parametrize(
"client",
@@ -1122,7 +1122,7 @@ def test_validate_headers(self) -> None:
assert request.headers.get("Authorization") == f"Bearer {api_key}"
with pytest.raises(MixedbreadError):
- with update_env(**{"MXBAI_API_KEY": Omit()}):
+ with update_env(**{"MIXEDBREAD_API_KEY": Omit()}):
client2 = AsyncMixedbread(base_url=base_url, api_key=None, _strict_response_validation=True)
_ = client2
@@ -1350,7 +1350,7 @@ def test_base_url_env(self) -> None:
client = AsyncMixedbread(
base_url=None, api_key=api_key, _strict_response_validation=True, environment="production"
)
- assert str(client.base_url).startswith("https://api.mixedbread.ai")
+ assert str(client.base_url).startswith("https://api.mixedbread.com")
@pytest.mark.parametrize(
"client",
From 536696bc8a09154ca189c96197e1c092e8768eaf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 19:49:35 +0000
Subject: [PATCH 079/375] chore(internal): version bump (#165)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index f9963500..a696b6a7 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.35"
+ ".": "0.1.0-alpha.36"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 404a177d..8e2fcbc6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.35"
+version = "0.1.0-alpha.36"
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 cf408422..61c8875b 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.1.0-alpha.35" # x-release-please-version
+__version__ = "0.1.0-alpha.36" # x-release-please-version
From af89bd05ac7b16d209e957e5079de01b703108bf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 19:57:48 +0000
Subject: [PATCH 080/375] feat(api): update via SDK Studio (#166)
---
.stats.yml | 2 +-
README.md | 4 ++--
SECURITY.md | 2 ++
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e15c1ab2..0f169186 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: bfb0b19d1094dc80774c752f9b84185e
-config_hash: 3fa8ca8b7bc0d9e1997e20d7a2e4d22c
+config_hash: 69ea986b716f75e2cd90b43881a59c88
diff --git a/README.md b/README.md
index a822dd97..5d3e4084 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# Mixedbread Python API library
+# Mixedbread Python SDK API library
[](https://pypi.org/project/mixedbread/)
-The Mixedbread Python library provides convenient access to the Mixedbread REST API from any Python 3.8+
+The Mixedbread Python SDK library provides convenient access to the Mixedbread REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
diff --git a/SECURITY.md b/SECURITY.md
index 6ccfcf0f..7a1bc651 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -20,6 +20,8 @@ or products provided by Mixedbread please follow the respective company's securi
### Mixedbread Terms and Policies
+Our Security Policy can be found at [Security Policy URL](https://mixedbread.com/pages/privacy).
+
Please contact support@mixedbread.com for any questions or concerns regarding security of our services.
---
From 820334e1e09ad802852de09a06d93e43f6394a59 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 19:58:39 +0000
Subject: [PATCH 081/375] chore(internal): version bump (#168)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index a696b6a7..154a6970 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.36"
+ ".": "0.1.0-alpha.37"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 8e2fcbc6..2385f4e6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.36"
+version = "0.1.0-alpha.37"
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 61c8875b..b1995b29 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.1.0-alpha.36" # x-release-please-version
+__version__ = "0.1.0-alpha.37" # x-release-please-version
From 473271ab9d27be7b79717f76340ef09895b4458a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 20:03:10 +0000
Subject: [PATCH 082/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 0f169186..658c1092 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: bfb0b19d1094dc80774c752f9b84185e
-config_hash: 69ea986b716f75e2cd90b43881a59c88
+config_hash: 6db3d031a23189505a30c2ce6eeca602
From 7228fb30a4c99d6e0851592835fd50fe59e72b75 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 20:56:40 +0000
Subject: [PATCH 083/375] feat(api): update via SDK Studio (#169)
---
.stats.yml | 4 +-
api.md | 98 +++++++++----------
src/mixedbread/_client.py | 56 +++++------
src/mixedbread/resources/__init__.py | 24 ++---
src/mixedbread/types/__init__.py | 2 +-
src/mixedbread/types/client_rerank_params.py | 4 +-
src/mixedbread/types/embed_response.py | 98 +++++++++++++++++++
src/mixedbread/types/embedding.py | 19 ----
.../types/embedding_create_response.py | 16 ++-
tests/api_resources/test_client.py | 22 ++---
10 files changed, 214 insertions(+), 129 deletions(-)
create mode 100644 src/mixedbread/types/embed_response.py
delete mode 100644 src/mixedbread/types/embedding.py
diff --git a/.stats.yml b/.stats.yml
index 658c1092..dfdb2a8c 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
-openapi_spec_hash: bfb0b19d1094dc80774c752f9b84185e
-config_hash: 6db3d031a23189505a30c2ce6eeca602
+openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
+config_hash: d4b3b47ba72c8829d6b804dd74b079c2
diff --git a/api.md b/api.md
index 60da71e9..c88b1319 100644
--- a/api.md
+++ b/api.md
@@ -9,62 +9,15 @@ from mixedbread.types import SearchFilter, SearchFilterCondition
Types:
```python
-from mixedbread.types import InfoResponse, RerankResponse
+from mixedbread.types import EmbedResponse, InfoResponse, RerankResponse
```
Methods:
-- client.embed(\*\*params) -> EmbeddingCreateResponse
+- client.embed(\*\*params) -> EmbedResponse
- client.info() -> InfoResponse
- client.rerank(\*\*params) -> RerankResponse
-# Embeddings
-
-Types:
-
-```python
-from mixedbread.types import Embedding, EmbeddingCreateResponse
-```
-
-Methods:
-
-- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
-
-# Parsing
-
-## Jobs
-
-Types:
-
-```python
-from mixedbread.types.parsing import ParsingJob, JobListResponse, JobDeleteResponse
-```
-
-Methods:
-
-- client.parsing.jobs.create(\*\*params) -> ParsingJob
-- client.parsing.jobs.retrieve(job_id) -> ParsingJob
-- client.parsing.jobs.list(\*\*params) -> SyncLimitOffset[JobListResponse]
-- client.parsing.jobs.delete(job_id) -> JobDeleteResponse
-- client.parsing.jobs.cancel(job_id) -> ParsingJob
-
-# Files
-
-Types:
-
-```python
-from mixedbread.types import FileObject, FileDeleteResponse
-```
-
-Methods:
-
-- client.files.create(\*\*params) -> FileObject
-- client.files.retrieve(file_id) -> FileObject
-- client.files.update(file_id, \*\*params) -> FileObject
-- client.files.list(\*\*params) -> SyncLimitOffset[FileObject]
-- client.files.delete(file_id) -> FileDeleteResponse
-- client.files.content(file_id) -> BinaryAPIResponse
-
# VectorStores
Types:
@@ -114,6 +67,41 @@ Methods:
- client.vector_stores.files.delete(file_id, \*, vector_store_id) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
+# Parsing
+
+## Jobs
+
+Types:
+
+```python
+from mixedbread.types.parsing import ParsingJob, JobListResponse, JobDeleteResponse
+```
+
+Methods:
+
+- client.parsing.jobs.create(\*\*params) -> ParsingJob
+- client.parsing.jobs.retrieve(job_id) -> ParsingJob
+- client.parsing.jobs.list(\*\*params) -> SyncLimitOffset[JobListResponse]
+- client.parsing.jobs.delete(job_id) -> JobDeleteResponse
+- client.parsing.jobs.cancel(job_id) -> ParsingJob
+
+# Files
+
+Types:
+
+```python
+from mixedbread.types import FileObject, FileDeleteResponse
+```
+
+Methods:
+
+- client.files.create(\*\*params) -> FileObject
+- client.files.retrieve(file_id) -> FileObject
+- client.files.update(file_id, \*\*params) -> FileObject
+- client.files.list(\*\*params) -> SyncLimitOffset[FileObject]
+- client.files.delete(file_id) -> FileDeleteResponse
+- client.files.content(file_id) -> BinaryAPIResponse
+
# Extractions
## Jobs
@@ -154,3 +142,15 @@ from mixedbread.types.extractions import ExtractionResult
Methods:
- client.extractions.content.create(\*\*params) -> ExtractionResult
+
+# Embeddings
+
+Types:
+
+```python
+from mixedbread.types import EmbeddingCreateResponse
+```
+
+Methods:
+
+- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 506a0e3b..b9996076 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -3,7 +3,7 @@
from __future__ import annotations
import os
-from typing import Any, Dict, List, Union, Mapping, Optional, cast
+from typing import Any, Dict, List, Union, Mapping, Iterable, Optional, cast
from typing_extensions import Self, Literal, override
import httpx
@@ -47,10 +47,10 @@
)
from .resources.parsing import parsing
from .types.info_response import InfoResponse
+from .types.embed_response import EmbedResponse
from .resources.extractions import extractions
from .types.rerank_response import RerankResponse
from .resources.vector_stores import vector_stores
-from .types.embedding_create_response import EmbeddingCreateResponse
__all__ = [
"ENVIRONMENTS",
@@ -71,11 +71,11 @@
class Mixedbread(SyncAPIClient):
- embeddings: embeddings.EmbeddingsResource
+ vector_stores: vector_stores.VectorStoresResource
parsing: parsing.ParsingResource
files: files.FilesResource
- vector_stores: vector_stores.VectorStoresResource
extractions: extractions.ExtractionsResource
+ embeddings: embeddings.EmbeddingsResource
with_raw_response: MixedbreadWithRawResponse
with_streaming_response: MixedbreadWithStreamedResponse
@@ -157,11 +157,11 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.embeddings = embeddings.EmbeddingsResource(self)
+ self.vector_stores = vector_stores.VectorStoresResource(self)
self.parsing = parsing.ParsingResource(self)
self.files = files.FilesResource(self)
- self.vector_stores = vector_stores.VectorStoresResource(self)
self.extractions = extractions.ExtractionsResource(self)
+ self.embeddings = embeddings.EmbeddingsResource(self)
self.with_raw_response = MixedbreadWithRawResponse(self)
self.with_streaming_response = MixedbreadWithStreamedResponse(self)
@@ -257,7 +257,7 @@ def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbeddingCreateResponse:
+ ) -> EmbedResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -304,7 +304,7 @@ def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbeddingCreateResponse,
+ cast_to=EmbedResponse,
)
def info(
@@ -335,7 +335,7 @@ def rerank(
*,
model: str | NotGiven = NOT_GIVEN,
query: str,
- input: List[Union[str, object]],
+ input: List[Union[str, Iterable[object], object]],
rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
return_input: bool | NotGiven = NOT_GIVEN,
@@ -349,9 +349,9 @@ def rerank(
"""
Rerank different kind of documents for a given query.
- Args: params: RerankingCreateParams: The parameters for reranking.
+ Args: params: RerankParams: The parameters for reranking.
- Returns: RerankingCreateResponse: The reranked documents for the input query.
+ Returns: RerankResponse: The reranked documents for the input query.
Args:
model: The model to use for reranking documents.
@@ -428,11 +428,11 @@ def _make_status_error(
class AsyncMixedbread(AsyncAPIClient):
- embeddings: embeddings.AsyncEmbeddingsResource
+ vector_stores: vector_stores.AsyncVectorStoresResource
parsing: parsing.AsyncParsingResource
files: files.AsyncFilesResource
- vector_stores: vector_stores.AsyncVectorStoresResource
extractions: extractions.AsyncExtractionsResource
+ embeddings: embeddings.AsyncEmbeddingsResource
with_raw_response: AsyncMixedbreadWithRawResponse
with_streaming_response: AsyncMixedbreadWithStreamedResponse
@@ -514,11 +514,11 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.embeddings = embeddings.AsyncEmbeddingsResource(self)
+ self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
self.parsing = parsing.AsyncParsingResource(self)
self.files = files.AsyncFilesResource(self)
- self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
self.extractions = extractions.AsyncExtractionsResource(self)
+ self.embeddings = embeddings.AsyncEmbeddingsResource(self)
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)
@@ -614,7 +614,7 @@ async def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbeddingCreateResponse:
+ ) -> EmbedResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -661,7 +661,7 @@ async def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbeddingCreateResponse,
+ cast_to=EmbedResponse,
)
async def info(
@@ -692,7 +692,7 @@ async def rerank(
*,
model: str | NotGiven = NOT_GIVEN,
query: str,
- input: List[Union[str, object]],
+ input: List[Union[str, Iterable[object], object]],
rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
return_input: bool | NotGiven = NOT_GIVEN,
@@ -706,9 +706,9 @@ async def rerank(
"""
Rerank different kind of documents for a given query.
- Args: params: RerankingCreateParams: The parameters for reranking.
+ Args: params: RerankParams: The parameters for reranking.
- Returns: RerankingCreateResponse: The reranked documents for the input query.
+ Returns: RerankResponse: The reranked documents for the input query.
Args:
model: The model to use for reranking documents.
@@ -786,11 +786,11 @@ def _make_status_error(
class MixedbreadWithRawResponse:
def __init__(self, client: Mixedbread) -> None:
- self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
+ self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
self.parsing = parsing.ParsingResourceWithRawResponse(client.parsing)
self.files = files.FilesResourceWithRawResponse(client.files)
- self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
+ self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
self.embed = to_raw_response_wrapper(
client.embed,
@@ -805,11 +805,11 @@ def __init__(self, client: Mixedbread) -> None:
class AsyncMixedbreadWithRawResponse:
def __init__(self, client: AsyncMixedbread) -> None:
- self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
+ self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
self.parsing = parsing.AsyncParsingResourceWithRawResponse(client.parsing)
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
- self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
+ self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
self.embed = async_to_raw_response_wrapper(
client.embed,
@@ -824,11 +824,11 @@ def __init__(self, client: AsyncMixedbread) -> None:
class MixedbreadWithStreamedResponse:
def __init__(self, client: Mixedbread) -> None:
- self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
+ self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
self.parsing = parsing.ParsingResourceWithStreamingResponse(client.parsing)
self.files = files.FilesResourceWithStreamingResponse(client.files)
- self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
+ self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
self.embed = to_streamed_response_wrapper(
client.embed,
@@ -843,11 +843,11 @@ def __init__(self, client: Mixedbread) -> None:
class AsyncMixedbreadWithStreamedResponse:
def __init__(self, client: AsyncMixedbread) -> None:
- self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
+ self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
self.parsing = parsing.AsyncParsingResourceWithStreamingResponse(client.parsing)
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
- self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
+ self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
self.embed = async_to_streamed_response_wrapper(
client.embed,
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index e98cf7b8..7df49504 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -42,12 +42,12 @@
)
__all__ = [
- "EmbeddingsResource",
- "AsyncEmbeddingsResource",
- "EmbeddingsResourceWithRawResponse",
- "AsyncEmbeddingsResourceWithRawResponse",
- "EmbeddingsResourceWithStreamingResponse",
- "AsyncEmbeddingsResourceWithStreamingResponse",
+ "VectorStoresResource",
+ "AsyncVectorStoresResource",
+ "VectorStoresResourceWithRawResponse",
+ "AsyncVectorStoresResourceWithRawResponse",
+ "VectorStoresResourceWithStreamingResponse",
+ "AsyncVectorStoresResourceWithStreamingResponse",
"ParsingResource",
"AsyncParsingResource",
"ParsingResourceWithRawResponse",
@@ -60,16 +60,16 @@
"AsyncFilesResourceWithRawResponse",
"FilesResourceWithStreamingResponse",
"AsyncFilesResourceWithStreamingResponse",
- "VectorStoresResource",
- "AsyncVectorStoresResource",
- "VectorStoresResourceWithRawResponse",
- "AsyncVectorStoresResourceWithRawResponse",
- "VectorStoresResourceWithStreamingResponse",
- "AsyncVectorStoresResourceWithStreamingResponse",
"ExtractionsResource",
"AsyncExtractionsResource",
"ExtractionsResourceWithRawResponse",
"AsyncExtractionsResourceWithRawResponse",
"ExtractionsResourceWithStreamingResponse",
"AsyncExtractionsResourceWithStreamingResponse",
+ "EmbeddingsResource",
+ "AsyncEmbeddingsResource",
+ "EmbeddingsResourceWithRawResponse",
+ "AsyncEmbeddingsResourceWithRawResponse",
+ "EmbeddingsResourceWithStreamingResponse",
+ "AsyncEmbeddingsResourceWithStreamingResponse",
]
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 18991940..cdda6dd8 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -3,12 +3,12 @@
from __future__ import annotations
from .shared import SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
-from .embedding import Embedding as Embedding
from .file_counts import FileCounts as FileCounts
from .file_object import FileObject as FileObject
from .vector_store import VectorStore as VectorStore
from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
+from .embed_response import EmbedResponse as EmbedResponse
from .rerank_response import RerankResponse as RerankResponse
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
diff --git a/src/mixedbread/types/client_rerank_params.py b/src/mixedbread/types/client_rerank_params.py
index 85b40928..ee17f942 100644
--- a/src/mixedbread/types/client_rerank_params.py
+++ b/src/mixedbread/types/client_rerank_params.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import List, Union, Optional
+from typing import List, Union, Iterable, Optional
from typing_extensions import Required, TypedDict
__all__ = ["ClientRerankParams"]
@@ -15,7 +15,7 @@ class ClientRerankParams(TypedDict, total=False):
query: Required[str]
"""The query to rerank the documents."""
- input: Required[List[Union[str, object]]]
+ input: Required[List[Union[str, Iterable[object], object]]]
"""The input documents to rerank."""
rank_fields: Optional[List[str]]
diff --git a/src/mixedbread/types/embed_response.py b/src/mixedbread/types/embed_response.py
new file mode 100644
index 00000000..75183ce0
--- /dev/null
+++ b/src/mixedbread/types/embed_response.py
@@ -0,0 +1,98 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import builtins
+from typing import List, Union, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["EmbedResponse", "Usage", "DataUnionMember0", "DataUnionMember1", "DataUnionMember1Embedding"]
+
+
+class Usage(BaseModel):
+ prompt_tokens: int
+ """The number of tokens used for the prompt"""
+
+ total_tokens: int
+ """The total number of tokens used"""
+
+ completion_tokens: Optional[int] = None
+ """The number of tokens used for the completion"""
+
+
+class DataUnionMember0(BaseModel):
+ embedding: Union[List[float], List[int], str]
+ """The encoded embedding."""
+
+ index: int
+ """The index of the embedding."""
+
+ object: Optional[Literal["embedding"]] = None
+ """The object type of the embedding."""
+
+
+class DataUnionMember1Embedding(BaseModel):
+ float: Optional[List[builtins.float]] = None
+
+ int8: Optional[List[int]] = None
+
+ uint8: Optional[List[int]] = None
+
+ binary: Optional[List[int]] = None
+
+ ubinary: Optional[List[int]] = None
+
+ base64: Optional[str] = None
+
+
+class DataUnionMember1(BaseModel):
+ embedding: DataUnionMember1Embedding
+ """
+ The encoded embedding data by encoding format.Returned, if more than one
+ encoding format is used.
+ """
+
+ index: int
+ """The index of the embedding."""
+
+ object: Optional[Literal["embedding_dict"]] = None
+ """The object type of the embedding."""
+
+
+class EmbedResponse(BaseModel):
+ usage: Usage
+ """The usage of the model"""
+
+ model: str
+ """The model used"""
+
+ data: Union[List[DataUnionMember0], List[DataUnionMember1]]
+ """The created embeddings."""
+
+ object: Optional[
+ Literal[
+ "list",
+ "parsing_job",
+ "job",
+ "embedding",
+ "embedding_dict",
+ "rank_result",
+ "file",
+ "vector_store",
+ "vector_store.file",
+ "api_key",
+ ]
+ ] = None
+ """The object type of the response"""
+
+ normalized: bool
+ """Whether the embeddings are normalized."""
+
+ encoding_format: Union[
+ Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
+ List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
+ ]
+ """The encoding formats of the embeddings."""
+
+ dimensions: Optional[int] = None
+ """The number of dimensions used for the embeddings."""
diff --git a/src/mixedbread/types/embedding.py b/src/mixedbread/types/embedding.py
deleted file mode 100644
index 19fd8136..00000000
--- a/src/mixedbread/types/embedding.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Union, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["Embedding"]
-
-
-class Embedding(BaseModel):
- embedding: Union[List[float], List[int], str]
- """The encoded embedding."""
-
- index: int
- """The index of the embedding."""
-
- object: Optional[Literal["embedding"]] = None
- """The object type of the embedding."""
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index c72e68cb..e95bf75a 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -5,9 +5,8 @@
from typing_extensions import Literal
from .._models import BaseModel
-from .embedding import Embedding
-__all__ = ["EmbeddingCreateResponse", "Usage", "DataUnionMember1", "DataUnionMember1Embedding"]
+__all__ = ["EmbeddingCreateResponse", "Usage", "DataUnionMember0", "DataUnionMember1", "DataUnionMember1Embedding"]
class Usage(BaseModel):
@@ -21,6 +20,17 @@ class Usage(BaseModel):
"""The number of tokens used for the completion"""
+class DataUnionMember0(BaseModel):
+ embedding: Union[List[float], List[int], str]
+ """The encoded embedding."""
+
+ index: int
+ """The index of the embedding."""
+
+ object: Optional[Literal["embedding"]] = None
+ """The object type of the embedding."""
+
+
class DataUnionMember1Embedding(BaseModel):
float: Optional[List[builtins.float]] = None
@@ -56,7 +66,7 @@ class EmbeddingCreateResponse(BaseModel):
model: str
"""The model used"""
- data: Union[List[Embedding], List[DataUnionMember1]]
+ data: Union[List[DataUnionMember0], List[DataUnionMember1]]
"""The created embeddings."""
object: Optional[
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index 1c38d8ba..1d143378 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -9,11 +9,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import (
- InfoResponse,
- RerankResponse,
- EmbeddingCreateResponse,
-)
+from mixedbread.types import InfoResponse, EmbedResponse, RerankResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -27,7 +23,7 @@ def test_method_embed(self, client: Mixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+ assert_matches_type(EmbedResponse, client_, path=["response"])
@parametrize
def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
@@ -39,7 +35,7 @@ def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+ assert_matches_type(EmbedResponse, client_, path=["response"])
@parametrize
def test_raw_response_embed(self, client: Mixedbread) -> None:
@@ -51,7 +47,7 @@ def test_raw_response_embed(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+ assert_matches_type(EmbedResponse, client_, path=["response"])
@parametrize
def test_streaming_response_embed(self, client: Mixedbread) -> None:
@@ -63,7 +59,7 @@ def test_streaming_response_embed(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+ assert_matches_type(EmbedResponse, client_, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -148,7 +144,7 @@ async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+ assert_matches_type(EmbedResponse, client, path=["response"])
@parametrize
async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -160,7 +156,7 @@ async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread)
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+ assert_matches_type(EmbedResponse, client, path=["response"])
@parametrize
async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -172,7 +168,7 @@ async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+ assert_matches_type(EmbedResponse, client, path=["response"])
@parametrize
async def test_streaming_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -184,7 +180,7 @@ async def test_streaming_response_embed(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+ assert_matches_type(EmbedResponse, client, path=["response"])
assert cast(Any, response.is_closed) is True
From d3d55289ada01b3fcc497f1688dfbad48bacf863 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 20:57:38 +0000
Subject: [PATCH 084/375] chore(internal): version bump (#171)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 154a6970..0c41cec4 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.37"
+ ".": "0.1.0-alpha.38"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 2385f4e6..4a2c8f3d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.37"
+version = "0.1.0-alpha.38"
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 b1995b29..5a6196cd 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.1.0-alpha.37" # x-release-please-version
+__version__ = "0.1.0-alpha.38" # x-release-please-version
From fd53a21dac307749c6af3631a8cca2af0ed396f8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 20:59:01 +0000
Subject: [PATCH 085/375] feat(api): update via SDK Studio (#172)
---
.stats.yml | 2 +-
api.md | 10 +-
src/mixedbread/_client.py | 10 +-
src/mixedbread/types/__init__.py | 2 +-
src/mixedbread/types/embed_response.py | 98 -------------------
src/mixedbread/types/embedding.py | 19 ++++
.../types/embedding_create_response.py | 16 +--
tests/api_resources/test_client.py | 22 +++--
8 files changed, 44 insertions(+), 135 deletions(-)
delete mode 100644 src/mixedbread/types/embed_response.py
create mode 100644 src/mixedbread/types/embedding.py
diff --git a/.stats.yml b/.stats.yml
index dfdb2a8c..7ce94546 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
-config_hash: d4b3b47ba72c8829d6b804dd74b079c2
+config_hash: 564cc8bc5835fe03496be6aab6d4dc42
diff --git a/api.md b/api.md
index c88b1319..c2a19d86 100644
--- a/api.md
+++ b/api.md
@@ -9,12 +9,12 @@ from mixedbread.types import SearchFilter, SearchFilterCondition
Types:
```python
-from mixedbread.types import EmbedResponse, InfoResponse, RerankResponse
+from mixedbread.types import Embedding, EmbeddingCreateResponse, InfoResponse, RerankResponse
```
Methods:
-- client.embed(\*\*params) -> EmbedResponse
+- client.embed(\*\*params) -> EmbeddingCreateResponse
- client.info() -> InfoResponse
- client.rerank(\*\*params) -> RerankResponse
@@ -145,12 +145,6 @@ Methods:
# Embeddings
-Types:
-
-```python
-from mixedbread.types import EmbeddingCreateResponse
-```
-
Methods:
- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index b9996076..30ff9cca 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -47,10 +47,10 @@
)
from .resources.parsing import parsing
from .types.info_response import InfoResponse
-from .types.embed_response import EmbedResponse
from .resources.extractions import extractions
from .types.rerank_response import RerankResponse
from .resources.vector_stores import vector_stores
+from .types.embedding_create_response import EmbeddingCreateResponse
__all__ = [
"ENVIRONMENTS",
@@ -257,7 +257,7 @@ def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbedResponse:
+ ) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -304,7 +304,7 @@ def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbedResponse,
+ cast_to=EmbeddingCreateResponse,
)
def info(
@@ -614,7 +614,7 @@ async def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbedResponse:
+ ) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -661,7 +661,7 @@ async def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbedResponse,
+ cast_to=EmbeddingCreateResponse,
)
async def info(
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index cdda6dd8..18991940 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -3,12 +3,12 @@
from __future__ import annotations
from .shared import SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
+from .embedding import Embedding as Embedding
from .file_counts import FileCounts as FileCounts
from .file_object import FileObject as FileObject
from .vector_store import VectorStore as VectorStore
from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
-from .embed_response import EmbedResponse as EmbedResponse
from .rerank_response import RerankResponse as RerankResponse
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
diff --git a/src/mixedbread/types/embed_response.py b/src/mixedbread/types/embed_response.py
deleted file mode 100644
index 75183ce0..00000000
--- a/src/mixedbread/types/embed_response.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-import builtins
-from typing import List, Union, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["EmbedResponse", "Usage", "DataUnionMember0", "DataUnionMember1", "DataUnionMember1Embedding"]
-
-
-class Usage(BaseModel):
- prompt_tokens: int
- """The number of tokens used for the prompt"""
-
- total_tokens: int
- """The total number of tokens used"""
-
- completion_tokens: Optional[int] = None
- """The number of tokens used for the completion"""
-
-
-class DataUnionMember0(BaseModel):
- embedding: Union[List[float], List[int], str]
- """The encoded embedding."""
-
- index: int
- """The index of the embedding."""
-
- object: Optional[Literal["embedding"]] = None
- """The object type of the embedding."""
-
-
-class DataUnionMember1Embedding(BaseModel):
- float: Optional[List[builtins.float]] = None
-
- int8: Optional[List[int]] = None
-
- uint8: Optional[List[int]] = None
-
- binary: Optional[List[int]] = None
-
- ubinary: Optional[List[int]] = None
-
- base64: Optional[str] = None
-
-
-class DataUnionMember1(BaseModel):
- embedding: DataUnionMember1Embedding
- """
- The encoded embedding data by encoding format.Returned, if more than one
- encoding format is used.
- """
-
- index: int
- """The index of the embedding."""
-
- object: Optional[Literal["embedding_dict"]] = None
- """The object type of the embedding."""
-
-
-class EmbedResponse(BaseModel):
- usage: Usage
- """The usage of the model"""
-
- model: str
- """The model used"""
-
- data: Union[List[DataUnionMember0], List[DataUnionMember1]]
- """The created embeddings."""
-
- object: Optional[
- Literal[
- "list",
- "parsing_job",
- "job",
- "embedding",
- "embedding_dict",
- "rank_result",
- "file",
- "vector_store",
- "vector_store.file",
- "api_key",
- ]
- ] = None
- """The object type of the response"""
-
- normalized: bool
- """Whether the embeddings are normalized."""
-
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- """The encoding formats of the embeddings."""
-
- dimensions: Optional[int] = None
- """The number of dimensions used for the embeddings."""
diff --git a/src/mixedbread/types/embedding.py b/src/mixedbread/types/embedding.py
new file mode 100644
index 00000000..19fd8136
--- /dev/null
+++ b/src/mixedbread/types/embedding.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["Embedding"]
+
+
+class Embedding(BaseModel):
+ embedding: Union[List[float], List[int], str]
+ """The encoded embedding."""
+
+ index: int
+ """The index of the embedding."""
+
+ object: Optional[Literal["embedding"]] = None
+ """The object type of the embedding."""
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index e95bf75a..c72e68cb 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -5,8 +5,9 @@
from typing_extensions import Literal
from .._models import BaseModel
+from .embedding import Embedding
-__all__ = ["EmbeddingCreateResponse", "Usage", "DataUnionMember0", "DataUnionMember1", "DataUnionMember1Embedding"]
+__all__ = ["EmbeddingCreateResponse", "Usage", "DataUnionMember1", "DataUnionMember1Embedding"]
class Usage(BaseModel):
@@ -20,17 +21,6 @@ class Usage(BaseModel):
"""The number of tokens used for the completion"""
-class DataUnionMember0(BaseModel):
- embedding: Union[List[float], List[int], str]
- """The encoded embedding."""
-
- index: int
- """The index of the embedding."""
-
- object: Optional[Literal["embedding"]] = None
- """The object type of the embedding."""
-
-
class DataUnionMember1Embedding(BaseModel):
float: Optional[List[builtins.float]] = None
@@ -66,7 +56,7 @@ class EmbeddingCreateResponse(BaseModel):
model: str
"""The model used"""
- data: Union[List[DataUnionMember0], List[DataUnionMember1]]
+ data: Union[List[Embedding], List[DataUnionMember1]]
"""The created embeddings."""
object: Optional[
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index 1d143378..1c38d8ba 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -9,7 +9,11 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import InfoResponse, EmbedResponse, RerankResponse
+from mixedbread.types import (
+ InfoResponse,
+ RerankResponse,
+ EmbeddingCreateResponse,
+)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,7 +27,7 @@ def test_method_embed(self, client: Mixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbedResponse, client_, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
@parametrize
def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
@@ -35,7 +39,7 @@ def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbedResponse, client_, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
@parametrize
def test_raw_response_embed(self, client: Mixedbread) -> None:
@@ -47,7 +51,7 @@ def test_raw_response_embed(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(EmbedResponse, client_, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
@parametrize
def test_streaming_response_embed(self, client: Mixedbread) -> None:
@@ -59,7 +63,7 @@ def test_streaming_response_embed(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(EmbedResponse, client_, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -144,7 +148,7 @@ async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbedResponse, client, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
@parametrize
async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -156,7 +160,7 @@ async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread)
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbedResponse, client, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
@parametrize
async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -168,7 +172,7 @@ async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(EmbedResponse, client, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
@parametrize
async def test_streaming_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -180,7 +184,7 @@ async def test_streaming_response_embed(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(EmbedResponse, client, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
assert cast(Any, response.is_closed) is True
From 3cb59cecbea8acfffab74f8d9fa964ccaf04c526 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:00:00 +0000
Subject: [PATCH 086/375] chore(internal): version bump (#174)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 0c41cec4..0f02ea1c 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.38"
+ ".": "0.1.0-alpha.39"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 4a2c8f3d..6b961a75 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.38"
+version = "0.1.0-alpha.39"
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 5a6196cd..5ce0d007 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.1.0-alpha.38" # x-release-please-version
+__version__ = "0.1.0-alpha.39" # x-release-please-version
From 395f768efe58025eb8ecc8eff44d185e3638870c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:03:52 +0000
Subject: [PATCH 087/375] feat(api): update via SDK Studio (#175)
---
.stats.yml | 2 +-
api.md | 8 +++-
src/mixedbread/types/__init__.py | 1 +
.../types/embedding_create_response.py | 34 ++---------------
.../types/multi_encoding_embedding.py | 37 +++++++++++++++++++
5 files changed, 49 insertions(+), 33 deletions(-)
create mode 100644 src/mixedbread/types/multi_encoding_embedding.py
diff --git a/.stats.yml b/.stats.yml
index 7ce94546..a346743e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
-config_hash: 564cc8bc5835fe03496be6aab6d4dc42
+config_hash: 6552b029ab372150ad4054acd59dde95
diff --git a/api.md b/api.md
index c2a19d86..a7d820d8 100644
--- a/api.md
+++ b/api.md
@@ -9,7 +9,13 @@ from mixedbread.types import SearchFilter, SearchFilterCondition
Types:
```python
-from mixedbread.types import Embedding, EmbeddingCreateResponse, InfoResponse, RerankResponse
+from mixedbread.types import (
+ Embedding,
+ EmbeddingCreateResponse,
+ MultiEncodingEmbedding,
+ InfoResponse,
+ RerankResponse,
+)
```
Methods:
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 18991940..ae8ce3a4 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -18,6 +18,7 @@
from .client_rerank_params import ClientRerankParams as ClientRerankParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
+from .multi_encoding_embedding import MultiEncodingEmbedding as MultiEncodingEmbedding
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
from .embedding_create_response import EmbeddingCreateResponse as EmbeddingCreateResponse
from .scored_vector_store_chunk import ScoredVectorStoreChunk as ScoredVectorStoreChunk
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index c72e68cb..8f3605cb 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -1,13 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-import builtins
from typing import List, Union, Optional
from typing_extensions import Literal
from .._models import BaseModel
from .embedding import Embedding
+from .multi_encoding_embedding import MultiEncodingEmbedding
-__all__ = ["EmbeddingCreateResponse", "Usage", "DataUnionMember1", "DataUnionMember1Embedding"]
+__all__ = ["EmbeddingCreateResponse", "Usage"]
class Usage(BaseModel):
@@ -21,34 +21,6 @@ class Usage(BaseModel):
"""The number of tokens used for the completion"""
-class DataUnionMember1Embedding(BaseModel):
- float: Optional[List[builtins.float]] = None
-
- int8: Optional[List[int]] = None
-
- uint8: Optional[List[int]] = None
-
- binary: Optional[List[int]] = None
-
- ubinary: Optional[List[int]] = None
-
- base64: Optional[str] = None
-
-
-class DataUnionMember1(BaseModel):
- embedding: DataUnionMember1Embedding
- """
- The encoded embedding data by encoding format.Returned, if more than one
- encoding format is used.
- """
-
- index: int
- """The index of the embedding."""
-
- object: Optional[Literal["embedding_dict"]] = None
- """The object type of the embedding."""
-
-
class EmbeddingCreateResponse(BaseModel):
usage: Usage
"""The usage of the model"""
@@ -56,7 +28,7 @@ class EmbeddingCreateResponse(BaseModel):
model: str
"""The model used"""
- data: Union[List[Embedding], List[DataUnionMember1]]
+ data: Union[List[Embedding], List[MultiEncodingEmbedding]]
"""The created embeddings."""
object: Optional[
diff --git a/src/mixedbread/types/multi_encoding_embedding.py b/src/mixedbread/types/multi_encoding_embedding.py
new file mode 100644
index 00000000..8a7b3ca3
--- /dev/null
+++ b/src/mixedbread/types/multi_encoding_embedding.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+import builtins
+from typing import List, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["MultiEncodingEmbedding", "Embedding"]
+
+
+class Embedding(BaseModel):
+ float: Optional[List[builtins.float]] = None
+
+ int8: Optional[List[int]] = None
+
+ uint8: Optional[List[int]] = None
+
+ binary: Optional[List[int]] = None
+
+ ubinary: Optional[List[int]] = None
+
+ base64: Optional[str] = None
+
+
+class MultiEncodingEmbedding(BaseModel):
+ embedding: Embedding
+ """
+ The encoded embedding data by encoding format.Returned, if more than one
+ encoding format is used.
+ """
+
+ index: int
+ """The index of the embedding."""
+
+ object: Optional[Literal["embedding_dict"]] = None
+ """The object type of the embedding."""
From 67dbede04fe4372daeeac4df7648adc414429a51 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:04:49 +0000
Subject: [PATCH 088/375] chore(internal): version bump (#177)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 0f02ea1c..db3930fd 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.39"
+ ".": "0.1.0-alpha.40"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 6b961a75..f124245d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.39"
+version = "0.1.0-alpha.40"
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 5ce0d007..92e78fd7 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.1.0-alpha.39" # x-release-please-version
+__version__ = "0.1.0-alpha.40" # x-release-please-version
From 1bb8270be5540e67782f8288f49f22274b3be935 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:09:11 +0000
Subject: [PATCH 089/375] feat(api): update via SDK Studio (#178)
---
.stats.yml | 2 +-
README.md | 108 ++++++------------
api.md | 12 +-
src/mixedbread/_client.py | 10 +-
src/mixedbread/resources/embeddings.py | 10 +-
src/mixedbread/types/__init__.py | 2 +-
.../{embedding_create_response.py => em.py} | 4 +-
tests/api_resources/test_client.py | 22 ++--
tests/api_resources/test_embeddings.py | 18 +--
tests/test_client.py | 94 ++++++++++-----
10 files changed, 135 insertions(+), 147 deletions(-)
rename src/mixedbread/types/{embedding_create_response.py => em.py} (94%)
diff --git a/.stats.yml b/.stats.yml
index a346743e..00db8629 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
-config_hash: 6552b029ab372150ad4054acd59dde95
+config_hash: 2a44785dc321bd6e458c4e767035de1b
diff --git a/README.md b/README.md
index 5d3e4084..3d966cc2 100644
--- a/README.md
+++ b/README.md
@@ -33,8 +33,11 @@ client = Mixedbread(
environment="local",
)
-vector_store = client.vector_stores.create()
-print(vector_store.id)
+response = client.vector_stores.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+)
+print(response.object)
```
While you can provide an `api_key` keyword argument,
@@ -59,8 +62,11 @@ client = AsyncMixedbread(
async def main() -> None:
- vector_store = await client.vector_stores.create()
- print(vector_store.id)
+ response = await client.vector_stores.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
+ print(response.object)
asyncio.run(main())
@@ -77,71 +83,6 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
-## Pagination
-
-List methods in the Mixedbread API are paginated.
-
-This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
-
-```python
-from mixedbread import Mixedbread
-
-client = Mixedbread()
-
-all_vector_stores = []
-# Automatically fetches more pages as needed.
-for vector_store in client.vector_stores.list():
- # Do something with vector_store here
- all_vector_stores.append(vector_store)
-print(all_vector_stores)
-```
-
-Or, asynchronously:
-
-```python
-import asyncio
-from mixedbread import AsyncMixedbread
-
-client = AsyncMixedbread()
-
-
-async def main() -> None:
- all_vector_stores = []
- # Iterate through items across all pages, issuing requests as needed.
- async for vector_store in client.vector_stores.list():
- all_vector_stores.append(vector_store)
- print(all_vector_stores)
-
-
-asyncio.run(main())
-```
-
-Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
-
-```python
-first_page = await client.vector_stores.list()
-if first_page.has_next_page():
- print(f"will fetch next page using these details: {first_page.next_page_info()}")
- next_page = await first_page.get_next_page()
- print(f"number of items we just fetched: {len(next_page.data)}")
-
-# Remove `await` for non-async usage.
-```
-
-Or just work directly with the returned data:
-
-```python
-first_page = await client.vector_stores.list()
-
-print(
- f"the current start offset for this page: {first_page.pagination.offset}"
-) # => "the current start offset for this page: 1"
-for vector_store in first_page.data:
- print(vector_store.id)
-
-# Remove `await` for non-async usage.
-```
-
## Nested params
Nested parameters are dictionaries, typed using `TypedDict`, for example:
@@ -193,7 +134,10 @@ from mixedbread import Mixedbread
client = Mixedbread()
try:
- client.vector_stores.create()
+ client.vector_stores.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
except mixedbread.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -236,7 +180,10 @@ client = Mixedbread(
)
# Or, configure per-request:
-client.with_options(max_retries=5).vector_stores.create()
+client.with_options(max_retries=5).vector_stores.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+)
```
### Timeouts
@@ -259,7 +206,10 @@ client = Mixedbread(
)
# Override per-request:
-client.with_options(timeout=5.0).vector_stores.create()
+client.with_options(timeout=5.0).vector_stores.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+)
```
On timeout, an `APITimeoutError` is thrown.
@@ -300,11 +250,14 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
from mixedbread import Mixedbread
client = Mixedbread()
-response = client.vector_stores.with_raw_response.create()
+response = client.vector_stores.with_raw_response.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+)
print(response.headers.get('X-My-Header'))
-vector_store = response.parse() # get the object that `vector_stores.create()` would have returned
-print(vector_store.id)
+vector_store = response.parse() # get the object that `vector_stores.search()` would have returned
+print(vector_store.object)
```
These methods return an [`APIResponse`](https://github.com/mixedbread-ai/mixedbread-python/tree/main/src/mixedbread/_response.py) object.
@@ -318,7 +271,10 @@ The above interface eagerly reads the full response body when you make the reque
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
```python
-with client.vector_stores.with_streaming_response.create() as response:
+with client.vector_stores.with_streaming_response.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+) as response:
print(response.headers.get("X-My-Header"))
for line in response.iter_lines():
diff --git a/api.md b/api.md
index a7d820d8..556c3a91 100644
--- a/api.md
+++ b/api.md
@@ -9,18 +9,12 @@ from mixedbread.types import SearchFilter, SearchFilterCondition
Types:
```python
-from mixedbread.types import (
- Embedding,
- EmbeddingCreateResponse,
- MultiEncodingEmbedding,
- InfoResponse,
- RerankResponse,
-)
+from mixedbread.types import Em, Embedding, MultiEncodingEmbedding, InfoResponse, RerankResponse
```
Methods:
-- client.embed(\*\*params) -> EmbeddingCreateResponse
+- client.embed(\*\*params) -> Em
- client.info() -> InfoResponse
- client.rerank(\*\*params) -> RerankResponse
@@ -153,4 +147,4 @@ Methods:
Methods:
-- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
+- client.embeddings.create(\*\*params) -> Em
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 30ff9cca..29b4d595 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -30,6 +30,7 @@
async_maybe_transform,
)
from ._version import __version__
+from .types.em import Em
from ._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
@@ -50,7 +51,6 @@
from .resources.extractions import extractions
from .types.rerank_response import RerankResponse
from .resources.vector_stores import vector_stores
-from .types.embedding_create_response import EmbeddingCreateResponse
__all__ = [
"ENVIRONMENTS",
@@ -257,7 +257,7 @@ def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbeddingCreateResponse:
+ ) -> Em:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -304,7 +304,7 @@ def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbeddingCreateResponse,
+ cast_to=Em,
)
def info(
@@ -614,7 +614,7 @@ async def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbeddingCreateResponse:
+ ) -> Em:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -661,7 +661,7 @@ async def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbeddingCreateResponse,
+ cast_to=Em,
)
async def info(
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index d7390eda..f2adc49c 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -14,6 +14,7 @@
async_maybe_transform,
)
from .._compat import cached_property
+from ..types.em import Em
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
@@ -22,7 +23,6 @@
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
-from ..types.embedding_create_response import EmbeddingCreateResponse
__all__ = ["EmbeddingsResource", "AsyncEmbeddingsResource"]
@@ -66,7 +66,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbeddingCreateResponse:
+ ) -> Em:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -113,7 +113,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbeddingCreateResponse,
+ cast_to=Em,
)
@@ -156,7 +156,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbeddingCreateResponse:
+ ) -> Em:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -203,7 +203,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbeddingCreateResponse,
+ cast_to=Em,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index ae8ce3a4..c48a74b0 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from .em import Em as Em
from .shared import SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
from .embedding import Embedding as Embedding
from .file_counts import FileCounts as FileCounts
@@ -20,7 +21,6 @@
from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
from .multi_encoding_embedding import MultiEncodingEmbedding as MultiEncodingEmbedding
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
-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
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/em.py
similarity index 94%
rename from src/mixedbread/types/embedding_create_response.py
rename to src/mixedbread/types/em.py
index 8f3605cb..12277e0a 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/em.py
@@ -7,7 +7,7 @@
from .embedding import Embedding
from .multi_encoding_embedding import MultiEncodingEmbedding
-__all__ = ["EmbeddingCreateResponse", "Usage"]
+__all__ = ["Em", "Usage"]
class Usage(BaseModel):
@@ -21,7 +21,7 @@ class Usage(BaseModel):
"""The number of tokens used for the completion"""
-class EmbeddingCreateResponse(BaseModel):
+class Em(BaseModel):
usage: Usage
"""The usage of the model"""
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index 1c38d8ba..dc3ed1d8 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -9,11 +9,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import (
- InfoResponse,
- RerankResponse,
- EmbeddingCreateResponse,
-)
+from mixedbread.types import Em, InfoResponse, RerankResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -27,7 +23,7 @@ def test_method_embed(self, client: Mixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+ assert_matches_type(Em, client_, path=["response"])
@parametrize
def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
@@ -39,7 +35,7 @@ def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+ assert_matches_type(Em, client_, path=["response"])
@parametrize
def test_raw_response_embed(self, client: Mixedbread) -> None:
@@ -51,7 +47,7 @@ def test_raw_response_embed(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+ assert_matches_type(Em, client_, path=["response"])
@parametrize
def test_streaming_response_embed(self, client: Mixedbread) -> None:
@@ -63,7 +59,7 @@ def test_streaming_response_embed(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
+ assert_matches_type(Em, client_, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -148,7 +144,7 @@ async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+ assert_matches_type(Em, client, path=["response"])
@parametrize
async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -160,7 +156,7 @@ async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread)
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+ assert_matches_type(Em, client, path=["response"])
@parametrize
async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -172,7 +168,7 @@ async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+ assert_matches_type(Em, client, path=["response"])
@parametrize
async def test_streaming_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -184,7 +180,7 @@ async def test_streaming_response_embed(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
+ assert_matches_type(Em, client, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py
index ffe758eb..610022ee 100644
--- a/tests/api_resources/test_embeddings.py
+++ b/tests/api_resources/test_embeddings.py
@@ -9,7 +9,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import EmbeddingCreateResponse
+from mixedbread.types import Em
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,7 +23,7 @@ def test_method_create(self, client: Mixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+ assert_matches_type(Em, embedding, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
@@ -35,7 +35,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+ assert_matches_type(Em, embedding, path=["response"])
@parametrize
def test_raw_response_create(self, client: Mixedbread) -> None:
@@ -47,7 +47,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
embedding = response.parse()
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+ assert_matches_type(Em, embedding, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Mixedbread) -> None:
@@ -59,7 +59,7 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
embedding = response.parse()
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+ assert_matches_type(Em, embedding, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -73,7 +73,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+ assert_matches_type(Em, embedding, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -85,7 +85,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+ assert_matches_type(Em, embedding, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -97,7 +97,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
embedding = await response.parse()
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+ assert_matches_type(Em, embedding, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -109,6 +109,6 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
embedding = await response.parse()
- assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
+ assert_matches_type(Em, embedding, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/test_client.py b/tests/test_client.py
index 9a2b23af..450bfe0b 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -33,7 +33,7 @@
BaseClient,
make_request_options,
)
-from mixedbread.types.vector_store_create_params import VectorStoreCreateParams
+from mixedbread.types.vector_store_search_params import VectorStoreSearchParams
from .utils import update_env
@@ -732,12 +732,18 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
+ respx_mock.post("/v1/vector_stores/search").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
self.client.post(
- "/v1/vector_stores",
- body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
+ "/v1/vector_stores/search",
+ body=cast(
+ object,
+ maybe_transform(
+ dict(query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]),
+ VectorStoreSearchParams,
+ ),
+ ),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -747,12 +753,18 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
+ respx_mock.post("/v1/vector_stores/search").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
self.client.post(
- "/v1/vector_stores",
- body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
+ "/v1/vector_stores/search",
+ body=cast(
+ object,
+ maybe_transform(
+ dict(query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]),
+ VectorStoreSearchParams,
+ ),
+ ),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -783,9 +795,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
- response = client.vector_stores.with_raw_response.create()
+ response = client.vector_stores.with_raw_response.search(
+ query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]
+ )
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -807,9 +821,13 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
- response = client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()})
+ response = client.vector_stores.with_raw_response.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ extra_headers={"x-stainless-retry-count": Omit()},
+ )
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -830,9 +848,13 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
- response = client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
+ response = client.vector_stores.with_raw_response.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ extra_headers={"x-stainless-retry-count": "42"},
+ )
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
@@ -1518,12 +1540,18 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
+ respx_mock.post("/v1/vector_stores/search").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
await self.client.post(
- "/v1/vector_stores",
- body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
+ "/v1/vector_stores/search",
+ body=cast(
+ object,
+ maybe_transform(
+ dict(query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]),
+ VectorStoreSearchParams,
+ ),
+ ),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1533,12 +1561,18 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
+ respx_mock.post("/v1/vector_stores/search").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
await self.client.post(
- "/v1/vector_stores",
- body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
+ "/v1/vector_stores/search",
+ body=cast(
+ object,
+ maybe_transform(
+ dict(query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]),
+ VectorStoreSearchParams,
+ ),
+ ),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1570,9 +1604,11 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
- response = await client.vector_stores.with_raw_response.create()
+ response = await client.vector_stores.with_raw_response.search(
+ query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]
+ )
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -1595,10 +1631,12 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
- response = await client.vector_stores.with_raw_response.create(
- extra_headers={"x-stainless-retry-count": Omit()}
+ response = await client.vector_stores.with_raw_response.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ extra_headers={"x-stainless-retry-count": Omit()},
)
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -1621,9 +1659,13 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
- response = await client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
+ response = await client.vector_stores.with_raw_response.search(
+ query="how to configure SSL",
+ vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ extra_headers={"x-stainless-retry-count": "42"},
+ )
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
From e643b2ddd39d0eda092c08c8c5945ca47224b805 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:09:41 +0000
Subject: [PATCH 090/375] feat(api): update via SDK Studio (#180)
---
.stats.yml | 2 +-
api.md | 18 +++++-
src/mixedbread/_client.py | 10 ++--
src/mixedbread/resources/embeddings.py | 10 ++--
src/mixedbread/types/__init__.py | 3 +-
.../types/{em.py => embed_response.py} | 4 +-
.../types/embedding_create_response.py | 60 +++++++++++++++++++
tests/api_resources/test_client.py | 18 +++---
tests/api_resources/test_embeddings.py | 18 +++---
9 files changed, 108 insertions(+), 35 deletions(-)
rename src/mixedbread/types/{em.py => embed_response.py} (95%)
create mode 100644 src/mixedbread/types/embedding_create_response.py
diff --git a/.stats.yml b/.stats.yml
index 00db8629..c0a3743f 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
-config_hash: 2a44785dc321bd6e458c4e767035de1b
+config_hash: 404d016390359897b6f1ea74357b2ace
diff --git a/api.md b/api.md
index 556c3a91..2c0954d6 100644
--- a/api.md
+++ b/api.md
@@ -9,12 +9,18 @@ from mixedbread.types import SearchFilter, SearchFilterCondition
Types:
```python
-from mixedbread.types import Em, Embedding, MultiEncodingEmbedding, InfoResponse, RerankResponse
+from mixedbread.types import (
+ Embedding,
+ MultiEncodingEmbedding,
+ EmbedResponse,
+ InfoResponse,
+ RerankResponse,
+)
```
Methods:
-- client.embed(\*\*params) -> Em
+- client.embed(\*\*params) -> EmbedResponse
- client.info() -> InfoResponse
- client.rerank(\*\*params) -> RerankResponse
@@ -145,6 +151,12 @@ Methods:
# Embeddings
+Types:
+
+```python
+from mixedbread.types import EmbeddingCreateResponse
+```
+
Methods:
-- client.embeddings.create(\*\*params) -> Em
+- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 29b4d595..b9996076 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -30,7 +30,6 @@
async_maybe_transform,
)
from ._version import __version__
-from .types.em import Em
from ._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
@@ -48,6 +47,7 @@
)
from .resources.parsing import parsing
from .types.info_response import InfoResponse
+from .types.embed_response import EmbedResponse
from .resources.extractions import extractions
from .types.rerank_response import RerankResponse
from .resources.vector_stores import vector_stores
@@ -257,7 +257,7 @@ def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> Em:
+ ) -> EmbedResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -304,7 +304,7 @@ def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=Em,
+ cast_to=EmbedResponse,
)
def info(
@@ -614,7 +614,7 @@ async def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> Em:
+ ) -> EmbedResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -661,7 +661,7 @@ async def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=Em,
+ cast_to=EmbedResponse,
)
async def info(
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index f2adc49c..d7390eda 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -14,7 +14,6 @@
async_maybe_transform,
)
from .._compat import cached_property
-from ..types.em import Em
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
to_raw_response_wrapper,
@@ -23,6 +22,7 @@
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
+from ..types.embedding_create_response import EmbeddingCreateResponse
__all__ = ["EmbeddingsResource", "AsyncEmbeddingsResource"]
@@ -66,7 +66,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> Em:
+ ) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -113,7 +113,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=Em,
+ cast_to=EmbeddingCreateResponse,
)
@@ -156,7 +156,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> Em:
+ ) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -203,7 +203,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=Em,
+ cast_to=EmbeddingCreateResponse,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index c48a74b0..ee8d1032 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,7 +2,6 @@
from __future__ import annotations
-from .em import Em as Em
from .shared import SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
from .embedding import Embedding as Embedding
from .file_counts import FileCounts as FileCounts
@@ -10,6 +9,7 @@
from .vector_store import VectorStore as VectorStore
from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
+from .embed_response import EmbedResponse as EmbedResponse
from .rerank_response import RerankResponse as RerankResponse
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
@@ -21,6 +21,7 @@
from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
from .multi_encoding_embedding import MultiEncodingEmbedding as MultiEncodingEmbedding
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
+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
diff --git a/src/mixedbread/types/em.py b/src/mixedbread/types/embed_response.py
similarity index 95%
rename from src/mixedbread/types/em.py
rename to src/mixedbread/types/embed_response.py
index 12277e0a..fb9c8803 100644
--- a/src/mixedbread/types/em.py
+++ b/src/mixedbread/types/embed_response.py
@@ -7,7 +7,7 @@
from .embedding import Embedding
from .multi_encoding_embedding import MultiEncodingEmbedding
-__all__ = ["Em", "Usage"]
+__all__ = ["EmbedResponse", "Usage"]
class Usage(BaseModel):
@@ -21,7 +21,7 @@ class Usage(BaseModel):
"""The number of tokens used for the completion"""
-class Em(BaseModel):
+class EmbedResponse(BaseModel):
usage: Usage
"""The usage of the model"""
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
new file mode 100644
index 00000000..8f3605cb
--- /dev/null
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -0,0 +1,60 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .embedding import Embedding
+from .multi_encoding_embedding import MultiEncodingEmbedding
+
+__all__ = ["EmbeddingCreateResponse", "Usage"]
+
+
+class Usage(BaseModel):
+ prompt_tokens: int
+ """The number of tokens used for the prompt"""
+
+ total_tokens: int
+ """The total number of tokens used"""
+
+ completion_tokens: Optional[int] = None
+ """The number of tokens used for the completion"""
+
+
+class EmbeddingCreateResponse(BaseModel):
+ usage: Usage
+ """The usage of the model"""
+
+ model: str
+ """The model used"""
+
+ data: Union[List[Embedding], List[MultiEncodingEmbedding]]
+ """The created embeddings."""
+
+ object: Optional[
+ Literal[
+ "list",
+ "parsing_job",
+ "job",
+ "embedding",
+ "embedding_dict",
+ "rank_result",
+ "file",
+ "vector_store",
+ "vector_store.file",
+ "api_key",
+ ]
+ ] = None
+ """The object type of the response"""
+
+ normalized: bool
+ """Whether the embeddings are normalized."""
+
+ encoding_format: Union[
+ Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
+ List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
+ ]
+ """The encoding formats of the embeddings."""
+
+ dimensions: Optional[int] = None
+ """The number of dimensions used for the embeddings."""
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index dc3ed1d8..1d143378 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -9,7 +9,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import Em, InfoResponse, RerankResponse
+from mixedbread.types import InfoResponse, EmbedResponse, RerankResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,7 +23,7 @@ def test_method_embed(self, client: Mixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(Em, client_, path=["response"])
+ assert_matches_type(EmbedResponse, client_, path=["response"])
@parametrize
def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
@@ -35,7 +35,7 @@ def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
normalized=True,
encoding_format="float",
)
- assert_matches_type(Em, client_, path=["response"])
+ assert_matches_type(EmbedResponse, client_, path=["response"])
@parametrize
def test_raw_response_embed(self, client: Mixedbread) -> None:
@@ -47,7 +47,7 @@ def test_raw_response_embed(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(Em, client_, path=["response"])
+ assert_matches_type(EmbedResponse, client_, path=["response"])
@parametrize
def test_streaming_response_embed(self, client: Mixedbread) -> None:
@@ -59,7 +59,7 @@ def test_streaming_response_embed(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(Em, client_, path=["response"])
+ assert_matches_type(EmbedResponse, client_, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -144,7 +144,7 @@ async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(Em, client, path=["response"])
+ assert_matches_type(EmbedResponse, client, path=["response"])
@parametrize
async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -156,7 +156,7 @@ async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread)
normalized=True,
encoding_format="float",
)
- assert_matches_type(Em, client, path=["response"])
+ assert_matches_type(EmbedResponse, client, path=["response"])
@parametrize
async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -168,7 +168,7 @@ async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(Em, client, path=["response"])
+ assert_matches_type(EmbedResponse, client, path=["response"])
@parametrize
async def test_streaming_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -180,7 +180,7 @@ async def test_streaming_response_embed(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(Em, client, path=["response"])
+ assert_matches_type(EmbedResponse, client, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py
index 610022ee..ffe758eb 100644
--- a/tests/api_resources/test_embeddings.py
+++ b/tests/api_resources/test_embeddings.py
@@ -9,7 +9,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import Em
+from mixedbread.types import EmbeddingCreateResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,7 +23,7 @@ def test_method_create(self, client: Mixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(Em, embedding, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
@@ -35,7 +35,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
normalized=True,
encoding_format="float",
)
- assert_matches_type(Em, embedding, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@parametrize
def test_raw_response_create(self, client: Mixedbread) -> None:
@@ -47,7 +47,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
embedding = response.parse()
- assert_matches_type(Em, embedding, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Mixedbread) -> None:
@@ -59,7 +59,7 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
embedding = response.parse()
- assert_matches_type(Em, embedding, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -73,7 +73,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(Em, embedding, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -85,7 +85,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
normalized=True,
encoding_format="float",
)
- assert_matches_type(Em, embedding, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -97,7 +97,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
embedding = await response.parse()
- assert_matches_type(Em, embedding, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -109,6 +109,6 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
embedding = await response.parse()
- assert_matches_type(Em, embedding, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
assert cast(Any, response.is_closed) is True
From 662d0331896040935f938ff0fc73ea8d4895e3ed Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:10:07 +0000
Subject: [PATCH 091/375] chore(internal): version bump (#181)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index db3930fd..9c28aaea 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.40"
+ ".": "0.1.0-alpha.41"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index f124245d..8871ff50 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.40"
+version = "0.1.0-alpha.41"
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 92e78fd7..18d791e8 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.1.0-alpha.40" # x-release-please-version
+__version__ = "0.1.0-alpha.41" # x-release-please-version
From 26385a3564f46f8865aa664f50e966271fcc4741 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:16:40 +0000
Subject: [PATCH 092/375] feat(api): update via SDK Studio (#182)
---
.stats.yml | 2 +-
api.md | 10 +----
src/mixedbread/_client.py | 10 ++---
src/mixedbread/types/__init__.py | 1 -
src/mixedbread/types/embed_response.py | 60 --------------------------
tests/api_resources/test_client.py | 22 ++++++----
6 files changed, 21 insertions(+), 84 deletions(-)
delete mode 100644 src/mixedbread/types/embed_response.py
diff --git a/.stats.yml b/.stats.yml
index c0a3743f..ffb38610 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
-config_hash: 404d016390359897b6f1ea74357b2ace
+config_hash: bed309dda44f5c585068c1fa50ccc7ca
diff --git a/api.md b/api.md
index 2c0954d6..a7d820d8 100644
--- a/api.md
+++ b/api.md
@@ -11,8 +11,8 @@ Types:
```python
from mixedbread.types import (
Embedding,
+ EmbeddingCreateResponse,
MultiEncodingEmbedding,
- EmbedResponse,
InfoResponse,
RerankResponse,
)
@@ -20,7 +20,7 @@ from mixedbread.types import (
Methods:
-- client.embed(\*\*params) -> EmbedResponse
+- client.embed(\*\*params) -> EmbeddingCreateResponse
- client.info() -> InfoResponse
- client.rerank(\*\*params) -> RerankResponse
@@ -151,12 +151,6 @@ Methods:
# Embeddings
-Types:
-
-```python
-from mixedbread.types import EmbeddingCreateResponse
-```
-
Methods:
- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index b9996076..30ff9cca 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -47,10 +47,10 @@
)
from .resources.parsing import parsing
from .types.info_response import InfoResponse
-from .types.embed_response import EmbedResponse
from .resources.extractions import extractions
from .types.rerank_response import RerankResponse
from .resources.vector_stores import vector_stores
+from .types.embedding_create_response import EmbeddingCreateResponse
__all__ = [
"ENVIRONMENTS",
@@ -257,7 +257,7 @@ def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbedResponse:
+ ) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -304,7 +304,7 @@ def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbedResponse,
+ cast_to=EmbeddingCreateResponse,
)
def info(
@@ -614,7 +614,7 @@ async def embed(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> EmbedResponse:
+ ) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
and normalization.
@@ -661,7 +661,7 @@ async def embed(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=EmbedResponse,
+ cast_to=EmbeddingCreateResponse,
)
async def info(
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index ee8d1032..ae8ce3a4 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -9,7 +9,6 @@
from .vector_store import VectorStore as VectorStore
from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
-from .embed_response import EmbedResponse as EmbedResponse
from .rerank_response import RerankResponse as RerankResponse
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
diff --git a/src/mixedbread/types/embed_response.py b/src/mixedbread/types/embed_response.py
deleted file mode 100644
index fb9c8803..00000000
--- a/src/mixedbread/types/embed_response.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Union, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .embedding import Embedding
-from .multi_encoding_embedding import MultiEncodingEmbedding
-
-__all__ = ["EmbedResponse", "Usage"]
-
-
-class Usage(BaseModel):
- prompt_tokens: int
- """The number of tokens used for the prompt"""
-
- total_tokens: int
- """The total number of tokens used"""
-
- completion_tokens: Optional[int] = None
- """The number of tokens used for the completion"""
-
-
-class EmbedResponse(BaseModel):
- usage: Usage
- """The usage of the model"""
-
- model: str
- """The model used"""
-
- data: Union[List[Embedding], List[MultiEncodingEmbedding]]
- """The created embeddings."""
-
- object: Optional[
- Literal[
- "list",
- "parsing_job",
- "job",
- "embedding",
- "embedding_dict",
- "rank_result",
- "file",
- "vector_store",
- "vector_store.file",
- "api_key",
- ]
- ] = None
- """The object type of the response"""
-
- normalized: bool
- """Whether the embeddings are normalized."""
-
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- """The encoding formats of the embeddings."""
-
- dimensions: Optional[int] = None
- """The number of dimensions used for the embeddings."""
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index 1d143378..1c38d8ba 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -9,7 +9,11 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import InfoResponse, EmbedResponse, RerankResponse
+from mixedbread.types import (
+ InfoResponse,
+ RerankResponse,
+ EmbeddingCreateResponse,
+)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,7 +27,7 @@ def test_method_embed(self, client: Mixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbedResponse, client_, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
@parametrize
def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
@@ -35,7 +39,7 @@ def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbedResponse, client_, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
@parametrize
def test_raw_response_embed(self, client: Mixedbread) -> None:
@@ -47,7 +51,7 @@ def test_raw_response_embed(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(EmbedResponse, client_, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
@parametrize
def test_streaming_response_embed(self, client: Mixedbread) -> None:
@@ -59,7 +63,7 @@ def test_streaming_response_embed(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client_ = response.parse()
- assert_matches_type(EmbedResponse, client_, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -144,7 +148,7 @@ async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
model="mixedbread-ai/mxbai-embed-large-v1",
input=["string"],
)
- assert_matches_type(EmbedResponse, client, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
@parametrize
async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -156,7 +160,7 @@ async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread)
normalized=True,
encoding_format="float",
)
- assert_matches_type(EmbedResponse, client, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
@parametrize
async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -168,7 +172,7 @@ async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(EmbedResponse, client, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
@parametrize
async def test_streaming_response_embed(self, async_client: AsyncMixedbread) -> None:
@@ -180,7 +184,7 @@ async def test_streaming_response_embed(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
client = await response.parse()
- assert_matches_type(EmbedResponse, client, path=["response"])
+ assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
assert cast(Any, response.is_closed) is True
From 0a913164cba1e56c729f995ad73ef2bb90fa12a8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:21:13 +0000
Subject: [PATCH 093/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index ffb38610..5bff61e7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
-config_hash: bed309dda44f5c585068c1fa50ccc7ca
+config_hash: 1abee5c9ed042aec152177e571d391e1
From f918d85e3946d640d8672be20a71777cfa945e2a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:23:37 +0000
Subject: [PATCH 094/375] feat(api): update via SDK Studio (#184)
---
.stats.yml | 2 +-
README.md | 108 ++++++++++++++++++++++++++++++-------------
tests/test_client.py | 94 +++++++++++--------------------------
3 files changed, 103 insertions(+), 101 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 5bff61e7..85523261 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
-config_hash: 1abee5c9ed042aec152177e571d391e1
+config_hash: daf46fcf1979db0bfe4221c9a4197cd1
diff --git a/README.md b/README.md
index 3d966cc2..5d3e4084 100644
--- a/README.md
+++ b/README.md
@@ -33,11 +33,8 @@ client = Mixedbread(
environment="local",
)
-response = client.vector_stores.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
-)
-print(response.object)
+vector_store = client.vector_stores.create()
+print(vector_store.id)
```
While you can provide an `api_key` keyword argument,
@@ -62,11 +59,8 @@ client = AsyncMixedbread(
async def main() -> None:
- response = await client.vector_stores.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
- print(response.object)
+ vector_store = await client.vector_stores.create()
+ print(vector_store.id)
asyncio.run(main())
@@ -83,6 +77,71 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
+## Pagination
+
+List methods in the Mixedbread API are paginated.
+
+This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
+
+```python
+from mixedbread import Mixedbread
+
+client = Mixedbread()
+
+all_vector_stores = []
+# Automatically fetches more pages as needed.
+for vector_store in client.vector_stores.list():
+ # Do something with vector_store here
+ all_vector_stores.append(vector_store)
+print(all_vector_stores)
+```
+
+Or, asynchronously:
+
+```python
+import asyncio
+from mixedbread import AsyncMixedbread
+
+client = AsyncMixedbread()
+
+
+async def main() -> None:
+ all_vector_stores = []
+ # Iterate through items across all pages, issuing requests as needed.
+ async for vector_store in client.vector_stores.list():
+ all_vector_stores.append(vector_store)
+ print(all_vector_stores)
+
+
+asyncio.run(main())
+```
+
+Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
+
+```python
+first_page = await client.vector_stores.list()
+if first_page.has_next_page():
+ print(f"will fetch next page using these details: {first_page.next_page_info()}")
+ next_page = await first_page.get_next_page()
+ print(f"number of items we just fetched: {len(next_page.data)}")
+
+# Remove `await` for non-async usage.
+```
+
+Or just work directly with the returned data:
+
+```python
+first_page = await client.vector_stores.list()
+
+print(
+ f"the current start offset for this page: {first_page.pagination.offset}"
+) # => "the current start offset for this page: 1"
+for vector_store in first_page.data:
+ print(vector_store.id)
+
+# Remove `await` for non-async usage.
+```
+
## Nested params
Nested parameters are dictionaries, typed using `TypedDict`, for example:
@@ -134,10 +193,7 @@ from mixedbread import Mixedbread
client = Mixedbread()
try:
- client.vector_stores.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
+ client.vector_stores.create()
except mixedbread.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -180,10 +236,7 @@ client = Mixedbread(
)
# Or, configure per-request:
-client.with_options(max_retries=5).vector_stores.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
-)
+client.with_options(max_retries=5).vector_stores.create()
```
### Timeouts
@@ -206,10 +259,7 @@ client = Mixedbread(
)
# Override per-request:
-client.with_options(timeout=5.0).vector_stores.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
-)
+client.with_options(timeout=5.0).vector_stores.create()
```
On timeout, an `APITimeoutError` is thrown.
@@ -250,14 +300,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
from mixedbread import Mixedbread
client = Mixedbread()
-response = client.vector_stores.with_raw_response.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
-)
+response = client.vector_stores.with_raw_response.create()
print(response.headers.get('X-My-Header'))
-vector_store = response.parse() # get the object that `vector_stores.search()` would have returned
-print(vector_store.object)
+vector_store = response.parse() # get the object that `vector_stores.create()` would have returned
+print(vector_store.id)
```
These methods return an [`APIResponse`](https://github.com/mixedbread-ai/mixedbread-python/tree/main/src/mixedbread/_response.py) object.
@@ -271,10 +318,7 @@ The above interface eagerly reads the full response body when you make the reque
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
```python
-with client.vector_stores.with_streaming_response.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
-) as response:
+with client.vector_stores.with_streaming_response.create() as response:
print(response.headers.get("X-My-Header"))
for line in response.iter_lines():
diff --git a/tests/test_client.py b/tests/test_client.py
index 450bfe0b..9a2b23af 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -33,7 +33,7 @@
BaseClient,
make_request_options,
)
-from mixedbread.types.vector_store_search_params import VectorStoreSearchParams
+from mixedbread.types.vector_store_create_params import VectorStoreCreateParams
from .utils import update_env
@@ -732,18 +732,12 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/vector_stores/search").mock(side_effect=httpx.TimeoutException("Test timeout error"))
+ respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
self.client.post(
- "/v1/vector_stores/search",
- body=cast(
- object,
- maybe_transform(
- dict(query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]),
- VectorStoreSearchParams,
- ),
- ),
+ "/v1/vector_stores",
+ body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -753,18 +747,12 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/vector_stores/search").mock(return_value=httpx.Response(500))
+ respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
self.client.post(
- "/v1/vector_stores/search",
- body=cast(
- object,
- maybe_transform(
- dict(query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]),
- VectorStoreSearchParams,
- ),
- ),
+ "/v1/vector_stores",
+ body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -795,11 +783,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = client.vector_stores.with_raw_response.search(
- query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]
- )
+ response = client.vector_stores.with_raw_response.create()
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -821,13 +807,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = client.vector_stores.with_raw_response.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- extra_headers={"x-stainless-retry-count": Omit()},
- )
+ response = client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()})
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -848,13 +830,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = client.vector_stores.with_raw_response.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- extra_headers={"x-stainless-retry-count": "42"},
- )
+ response = client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
@@ -1540,18 +1518,12 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/vector_stores/search").mock(side_effect=httpx.TimeoutException("Test timeout error"))
+ respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
await self.client.post(
- "/v1/vector_stores/search",
- body=cast(
- object,
- maybe_transform(
- dict(query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]),
- VectorStoreSearchParams,
- ),
- ),
+ "/v1/vector_stores",
+ body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1561,18 +1533,12 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
- respx_mock.post("/v1/vector_stores/search").mock(return_value=httpx.Response(500))
+ respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
await self.client.post(
- "/v1/vector_stores/search",
- body=cast(
- object,
- maybe_transform(
- dict(query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]),
- VectorStoreSearchParams,
- ),
- ),
+ "/v1/vector_stores",
+ body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
cast_to=httpx.Response,
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
)
@@ -1604,11 +1570,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = await client.vector_stores.with_raw_response.search(
- query="how to configure SSL", vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]
- )
+ response = await client.vector_stores.with_raw_response.create()
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -1631,12 +1595,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = await client.vector_stores.with_raw_response.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- extra_headers={"x-stainless-retry-count": Omit()},
+ response = await client.vector_stores.with_raw_response.create(
+ extra_headers={"x-stainless-retry-count": Omit()}
)
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -1659,13 +1621,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores/search").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
- response = await client.vector_stores.with_raw_response.search(
- query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- extra_headers={"x-stainless-retry-count": "42"},
- )
+ response = await client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
From 1f92e0e80374f3b6329c06704c588e4b175e772e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:54:15 +0000
Subject: [PATCH 095/375] feat(api): update via SDK Studio (#186)
---
.stats.yml | 2 +-
README.md | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 85523261..c2ca6ff0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
-config_hash: daf46fcf1979db0bfe4221c9a4197cd1
+config_hash: 20a40be2c85d83a4bb34aee53cefd856
diff --git a/README.md b/README.md
index 5d3e4084..fcc0dd73 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# Mixedbread Python SDK API library
+# Mixedbread API Python SDK API library
[](https://pypi.org/project/mixedbread/)
-The Mixedbread Python SDK library provides convenient access to the Mixedbread REST API from any Python 3.8+
+The Mixedbread API Python SDK library provides convenient access to the Mixedbread REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
From 8667a66ebafc0560a28afcc8d566688bf9253977 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 21:55:03 +0000
Subject: [PATCH 096/375] chore(internal): version bump (#188)
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 9c28aaea..859ebd32 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.41"
+ ".": "0.1.0-alpha.42"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 8871ff50..5be3f0a9 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.41"
+version = "0.1.0-alpha.42"
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 18d791e8..f4132283 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.1.0-alpha.41" # x-release-please-version
+__version__ = "0.1.0-alpha.42" # x-release-please-version
From fb85eeb9ee8de1b30d9c46ec6c80f90d960d33e7 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 22:02:01 +0000
Subject: [PATCH 097/375] feat(api): update via SDK Studio (#189)
---
.stats.yml | 2 +-
api.md | 2 +-
src/mixedbread/types/__init__.py | 2 +-
.../types/embedding_create_response.py | 14 ++------------
src/mixedbread/types/rerank_response.py | 14 ++------------
src/mixedbread/types/shared/__init__.py | 1 +
src/mixedbread/types/shared/usage.py | 18 ++++++++++++++++++
7 files changed, 26 insertions(+), 27 deletions(-)
create mode 100644 src/mixedbread/types/shared/usage.py
diff --git a/.stats.yml b/.stats.yml
index c2ca6ff0..155f8534 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
-config_hash: 20a40be2c85d83a4bb34aee53cefd856
+config_hash: f87f729f63f3b34364d1c144753b920d
diff --git a/api.md b/api.md
index a7d820d8..b1cf6f5a 100644
--- a/api.md
+++ b/api.md
@@ -1,7 +1,7 @@
# Shared Types
```python
-from mixedbread.types import SearchFilter, SearchFilterCondition
+from mixedbread.types import SearchFilter, SearchFilterCondition, Usage
```
# Mixedbread
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index ae8ce3a4..5d068c8e 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from .shared import SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
+from .shared import Usage as Usage, SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
from .embedding import Embedding as Embedding
from .file_counts import FileCounts as FileCounts
from .file_object import FileObject as FileObject
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index 8f3605cb..c7374f21 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -5,20 +5,10 @@
from .._models import BaseModel
from .embedding import Embedding
+from .shared.usage import Usage
from .multi_encoding_embedding import MultiEncodingEmbedding
-__all__ = ["EmbeddingCreateResponse", "Usage"]
-
-
-class Usage(BaseModel):
- prompt_tokens: int
- """The number of tokens used for the prompt"""
-
- total_tokens: int
- """The total number of tokens used"""
-
- completion_tokens: Optional[int] = None
- """The number of tokens used for the completion"""
+__all__ = ["EmbeddingCreateResponse"]
class EmbeddingCreateResponse(BaseModel):
diff --git a/src/mixedbread/types/rerank_response.py b/src/mixedbread/types/rerank_response.py
index 5cf151fc..1b4dd0a9 100644
--- a/src/mixedbread/types/rerank_response.py
+++ b/src/mixedbread/types/rerank_response.py
@@ -4,19 +4,9 @@
from typing_extensions import Literal
from .._models import BaseModel
+from .shared.usage import Usage
-__all__ = ["RerankResponse", "Usage", "Data"]
-
-
-class Usage(BaseModel):
- prompt_tokens: int
- """The number of tokens used for the prompt"""
-
- total_tokens: int
- """The total number of tokens used"""
-
- completion_tokens: Optional[int] = None
- """The number of tokens used for the completion"""
+__all__ = ["RerankResponse", "Data"]
class Data(BaseModel):
diff --git a/src/mixedbread/types/shared/__init__.py b/src/mixedbread/types/shared/__init__.py
index c91e740d..66d5dcf9 100644
--- a/src/mixedbread/types/shared/__init__.py
+++ b/src/mixedbread/types/shared/__init__.py
@@ -1,4 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from .usage import Usage as Usage
from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared/usage.py b/src/mixedbread/types/shared/usage.py
new file mode 100644
index 00000000..eab91a6c
--- /dev/null
+++ b/src/mixedbread/types/shared/usage.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+
+from ..._models import BaseModel
+
+__all__ = ["Usage"]
+
+
+class Usage(BaseModel):
+ prompt_tokens: int
+ """The number of tokens used for the prompt"""
+
+ total_tokens: int
+ """The total number of tokens used"""
+
+ completion_tokens: Optional[int] = None
+ """The number of tokens used for the completion"""
From 34080d1adc8c4efad9a311e7dd1f0bad4fb639f1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 22:06:17 +0000
Subject: [PATCH 098/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 155f8534..83cccef3 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
-openapi_spec_hash: dbd7616a32c90fd25b32994830fb12f6
+openapi_spec_hash: 4faa08fce1f48979a83ff502c9db157b
config_hash: f87f729f63f3b34364d1c144753b920d
From 55fc016a12a64c2b5ad186144ffaee83ff237a9b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 22:10:08 +0000
Subject: [PATCH 099/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 83cccef3..9bfa71fc 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
-openapi_spec_hash: 4faa08fce1f48979a83ff502c9db157b
+openapi_spec_hash: d3ab27dba9665501eb2e47d18d3a2b68
config_hash: f87f729f63f3b34364d1c144753b920d
From a0af576e3a7f2821a445bec2e61d649826ece4b8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 22:20:29 +0000
Subject: [PATCH 100/375] feat(api): update via SDK Studio (#191)
---
.stats.yml | 2 +-
src/mixedbread/_client.py | 4 +-
src/mixedbread/resources/embeddings.py | 4 +-
src/mixedbread/types/client_embed_params.py | 2 +-
.../types/embedding_create_params.py | 2 +-
tests/api_resources/test_client.py | 40 +++++++++----------
tests/api_resources/test_embeddings.py | 16 ++++----
7 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 9bfa71fc..68253575 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
-openapi_spec_hash: d3ab27dba9665501eb2e47d18d3a2b68
+openapi_spec_hash: bbf8d4c5379fa9652890792e28f97f4e
config_hash: f87f729f63f3b34364d1c144753b920d
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 30ff9cca..c80b3274 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -242,7 +242,7 @@ def embed(
self,
*,
model: str,
- input: List[str],
+ input: Union[str, List[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
@@ -599,7 +599,7 @@ async def embed(
self,
*,
model: str,
- input: List[str],
+ input: Union[str, List[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index d7390eda..3800954d 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -51,7 +51,7 @@ def create(
self,
*,
model: str,
- input: List[str],
+ input: Union[str, List[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
@@ -141,7 +141,7 @@ async def create(
self,
*,
model: str,
- input: List[str],
+ input: Union[str, List[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
diff --git a/src/mixedbread/types/client_embed_params.py b/src/mixedbread/types/client_embed_params.py
index ec6a6e8b..3f27c1a3 100644
--- a/src/mixedbread/types/client_embed_params.py
+++ b/src/mixedbread/types/client_embed_params.py
@@ -12,7 +12,7 @@ class ClientEmbedParams(TypedDict, total=False):
model: Required[str]
"""The model to use for creating embeddings."""
- input: Required[List[str]]
+ input: Required[Union[str, List[str]]]
"""The input to create embeddings for."""
dimensions: Optional[int]
diff --git a/src/mixedbread/types/embedding_create_params.py b/src/mixedbread/types/embedding_create_params.py
index 534982e3..6c9b29f6 100644
--- a/src/mixedbread/types/embedding_create_params.py
+++ b/src/mixedbread/types/embedding_create_params.py
@@ -12,7 +12,7 @@ class EmbeddingCreateParams(TypedDict, total=False):
model: Required[str]
"""The model to use for creating embeddings."""
- input: Required[List[str]]
+ input: Required[Union[str, List[str]]]
"""The input to create embeddings for."""
dimensions: Optional[int]
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index 1c38d8ba..2122a9f1 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -25,7 +25,7 @@ class TestClient:
def test_method_embed(self, client: Mixedbread) -> None:
client_ = client.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
)
assert_matches_type(EmbeddingCreateResponse, client_, path=["response"])
@@ -33,7 +33,7 @@ def test_method_embed(self, client: Mixedbread) -> None:
def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
client_ = client.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
dimensions=768,
prompt="Provide a detailed summary of the following text.",
normalized=True,
@@ -45,7 +45,7 @@ def test_method_embed_with_all_params(self, client: Mixedbread) -> None:
def test_raw_response_embed(self, client: Mixedbread) -> None:
response = client.with_raw_response.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
)
assert response.is_closed is True
@@ -57,7 +57,7 @@ def test_raw_response_embed(self, client: Mixedbread) -> None:
def test_streaming_response_embed(self, client: Mixedbread) -> None:
with client.with_streaming_response.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -95,7 +95,7 @@ def test_streaming_response_info(self, client: Mixedbread) -> None:
@parametrize
def test_method_rerank(self, client: Mixedbread) -> None:
client_ = client.rerank(
- query="What is mixedbread ai?",
+ query="What are the key features of the Mixedbread embedding model?",
input=["Document 1", "Document 2"],
)
assert_matches_type(RerankResponse, client_, path=["response"])
@@ -103,10 +103,10 @@ def test_method_rerank(self, client: Mixedbread) -> None:
@parametrize
def test_method_rerank_with_all_params(self, client: Mixedbread) -> None:
client_ = client.rerank(
- model="x",
- query="What is mixedbread ai?",
+ model="mixedbread-ai/mxbai-rerank-large-v2",
+ query="What are the key features of the Mixedbread embedding model?",
input=["Document 1", "Document 2"],
- rank_fields=["field1", "field2"],
+ rank_fields=["content", "title"],
top_k=10,
return_input=False,
)
@@ -115,7 +115,7 @@ def test_method_rerank_with_all_params(self, client: Mixedbread) -> None:
@parametrize
def test_raw_response_rerank(self, client: Mixedbread) -> None:
response = client.with_raw_response.rerank(
- query="What is mixedbread ai?",
+ query="What are the key features of the Mixedbread embedding model?",
input=["Document 1", "Document 2"],
)
@@ -127,7 +127,7 @@ def test_raw_response_rerank(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_rerank(self, client: Mixedbread) -> None:
with client.with_streaming_response.rerank(
- query="What is mixedbread ai?",
+ query="What are the key features of the Mixedbread embedding model?",
input=["Document 1", "Document 2"],
) as response:
assert not response.is_closed
@@ -146,7 +146,7 @@ class TestAsyncClient:
async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
client = await async_client.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
)
assert_matches_type(EmbeddingCreateResponse, client, path=["response"])
@@ -154,7 +154,7 @@ async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread) -> None:
client = await async_client.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
dimensions=768,
prompt="Provide a detailed summary of the following text.",
normalized=True,
@@ -166,7 +166,7 @@ async def test_method_embed_with_all_params(self, async_client: AsyncMixedbread)
async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
response = await async_client.with_raw_response.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
)
assert response.is_closed is True
@@ -178,7 +178,7 @@ async def test_raw_response_embed(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_embed(self, async_client: AsyncMixedbread) -> None:
async with async_client.with_streaming_response.embed(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -216,7 +216,7 @@ async def test_streaming_response_info(self, async_client: AsyncMixedbread) -> N
@parametrize
async def test_method_rerank(self, async_client: AsyncMixedbread) -> None:
client = await async_client.rerank(
- query="What is mixedbread ai?",
+ query="What are the key features of the Mixedbread embedding model?",
input=["Document 1", "Document 2"],
)
assert_matches_type(RerankResponse, client, path=["response"])
@@ -224,10 +224,10 @@ async def test_method_rerank(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_rerank_with_all_params(self, async_client: AsyncMixedbread) -> None:
client = await async_client.rerank(
- model="x",
- query="What is mixedbread ai?",
+ model="mixedbread-ai/mxbai-rerank-large-v2",
+ query="What are the key features of the Mixedbread embedding model?",
input=["Document 1", "Document 2"],
- rank_fields=["field1", "field2"],
+ rank_fields=["content", "title"],
top_k=10,
return_input=False,
)
@@ -236,7 +236,7 @@ async def test_method_rerank_with_all_params(self, async_client: AsyncMixedbread
@parametrize
async def test_raw_response_rerank(self, async_client: AsyncMixedbread) -> None:
response = await async_client.with_raw_response.rerank(
- query="What is mixedbread ai?",
+ query="What are the key features of the Mixedbread embedding model?",
input=["Document 1", "Document 2"],
)
@@ -248,7 +248,7 @@ async def test_raw_response_rerank(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_rerank(self, async_client: AsyncMixedbread) -> None:
async with async_client.with_streaming_response.rerank(
- query="What is mixedbread ai?",
+ query="What are the key features of the Mixedbread embedding model?",
input=["Document 1", "Document 2"],
) as response:
assert not response.is_closed
diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py
index ffe758eb..9aab6efd 100644
--- a/tests/api_resources/test_embeddings.py
+++ b/tests/api_resources/test_embeddings.py
@@ -21,7 +21,7 @@ class TestEmbeddings:
def test_method_create(self, client: Mixedbread) -> None:
embedding = client.embeddings.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
)
assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@@ -29,7 +29,7 @@ def test_method_create(self, client: Mixedbread) -> None:
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
embedding = client.embeddings.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
dimensions=768,
prompt="Provide a detailed summary of the following text.",
normalized=True,
@@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
def test_raw_response_create(self, client: Mixedbread) -> None:
response = client.embeddings.with_raw_response.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
)
assert response.is_closed is True
@@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
def test_streaming_response_create(self, client: Mixedbread) -> None:
with client.embeddings.with_streaming_response.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -71,7 +71,7 @@ class TestAsyncEmbeddings:
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
embedding = await async_client.embeddings.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
)
assert_matches_type(EmbeddingCreateResponse, embedding, path=["response"])
@@ -79,7 +79,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
embedding = await async_client.embeddings.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
dimensions=768,
prompt="Provide a detailed summary of the following text.",
normalized=True,
@@ -91,7 +91,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
response = await async_client.embeddings.with_raw_response.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
)
assert response.is_closed is True
@@ -103,7 +103,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
async with async_client.embeddings.with_streaming_response.create(
model="mixedbread-ai/mxbai-embed-large-v1",
- input=["string"],
+ input="x",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
From 3ed7950addf1808145e32a87f119de7533c1f826 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 22:26:21 +0000
Subject: [PATCH 101/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 68253575..079df7a2 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
-openapi_spec_hash: bbf8d4c5379fa9652890792e28f97f4e
+openapi_spec_hash: a9df47de09efe21b0d8e0c513493940c
config_hash: f87f729f63f3b34364d1c144753b920d
From b5fa308ad5285766e641cad98c1bfd23902d6b69 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 3 Apr 2025 22:36:40 +0000
Subject: [PATCH 102/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 079df7a2..b46a3c09 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
-openapi_spec_hash: a9df47de09efe21b0d8e0c513493940c
+openapi_spec_hash: a47fe4cb39ee0cb74ee5888de2f0a5e1
config_hash: f87f729f63f3b34364d1c144753b920d
From c52297a83d648b4336a034417a7d8da72685c810 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 4 Apr 2025 10:33:58 +0000
Subject: [PATCH 103/375] chore(internal): remove trailing character (#192)
---
tests/test_client.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_client.py b/tests/test_client.py
index 9a2b23af..990596df 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -1639,7 +1639,7 @@ def test_get_platform(self) -> None:
import threading
from mixedbread._utils import asyncify
- from mixedbread._base_client import get_platform
+ from mixedbread._base_client import get_platform
async def test_main() -> None:
result = await asyncify(get_platform)()
From a39852f050e9446be2e7a7d2593e9e429b9203b7 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 4 Apr 2025 10:36:21 +0000
Subject: [PATCH 104/375] chore(internal): version bump (#193)
---
.release-please-manifest.json | 2 +-
README.md | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 859ebd32..3d2ac0bd 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.42"
+ ".": "0.1.0"
}
\ No newline at end of file
diff --git a/README.md b/README.md
index fcc0dd73..72224fc3 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ The REST API documentation can be found on [mixedbread.com](https://mixedbread.c
```sh
# install from PyPI
-pip install --pre mixedbread
+pip install mixedbread
```
## Usage
diff --git a/pyproject.toml b/pyproject.toml
index 5be3f0a9..93ded3d5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0-alpha.42"
+version = "0.1.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 f4132283..ec180d74 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.1.0-alpha.42" # x-release-please-version
+__version__ = "0.1.0" # x-release-please-version
From edfcb9e947904d58842c91c1f937edb6c0ee53cc Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 8 Apr 2025 00:24:33 +0000
Subject: [PATCH 105/375] feat(api): update via SDK Studio (#194)
---
.stats.yml | 2 +-
README.md | 6 +++---
src/mixedbread/_client.py | 12 ++++++------
tests/test_client.py | 4 ++--
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index b46a3c09..bf9e8e0e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: a47fe4cb39ee0cb74ee5888de2f0a5e1
-config_hash: f87f729f63f3b34364d1c144753b920d
+config_hash: 6d1076e161e84bae54e1b0df1015d37e
diff --git a/README.md b/README.md
index 72224fc3..0c9b9688 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@ import os
from mixedbread import Mixedbread
client = Mixedbread(
- api_key=os.environ.get("MIXEDBREAD_API_KEY"), # This is the default and can be omitted
+ api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
# defaults to "production".
environment="local",
)
@@ -39,7 +39,7 @@ print(vector_store.id)
While you can provide an `api_key` keyword argument,
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
-to add `MIXEDBREAD_API_KEY="My API Key"` to your `.env` file
+to add `MXBAI_API_KEY="My API Key"` to your `.env` file
so that your API Key is not stored in source control.
## Async usage
@@ -52,7 +52,7 @@ import asyncio
from mixedbread import AsyncMixedbread
client = AsyncMixedbread(
- api_key=os.environ.get("MIXEDBREAD_API_KEY"), # This is the default and can be omitted
+ api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
# defaults to "production".
environment="local",
)
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index c80b3274..ece8c7f8 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -110,13 +110,13 @@ def __init__(
) -> None:
"""Construct a new synchronous Mixedbread client instance.
- This automatically infers the `api_key` argument from the `MIXEDBREAD_API_KEY` environment variable if it is not provided.
+ This automatically infers the `api_key` argument from the `MXBAI_API_KEY` environment variable if it is not provided.
"""
if api_key is None:
- api_key = os.environ.get("MIXEDBREAD_API_KEY")
+ api_key = os.environ.get("MXBAI_API_KEY")
if api_key is None:
raise MixedbreadError(
- "The api_key client option must be set either by passing api_key to the client or by setting the MIXEDBREAD_API_KEY environment variable"
+ "The api_key client option must be set either by passing api_key to the client or by setting the MXBAI_API_KEY environment variable"
)
self.api_key = api_key
@@ -467,13 +467,13 @@ def __init__(
) -> None:
"""Construct a new async AsyncMixedbread client instance.
- This automatically infers the `api_key` argument from the `MIXEDBREAD_API_KEY` environment variable if it is not provided.
+ This automatically infers the `api_key` argument from the `MXBAI_API_KEY` environment variable if it is not provided.
"""
if api_key is None:
- api_key = os.environ.get("MIXEDBREAD_API_KEY")
+ api_key = os.environ.get("MXBAI_API_KEY")
if api_key is None:
raise MixedbreadError(
- "The api_key client option must be set either by passing api_key to the client or by setting the MIXEDBREAD_API_KEY environment variable"
+ "The api_key client option must be set either by passing api_key to the client or by setting the MXBAI_API_KEY environment variable"
)
self.api_key = api_key
diff --git a/tests/test_client.py b/tests/test_client.py
index 990596df..4d16384d 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -342,7 +342,7 @@ def test_validate_headers(self) -> None:
assert request.headers.get("Authorization") == f"Bearer {api_key}"
with pytest.raises(MixedbreadError):
- with update_env(**{"MIXEDBREAD_API_KEY": Omit()}):
+ with update_env(**{"MXBAI_API_KEY": Omit()}):
client2 = Mixedbread(base_url=base_url, api_key=None, _strict_response_validation=True)
_ = client2
@@ -1122,7 +1122,7 @@ def test_validate_headers(self) -> None:
assert request.headers.get("Authorization") == f"Bearer {api_key}"
with pytest.raises(MixedbreadError):
- with update_env(**{"MIXEDBREAD_API_KEY": Omit()}):
+ with update_env(**{"MXBAI_API_KEY": Omit()}):
client2 = AsyncMixedbread(base_url=base_url, api_key=None, _strict_response_validation=True)
_ = client2
From 781b29afe7c3b05cf4b6692145423c707efc5bab Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 8 Apr 2025 00:25:24 +0000
Subject: [PATCH 106/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3d2ac0bd..10f30916 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0"
+ ".": "0.2.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 93ded3d5..cfb02939 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.1.0"
+version = "0.2.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 ec180d74..593e3c09 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.1.0" # x-release-please-version
+__version__ = "0.2.0" # x-release-please-version
From 7ad0ad2ebd1db5faf008c4b33839e6c57edd5238 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 9 Apr 2025 02:35:34 +0000
Subject: [PATCH 107/375] chore(internal): slight transform perf improvement
(#196)
---
src/mixedbread/_utils/_transform.py | 22 ++++++++++++++++++++++
tests/test_transform.py | 12 ++++++++++++
2 files changed, 34 insertions(+)
diff --git a/src/mixedbread/_utils/_transform.py b/src/mixedbread/_utils/_transform.py
index 7ac2e17f..3ec62081 100644
--- a/src/mixedbread/_utils/_transform.py
+++ b/src/mixedbread/_utils/_transform.py
@@ -142,6 +142,10 @@ def _maybe_transform_key(key: str, type_: type) -> str:
return key
+def _no_transform_needed(annotation: type) -> bool:
+ return annotation == float or annotation == int
+
+
def _transform_recursive(
data: object,
*,
@@ -184,6 +188,15 @@ def _transform_recursive(
return cast(object, data)
inner_type = extract_type_arg(stripped_type, 0)
+ if _no_transform_needed(inner_type):
+ # for some types there is no need to transform anything, so we can get a small
+ # perf boost from skipping that work.
+ #
+ # but we still need to convert to a list to ensure the data is json-serializable
+ if is_list(data):
+ return data
+ return list(data)
+
return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
if is_union_type(stripped_type):
@@ -332,6 +345,15 @@ async def _async_transform_recursive(
return cast(object, data)
inner_type = extract_type_arg(stripped_type, 0)
+ if _no_transform_needed(inner_type):
+ # for some types there is no need to transform anything, so we can get a small
+ # perf boost from skipping that work.
+ #
+ # but we still need to convert to a list to ensure the data is json-serializable
+ if is_list(data):
+ return data
+ return list(data)
+
return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
if is_union_type(stripped_type):
diff --git a/tests/test_transform.py b/tests/test_transform.py
index 4cedd6a2..0965c692 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -432,3 +432,15 @@ async def test_base64_file_input(use_async: bool) -> None:
assert await transform({"foo": io.BytesIO(b"Hello, world!")}, TypedDictBase64Input, use_async) == {
"foo": "SGVsbG8sIHdvcmxkIQ=="
} # type: ignore[comparison-overlap]
+
+
+@parametrize
+@pytest.mark.asyncio
+async def test_transform_skipping(use_async: bool) -> None:
+ # lists of ints are left as-is
+ data = [1, 2, 3]
+ assert await transform(data, List[int], use_async) is data
+
+ # iterables of ints are converted to a list
+ data = iter([1, 2, 3])
+ assert await transform(data, Iterable[int], use_async) == [1, 2, 3]
From 796e986b7dce7758e5c9c0f19fffbc1b0dfbaedc Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 9 Apr 2025 02:36:10 +0000
Subject: [PATCH 108/375] chore(tests): improve enum examples (#197)
---
tests/api_resources/test_vector_stores.py | 24 +++++++++----------
.../api_resources/vector_stores/test_files.py | 12 +++++-----
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index bc9e0ab3..5a367783 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -240,7 +240,7 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -252,7 +252,7 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -264,7 +264,7 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -328,7 +328,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -340,7 +340,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -352,7 +352,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -617,7 +617,7 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -629,7 +629,7 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -641,7 +641,7 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -705,7 +705,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -717,7 +717,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -729,7 +729,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index ff4d7a91..e089a591 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -239,7 +239,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -251,7 +251,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -263,7 +263,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -529,7 +529,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -541,7 +541,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
@@ -553,7 +553,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
{
"key": "price",
"value": "100",
- "operator": "eq",
+ "operator": "gt",
},
{
"key": "color",
From 1f39da98c1d5088192031df72715a16f47765547 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 9 Apr 2025 02:41:09 +0000
Subject: [PATCH 109/375] chore: slight wording improvement in README (#198)
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0c9b9688..831cfdec 100644
--- a/README.md
+++ b/README.md
@@ -162,7 +162,7 @@ print(vector_store.expires_after)
## File uploads
-Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
+Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.
```python
from pathlib import Path
From 878f2ea045a5025454d88ca67ce6e047b59854a3 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 10 Apr 2025 02:53:51 +0000
Subject: [PATCH 110/375] chore(internal): expand CI branch coverage
---
.github/workflows/ci.yml | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3b286e5a..53a3a09c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,18 +1,18 @@
name: CI
on:
push:
- branches:
- - main
- pull_request:
- branches:
- - main
- - next
+ branches-ignore:
+ - 'generated'
+ - 'codegen/**'
+ - 'integrated/**'
+ - 'preview-head/**'
+ - 'preview-base/**'
+ - 'preview/**'
jobs:
lint:
name: lint
runs-on: ubuntu-latest
-
steps:
- uses: actions/checkout@v4
@@ -33,7 +33,6 @@ jobs:
test:
name: test
runs-on: ubuntu-latest
-
steps:
- uses: actions/checkout@v4
From 2fbd7b1a47147859afdb32b1005f57d93af50e88 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 10 Apr 2025 02:57:59 +0000
Subject: [PATCH 111/375] chore(internal): reduce CI branch coverage
---
.github/workflows/ci.yml | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 53a3a09c..81f6dc20 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,13 +1,12 @@
name: CI
on:
push:
- branches-ignore:
- - 'generated'
- - 'codegen/**'
- - 'integrated/**'
- - 'preview-head/**'
- - 'preview-base/**'
- - 'preview/**'
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+ - next
jobs:
lint:
From f8c47ee5bdb33319b93d847a5109a6bb9996a54c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 10 Apr 2025 16:38:00 +0000
Subject: [PATCH 112/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index bf9e8e0e..c641ef5e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: a47fe4cb39ee0cb74ee5888de2f0a5e1
-config_hash: 6d1076e161e84bae54e1b0df1015d37e
+config_hash: 9062b0aec39c48ae1d4268f2ca703bf3
From 264d3144cf27c683c297b753664ce20180c1a505 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 10 Apr 2025 17:07:44 +0000
Subject: [PATCH 113/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index c641ef5e..33d10985 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: a47fe4cb39ee0cb74ee5888de2f0a5e1
-config_hash: 9062b0aec39c48ae1d4268f2ca703bf3
+config_hash: 444ab698b590ba1c7d3fa49ef2eca9b5
From dcc77dfc50fe7cfc58a4a5108a5d1c78bf79646c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 10 Apr 2025 17:28:11 +0000
Subject: [PATCH 114/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 33d10985..425b2e64 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: a47fe4cb39ee0cb74ee5888de2f0a5e1
-config_hash: 444ab698b590ba1c7d3fa49ef2eca9b5
+config_hash: 931562be0efa01a0833aafe954a8502a
From d4d9c66539866323e6b901f8d82d3c51fb08eaca Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 10 Apr 2025 18:13:56 +0000
Subject: [PATCH 115/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 425b2e64..79ca4185 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: a47fe4cb39ee0cb74ee5888de2f0a5e1
-config_hash: 931562be0efa01a0833aafe954a8502a
+config_hash: 6a7c1faa96b022a6959d720d7957eade
From 98f3ce804d6031c5268e00f85a558bafee58801d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 12 Apr 2025 02:50:10 +0000
Subject: [PATCH 116/375] fix(perf): skip traversing types for NotGiven values
---
src/mixedbread/_utils/_transform.py | 11 +++++++++++
tests/test_transform.py | 9 ++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/mixedbread/_utils/_transform.py b/src/mixedbread/_utils/_transform.py
index 3ec62081..3b2b8e00 100644
--- a/src/mixedbread/_utils/_transform.py
+++ b/src/mixedbread/_utils/_transform.py
@@ -12,6 +12,7 @@
from ._utils import (
is_list,
+ is_given,
is_mapping,
is_iterable,
)
@@ -258,6 +259,11 @@ def _transform_typeddict(
result: dict[str, object] = {}
annotations = get_type_hints(expected_type, include_extras=True)
for key, value in data.items():
+ if not is_given(value):
+ # we don't need to include `NotGiven` values here as they'll
+ # be stripped out before the request is sent anyway
+ continue
+
type_ = annotations.get(key)
if type_ is None:
# we do not have a type annotation for this field, leave it as is
@@ -415,6 +421,11 @@ async def _async_transform_typeddict(
result: dict[str, object] = {}
annotations = get_type_hints(expected_type, include_extras=True)
for key, value in data.items():
+ if not is_given(value):
+ # we don't need to include `NotGiven` values here as they'll
+ # be stripped out before the request is sent anyway
+ continue
+
type_ = annotations.get(key)
if type_ is None:
# we do not have a type annotation for this field, leave it as is
diff --git a/tests/test_transform.py b/tests/test_transform.py
index 0965c692..d3c69d8e 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -8,7 +8,7 @@
import pytest
-from mixedbread._types import Base64FileInput
+from mixedbread._types import NOT_GIVEN, Base64FileInput
from mixedbread._utils import (
PropertyInfo,
transform as _transform,
@@ -444,3 +444,10 @@ async def test_transform_skipping(use_async: bool) -> None:
# iterables of ints are converted to a list
data = iter([1, 2, 3])
assert await transform(data, Iterable[int], use_async) == [1, 2, 3]
+
+
+@parametrize
+@pytest.mark.asyncio
+async def test_strips_notgiven(use_async: bool) -> None:
+ assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"}
+ assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {}
From 78959dbb292f4d62a641483faafb6b950ce881b6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 12 Apr 2025 02:51:06 +0000
Subject: [PATCH 117/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 10f30916..b06ba919 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.2.0"
+ ".": "0.2.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index cfb02939..61c45f44 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.2.0"
+version = "0.2.1"
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 593e3c09..2c97ccc1 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.2.0" # x-release-please-version
+__version__ = "0.2.1" # x-release-please-version
From 69383e16b20a368f599f76ad09a2917d39c52383 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 12 Apr 2025 02:51:35 +0000
Subject: [PATCH 118/375] fix(perf): optimize some hot paths
---
src/mixedbread/_utils/_transform.py | 14 +++++++++++++-
src/mixedbread/_utils/_typing.py | 2 ++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/mixedbread/_utils/_transform.py b/src/mixedbread/_utils/_transform.py
index 3b2b8e00..b0cc20a7 100644
--- a/src/mixedbread/_utils/_transform.py
+++ b/src/mixedbread/_utils/_transform.py
@@ -5,7 +5,7 @@
import pathlib
from typing import Any, Mapping, TypeVar, cast
from datetime import date, datetime
-from typing_extensions import Literal, get_args, override, get_type_hints
+from typing_extensions import Literal, get_args, override, get_type_hints as _get_type_hints
import anyio
import pydantic
@@ -13,6 +13,7 @@
from ._utils import (
is_list,
is_given,
+ lru_cache,
is_mapping,
is_iterable,
)
@@ -109,6 +110,7 @@ class Params(TypedDict, total=False):
return cast(_T, transformed)
+@lru_cache(maxsize=8096)
def _get_annotated_type(type_: type) -> type | None:
"""If the given type is an `Annotated` type then it is returned, if not `None` is returned.
@@ -433,3 +435,13 @@ async def _async_transform_typeddict(
else:
result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_)
return result
+
+
+@lru_cache(maxsize=8096)
+def get_type_hints(
+ obj: Any,
+ globalns: dict[str, Any] | None = None,
+ localns: Mapping[str, Any] | None = None,
+ include_extras: bool = False,
+) -> dict[str, Any]:
+ return _get_type_hints(obj, globalns=globalns, localns=localns, include_extras=include_extras)
diff --git a/src/mixedbread/_utils/_typing.py b/src/mixedbread/_utils/_typing.py
index 278749b1..1958820f 100644
--- a/src/mixedbread/_utils/_typing.py
+++ b/src/mixedbread/_utils/_typing.py
@@ -13,6 +13,7 @@
get_origin,
)
+from ._utils import lru_cache
from .._types import InheritsGeneric
from .._compat import is_union as _is_union
@@ -66,6 +67,7 @@ def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]:
# Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]]
+@lru_cache(maxsize=8096)
def strip_annotated_type(typ: type) -> type:
if is_required_type(typ) or is_annotated_type(typ):
return strip_annotated_type(cast(type, get_args(typ)[0]))
From c7083c9dc26b14671c74ba8f88c08345ba884e7a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 15 Apr 2025 03:10:43 +0000
Subject: [PATCH 119/375] chore(internal): update pyright settings
---
pyproject.toml | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyproject.toml b/pyproject.toml
index 61c45f44..3fbf11fc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -147,6 +147,7 @@ exclude = [
]
reportImplicitOverride = true
+reportOverlappingOverload = false
reportImportCycles = false
reportPrivateUsage = false
From 2e025b95e07c9aa7d3613f9f82105f998e095443 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 15 Apr 2025 03:12:31 +0000
Subject: [PATCH 120/375] chore(client): minor internal fixes
---
src/mixedbread/_base_client.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index b206ef2e..c9ab1a6f 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -409,7 +409,8 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0
idempotency_header = self._idempotency_header
if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers:
- headers[idempotency_header] = options.idempotency_key or self._idempotency_key()
+ options.idempotency_key = options.idempotency_key or self._idempotency_key()
+ headers[idempotency_header] = options.idempotency_key
# Don't set these headers if they were already set or removed by the caller. We check
# `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
@@ -943,6 +944,10 @@ def _request(
request = self._build_request(options, retries_taken=retries_taken)
self._prepare_request(request)
+ if options.idempotency_key:
+ # ensure the idempotency key is reused between requests
+ input_options.idempotency_key = options.idempotency_key
+
kwargs: HttpxSendArgs = {}
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth
@@ -1475,6 +1480,10 @@ async def _request(
request = self._build_request(options, retries_taken=retries_taken)
await self._prepare_request(request)
+ if options.idempotency_key:
+ # ensure the idempotency key is reused between requests
+ input_options.idempotency_key = options.idempotency_key
+
kwargs: HttpxSendArgs = {}
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth
From 476c1b23b13c2e80ec6f836021c7cf9edc8f4ee8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 17 Apr 2025 02:52:54 +0000
Subject: [PATCH 121/375] chore(internal): bump pyright version
---
pyproject.toml | 2 +-
requirements-dev.lock | 2 +-
src/mixedbread/_base_client.py | 6 +++++-
src/mixedbread/_models.py | 1 -
src/mixedbread/_utils/_typing.py | 2 +-
tests/conftest.py | 2 +-
tests/test_models.py | 2 +-
7 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 3fbf11fc..03ceb4d0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -42,7 +42,7 @@ Repository = "https://github.com/mixedbread-ai/mixedbread-python"
managed = true
# version pins are in requirements-dev.lock
dev-dependencies = [
- "pyright>=1.1.359",
+ "pyright==1.1.399",
"mypy",
"respx",
"pytest",
diff --git a/requirements-dev.lock b/requirements-dev.lock
index 6dbb147d..4d2d4266 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -69,7 +69,7 @@ pydantic-core==2.27.1
# via pydantic
pygments==2.18.0
# via rich
-pyright==1.1.392.post0
+pyright==1.1.399
pytest==8.3.3
# via pytest-asyncio
pytest-asyncio==0.24.0
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index c9ab1a6f..4b6be35f 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -98,7 +98,11 @@
_AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any])
if TYPE_CHECKING:
- from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
+ from httpx._config import (
+ DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage]
+ )
+
+ HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG
else:
try:
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 34935716..58b9263e 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -19,7 +19,6 @@
)
import pydantic
-import pydantic.generics
from pydantic.fields import FieldInfo
from ._types import (
diff --git a/src/mixedbread/_utils/_typing.py b/src/mixedbread/_utils/_typing.py
index 1958820f..1bac9542 100644
--- a/src/mixedbread/_utils/_typing.py
+++ b/src/mixedbread/_utils/_typing.py
@@ -110,7 +110,7 @@ class MyResponse(Foo[_T]):
```
"""
cls = cast(object, get_origin(typ) or typ)
- if cls in generic_bases:
+ if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains]
# we're given the class directly
return extract_type_arg(typ, index)
diff --git a/tests/conftest.py b/tests/conftest.py
index f546bdd5..95be7245 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -10,7 +10,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
if TYPE_CHECKING:
- from _pytest.fixtures import FixtureRequest
+ from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]
pytest.register_assert_rewrite("tests.utils")
diff --git a/tests/test_models.py b/tests/test_models.py
index fa8f6491..c6a7c834 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -832,7 +832,7 @@ class B(BaseModel):
@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1")
def test_type_alias_type() -> None:
- Alias = TypeAliasType("Alias", str)
+ Alias = TypeAliasType("Alias", str) # pyright: ignore
class Model(BaseModel):
alias: Alias
From dc9bd0d7499bf2b63b0d0a40c5e3528bc26caea5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 17 Apr 2025 02:53:35 +0000
Subject: [PATCH 122/375] chore(internal): base client updates
---
src/mixedbread/_base_client.py | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 4b6be35f..484fd70a 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -119,6 +119,7 @@ class PageInfo:
url: URL | NotGiven
params: Query | NotGiven
+ json: Body | NotGiven
@overload
def __init__(
@@ -134,19 +135,30 @@ def __init__(
params: Query,
) -> None: ...
+ @overload
+ def __init__(
+ self,
+ *,
+ json: Body,
+ ) -> None: ...
+
def __init__(
self,
*,
url: URL | NotGiven = NOT_GIVEN,
+ json: Body | NotGiven = NOT_GIVEN,
params: Query | NotGiven = NOT_GIVEN,
) -> None:
self.url = url
+ self.json = json
self.params = params
@override
def __repr__(self) -> str:
if self.url:
return f"{self.__class__.__name__}(url={self.url})"
+ if self.json:
+ return f"{self.__class__.__name__}(json={self.json})"
return f"{self.__class__.__name__}(params={self.params})"
@@ -195,6 +207,19 @@ def _info_to_options(self, info: PageInfo) -> FinalRequestOptions:
options.url = str(url)
return options
+ if not isinstance(info.json, NotGiven):
+ if not is_mapping(info.json):
+ raise TypeError("Pagination is only supported with mappings")
+
+ if not options.json_data:
+ options.json_data = {**info.json}
+ else:
+ if not is_mapping(options.json_data):
+ raise TypeError("Pagination is only supported with mappings")
+
+ options.json_data = {**options.json_data, **info.json}
+ return options
+
raise ValueError("Unexpected PageInfo state")
From 9c6ce2f1f4f6916cfa58134cdf9be59499b4a8a0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 19 Apr 2025 03:01:00 +0000
Subject: [PATCH 123/375] chore(internal): update models test
---
tests/test_models.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/test_models.py b/tests/test_models.py
index c6a7c834..7f19dc8b 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -492,12 +492,15 @@ class Model(BaseModel):
resource_id: Optional[str] = None
m = Model.construct()
+ assert m.resource_id is None
assert "resource_id" not in m.model_fields_set
m = Model.construct(resource_id=None)
+ assert m.resource_id is None
assert "resource_id" in m.model_fields_set
m = Model.construct(resource_id="foo")
+ assert m.resource_id == "foo"
assert "resource_id" in m.model_fields_set
From f790ccbeee5cad0db2f586a1e3e42cd3d354f477 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 23 Apr 2025 03:42:40 +0000
Subject: [PATCH 124/375] chore(ci): add timeout thresholds for CI jobs
---
.github/workflows/ci.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 81f6dc20..04b083ca 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,6 +10,7 @@ on:
jobs:
lint:
+ timeout-minutes: 10
name: lint
runs-on: ubuntu-latest
steps:
@@ -30,6 +31,7 @@ jobs:
run: ./scripts/lint
test:
+ timeout-minutes: 10
name: test
runs-on: ubuntu-latest
steps:
From 55e96799ddd651040a6a9c797355498265bc9e8e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 23 Apr 2025 03:44:01 +0000
Subject: [PATCH 125/375] chore(internal): import reformatting
---
src/mixedbread/resources/embeddings.py | 5 +----
src/mixedbread/resources/extractions/content.py | 5 +----
src/mixedbread/resources/extractions/jobs.py | 5 +----
src/mixedbread/resources/extractions/schema.py | 5 +----
src/mixedbread/resources/files.py | 7 +------
src/mixedbread/resources/parsing/jobs.py | 5 +----
src/mixedbread/resources/vector_stores/files.py | 5 +----
src/mixedbread/resources/vector_stores/vector_stores.py | 5 +----
8 files changed, 8 insertions(+), 34 deletions(-)
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index 3800954d..72e10c5d 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -9,10 +9,7 @@
from ..types import embedding_create_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from .._utils import (
- maybe_transform,
- async_maybe_transform,
-)
+from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
index 2d1b896f..4a2a155f 100644
--- a/src/mixedbread/resources/extractions/content.py
+++ b/src/mixedbread/resources/extractions/content.py
@@ -7,10 +7,7 @@
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
+from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
diff --git a/src/mixedbread/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py
index d127824c..29b77911 100644
--- a/src/mixedbread/resources/extractions/jobs.py
+++ b/src/mixedbread/resources/extractions/jobs.py
@@ -7,10 +7,7 @@
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
+from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
diff --git a/src/mixedbread/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py
index d92032fa..651723f6 100644
--- a/src/mixedbread/resources/extractions/schema.py
+++ b/src/mixedbread/resources/extractions/schema.py
@@ -7,10 +7,7 @@
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
+from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py
index 49d4e39b..43cafa7d 100644
--- a/src/mixedbread/resources/files.py
+++ b/src/mixedbread/resources/files.py
@@ -8,12 +8,7 @@
from ..types import file_list_params, file_create_params, file_update_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
-from .._utils import (
- extract_files,
- maybe_transform,
- deepcopy_minimal,
- async_maybe_transform,
-)
+from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 24c214ef..d6abb074 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -8,10 +8,7 @@
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
+from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index cb9c7be8..526a2903 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -7,10 +7,7 @@
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
+from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 1efaec37..742b5f70 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -22,10 +22,7 @@
vector_store_question_answering_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import (
- maybe_transform,
- async_maybe_transform,
-)
+from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
From c9c1f1ca6965322e6f8326189dcff3e998cdbfc6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 23 Apr 2025 03:45:29 +0000
Subject: [PATCH 126/375] chore(internal): fix list file params
---
src/mixedbread/_utils/_utils.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/mixedbread/_utils/_utils.py b/src/mixedbread/_utils/_utils.py
index e5811bba..ea3cf3f2 100644
--- a/src/mixedbread/_utils/_utils.py
+++ b/src/mixedbread/_utils/_utils.py
@@ -72,8 +72,16 @@ def _extract_items(
from .._files import assert_is_file_content
# We have exhausted the path, return the entry we found.
- assert_is_file_content(obj, key=flattened_key)
assert flattened_key is not None
+
+ if is_list(obj):
+ files: list[tuple[str, FileTypes]] = []
+ for entry in obj:
+ assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "")
+ files.append((flattened_key + "[]", cast(FileTypes, entry)))
+ return files
+
+ assert_is_file_content(obj, key=flattened_key)
return [(flattened_key, cast(FileTypes, obj))]
index += 1
From 967f8b704debcae3308878f02b06fbdcf488ebb5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 23 Apr 2025 03:46:04 +0000
Subject: [PATCH 127/375] chore(internal): refactor retries to not use
recursion
---
src/mixedbread/_base_client.py | 414 ++++++++++++++-------------------
1 file changed, 175 insertions(+), 239 deletions(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 484fd70a..72f949dc 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -437,8 +437,7 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0
headers = httpx.Headers(headers_dict)
idempotency_header = self._idempotency_header
- if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers:
- options.idempotency_key = options.idempotency_key or self._idempotency_key()
+ if idempotency_header and options.idempotency_key and idempotency_header not in headers:
headers[idempotency_header] = options.idempotency_key
# Don't set these headers if they were already set or removed by the caller. We check
@@ -903,7 +902,6 @@ def request(
self,
cast_to: Type[ResponseT],
options: FinalRequestOptions,
- remaining_retries: Optional[int] = None,
*,
stream: Literal[True],
stream_cls: Type[_StreamT],
@@ -914,7 +912,6 @@ def request(
self,
cast_to: Type[ResponseT],
options: FinalRequestOptions,
- remaining_retries: Optional[int] = None,
*,
stream: Literal[False] = False,
) -> ResponseT: ...
@@ -924,7 +921,6 @@ def request(
self,
cast_to: Type[ResponseT],
options: FinalRequestOptions,
- remaining_retries: Optional[int] = None,
*,
stream: bool = False,
stream_cls: Type[_StreamT] | None = None,
@@ -934,125 +930,109 @@ def request(
self,
cast_to: Type[ResponseT],
options: FinalRequestOptions,
- remaining_retries: Optional[int] = None,
*,
stream: bool = False,
stream_cls: type[_StreamT] | None = None,
) -> ResponseT | _StreamT:
- if remaining_retries is not None:
- retries_taken = options.get_max_retries(self.max_retries) - remaining_retries
- else:
- retries_taken = 0
-
- return self._request(
- cast_to=cast_to,
- options=options,
- stream=stream,
- stream_cls=stream_cls,
- retries_taken=retries_taken,
- )
+ cast_to = self._maybe_override_cast_to(cast_to, options)
- def _request(
- self,
- *,
- cast_to: Type[ResponseT],
- options: FinalRequestOptions,
- retries_taken: int,
- stream: bool,
- stream_cls: type[_StreamT] | None,
- ) -> ResponseT | _StreamT:
# create a copy of the options we were given so that if the
# options are mutated later & we then retry, the retries are
# given the original options
input_options = model_copy(options)
-
- cast_to = self._maybe_override_cast_to(cast_to, options)
- options = self._prepare_options(options)
-
- remaining_retries = options.get_max_retries(self.max_retries) - retries_taken
- request = self._build_request(options, retries_taken=retries_taken)
- self._prepare_request(request)
-
- if options.idempotency_key:
+ if input_options.idempotency_key is None and input_options.method.lower() != "get":
# ensure the idempotency key is reused between requests
- input_options.idempotency_key = options.idempotency_key
+ input_options.idempotency_key = self._idempotency_key()
- kwargs: HttpxSendArgs = {}
- if self.custom_auth is not None:
- kwargs["auth"] = self.custom_auth
+ response: httpx.Response | None = None
+ max_retries = input_options.get_max_retries(self.max_retries)
- log.debug("Sending HTTP Request: %s %s", request.method, request.url)
+ retries_taken = 0
+ for retries_taken in range(max_retries + 1):
+ options = model_copy(input_options)
+ options = self._prepare_options(options)
- try:
- response = self._client.send(
- request,
- stream=stream or self._should_stream_response_body(request=request),
- **kwargs,
- )
- except httpx.TimeoutException as err:
- log.debug("Encountered httpx.TimeoutException", exc_info=True)
+ remaining_retries = max_retries - retries_taken
+ request = self._build_request(options, retries_taken=retries_taken)
+ self._prepare_request(request)
- if remaining_retries > 0:
- return self._retry_request(
- input_options,
- cast_to,
- retries_taken=retries_taken,
- stream=stream,
- stream_cls=stream_cls,
- response_headers=None,
- )
+ kwargs: HttpxSendArgs = {}
+ if self.custom_auth is not None:
+ kwargs["auth"] = self.custom_auth
- log.debug("Raising timeout error")
- raise APITimeoutError(request=request) from err
- except Exception as err:
- log.debug("Encountered Exception", exc_info=True)
+ log.debug("Sending HTTP Request: %s %s", request.method, request.url)
- if remaining_retries > 0:
- return self._retry_request(
- input_options,
- cast_to,
- retries_taken=retries_taken,
- stream=stream,
- stream_cls=stream_cls,
- response_headers=None,
+ response = None
+ try:
+ response = self._client.send(
+ request,
+ stream=stream or self._should_stream_response_body(request=request),
+ **kwargs,
)
+ except httpx.TimeoutException as err:
+ log.debug("Encountered httpx.TimeoutException", exc_info=True)
+
+ if remaining_retries > 0:
+ self._sleep_for_retry(
+ retries_taken=retries_taken,
+ max_retries=max_retries,
+ options=input_options,
+ response=None,
+ )
+ continue
+
+ log.debug("Raising timeout error")
+ raise APITimeoutError(request=request) from err
+ except Exception as err:
+ log.debug("Encountered Exception", exc_info=True)
+
+ if remaining_retries > 0:
+ self._sleep_for_retry(
+ retries_taken=retries_taken,
+ max_retries=max_retries,
+ options=input_options,
+ response=None,
+ )
+ continue
+
+ log.debug("Raising connection error")
+ raise APIConnectionError(request=request) from err
+
+ log.debug(
+ 'HTTP Response: %s %s "%i %s" %s',
+ request.method,
+ request.url,
+ response.status_code,
+ response.reason_phrase,
+ response.headers,
+ )
- log.debug("Raising connection error")
- raise APIConnectionError(request=request) from err
-
- log.debug(
- 'HTTP Response: %s %s "%i %s" %s',
- request.method,
- request.url,
- response.status_code,
- response.reason_phrase,
- response.headers,
- )
+ try:
+ response.raise_for_status()
+ except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code
+ log.debug("Encountered httpx.HTTPStatusError", exc_info=True)
+
+ if remaining_retries > 0 and self._should_retry(err.response):
+ err.response.close()
+ self._sleep_for_retry(
+ retries_taken=retries_taken,
+ max_retries=max_retries,
+ options=input_options,
+ response=response,
+ )
+ continue
- try:
- response.raise_for_status()
- except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code
- log.debug("Encountered httpx.HTTPStatusError", exc_info=True)
-
- if remaining_retries > 0 and self._should_retry(err.response):
- err.response.close()
- return self._retry_request(
- input_options,
- cast_to,
- retries_taken=retries_taken,
- response_headers=err.response.headers,
- stream=stream,
- stream_cls=stream_cls,
- )
+ # If the response is streamed then we need to explicitly read the response
+ # to completion before attempting to access the response text.
+ if not err.response.is_closed:
+ err.response.read()
- # If the response is streamed then we need to explicitly read the response
- # to completion before attempting to access the response text.
- if not err.response.is_closed:
- err.response.read()
+ log.debug("Re-raising status error")
+ raise self._make_status_error_from_response(err.response) from None
- log.debug("Re-raising status error")
- raise self._make_status_error_from_response(err.response) from None
+ break
+ assert response is not None, "could not resolve response (should never happen)"
return self._process_response(
cast_to=cast_to,
options=options,
@@ -1062,37 +1042,20 @@ def _request(
retries_taken=retries_taken,
)
- def _retry_request(
- self,
- options: FinalRequestOptions,
- cast_to: Type[ResponseT],
- *,
- retries_taken: int,
- response_headers: httpx.Headers | None,
- stream: bool,
- stream_cls: type[_StreamT] | None,
- ) -> ResponseT | _StreamT:
- remaining_retries = options.get_max_retries(self.max_retries) - retries_taken
+ def _sleep_for_retry(
+ self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None
+ ) -> None:
+ remaining_retries = max_retries - retries_taken
if remaining_retries == 1:
log.debug("1 retry left")
else:
log.debug("%i retries left", remaining_retries)
- timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers)
+ timeout = self._calculate_retry_timeout(remaining_retries, options, response.headers if response else None)
log.info("Retrying request to %s in %f seconds", options.url, timeout)
- # In a synchronous context we are blocking the entire thread. Up to the library user to run the client in a
- # different thread if necessary.
time.sleep(timeout)
- return self._request(
- options=options,
- cast_to=cast_to,
- retries_taken=retries_taken + 1,
- stream=stream,
- stream_cls=stream_cls,
- )
-
def _process_response(
self,
*,
@@ -1436,7 +1399,6 @@ async def request(
options: FinalRequestOptions,
*,
stream: Literal[False] = False,
- remaining_retries: Optional[int] = None,
) -> ResponseT: ...
@overload
@@ -1447,7 +1409,6 @@ async def request(
*,
stream: Literal[True],
stream_cls: type[_AsyncStreamT],
- remaining_retries: Optional[int] = None,
) -> _AsyncStreamT: ...
@overload
@@ -1458,7 +1419,6 @@ async def request(
*,
stream: bool,
stream_cls: type[_AsyncStreamT] | None = None,
- remaining_retries: Optional[int] = None,
) -> ResponseT | _AsyncStreamT: ...
async def request(
@@ -1468,120 +1428,111 @@ async def request(
*,
stream: bool = False,
stream_cls: type[_AsyncStreamT] | None = None,
- remaining_retries: Optional[int] = None,
- ) -> ResponseT | _AsyncStreamT:
- if remaining_retries is not None:
- retries_taken = options.get_max_retries(self.max_retries) - remaining_retries
- else:
- retries_taken = 0
-
- return await self._request(
- cast_to=cast_to,
- options=options,
- stream=stream,
- stream_cls=stream_cls,
- retries_taken=retries_taken,
- )
-
- async def _request(
- self,
- cast_to: Type[ResponseT],
- options: FinalRequestOptions,
- *,
- stream: bool,
- stream_cls: type[_AsyncStreamT] | None,
- retries_taken: int,
) -> ResponseT | _AsyncStreamT:
if self._platform is None:
# `get_platform` can make blocking IO calls so we
# execute it earlier while we are in an async context
self._platform = await asyncify(get_platform)()
+ cast_to = self._maybe_override_cast_to(cast_to, options)
+
# create a copy of the options we were given so that if the
# options are mutated later & we then retry, the retries are
# given the original options
input_options = model_copy(options)
-
- cast_to = self._maybe_override_cast_to(cast_to, options)
- options = await self._prepare_options(options)
-
- remaining_retries = options.get_max_retries(self.max_retries) - retries_taken
- request = self._build_request(options, retries_taken=retries_taken)
- await self._prepare_request(request)
-
- if options.idempotency_key:
+ if input_options.idempotency_key is None and input_options.method.lower() != "get":
# ensure the idempotency key is reused between requests
- input_options.idempotency_key = options.idempotency_key
+ input_options.idempotency_key = self._idempotency_key()
- kwargs: HttpxSendArgs = {}
- if self.custom_auth is not None:
- kwargs["auth"] = self.custom_auth
+ response: httpx.Response | None = None
+ max_retries = input_options.get_max_retries(self.max_retries)
- try:
- response = await self._client.send(
- request,
- stream=stream or self._should_stream_response_body(request=request),
- **kwargs,
- )
- except httpx.TimeoutException as err:
- log.debug("Encountered httpx.TimeoutException", exc_info=True)
+ retries_taken = 0
+ for retries_taken in range(max_retries + 1):
+ options = model_copy(input_options)
+ options = await self._prepare_options(options)
- if remaining_retries > 0:
- return await self._retry_request(
- input_options,
- cast_to,
- retries_taken=retries_taken,
- stream=stream,
- stream_cls=stream_cls,
- response_headers=None,
- )
+ remaining_retries = max_retries - retries_taken
+ request = self._build_request(options, retries_taken=retries_taken)
+ await self._prepare_request(request)
- log.debug("Raising timeout error")
- raise APITimeoutError(request=request) from err
- except Exception as err:
- log.debug("Encountered Exception", exc_info=True)
+ kwargs: HttpxSendArgs = {}
+ if self.custom_auth is not None:
+ kwargs["auth"] = self.custom_auth
- if remaining_retries > 0:
- return await self._retry_request(
- input_options,
- cast_to,
- retries_taken=retries_taken,
- stream=stream,
- stream_cls=stream_cls,
- response_headers=None,
- )
+ log.debug("Sending HTTP Request: %s %s", request.method, request.url)
- log.debug("Raising connection error")
- raise APIConnectionError(request=request) from err
+ response = None
+ try:
+ response = await self._client.send(
+ request,
+ stream=stream or self._should_stream_response_body(request=request),
+ **kwargs,
+ )
+ except httpx.TimeoutException as err:
+ log.debug("Encountered httpx.TimeoutException", exc_info=True)
+
+ if remaining_retries > 0:
+ await self._sleep_for_retry(
+ retries_taken=retries_taken,
+ max_retries=max_retries,
+ options=input_options,
+ response=None,
+ )
+ continue
+
+ log.debug("Raising timeout error")
+ raise APITimeoutError(request=request) from err
+ except Exception as err:
+ log.debug("Encountered Exception", exc_info=True)
+
+ if remaining_retries > 0:
+ await self._sleep_for_retry(
+ retries_taken=retries_taken,
+ max_retries=max_retries,
+ options=input_options,
+ response=None,
+ )
+ continue
+
+ log.debug("Raising connection error")
+ raise APIConnectionError(request=request) from err
+
+ log.debug(
+ 'HTTP Response: %s %s "%i %s" %s',
+ request.method,
+ request.url,
+ response.status_code,
+ response.reason_phrase,
+ response.headers,
+ )
- log.debug(
- 'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase
- )
+ try:
+ response.raise_for_status()
+ except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code
+ log.debug("Encountered httpx.HTTPStatusError", exc_info=True)
+
+ if remaining_retries > 0 and self._should_retry(err.response):
+ await err.response.aclose()
+ await self._sleep_for_retry(
+ retries_taken=retries_taken,
+ max_retries=max_retries,
+ options=input_options,
+ response=response,
+ )
+ continue
- try:
- response.raise_for_status()
- except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code
- log.debug("Encountered httpx.HTTPStatusError", exc_info=True)
-
- if remaining_retries > 0 and self._should_retry(err.response):
- await err.response.aclose()
- return await self._retry_request(
- input_options,
- cast_to,
- retries_taken=retries_taken,
- response_headers=err.response.headers,
- stream=stream,
- stream_cls=stream_cls,
- )
+ # If the response is streamed then we need to explicitly read the response
+ # to completion before attempting to access the response text.
+ if not err.response.is_closed:
+ await err.response.aread()
- # If the response is streamed then we need to explicitly read the response
- # to completion before attempting to access the response text.
- if not err.response.is_closed:
- await err.response.aread()
+ log.debug("Re-raising status error")
+ raise self._make_status_error_from_response(err.response) from None
- log.debug("Re-raising status error")
- raise self._make_status_error_from_response(err.response) from None
+ break
+ assert response is not None, "could not resolve response (should never happen)"
return await self._process_response(
cast_to=cast_to,
options=options,
@@ -1591,35 +1542,20 @@ async def _request(
retries_taken=retries_taken,
)
- async def _retry_request(
- self,
- options: FinalRequestOptions,
- cast_to: Type[ResponseT],
- *,
- retries_taken: int,
- response_headers: httpx.Headers | None,
- stream: bool,
- stream_cls: type[_AsyncStreamT] | None,
- ) -> ResponseT | _AsyncStreamT:
- remaining_retries = options.get_max_retries(self.max_retries) - retries_taken
+ async def _sleep_for_retry(
+ self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None
+ ) -> None:
+ remaining_retries = max_retries - retries_taken
if remaining_retries == 1:
log.debug("1 retry left")
else:
log.debug("%i retries left", remaining_retries)
- timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers)
+ timeout = self._calculate_retry_timeout(remaining_retries, options, response.headers if response else None)
log.info("Retrying request to %s in %f seconds", options.url, timeout)
await anyio.sleep(timeout)
- return await self._request(
- options=options,
- cast_to=cast_to,
- retries_taken=retries_taken + 1,
- stream=stream,
- stream_cls=stream_cls,
- )
-
async def _process_response(
self,
*,
From 9b326dd267be552b0e972446e480bec87f25f569 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 23 Apr 2025 03:46:32 +0000
Subject: [PATCH 128/375] fix(pydantic v1): more robust ModelField.annotation
check
---
src/mixedbread/_models.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 58b9263e..798956f1 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -626,8 +626,8 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
# Note: if one variant defines an alias then they all should
discriminator_alias = field_info.alias
- if field_info.annotation and is_literal_type(field_info.annotation):
- for entry in get_args(field_info.annotation):
+ if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation):
+ for entry in get_args(annotation):
if isinstance(entry, str):
mapping[entry] = variant
From bb1fa8ce6fb808b0ebe438aa33eb2ef71fbcd26f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 24 Apr 2025 02:37:55 +0000
Subject: [PATCH 129/375] chore(internal): minor formatting changes
---
src/mixedbread/types/info_response.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/mixedbread/types/info_response.py b/src/mixedbread/types/info_response.py
index fee93225..a7184bcf 100644
--- a/src/mixedbread/types/info_response.py
+++ b/src/mixedbread/types/info_response.py
@@ -1,6 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
from .._models import BaseModel
__all__ = ["InfoResponse"]
From 6b231b2767b77562fed54912a3e9949164a8188b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 24 Apr 2025 02:38:32 +0000
Subject: [PATCH 130/375] chore(internal): codegen related update
---
.github/workflows/ci.yml | 16 ++++++++--------
.github/workflows/publish-pypi.yml | 2 +-
.github/workflows/release-doctor.yml | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 04b083ca..33820422 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,18 +1,18 @@
name: CI
on:
push:
- branches:
- - main
- pull_request:
- branches:
- - main
- - next
+ branches-ignore:
+ - 'generated'
+ - 'codegen/**'
+ - 'integrated/**'
+ - 'stl-preview-head/**'
+ - 'stl-preview-base/**'
jobs:
lint:
timeout-minutes: 10
name: lint
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4
@@ -33,7 +33,7 @@ jobs:
test:
timeout-minutes: 10
name: test
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml
index 1198ae86..aa3da9eb 100644
--- a/.github/workflows/publish-pypi.yml
+++ b/.github/workflows/publish-pypi.yml
@@ -11,7 +11,7 @@ on:
jobs:
publish:
name: publish
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index f49b8bb9..e5498a4c 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -8,7 +8,7 @@ on:
jobs:
release_doctor:
name: release doctor
- runs-on: ubuntu-latest
+ runs-on: depot-ubuntu-24.04
if: github.repository == 'mixedbread-ai/mixedbread-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
steps:
From eb56d880b99b6e5c5bf878161dfb22c059a852cf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 24 Apr 2025 02:39:09 +0000
Subject: [PATCH 131/375] chore(ci): only use depot for staging repos
---
.github/workflows/ci.yml | 4 ++--
.github/workflows/publish-pypi.yml | 2 +-
.github/workflows/release-doctor.yml | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 33820422..bd8f9862 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -12,7 +12,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
- runs-on: depot-ubuntu-24.04
+ runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
@@ -33,7 +33,7 @@ jobs:
test:
timeout-minutes: 10
name: test
- runs-on: depot-ubuntu-24.04
+ runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml
index aa3da9eb..1198ae86 100644
--- a/.github/workflows/publish-pypi.yml
+++ b/.github/workflows/publish-pypi.yml
@@ -11,7 +11,7 @@ on:
jobs:
publish:
name: publish
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index e5498a4c..f49b8bb9 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -8,7 +8,7 @@ on:
jobs:
release_doctor:
name: release doctor
- runs-on: depot-ubuntu-24.04
+ runs-on: ubuntu-latest
if: github.repository == 'mixedbread-ai/mixedbread-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
steps:
From 4b1787c1729eec38be280ee74483564a4b2cef09 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 24 Apr 2025 02:41:11 +0000
Subject: [PATCH 132/375] chore: broadly detect json family of content-type
headers
---
src/mixedbread/_response.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mixedbread/_response.py b/src/mixedbread/_response.py
index 82f0f3ce..543946b9 100644
--- a/src/mixedbread/_response.py
+++ b/src/mixedbread/_response.py
@@ -235,7 +235,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
# split is required to handle cases where additional information is included
# in the response, e.g. application/json; charset=utf-8
content_type, *_ = response.headers.get("content-type", "*").split(";")
- if content_type != "application/json":
+ if not content_type.endswith("json"):
if is_basemodel(cast_to):
try:
data = response.json()
From 8388c2173510e922ef08fcf4168e87656a862cfd Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 3 May 2025 20:30:00 +0000
Subject: [PATCH 133/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
api.md | 2 +-
src/mixedbread/_client.py | 8 ++++
.../resources/extractions/content.py | 14 +++++--
src/mixedbread/resources/parsing/jobs.py | 8 ++++
.../resources/vector_stores/vector_stores.py | 14 +++----
src/mixedbread/types/__init__.py | 3 ++
src/mixedbread/types/client_rerank_params.py | 3 ++
.../types/embedding_create_response.py | 4 +-
.../extractions/content_create_params.py | 41 +++++++++++++++++--
.../types/parsing/job_create_params.py | 3 ++
src/mixedbread/types/parsing/parsing_job.py | 2 +-
src/mixedbread/types/rerank_response.py | 4 +-
.../types/scored_vector_store_chunk.py | 6 +--
.../vector_store_question_answering_params.py | 4 +-
...ector_store_question_answering_response.py | 16 ++++++++
.../api_resources/extractions/test_content.py | 30 +++++++++++---
tests/api_resources/parsing/test_jobs.py | 2 +
tests/api_resources/test_client.py | 2 +
tests/api_resources/test_vector_stores.py | 21 ++++------
20 files changed, 147 insertions(+), 42 deletions(-)
create mode 100644 src/mixedbread/types/vector_store_question_answering_response.py
diff --git a/.stats.yml b/.stats.yml
index 79ca4185..dc5b9a3b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
-openapi_spec_hash: a47fe4cb39ee0cb74ee5888de2f0a5e1
+openapi_spec_hash: f6661e9fafda26e7e9f3fc06739a33ad
config_hash: 6a7c1faa96b022a6959d720d7957eade
diff --git a/api.md b/api.md
index b1cf6f5a..2844a12f 100644
--- a/api.md
+++ b/api.md
@@ -49,7 +49,7 @@ Methods:
- client.vector_stores.update(vector_store_id, \*\*params) -> VectorStore
- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStore]
- client.vector_stores.delete(vector_store_id) -> VectorStoreDeleteResponse
-- client.vector_stores.question_answering(\*\*params) -> object
+- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
## Files
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index ece8c7f8..efe87763 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -339,6 +339,7 @@ def rerank(
rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
return_input: bool | NotGiven = NOT_GIVEN,
+ rewrite_query: 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,
@@ -366,6 +367,8 @@ def rerank(
return_input: Whether to return the documents.
+ rewrite_query: Wether or not to rewrite the query before passing it to the reranking model
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -384,6 +387,7 @@ def rerank(
"rank_fields": rank_fields,
"top_k": top_k,
"return_input": return_input,
+ "rewrite_query": rewrite_query,
},
client_rerank_params.ClientRerankParams,
),
@@ -696,6 +700,7 @@ async def rerank(
rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
return_input: bool | NotGiven = NOT_GIVEN,
+ rewrite_query: 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,
@@ -723,6 +728,8 @@ async def rerank(
return_input: Whether to return the documents.
+ rewrite_query: Wether or not to rewrite the query before passing it to the reranking model
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -741,6 +748,7 @@ async def rerank(
"rank_fields": rank_fields,
"top_k": top_k,
"return_input": return_input,
+ "rewrite_query": rewrite_query,
},
client_rerank_params.ClientRerankParams,
),
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
index 4a2a155f..9dd3c663 100644
--- a/src/mixedbread/resources/extractions/content.py
+++ b/src/mixedbread/resources/extractions/content.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import Dict
+from typing import Dict, List, Union, Iterable, Optional
import httpx
@@ -46,8 +46,9 @@ def with_streaming_response(self) -> ContentResourceWithStreamingResponse:
def create(
self,
*,
- content: str,
+ content: Union[str, List[str], Iterable[content_create_params.ContentUnionMember2]],
json_schema: Dict[str, object],
+ instructions: Optional[str] | 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,
@@ -67,6 +68,8 @@ def create(
json_schema: The JSON schema to use for extraction
+ instructions: Additional instructions for the extraction
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -81,6 +84,7 @@ def create(
{
"content": content,
"json_schema": json_schema,
+ "instructions": instructions,
},
content_create_params.ContentCreateParams,
),
@@ -114,8 +118,9 @@ def with_streaming_response(self) -> AsyncContentResourceWithStreamingResponse:
async def create(
self,
*,
- content: str,
+ content: Union[str, List[str], Iterable[content_create_params.ContentUnionMember2]],
json_schema: Dict[str, object],
+ instructions: Optional[str] | 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,
@@ -135,6 +140,8 @@ async def create(
json_schema: The JSON schema to use for extraction
+ instructions: Additional instructions for the extraction
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -149,6 +156,7 @@ async def create(
{
"content": content,
"json_schema": json_schema,
+ "instructions": instructions,
},
content_create_params.ContentCreateParams,
),
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index d6abb074..c512f2b2 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -71,6 +71,7 @@ def create(
| NotGiven = NOT_GIVEN,
chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN,
return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN,
+ mode: Literal["fast", "high_quality"] | 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,
@@ -94,6 +95,8 @@ def create(
return_format: The format of the returned content
+ mode: The strategy to use for OCR
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -110,6 +113,7 @@ def create(
"element_types": element_types,
"chunking_strategy": chunking_strategy,
"return_format": return_format,
+ "mode": mode,
},
job_create_params.JobCreateParams,
),
@@ -333,6 +337,7 @@ async def create(
| NotGiven = NOT_GIVEN,
chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN,
return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN,
+ mode: Literal["fast", "high_quality"] | 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,
@@ -356,6 +361,8 @@ async def create(
return_format: The format of the returned content
+ mode: The strategy to use for OCR
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -372,6 +379,7 @@ async def create(
"element_types": element_types,
"chunking_strategy": chunking_strategy,
"return_format": return_format,
+ "mode": mode,
},
job_create_params.JobCreateParams,
),
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 742b5f70..18b25941 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -37,8 +37,8 @@
from ...types.expires_after_param import ExpiresAfterParam
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
-from ...types.vector_store_file_search_options_param import VectorStoreFileSearchOptionsParam
from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
+from ...types.vector_store_question_answering_response import VectorStoreQuestionAnsweringResponse
__all__ = ["VectorStoresResource", "AsyncVectorStoresResource"]
@@ -325,7 +325,7 @@ def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreFileSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -334,7 +334,7 @@ def question_answering(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
+ ) -> VectorStoreQuestionAnsweringResponse:
"""Question answering
Args:
@@ -380,7 +380,7 @@ def question_answering(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=object,
+ cast_to=VectorStoreQuestionAnsweringResponse,
)
def search(
@@ -735,7 +735,7 @@ async def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreFileSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -744,7 +744,7 @@ async def question_answering(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
+ ) -> VectorStoreQuestionAnsweringResponse:
"""Question answering
Args:
@@ -790,7 +790,7 @@ async def question_answering(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=object,
+ cast_to=VectorStoreQuestionAnsweringResponse,
)
async def search(
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 5d068c8e..a8ab8119 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -36,3 +36,6 @@
from .vector_store_chunk_search_options_param import (
VectorStoreChunkSearchOptionsParam as VectorStoreChunkSearchOptionsParam,
)
+from .vector_store_question_answering_response import (
+ VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
+)
diff --git a/src/mixedbread/types/client_rerank_params.py b/src/mixedbread/types/client_rerank_params.py
index ee17f942..89548084 100644
--- a/src/mixedbread/types/client_rerank_params.py
+++ b/src/mixedbread/types/client_rerank_params.py
@@ -26,3 +26,6 @@ class ClientRerankParams(TypedDict, total=False):
return_input: bool
"""Whether to return the documents."""
+
+ rewrite_query: bool
+ """Wether or not to rewrite the query before passing it to the reranking model"""
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index c7374f21..24f996e9 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -25,7 +25,7 @@ class EmbeddingCreateResponse(BaseModel):
Literal[
"list",
"parsing_job",
- "job",
+ "extraction_job",
"embedding",
"embedding_dict",
"rank_result",
@@ -33,6 +33,8 @@ class EmbeddingCreateResponse(BaseModel):
"vector_store",
"vector_store.file",
"api_key",
+ "data_source",
+ "data_source.connector",
]
] = None
"""The object type of the response"""
diff --git a/src/mixedbread/types/extractions/content_create_params.py b/src/mixedbread/types/extractions/content_create_params.py
index 372051b0..4e3d3ef9 100644
--- a/src/mixedbread/types/extractions/content_create_params.py
+++ b/src/mixedbread/types/extractions/content_create_params.py
@@ -2,15 +2,48 @@
from __future__ import annotations
-from typing import Dict
-from typing_extensions import Required, TypedDict
+from typing import Dict, List, Union, Iterable, Optional
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
-__all__ = ["ContentCreateParams"]
+__all__ = [
+ "ContentCreateParams",
+ "ContentUnionMember2",
+ "ContentUnionMember2TextInput",
+ "ContentUnionMember2ImageURLInput",
+ "ContentUnionMember2ImageURLInputImageURL",
+]
class ContentCreateParams(TypedDict, total=False):
- content: Required[str]
+ content: Required[Union[str, List[str], Iterable[ContentUnionMember2]]]
"""The content to extract from"""
json_schema: Required[Dict[str, object]]
"""The JSON schema to use for extraction"""
+
+ instructions: Optional[str]
+ """Additional instructions for the extraction"""
+
+
+class ContentUnionMember2TextInput(TypedDict, total=False):
+ type: Literal["text"]
+ """Input type identifier"""
+
+ text: Required[str]
+ """Text content to process"""
+
+
+class ContentUnionMember2ImageURLInputImageURL(TypedDict, total=False):
+ url: Required[str]
+ """The image URL. Can be either a URL or a Data URI."""
+
+
+class ContentUnionMember2ImageURLInput(TypedDict, total=False):
+ type: Literal["image_url"]
+ """Input type identifier"""
+
+ image_url: Required[ContentUnionMember2ImageURLInputImageURL]
+ """The image input specification."""
+
+
+ContentUnionMember2: TypeAlias = Union[ContentUnionMember2TextInput, ContentUnionMember2ImageURLInput]
diff --git a/src/mixedbread/types/parsing/job_create_params.py b/src/mixedbread/types/parsing/job_create_params.py
index 13ca1743..a8e25307 100644
--- a/src/mixedbread/types/parsing/job_create_params.py
+++ b/src/mixedbread/types/parsing/job_create_params.py
@@ -36,3 +36,6 @@ class JobCreateParams(TypedDict, total=False):
return_format: Literal["html", "markdown", "plain"]
"""The format of the returned content"""
+
+ mode: Literal["fast", "high_quality"]
+ """The strategy to use for OCR"""
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index 9e9bb92c..959a7ef8 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -46,7 +46,7 @@ class ResultChunk(BaseModel):
"""The full content of the chunk"""
content_to_embed: str
- """The content to be used for embedding"""
+ """The content of the chunk to embed"""
elements: List[ResultChunkElement]
"""List of elements contained in this chunk"""
diff --git a/src/mixedbread/types/rerank_response.py b/src/mixedbread/types/rerank_response.py
index 1b4dd0a9..ef0d117d 100644
--- a/src/mixedbread/types/rerank_response.py
+++ b/src/mixedbread/types/rerank_response.py
@@ -37,7 +37,7 @@ class RerankResponse(BaseModel):
Literal[
"list",
"parsing_job",
- "job",
+ "extraction_job",
"embedding",
"embedding_dict",
"rank_result",
@@ -45,6 +45,8 @@ class RerankResponse(BaseModel):
"vector_store",
"vector_store.file",
"api_key",
+ "data_source",
+ "data_source.connector",
]
] = None
"""The object type of the response"""
diff --git a/src/mixedbread/types/scored_vector_store_chunk.py b/src/mixedbread/types/scored_vector_store_chunk.py
index 33a37463..87276ad7 100644
--- a/src/mixedbread/types/scored_vector_store_chunk.py
+++ b/src/mixedbread/types/scored_vector_store_chunk.py
@@ -5,10 +5,10 @@
from .._models import BaseModel
-__all__ = ["ScoredVectorStoreChunk", "Value", "ValueImageURLInput", "ValueImageURLInputImage", "ValueTextInput"]
+__all__ = ["ScoredVectorStoreChunk", "Value", "ValueImageURLInput", "ValueImageURLInputImageURL", "ValueTextInput"]
-class ValueImageURLInputImage(BaseModel):
+class ValueImageURLInputImageURL(BaseModel):
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -17,7 +17,7 @@ class ValueImageURLInput(BaseModel):
type: Optional[Literal["image_url"]] = None
"""Input type identifier"""
- image: ValueImageURLInputImage
+ image_url: ValueImageURLInputImageURL
"""The image input specification."""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index d91524df..7d388f89 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -6,7 +6,7 @@
from typing_extensions import Required, TypeAlias, TypedDict
from .shared_params.search_filter_condition import SearchFilterCondition
-from .vector_store_file_search_options_param import VectorStoreFileSearchOptionsParam
+from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
@@ -27,7 +27,7 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: VectorStoreFileSearchOptionsParam
+ search_options: VectorStoreChunkSearchOptionsParam
"""Search configuration options"""
stream: bool
diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py
new file mode 100644
index 00000000..311c2cf5
--- /dev/null
+++ b/src/mixedbread/types/vector_store_question_answering_response.py
@@ -0,0 +1,16 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+
+from .._models import BaseModel
+from .scored_vector_store_chunk import ScoredVectorStoreChunk
+
+__all__ = ["VectorStoreQuestionAnsweringResponse"]
+
+
+class VectorStoreQuestionAnsweringResponse(BaseModel):
+ answer: str
+ """The answer generated by the LLM"""
+
+ sources: Optional[List[ScoredVectorStoreChunk]] = None
+ """Source documents used to generate the answer"""
diff --git a/tests/api_resources/extractions/test_content.py b/tests/api_resources/extractions/test_content.py
index 923d1cf5..daf0b307 100644
--- a/tests/api_resources/extractions/test_content.py
+++ b/tests/api_resources/extractions/test_content.py
@@ -20,15 +20,24 @@ class TestContent:
@parametrize
def test_method_create(self, client: Mixedbread) -> None:
content = client.extractions.content.create(
- content="content",
+ content="string",
json_schema={"foo": "bar"},
)
assert_matches_type(ExtractionResult, content, path=["response"])
+ @parametrize
+ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
+ content = client.extractions.content.create(
+ content="string",
+ json_schema={"foo": "bar"},
+ instructions="instructions",
+ )
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
@parametrize
def test_raw_response_create(self, client: Mixedbread) -> None:
response = client.extractions.content.with_raw_response.create(
- content="content",
+ content="string",
json_schema={"foo": "bar"},
)
@@ -40,7 +49,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_create(self, client: Mixedbread) -> None:
with client.extractions.content.with_streaming_response.create(
- content="content",
+ content="string",
json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
@@ -58,15 +67,24 @@ class TestAsyncContent:
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
content = await async_client.extractions.content.create(
- content="content",
+ content="string",
+ json_schema={"foo": "bar"},
+ )
+ assert_matches_type(ExtractionResult, content, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ content = await async_client.extractions.content.create(
+ content="string",
json_schema={"foo": "bar"},
+ instructions="instructions",
)
assert_matches_type(ExtractionResult, content, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
response = await async_client.extractions.content.with_raw_response.create(
- content="content",
+ content="string",
json_schema={"foo": "bar"},
)
@@ -78,7 +96,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
async with async_client.extractions.content.with_streaming_response.create(
- content="content",
+ content="string",
json_schema={"foo": "bar"},
) as response:
assert not response.is_closed
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 55cd95bc..a82ef6a0 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -32,6 +32,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
element_types=["caption"],
chunking_strategy="page",
return_format="html",
+ mode="fast",
)
assert_matches_type(ParsingJob, job, path=["response"])
@@ -224,6 +225,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
element_types=["caption"],
chunking_strategy="page",
return_format="html",
+ mode="fast",
)
assert_matches_type(ParsingJob, job, path=["response"])
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index 2122a9f1..e05d9df6 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -109,6 +109,7 @@ def test_method_rerank_with_all_params(self, client: Mixedbread) -> None:
rank_fields=["content", "title"],
top_k=10,
return_input=False,
+ rewrite_query=False,
)
assert_matches_type(RerankResponse, client_, path=["response"])
@@ -230,6 +231,7 @@ async def test_method_rerank_with_all_params(self, async_client: AsyncMixedbread
rank_fields=["content", "title"],
top_k=10,
return_input=False,
+ rewrite_query=False,
)
assert_matches_type(RerankResponse, client, path=["response"])
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 5a367783..4ecec3a0 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -13,6 +13,7 @@
VectorStore,
VectorStoreDeleteResponse,
VectorStoreSearchResponse,
+ VectorStoreQuestionAnsweringResponse,
)
from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
@@ -227,7 +228,7 @@ def test_method_question_answering(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.question_answering(
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
- assert_matches_type(object, vector_store, path=["response"])
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
def test_method_question_answering_with_all_params(self, client: Mixedbread) -> None:
@@ -277,13 +278,11 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
"score_threshold": 0,
"rewrite_query": True,
"return_metadata": True,
- "return_chunks": True,
- "chunks_per_file": 0,
},
stream=True,
qa_options={"cite": True},
)
- assert_matches_type(object, vector_store, path=["response"])
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_question_answering(self, client: Mixedbread) -> None:
@@ -294,7 +293,7 @@ def test_raw_response_question_answering(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(object, vector_store, path=["response"])
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
def test_streaming_response_question_answering(self, client: Mixedbread) -> None:
@@ -305,7 +304,7 @@ def test_streaming_response_question_answering(self, client: Mixedbread) -> None
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(object, vector_store, path=["response"])
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -604,7 +603,7 @@ async def test_method_question_answering(self, async_client: AsyncMixedbread) ->
vector_store = await async_client.vector_stores.question_answering(
vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
- assert_matches_type(object, vector_store, path=["response"])
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
async def test_method_question_answering_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -654,13 +653,11 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
"score_threshold": 0,
"rewrite_query": True,
"return_metadata": True,
- "return_chunks": True,
- "chunks_per_file": 0,
},
stream=True,
qa_options={"cite": True},
)
- assert_matches_type(object, vector_store, path=["response"])
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_question_answering(self, async_client: AsyncMixedbread) -> None:
@@ -671,7 +668,7 @@ async def test_raw_response_question_answering(self, async_client: AsyncMixedbre
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(object, vector_store, path=["response"])
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
async def test_streaming_response_question_answering(self, async_client: AsyncMixedbread) -> None:
@@ -682,7 +679,7 @@ async def test_streaming_response_question_answering(self, async_client: AsyncMi
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(object, vector_store, path=["response"])
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
From fae6d62545ca6ef1c70384af165a134b020450ec Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 3 May 2025 20:31:00 +0000
Subject: [PATCH 134/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index b06ba919..6b7b74c5 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.2.1"
+ ".": "0.3.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 03ceb4d0..1d52ff5f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.2.1"
+version = "0.3.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 2c97ccc1..0007f447 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.2.1" # x-release-please-version
+__version__ = "0.3.0" # x-release-please-version
From e79e2c3088a67788b66c5daf1029e864bd928cf0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 9 May 2025 04:17:15 +0000
Subject: [PATCH 135/375] chore(internal): avoid errors for isinstance checks
on proxies
---
src/mixedbread/_utils/_proxy.py | 5 ++++-
tests/test_utils/test_proxy.py | 11 +++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/mixedbread/_utils/_proxy.py b/src/mixedbread/_utils/_proxy.py
index ffd883e9..0f239a33 100644
--- a/src/mixedbread/_utils/_proxy.py
+++ b/src/mixedbread/_utils/_proxy.py
@@ -46,7 +46,10 @@ def __dir__(self) -> Iterable[str]:
@property # type: ignore
@override
def __class__(self) -> type: # pyright: ignore
- proxied = self.__get_proxied__()
+ try:
+ proxied = self.__get_proxied__()
+ except Exception:
+ return type(self)
if issubclass(type(proxied), LazyProxy):
return type(proxied)
return proxied.__class__
diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py
index 9b54af18..76104cef 100644
--- a/tests/test_utils/test_proxy.py
+++ b/tests/test_utils/test_proxy.py
@@ -21,3 +21,14 @@ def test_recursive_proxy() -> None:
assert dir(proxy) == []
assert type(proxy).__name__ == "RecursiveLazyProxy"
assert type(operator.attrgetter("name.foo.bar.baz")(proxy)).__name__ == "RecursiveLazyProxy"
+
+
+def test_isinstance_does_not_error() -> None:
+ class AlwaysErrorProxy(LazyProxy[Any]):
+ @override
+ def __load__(self) -> Any:
+ raise RuntimeError("Mocking missing dependency")
+
+ proxy = AlwaysErrorProxy()
+ assert not isinstance(proxy, dict)
+ assert isinstance(proxy, LazyProxy)
From 0fa22b2901355a682d95a30eb7bf75674779e5b9 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 10 May 2025 03:36:18 +0000
Subject: [PATCH 136/375] chore(internal): avoid lint errors in pagination
expressions
---
src/mixedbread/pagination.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/pagination.py b/src/mixedbread/pagination.py
index b7df01d1..c2f1ea59 100644
--- a/src/mixedbread/pagination.py
+++ b/src/mixedbread/pagination.py
@@ -35,7 +35,7 @@ def next_page_info(self) -> Optional[PageInfo]:
if self.pagination.offset is not None:
offset = self.pagination.offset
if offset is None:
- return None
+ return None # type: ignore[unreachable]
length = len(self._get_page_items())
current_count = offset + length
@@ -71,7 +71,7 @@ def next_page_info(self) -> Optional[PageInfo]:
if self.pagination.offset is not None:
offset = self.pagination.offset
if offset is None:
- return None
+ return None # type: ignore[unreachable]
length = len(self._get_page_items())
current_count = offset + length
From 82682dcd12da0ca0485a395c214d75872571940f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 10 May 2025 03:37:32 +0000
Subject: [PATCH 137/375] fix(package): support direct resource imports
---
src/mixedbread/__init__.py | 5 +++++
src/mixedbread/_utils/_resources_proxy.py | 24 +++++++++++++++++++++++
2 files changed, 29 insertions(+)
create mode 100644 src/mixedbread/_utils/_resources_proxy.py
diff --git a/src/mixedbread/__init__.py b/src/mixedbread/__init__.py
index c6b40046..022e49ef 100644
--- a/src/mixedbread/__init__.py
+++ b/src/mixedbread/__init__.py
@@ -1,5 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+import typing as _t
+
from . import types
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
from ._utils import file_from_path
@@ -80,6 +82,9 @@
"DefaultAsyncHttpxClient",
]
+if not _t.TYPE_CHECKING:
+ from ._utils._resources_proxy import resources as resources
+
_setup_logging()
# Update the __module__ attribute for exported symbols so that
diff --git a/src/mixedbread/_utils/_resources_proxy.py b/src/mixedbread/_utils/_resources_proxy.py
new file mode 100644
index 00000000..ad97bb05
--- /dev/null
+++ b/src/mixedbread/_utils/_resources_proxy.py
@@ -0,0 +1,24 @@
+from __future__ import annotations
+
+from typing import Any
+from typing_extensions import override
+
+from ._proxy import LazyProxy
+
+
+class ResourcesProxy(LazyProxy[Any]):
+ """A proxy for the `mixedbread.resources` module.
+
+ This is used so that we can lazily import `mixedbread.resources` only when
+ needed *and* so that users can just import `mixedbread` and reference `mixedbread.resources`
+ """
+
+ @override
+ def __load__(self) -> Any:
+ import importlib
+
+ mod = importlib.import_module("mixedbread.resources")
+ return mod
+
+
+resources = ResourcesProxy().__as_proxied__()
From 097e59e7a812b998f6f36c38219ddb3714f3bbbe Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 10 May 2025 03:38:40 +0000
Subject: [PATCH 138/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 6b7b74c5..cce92405 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.3.0"
+ ".": "0.3.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 1d52ff5f..91395731 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.3.0"
+version = "0.3.1"
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 0007f447..7e6e8c04 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.3.0" # x-release-please-version
+__version__ = "0.3.1" # x-release-please-version
From 41d69703432397a3539a75bf361220585a0f7784 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 15 May 2025 04:58:03 +0000
Subject: [PATCH 139/375] chore(ci): upload sdks to package manager
---
.github/workflows/ci.yml | 24 ++++++++++++++++++++++++
scripts/utils/upload-artifact.sh | 25 +++++++++++++++++++++++++
2 files changed, 49 insertions(+)
create mode 100755 scripts/utils/upload-artifact.sh
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index bd8f9862..e42d2173 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -30,6 +30,30 @@ jobs:
- name: Run lints
run: ./scripts/lint
+ upload:
+ if: github.repository == 'stainless-sdks/mixedbread-python'
+ timeout-minutes: 10
+ name: upload
+ permissions:
+ contents: read
+ id-token: write
+ runs-on: depot-ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Get GitHub OIDC Token
+ id: github-oidc
+ uses: actions/github-script@v6
+ with:
+ script: core.setOutput('github_token', await core.getIDToken());
+
+ - name: Upload tarball
+ env:
+ URL: https://pkg.stainless.com/s
+ AUTH: ${{ steps.github-oidc.outputs.github_token }}
+ SHA: ${{ github.sha }}
+ run: ./scripts/utils/upload-artifact.sh
+
test:
timeout-minutes: 10
name: test
diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh
new file mode 100755
index 00000000..4df1bf8c
--- /dev/null
+++ b/scripts/utils/upload-artifact.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+set -exuo pipefail
+
+RESPONSE=$(curl -X POST "$URL" \
+ -H "Authorization: Bearer $AUTH" \
+ -H "Content-Type: application/json")
+
+SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')
+
+if [[ "$SIGNED_URL" == "null" ]]; then
+ echo -e "\033[31mFailed to get signed URL.\033[0m"
+ exit 1
+fi
+
+UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
+ -H "Content-Type: application/gzip" \
+ --data-binary @- "$SIGNED_URL" 2>&1)
+
+if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
+ echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
+ echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/mixedbread-python/$SHA'\033[0m"
+else
+ echo -e "\033[31mFailed to upload artifact.\033[0m"
+ exit 1
+fi
From 007e57215d83173e95bd4cae1ee1a51fe63e970d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 16 May 2025 03:47:59 +0000
Subject: [PATCH 140/375] chore(ci): fix installation instructions
---
scripts/utils/upload-artifact.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh
index 4df1bf8c..e9b57e7c 100755
--- a/scripts/utils/upload-artifact.sh
+++ b/scripts/utils/upload-artifact.sh
@@ -18,7 +18,7 @@ UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
- echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/mixedbread-python/$SHA'\033[0m"
+ echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/mixedbread-python/$SHA'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
From 31d41ea380154455231c2c018395f589797e9836 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 22 May 2025 02:36:17 +0000
Subject: [PATCH 141/375] chore(docs): grammar improvements
---
SECURITY.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/SECURITY.md b/SECURITY.md
index 7a1bc651..9485d544 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -16,13 +16,13 @@ before making any information public.
## Reporting Non-SDK Related Security Issues
If you encounter security issues that are not directly related to SDKs but pertain to the services
-or products provided by Mixedbread please follow the respective company's security reporting guidelines.
+or products provided by Mixedbread, please follow the respective company's security reporting guidelines.
### Mixedbread Terms and Policies
Our Security Policy can be found at [Security Policy URL](https://mixedbread.com/pages/privacy).
-Please contact support@mixedbread.com for any questions or concerns regarding security of our services.
+Please contact support@mixedbread.com for any questions or concerns regarding the security of our services.
---
From 2e73512b2636aadad0204789a4ecaffd63b0f0ac Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 26 May 2025 12:30:05 +0000
Subject: [PATCH 142/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 56 ++
src/mixedbread/_client.py | 19 +-
src/mixedbread/resources/__init__.py | 28 +
src/mixedbread/resources/chat.py | 164 ++++
.../resources/data_sources/__init__.py | 33 +
.../resources/data_sources/connectors.py | 712 ++++++++++++++++++
.../resources/data_sources/data_sources.py | 663 ++++++++++++++++
src/mixedbread/types/__init__.py | 8 +
.../types/data_source_create_params.py | 56 ++
.../types/data_source_create_response.py | 66 ++
.../types/data_source_delete_response.py | 19 +
.../types/data_source_list_params.py | 15 +
.../types/data_source_list_response.py | 66 ++
.../types/data_source_retrieve_response.py | 66 ++
.../types/data_source_update_params.py | 53 ++
.../types/data_source_update_response.py | 66 ++
src/mixedbread/types/data_sources/__init__.py | 12 +
.../data_sources/connector_create_params.py | 25 +
.../data_sources/connector_create_response.py | 53 ++
.../data_sources/connector_delete_response.py | 19 +
.../data_sources/connector_list_params.py | 15 +
.../data_sources/connector_list_response.py | 53 ++
.../connector_retrieve_response.py | 53 ++
.../data_sources/connector_update_params.py | 25 +
.../data_sources/connector_update_response.py | 53 ++
tests/api_resources/data_sources/__init__.py | 1 +
.../data_sources/test_connectors.py | 543 +++++++++++++
tests/api_resources/test_chat.py | 71 ++
tests/api_resources/test_data_sources.py | 476 ++++++++++++
30 files changed, 3490 insertions(+), 3 deletions(-)
create mode 100644 src/mixedbread/resources/chat.py
create mode 100644 src/mixedbread/resources/data_sources/__init__.py
create mode 100644 src/mixedbread/resources/data_sources/connectors.py
create mode 100644 src/mixedbread/resources/data_sources/data_sources.py
create mode 100644 src/mixedbread/types/data_source_create_params.py
create mode 100644 src/mixedbread/types/data_source_create_response.py
create mode 100644 src/mixedbread/types/data_source_delete_response.py
create mode 100644 src/mixedbread/types/data_source_list_params.py
create mode 100644 src/mixedbread/types/data_source_list_response.py
create mode 100644 src/mixedbread/types/data_source_retrieve_response.py
create mode 100644 src/mixedbread/types/data_source_update_params.py
create mode 100644 src/mixedbread/types/data_source_update_response.py
create mode 100644 src/mixedbread/types/data_sources/__init__.py
create mode 100644 src/mixedbread/types/data_sources/connector_create_params.py
create mode 100644 src/mixedbread/types/data_sources/connector_create_response.py
create mode 100644 src/mixedbread/types/data_sources/connector_delete_response.py
create mode 100644 src/mixedbread/types/data_sources/connector_list_params.py
create mode 100644 src/mixedbread/types/data_sources/connector_list_response.py
create mode 100644 src/mixedbread/types/data_sources/connector_retrieve_response.py
create mode 100644 src/mixedbread/types/data_sources/connector_update_params.py
create mode 100644 src/mixedbread/types/data_sources/connector_update_response.py
create mode 100644 tests/api_resources/data_sources/__init__.py
create mode 100644 tests/api_resources/data_sources/test_connectors.py
create mode 100644 tests/api_resources/test_chat.py
create mode 100644 tests/api_resources/test_data_sources.py
diff --git a/.stats.yml b/.stats.yml
index dc5b9a3b..2aac0f69 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 32
+configured_endpoints: 43
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: f6661e9fafda26e7e9f3fc06739a33ad
-config_hash: 6a7c1faa96b022a6959d720d7957eade
+config_hash: 70d47aa4a1dd8327383138a26d47d21a
diff --git a/api.md b/api.md
index 2844a12f..141e338e 100644
--- a/api.md
+++ b/api.md
@@ -154,3 +154,59 @@ Methods:
Methods:
- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
+
+# Chat
+
+Types:
+
+```python
+from mixedbread.types import ChatCreateCompletionResponse
+```
+
+Methods:
+
+- client.chat.create_completion() -> object
+
+# DataSources
+
+Types:
+
+```python
+from mixedbread.types import (
+ DataSourceCreateResponse,
+ DataSourceRetrieveResponse,
+ DataSourceUpdateResponse,
+ DataSourceListResponse,
+ DataSourceDeleteResponse,
+)
+```
+
+Methods:
+
+- client.data_sources.create(\*\*params) -> DataSourceCreateResponse
+- client.data_sources.retrieve(data_source_id) -> DataSourceRetrieveResponse
+- client.data_sources.update(data_source_id, \*\*params) -> DataSourceUpdateResponse
+- client.data_sources.list(\*\*params) -> SyncLimitOffset[DataSourceListResponse]
+- client.data_sources.delete(data_source_id) -> DataSourceDeleteResponse
+
+## Connectors
+
+Types:
+
+```python
+from mixedbread.types.data_sources import (
+ ConnectorCreateResponse,
+ ConnectorRetrieveResponse,
+ ConnectorUpdateResponse,
+ ConnectorListResponse,
+ ConnectorDeleteResponse,
+)
+```
+
+Methods:
+
+- client.data_sources.connectors.create(data_source_id, \*\*params) -> ConnectorCreateResponse
+- client.data_sources.connectors.retrieve(connector_id, \*, data_source_id) -> ConnectorRetrieveResponse
+- client.data_sources.connectors.update(connector_id, \*, data_source_id, \*\*params) -> ConnectorUpdateResponse
+- client.data_sources.connectors.list(data_source_id, \*\*params) -> SyncLimitOffset[ConnectorListResponse]
+- client.data_sources.connectors.delete(connector_id, \*, data_source_id) -> ConnectorDeleteResponse
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index efe87763..082f61ef 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -36,7 +36,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from .resources import files, embeddings
+from .resources import chat, files, embeddings
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, MixedbreadError
from ._base_client import (
@@ -49,6 +49,7 @@
from .types.info_response import InfoResponse
from .resources.extractions import extractions
from .types.rerank_response import RerankResponse
+from .resources.data_sources import data_sources
from .resources.vector_stores import vector_stores
from .types.embedding_create_response import EmbeddingCreateResponse
@@ -76,6 +77,8 @@ class Mixedbread(SyncAPIClient):
files: files.FilesResource
extractions: extractions.ExtractionsResource
embeddings: embeddings.EmbeddingsResource
+ chat: chat.ChatResource
+ data_sources: data_sources.DataSourcesResource
with_raw_response: MixedbreadWithRawResponse
with_streaming_response: MixedbreadWithStreamedResponse
@@ -162,6 +165,8 @@ def __init__(
self.files = files.FilesResource(self)
self.extractions = extractions.ExtractionsResource(self)
self.embeddings = embeddings.EmbeddingsResource(self)
+ self.chat = chat.ChatResource(self)
+ self.data_sources = data_sources.DataSourcesResource(self)
self.with_raw_response = MixedbreadWithRawResponse(self)
self.with_streaming_response = MixedbreadWithStreamedResponse(self)
@@ -437,6 +442,8 @@ class AsyncMixedbread(AsyncAPIClient):
files: files.AsyncFilesResource
extractions: extractions.AsyncExtractionsResource
embeddings: embeddings.AsyncEmbeddingsResource
+ chat: chat.AsyncChatResource
+ data_sources: data_sources.AsyncDataSourcesResource
with_raw_response: AsyncMixedbreadWithRawResponse
with_streaming_response: AsyncMixedbreadWithStreamedResponse
@@ -523,6 +530,8 @@ def __init__(
self.files = files.AsyncFilesResource(self)
self.extractions = extractions.AsyncExtractionsResource(self)
self.embeddings = embeddings.AsyncEmbeddingsResource(self)
+ self.chat = chat.AsyncChatResource(self)
+ self.data_sources = data_sources.AsyncDataSourcesResource(self)
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)
@@ -799,6 +808,8 @@ def __init__(self, client: Mixedbread) -> None:
self.files = files.FilesResourceWithRawResponse(client.files)
self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
+ self.chat = chat.ChatResourceWithRawResponse(client.chat)
+ self.data_sources = data_sources.DataSourcesResourceWithRawResponse(client.data_sources)
self.embed = to_raw_response_wrapper(
client.embed,
@@ -818,6 +829,8 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
+ self.chat = chat.AsyncChatResourceWithRawResponse(client.chat)
+ self.data_sources = data_sources.AsyncDataSourcesResourceWithRawResponse(client.data_sources)
self.embed = async_to_raw_response_wrapper(
client.embed,
@@ -837,6 +850,8 @@ def __init__(self, client: Mixedbread) -> None:
self.files = files.FilesResourceWithStreamingResponse(client.files)
self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
+ self.chat = chat.ChatResourceWithStreamingResponse(client.chat)
+ self.data_sources = data_sources.DataSourcesResourceWithStreamingResponse(client.data_sources)
self.embed = to_streamed_response_wrapper(
client.embed,
@@ -856,6 +871,8 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
+ self.chat = chat.AsyncChatResourceWithStreamingResponse(client.chat)
+ self.data_sources = data_sources.AsyncDataSourcesResourceWithStreamingResponse(client.data_sources)
self.embed = async_to_streamed_response_wrapper(
client.embed,
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index 7df49504..21f67148 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -1,5 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from .chat import (
+ ChatResource,
+ AsyncChatResource,
+ ChatResourceWithRawResponse,
+ AsyncChatResourceWithRawResponse,
+ ChatResourceWithStreamingResponse,
+ AsyncChatResourceWithStreamingResponse,
+)
from .files import (
FilesResource,
AsyncFilesResource,
@@ -32,6 +40,14 @@
ExtractionsResourceWithStreamingResponse,
AsyncExtractionsResourceWithStreamingResponse,
)
+from .data_sources import (
+ DataSourcesResource,
+ AsyncDataSourcesResource,
+ DataSourcesResourceWithRawResponse,
+ AsyncDataSourcesResourceWithRawResponse,
+ DataSourcesResourceWithStreamingResponse,
+ AsyncDataSourcesResourceWithStreamingResponse,
+)
from .vector_stores import (
VectorStoresResource,
AsyncVectorStoresResource,
@@ -72,4 +88,16 @@
"AsyncEmbeddingsResourceWithRawResponse",
"EmbeddingsResourceWithStreamingResponse",
"AsyncEmbeddingsResourceWithStreamingResponse",
+ "ChatResource",
+ "AsyncChatResource",
+ "ChatResourceWithRawResponse",
+ "AsyncChatResourceWithRawResponse",
+ "ChatResourceWithStreamingResponse",
+ "AsyncChatResourceWithStreamingResponse",
+ "DataSourcesResource",
+ "AsyncDataSourcesResource",
+ "DataSourcesResourceWithRawResponse",
+ "AsyncDataSourcesResourceWithRawResponse",
+ "DataSourcesResourceWithStreamingResponse",
+ "AsyncDataSourcesResourceWithStreamingResponse",
]
diff --git a/src/mixedbread/resources/chat.py b/src/mixedbread/resources/chat.py
new file mode 100644
index 00000000..f9b1b0ce
--- /dev/null
+++ b/src/mixedbread/resources/chat.py
@@ -0,0 +1,164 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._compat import cached_property
+from .._resource import SyncAPIResource, AsyncAPIResource
+from .._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from .._base_client import make_request_options
+
+__all__ = ["ChatResource", "AsyncChatResource"]
+
+
+class ChatResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> ChatResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return ChatResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ChatResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return ChatResourceWithStreamingResponse(self)
+
+ def create_completion(
+ self,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> object:
+ """
+ Create a chat completion using the provided parameters.
+
+ Generates a completion response based on the chat messages and model parameters
+ provided. The response can be either a full completion or streamed chunks
+ depending on the request parameters.
+
+ Args: params: Parameters for creating the chat completion including messages,
+ model selection, and generation settings user: The authenticated user making the
+ request
+
+ Returns: Either a ChatCompletion containing the full response, or
+ ChatCompletionChunk for streaming
+
+ Raises: HTTPException: If there is an error creating the completion (500)
+ """
+ return self._post(
+ "/v1/chat/completions",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=object,
+ )
+
+
+class AsyncChatResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncChatResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncChatResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncChatResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncChatResourceWithStreamingResponse(self)
+
+ async def create_completion(
+ self,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> object:
+ """
+ Create a chat completion using the provided parameters.
+
+ Generates a completion response based on the chat messages and model parameters
+ provided. The response can be either a full completion or streamed chunks
+ depending on the request parameters.
+
+ Args: params: Parameters for creating the chat completion including messages,
+ model selection, and generation settings user: The authenticated user making the
+ request
+
+ Returns: Either a ChatCompletion containing the full response, or
+ ChatCompletionChunk for streaming
+
+ Raises: HTTPException: If there is an error creating the completion (500)
+ """
+ return await self._post(
+ "/v1/chat/completions",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=object,
+ )
+
+
+class ChatResourceWithRawResponse:
+ def __init__(self, chat: ChatResource) -> None:
+ self._chat = chat
+
+ self.create_completion = to_raw_response_wrapper(
+ chat.create_completion,
+ )
+
+
+class AsyncChatResourceWithRawResponse:
+ def __init__(self, chat: AsyncChatResource) -> None:
+ self._chat = chat
+
+ self.create_completion = async_to_raw_response_wrapper(
+ chat.create_completion,
+ )
+
+
+class ChatResourceWithStreamingResponse:
+ def __init__(self, chat: ChatResource) -> None:
+ self._chat = chat
+
+ self.create_completion = to_streamed_response_wrapper(
+ chat.create_completion,
+ )
+
+
+class AsyncChatResourceWithStreamingResponse:
+ def __init__(self, chat: AsyncChatResource) -> None:
+ self._chat = chat
+
+ self.create_completion = async_to_streamed_response_wrapper(
+ chat.create_completion,
+ )
diff --git a/src/mixedbread/resources/data_sources/__init__.py b/src/mixedbread/resources/data_sources/__init__.py
new file mode 100644
index 00000000..6e04f6ec
--- /dev/null
+++ b/src/mixedbread/resources/data_sources/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .connectors import (
+ ConnectorsResource,
+ AsyncConnectorsResource,
+ ConnectorsResourceWithRawResponse,
+ AsyncConnectorsResourceWithRawResponse,
+ ConnectorsResourceWithStreamingResponse,
+ AsyncConnectorsResourceWithStreamingResponse,
+)
+from .data_sources import (
+ DataSourcesResource,
+ AsyncDataSourcesResource,
+ DataSourcesResourceWithRawResponse,
+ AsyncDataSourcesResourceWithRawResponse,
+ DataSourcesResourceWithStreamingResponse,
+ AsyncDataSourcesResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "ConnectorsResource",
+ "AsyncConnectorsResource",
+ "ConnectorsResourceWithRawResponse",
+ "AsyncConnectorsResourceWithRawResponse",
+ "ConnectorsResourceWithStreamingResponse",
+ "AsyncConnectorsResourceWithStreamingResponse",
+ "DataSourcesResource",
+ "AsyncDataSourcesResource",
+ "DataSourcesResourceWithRawResponse",
+ "AsyncDataSourcesResourceWithRawResponse",
+ "DataSourcesResourceWithStreamingResponse",
+ "AsyncDataSourcesResourceWithStreamingResponse",
+]
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
new file mode 100644
index 00000000..f05318ee
--- /dev/null
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -0,0 +1,712 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Dict, Optional
+
+import httpx
+
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import maybe_transform, async_maybe_transform
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...pagination import SyncLimitOffset, AsyncLimitOffset
+from ..._base_client import AsyncPaginator, make_request_options
+from ...types.data_sources import connector_list_params, connector_create_params, connector_update_params
+from ...types.data_sources.connector_list_response import ConnectorListResponse
+from ...types.data_sources.connector_create_response import ConnectorCreateResponse
+from ...types.data_sources.connector_delete_response import ConnectorDeleteResponse
+from ...types.data_sources.connector_update_response import ConnectorUpdateResponse
+from ...types.data_sources.connector_retrieve_response import ConnectorRetrieveResponse
+
+__all__ = ["ConnectorsResource", "AsyncConnectorsResource"]
+
+
+class ConnectorsResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> ConnectorsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return ConnectorsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ConnectorsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return ConnectorsResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ data_source_id: str,
+ *,
+ vector_store_id: str,
+ name: str | NotGiven = NOT_GIVEN,
+ trigger_sync: bool | NotGiven = NOT_GIVEN,
+ metadata: object | NotGiven = NOT_GIVEN,
+ polling_interval: Optional[str] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ConnectorCreateResponse:
+ """
+ Create a new connector.
+
+ Args: data_source_id: The ID of the data source to create a connector for.
+ params: The connector to create.
+
+ Returns: The created connector.
+
+ Args:
+ data_source_id: The ID of the data source to create a connector for
+
+ vector_store_id: The ID of the vector store
+
+ name: The name of the connector
+
+ trigger_sync: Whether the connector should be synced after creation
+
+ metadata: The metadata of the connector
+
+ polling_interval: The polling interval of the connector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return self._post(
+ f"/v1/data_sources/{data_source_id}/connectors",
+ body=maybe_transform(
+ {
+ "vector_store_id": vector_store_id,
+ "name": name,
+ "trigger_sync": trigger_sync,
+ "metadata": metadata,
+ "polling_interval": polling_interval,
+ },
+ connector_create_params.ConnectorCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ConnectorCreateResponse,
+ )
+
+ def retrieve(
+ self,
+ connector_id: str,
+ *,
+ data_source_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ConnectorRetrieveResponse:
+ """
+ Get a connector by ID.
+
+ Args: data_source_id: The ID of the data source to get a connector for.
+ connector_id: The ID of the connector to get.
+
+ Returns: The connector.
+
+ Args:
+ data_source_id: The ID of the data source to get a connector for
+
+ connector_id: The ID of the connector to get
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ if not connector_id:
+ raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}")
+ return self._get(
+ f"/v1/data_sources/{data_source_id}/connectors/{connector_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ConnectorRetrieveResponse,
+ )
+
+ def update(
+ self,
+ connector_id: str,
+ *,
+ data_source_id: str,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
+ metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
+ trigger_sync: Optional[bool] | NotGiven = NOT_GIVEN,
+ polling_interval: Optional[str] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ConnectorUpdateResponse:
+ """
+ Update a connector.
+
+ Args: data_source_id: The ID of the data source to update a connector for.
+ connector_id: The ID of the connector to update. params: The connector to
+ update.
+
+ Returns: The updated connector.
+
+ Args:
+ data_source_id: The ID of the data source to update a connector for
+
+ connector_id: The ID of the connector to update
+
+ name: The name of the connector
+
+ metadata: The metadata of the connector
+
+ trigger_sync: Whether the connector should be synced after update
+
+ polling_interval: The polling interval of the connector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ if not connector_id:
+ raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}")
+ return self._put(
+ f"/v1/data_sources/{data_source_id}/connectors/{connector_id}",
+ body=maybe_transform(
+ {
+ "name": name,
+ "metadata": metadata,
+ "trigger_sync": trigger_sync,
+ "polling_interval": polling_interval,
+ },
+ connector_update_params.ConnectorUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ConnectorUpdateResponse,
+ )
+
+ def list(
+ self,
+ data_source_id: str,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> SyncLimitOffset[ConnectorListResponse]:
+ """
+ Get all connectors for a data source.
+
+ Args: data_source_id: The ID of the data source to get connectors for.
+ pagination: The pagination options.
+
+ Returns: The list of connectors.
+
+ Args:
+ data_source_id: The ID of the data source to get connectors for
+
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return self._get_api_list(
+ f"/v1/data_sources/{data_source_id}/connectors",
+ page=SyncLimitOffset[ConnectorListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ connector_list_params.ConnectorListParams,
+ ),
+ ),
+ model=ConnectorListResponse,
+ )
+
+ def delete(
+ self,
+ connector_id: str,
+ *,
+ data_source_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ConnectorDeleteResponse:
+ """
+ Delete a connector.
+
+ Args: data_source_id: The ID of the data source to delete a connector for.
+ connector_id: The ID of the connector to delete.
+
+ Returns: The deleted connector.
+
+ Args:
+ data_source_id: The ID of the data source to delete a connector for
+
+ connector_id: The ID of the connector to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ if not connector_id:
+ raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}")
+ return self._delete(
+ f"/v1/data_sources/{data_source_id}/connectors/{connector_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ConnectorDeleteResponse,
+ )
+
+
+class AsyncConnectorsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncConnectorsResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncConnectorsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncConnectorsResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncConnectorsResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ data_source_id: str,
+ *,
+ vector_store_id: str,
+ name: str | NotGiven = NOT_GIVEN,
+ trigger_sync: bool | NotGiven = NOT_GIVEN,
+ metadata: object | NotGiven = NOT_GIVEN,
+ polling_interval: Optional[str] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ConnectorCreateResponse:
+ """
+ Create a new connector.
+
+ Args: data_source_id: The ID of the data source to create a connector for.
+ params: The connector to create.
+
+ Returns: The created connector.
+
+ Args:
+ data_source_id: The ID of the data source to create a connector for
+
+ vector_store_id: The ID of the vector store
+
+ name: The name of the connector
+
+ trigger_sync: Whether the connector should be synced after creation
+
+ metadata: The metadata of the connector
+
+ polling_interval: The polling interval of the connector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return await self._post(
+ f"/v1/data_sources/{data_source_id}/connectors",
+ body=await async_maybe_transform(
+ {
+ "vector_store_id": vector_store_id,
+ "name": name,
+ "trigger_sync": trigger_sync,
+ "metadata": metadata,
+ "polling_interval": polling_interval,
+ },
+ connector_create_params.ConnectorCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ConnectorCreateResponse,
+ )
+
+ async def retrieve(
+ self,
+ connector_id: str,
+ *,
+ data_source_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ConnectorRetrieveResponse:
+ """
+ Get a connector by ID.
+
+ Args: data_source_id: The ID of the data source to get a connector for.
+ connector_id: The ID of the connector to get.
+
+ Returns: The connector.
+
+ Args:
+ data_source_id: The ID of the data source to get a connector for
+
+ connector_id: The ID of the connector to get
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ if not connector_id:
+ raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}")
+ return await self._get(
+ f"/v1/data_sources/{data_source_id}/connectors/{connector_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ConnectorRetrieveResponse,
+ )
+
+ async def update(
+ self,
+ connector_id: str,
+ *,
+ data_source_id: str,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
+ metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
+ trigger_sync: Optional[bool] | NotGiven = NOT_GIVEN,
+ polling_interval: Optional[str] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ConnectorUpdateResponse:
+ """
+ Update a connector.
+
+ Args: data_source_id: The ID of the data source to update a connector for.
+ connector_id: The ID of the connector to update. params: The connector to
+ update.
+
+ Returns: The updated connector.
+
+ Args:
+ data_source_id: The ID of the data source to update a connector for
+
+ connector_id: The ID of the connector to update
+
+ name: The name of the connector
+
+ metadata: The metadata of the connector
+
+ trigger_sync: Whether the connector should be synced after update
+
+ polling_interval: The polling interval of the connector
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ if not connector_id:
+ raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}")
+ return await self._put(
+ f"/v1/data_sources/{data_source_id}/connectors/{connector_id}",
+ body=await async_maybe_transform(
+ {
+ "name": name,
+ "metadata": metadata,
+ "trigger_sync": trigger_sync,
+ "polling_interval": polling_interval,
+ },
+ connector_update_params.ConnectorUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ConnectorUpdateResponse,
+ )
+
+ def list(
+ self,
+ data_source_id: str,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> AsyncPaginator[ConnectorListResponse, AsyncLimitOffset[ConnectorListResponse]]:
+ """
+ Get all connectors for a data source.
+
+ Args: data_source_id: The ID of the data source to get connectors for.
+ pagination: The pagination options.
+
+ Returns: The list of connectors.
+
+ Args:
+ data_source_id: The ID of the data source to get connectors for
+
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return self._get_api_list(
+ f"/v1/data_sources/{data_source_id}/connectors",
+ page=AsyncLimitOffset[ConnectorListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ connector_list_params.ConnectorListParams,
+ ),
+ ),
+ model=ConnectorListResponse,
+ )
+
+ async def delete(
+ self,
+ connector_id: str,
+ *,
+ data_source_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> ConnectorDeleteResponse:
+ """
+ Delete a connector.
+
+ Args: data_source_id: The ID of the data source to delete a connector for.
+ connector_id: The ID of the connector to delete.
+
+ Returns: The deleted connector.
+
+ Args:
+ data_source_id: The ID of the data source to delete a connector for
+
+ connector_id: The ID of the connector to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ if not connector_id:
+ raise ValueError(f"Expected a non-empty value for `connector_id` but received {connector_id!r}")
+ return await self._delete(
+ f"/v1/data_sources/{data_source_id}/connectors/{connector_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=ConnectorDeleteResponse,
+ )
+
+
+class ConnectorsResourceWithRawResponse:
+ def __init__(self, connectors: ConnectorsResource) -> None:
+ self._connectors = connectors
+
+ self.create = to_raw_response_wrapper(
+ connectors.create,
+ )
+ self.retrieve = to_raw_response_wrapper(
+ connectors.retrieve,
+ )
+ self.update = to_raw_response_wrapper(
+ connectors.update,
+ )
+ self.list = to_raw_response_wrapper(
+ connectors.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ connectors.delete,
+ )
+
+
+class AsyncConnectorsResourceWithRawResponse:
+ def __init__(self, connectors: AsyncConnectorsResource) -> None:
+ self._connectors = connectors
+
+ self.create = async_to_raw_response_wrapper(
+ connectors.create,
+ )
+ self.retrieve = async_to_raw_response_wrapper(
+ connectors.retrieve,
+ )
+ self.update = async_to_raw_response_wrapper(
+ connectors.update,
+ )
+ self.list = async_to_raw_response_wrapper(
+ connectors.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ connectors.delete,
+ )
+
+
+class ConnectorsResourceWithStreamingResponse:
+ def __init__(self, connectors: ConnectorsResource) -> None:
+ self._connectors = connectors
+
+ self.create = to_streamed_response_wrapper(
+ connectors.create,
+ )
+ self.retrieve = to_streamed_response_wrapper(
+ connectors.retrieve,
+ )
+ self.update = to_streamed_response_wrapper(
+ connectors.update,
+ )
+ self.list = to_streamed_response_wrapper(
+ connectors.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ connectors.delete,
+ )
+
+
+class AsyncConnectorsResourceWithStreamingResponse:
+ def __init__(self, connectors: AsyncConnectorsResource) -> None:
+ self._connectors = connectors
+
+ self.create = async_to_streamed_response_wrapper(
+ connectors.create,
+ )
+ self.retrieve = async_to_streamed_response_wrapper(
+ connectors.retrieve,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ connectors.update,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ connectors.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ connectors.delete,
+ )
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
new file mode 100644
index 00000000..e0a0d125
--- /dev/null
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -0,0 +1,663 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Optional
+from typing_extensions import Literal
+
+import httpx
+
+from ...types import data_source_list_params, data_source_create_params, data_source_update_params
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import maybe_transform, async_maybe_transform
+from ..._compat import cached_property
+from .connectors import (
+ ConnectorsResource,
+ AsyncConnectorsResource,
+ ConnectorsResourceWithRawResponse,
+ AsyncConnectorsResourceWithRawResponse,
+ ConnectorsResourceWithStreamingResponse,
+ AsyncConnectorsResourceWithStreamingResponse,
+)
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...pagination import SyncLimitOffset, AsyncLimitOffset
+from ..._base_client import AsyncPaginator, make_request_options
+from ...types.data_source_list_response import DataSourceListResponse
+from ...types.data_source_create_response import DataSourceCreateResponse
+from ...types.data_source_delete_response import DataSourceDeleteResponse
+from ...types.data_source_update_response import DataSourceUpdateResponse
+from ...types.data_source_retrieve_response import DataSourceRetrieveResponse
+
+__all__ = ["DataSourcesResource", "AsyncDataSourcesResource"]
+
+
+class DataSourcesResource(SyncAPIResource):
+ @cached_property
+ def connectors(self) -> ConnectorsResource:
+ return ConnectorsResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> DataSourcesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return DataSourcesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> DataSourcesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return DataSourcesResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ type: Literal["notion", "linear"],
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.AuthParams] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSourceCreateResponse:
+ """
+ Create a new data source.
+
+ Args: params: The data source to create.
+
+ Returns: The created data source.
+
+ Args:
+ type: The type of data source to create
+
+ name: The name of the data source
+
+ metadata: The metadata of the data source
+
+ auth_params: Authentication parameters for a OAuth data source.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/data_sources/",
+ body=maybe_transform(
+ {
+ "type": type,
+ "name": name,
+ "metadata": metadata,
+ "auth_params": auth_params,
+ },
+ data_source_create_params.DataSourceCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DataSourceCreateResponse,
+ )
+
+ def retrieve(
+ self,
+ data_source_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSourceRetrieveResponse:
+ """
+ Get a data source by ID.
+
+ Args: data_source_id: The ID of the data source to fetch.
+
+ Returns: The data source.
+
+ Args:
+ data_source_id: The ID of the data source to fetch
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return self._get(
+ f"/v1/data_sources/{data_source_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DataSourceRetrieveResponse,
+ )
+
+ def update(
+ self,
+ data_source_id: str,
+ *,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.AuthParams] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSourceUpdateResponse:
+ """Update a data source.
+
+ Args: data_source_id: The ID of the data source to update.
+
+ params: The data
+ source to update.
+
+ Returns: The updated data source.
+
+ Args:
+ data_source_id: The ID of the data source to update
+
+ name: The name of the data source
+
+ metadata: The metadata of the data source
+
+ auth_params: Authentication parameters for a OAuth data source.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return self._put(
+ f"/v1/data_sources/{data_source_id}",
+ body=maybe_transform(
+ {
+ "name": name,
+ "metadata": metadata,
+ "auth_params": auth_params,
+ },
+ data_source_update_params.DataSourceUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DataSourceUpdateResponse,
+ )
+
+ def list(
+ self,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> SyncLimitOffset[DataSourceListResponse]:
+ """
+ Get all data sources.
+
+ Returns: The list of data sources.
+
+ Args:
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/v1/data_sources/",
+ page=SyncLimitOffset[DataSourceListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ data_source_list_params.DataSourceListParams,
+ ),
+ ),
+ model=DataSourceListResponse,
+ )
+
+ def delete(
+ self,
+ data_source_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSourceDeleteResponse:
+ """
+ Delete a data source.
+
+ Args: data_source_id: The ID of the data source to delete.
+
+ Args:
+ data_source_id: The ID of the data source to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return self._delete(
+ f"/v1/data_sources/{data_source_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DataSourceDeleteResponse,
+ )
+
+
+class AsyncDataSourcesResource(AsyncAPIResource):
+ @cached_property
+ def connectors(self) -> AsyncConnectorsResource:
+ return AsyncConnectorsResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncDataSourcesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncDataSourcesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncDataSourcesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncDataSourcesResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ type: Literal["notion", "linear"],
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.AuthParams] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSourceCreateResponse:
+ """
+ Create a new data source.
+
+ Args: params: The data source to create.
+
+ Returns: The created data source.
+
+ Args:
+ type: The type of data source to create
+
+ name: The name of the data source
+
+ metadata: The metadata of the data source
+
+ auth_params: Authentication parameters for a OAuth data source.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/data_sources/",
+ body=await async_maybe_transform(
+ {
+ "type": type,
+ "name": name,
+ "metadata": metadata,
+ "auth_params": auth_params,
+ },
+ data_source_create_params.DataSourceCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DataSourceCreateResponse,
+ )
+
+ async def retrieve(
+ self,
+ data_source_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSourceRetrieveResponse:
+ """
+ Get a data source by ID.
+
+ Args: data_source_id: The ID of the data source to fetch.
+
+ Returns: The data source.
+
+ Args:
+ data_source_id: The ID of the data source to fetch
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return await self._get(
+ f"/v1/data_sources/{data_source_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DataSourceRetrieveResponse,
+ )
+
+ async def update(
+ self,
+ data_source_id: str,
+ *,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.AuthParams] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSourceUpdateResponse:
+ """Update a data source.
+
+ Args: data_source_id: The ID of the data source to update.
+
+ params: The data
+ source to update.
+
+ Returns: The updated data source.
+
+ Args:
+ data_source_id: The ID of the data source to update
+
+ name: The name of the data source
+
+ metadata: The metadata of the data source
+
+ auth_params: Authentication parameters for a OAuth data source.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return await self._put(
+ f"/v1/data_sources/{data_source_id}",
+ body=await async_maybe_transform(
+ {
+ "name": name,
+ "metadata": metadata,
+ "auth_params": auth_params,
+ },
+ data_source_update_params.DataSourceUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DataSourceUpdateResponse,
+ )
+
+ def list(
+ self,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> AsyncPaginator[DataSourceListResponse, AsyncLimitOffset[DataSourceListResponse]]:
+ """
+ Get all data sources.
+
+ Returns: The list of data sources.
+
+ Args:
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/v1/data_sources/",
+ page=AsyncLimitOffset[DataSourceListResponse],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ data_source_list_params.DataSourceListParams,
+ ),
+ ),
+ model=DataSourceListResponse,
+ )
+
+ async def delete(
+ self,
+ data_source_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSourceDeleteResponse:
+ """
+ Delete a data source.
+
+ Args: data_source_id: The ID of the data source to delete.
+
+ Args:
+ data_source_id: The ID of the data source to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not data_source_id:
+ raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
+ return await self._delete(
+ f"/v1/data_sources/{data_source_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=DataSourceDeleteResponse,
+ )
+
+
+class DataSourcesResourceWithRawResponse:
+ def __init__(self, data_sources: DataSourcesResource) -> None:
+ self._data_sources = data_sources
+
+ self.create = to_raw_response_wrapper(
+ data_sources.create,
+ )
+ self.retrieve = to_raw_response_wrapper(
+ data_sources.retrieve,
+ )
+ self.update = to_raw_response_wrapper(
+ data_sources.update,
+ )
+ self.list = to_raw_response_wrapper(
+ data_sources.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ data_sources.delete,
+ )
+
+ @cached_property
+ def connectors(self) -> ConnectorsResourceWithRawResponse:
+ return ConnectorsResourceWithRawResponse(self._data_sources.connectors)
+
+
+class AsyncDataSourcesResourceWithRawResponse:
+ def __init__(self, data_sources: AsyncDataSourcesResource) -> None:
+ self._data_sources = data_sources
+
+ self.create = async_to_raw_response_wrapper(
+ data_sources.create,
+ )
+ self.retrieve = async_to_raw_response_wrapper(
+ data_sources.retrieve,
+ )
+ self.update = async_to_raw_response_wrapper(
+ data_sources.update,
+ )
+ self.list = async_to_raw_response_wrapper(
+ data_sources.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ data_sources.delete,
+ )
+
+ @cached_property
+ def connectors(self) -> AsyncConnectorsResourceWithRawResponse:
+ return AsyncConnectorsResourceWithRawResponse(self._data_sources.connectors)
+
+
+class DataSourcesResourceWithStreamingResponse:
+ def __init__(self, data_sources: DataSourcesResource) -> None:
+ self._data_sources = data_sources
+
+ self.create = to_streamed_response_wrapper(
+ data_sources.create,
+ )
+ self.retrieve = to_streamed_response_wrapper(
+ data_sources.retrieve,
+ )
+ self.update = to_streamed_response_wrapper(
+ data_sources.update,
+ )
+ self.list = to_streamed_response_wrapper(
+ data_sources.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ data_sources.delete,
+ )
+
+ @cached_property
+ def connectors(self) -> ConnectorsResourceWithStreamingResponse:
+ return ConnectorsResourceWithStreamingResponse(self._data_sources.connectors)
+
+
+class AsyncDataSourcesResourceWithStreamingResponse:
+ def __init__(self, data_sources: AsyncDataSourcesResource) -> None:
+ self._data_sources = data_sources
+
+ self.create = async_to_streamed_response_wrapper(
+ data_sources.create,
+ )
+ self.retrieve = async_to_streamed_response_wrapper(
+ data_sources.retrieve,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ data_sources.update,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ data_sources.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ data_sources.delete,
+ )
+
+ @cached_property
+ def connectors(self) -> AsyncConnectorsResourceWithStreamingResponse:
+ return AsyncConnectorsResourceWithStreamingResponse(self._data_sources.connectors)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index a8ab8119..31efbe4f 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -17,16 +17,24 @@
from .expires_after_param import ExpiresAfterParam as ExpiresAfterParam
from .client_rerank_params import ClientRerankParams as ClientRerankParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
+from .data_source_list_params import DataSourceListParams as DataSourceListParams
from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
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_list_response import DataSourceListResponse as DataSourceListResponse
+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_create_response import DataSourceCreateResponse as DataSourceCreateResponse
+from .data_source_delete_response import DataSourceDeleteResponse as DataSourceDeleteResponse
+from .data_source_update_response import DataSourceUpdateResponse as DataSourceUpdateResponse
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
+from .data_source_retrieve_response import DataSourceRetrieveResponse as DataSourceRetrieveResponse
from .vector_store_file_search_options_param import (
VectorStoreFileSearchOptionsParam as VectorStoreFileSearchOptionsParam,
)
diff --git a/src/mixedbread/types/data_source_create_params.py b/src/mixedbread/types/data_source_create_params.py
new file mode 100644
index 00000000..6483d336
--- /dev/null
+++ b/src/mixedbread/types/data_source_create_params.py
@@ -0,0 +1,56 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Optional
+from datetime import datetime
+from typing_extensions import Literal, Required, Annotated, TypedDict
+
+from .._utils import PropertyInfo
+
+__all__ = ["DataSourceCreateParams", "AuthParams"]
+
+
+class DataSourceCreateParams(TypedDict, total=False):
+ type: Required[Literal["notion", "linear"]]
+ """The type of data source to create"""
+
+ name: Required[str]
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[AuthParams]
+ """Authentication parameters for a OAuth data source."""
+
+
+class AuthParams(TypedDict, total=False):
+ type: Literal["oauth2"]
+
+ created_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
+ """The timestamp when the OAuth2 credentials were created"""
+
+ client_id: Required[str]
+ """The OAuth2 client ID"""
+
+ client_secret: Required[str]
+ """The OAuth2 client secret"""
+
+ redirect_uri: Required[str]
+ """The OAuth2 redirect URI"""
+
+ scope: Required[str]
+ """The OAuth2 scope"""
+
+ access_token: Optional[str]
+ """The OAuth2 access token"""
+
+ refresh_token: Optional[str]
+ """The OAuth2 refresh token"""
+
+ token_type: Optional[str]
+ """The OAuth2 token type"""
+
+ expires_on: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
+ """The OAuth2 token expiration timestamp"""
diff --git a/src/mixedbread/types/data_source_create_response.py b/src/mixedbread/types/data_source_create_response.py
new file mode 100644
index 00000000..c8ff098e
--- /dev/null
+++ b/src/mixedbread/types/data_source_create_response.py
@@ -0,0 +1,66 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["DataSourceCreateResponse", "AuthParams"]
+
+
+class AuthParams(BaseModel):
+ type: Optional[Literal["oauth2"]] = None
+
+ created_at: Optional[datetime] = None
+ """The timestamp when the OAuth2 credentials were created"""
+
+ client_id: str
+ """The OAuth2 client ID"""
+
+ client_secret: str
+ """The OAuth2 client secret"""
+
+ redirect_uri: str
+ """The OAuth2 redirect URI"""
+
+ scope: str
+ """The OAuth2 scope"""
+
+ access_token: Optional[str] = None
+ """The OAuth2 access token"""
+
+ refresh_token: Optional[str] = None
+ """The OAuth2 refresh token"""
+
+ token_type: Optional[str] = None
+ """The OAuth2 token type"""
+
+ expires_on: Optional[datetime] = None
+ """The OAuth2 token expiration timestamp"""
+
+
+class DataSourceCreateResponse(BaseModel):
+ id: str
+ """The ID of the data source"""
+
+ created_at: datetime
+ """The creation time of the data source"""
+
+ updated_at: datetime
+ """The last update time of the data source"""
+
+ type: Literal["notion", "linear"]
+ """The type of data source"""
+
+ name: str
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[AuthParams] = None
+ """Authentication parameters for a OAuth data source."""
+
+ object: Optional[Literal["data_source"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_source_delete_response.py b/src/mixedbread/types/data_source_delete_response.py
new file mode 100644
index 00000000..6fe26744
--- /dev/null
+++ b/src/mixedbread/types/data_source_delete_response.py
@@ -0,0 +1,19 @@
+# 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__ = ["DataSourceDeleteResponse"]
+
+
+class DataSourceDeleteResponse(BaseModel):
+ id: str
+ """The ID of the data source"""
+
+ deleted: Optional[bool] = None
+ """Whether the data source was deleted"""
+
+ object: Optional[Literal["data_source"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_source_list_params.py b/src/mixedbread/types/data_source_list_params.py
new file mode 100644
index 00000000..d6026d5d
--- /dev/null
+++ b/src/mixedbread/types/data_source_list_params.py
@@ -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 TypedDict
+
+__all__ = ["DataSourceListParams"]
+
+
+class DataSourceListParams(TypedDict, total=False):
+ limit: int
+ """Maximum number of items to return per page"""
+
+ offset: int
+ """Offset of the first item to return"""
diff --git a/src/mixedbread/types/data_source_list_response.py b/src/mixedbread/types/data_source_list_response.py
new file mode 100644
index 00000000..afe40837
--- /dev/null
+++ b/src/mixedbread/types/data_source_list_response.py
@@ -0,0 +1,66 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["DataSourceListResponse", "AuthParams"]
+
+
+class AuthParams(BaseModel):
+ type: Optional[Literal["oauth2"]] = None
+
+ created_at: Optional[datetime] = None
+ """The timestamp when the OAuth2 credentials were created"""
+
+ client_id: str
+ """The OAuth2 client ID"""
+
+ client_secret: str
+ """The OAuth2 client secret"""
+
+ redirect_uri: str
+ """The OAuth2 redirect URI"""
+
+ scope: str
+ """The OAuth2 scope"""
+
+ access_token: Optional[str] = None
+ """The OAuth2 access token"""
+
+ refresh_token: Optional[str] = None
+ """The OAuth2 refresh token"""
+
+ token_type: Optional[str] = None
+ """The OAuth2 token type"""
+
+ expires_on: Optional[datetime] = None
+ """The OAuth2 token expiration timestamp"""
+
+
+class DataSourceListResponse(BaseModel):
+ id: str
+ """The ID of the data source"""
+
+ created_at: datetime
+ """The creation time of the data source"""
+
+ updated_at: datetime
+ """The last update time of the data source"""
+
+ type: Literal["notion", "linear"]
+ """The type of data source"""
+
+ name: str
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[AuthParams] = None
+ """Authentication parameters for a OAuth data source."""
+
+ object: Optional[Literal["data_source"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_source_retrieve_response.py b/src/mixedbread/types/data_source_retrieve_response.py
new file mode 100644
index 00000000..e6eda38d
--- /dev/null
+++ b/src/mixedbread/types/data_source_retrieve_response.py
@@ -0,0 +1,66 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["DataSourceRetrieveResponse", "AuthParams"]
+
+
+class AuthParams(BaseModel):
+ type: Optional[Literal["oauth2"]] = None
+
+ created_at: Optional[datetime] = None
+ """The timestamp when the OAuth2 credentials were created"""
+
+ client_id: str
+ """The OAuth2 client ID"""
+
+ client_secret: str
+ """The OAuth2 client secret"""
+
+ redirect_uri: str
+ """The OAuth2 redirect URI"""
+
+ scope: str
+ """The OAuth2 scope"""
+
+ access_token: Optional[str] = None
+ """The OAuth2 access token"""
+
+ refresh_token: Optional[str] = None
+ """The OAuth2 refresh token"""
+
+ token_type: Optional[str] = None
+ """The OAuth2 token type"""
+
+ expires_on: Optional[datetime] = None
+ """The OAuth2 token expiration timestamp"""
+
+
+class DataSourceRetrieveResponse(BaseModel):
+ id: str
+ """The ID of the data source"""
+
+ created_at: datetime
+ """The creation time of the data source"""
+
+ updated_at: datetime
+ """The last update time of the data source"""
+
+ type: Literal["notion", "linear"]
+ """The type of data source"""
+
+ name: str
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[AuthParams] = None
+ """Authentication parameters for a OAuth data source."""
+
+ object: Optional[Literal["data_source"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_source_update_params.py b/src/mixedbread/types/data_source_update_params.py
new file mode 100644
index 00000000..d5bc1c00
--- /dev/null
+++ b/src/mixedbread/types/data_source_update_params.py
@@ -0,0 +1,53 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Optional
+from datetime import datetime
+from typing_extensions import Literal, Required, Annotated, TypedDict
+
+from .._utils import PropertyInfo
+
+__all__ = ["DataSourceUpdateParams", "AuthParams"]
+
+
+class DataSourceUpdateParams(TypedDict, total=False):
+ name: Optional[str]
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[AuthParams]
+ """Authentication parameters for a OAuth data source."""
+
+
+class AuthParams(TypedDict, total=False):
+ type: Literal["oauth2"]
+
+ created_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
+ """The timestamp when the OAuth2 credentials were created"""
+
+ client_id: Required[str]
+ """The OAuth2 client ID"""
+
+ client_secret: Required[str]
+ """The OAuth2 client secret"""
+
+ redirect_uri: Required[str]
+ """The OAuth2 redirect URI"""
+
+ scope: Required[str]
+ """The OAuth2 scope"""
+
+ access_token: Optional[str]
+ """The OAuth2 access token"""
+
+ refresh_token: Optional[str]
+ """The OAuth2 refresh token"""
+
+ token_type: Optional[str]
+ """The OAuth2 token type"""
+
+ expires_on: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
+ """The OAuth2 token expiration timestamp"""
diff --git a/src/mixedbread/types/data_source_update_response.py b/src/mixedbread/types/data_source_update_response.py
new file mode 100644
index 00000000..8820151e
--- /dev/null
+++ b/src/mixedbread/types/data_source_update_response.py
@@ -0,0 +1,66 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["DataSourceUpdateResponse", "AuthParams"]
+
+
+class AuthParams(BaseModel):
+ type: Optional[Literal["oauth2"]] = None
+
+ created_at: Optional[datetime] = None
+ """The timestamp when the OAuth2 credentials were created"""
+
+ client_id: str
+ """The OAuth2 client ID"""
+
+ client_secret: str
+ """The OAuth2 client secret"""
+
+ redirect_uri: str
+ """The OAuth2 redirect URI"""
+
+ scope: str
+ """The OAuth2 scope"""
+
+ access_token: Optional[str] = None
+ """The OAuth2 access token"""
+
+ refresh_token: Optional[str] = None
+ """The OAuth2 refresh token"""
+
+ token_type: Optional[str] = None
+ """The OAuth2 token type"""
+
+ expires_on: Optional[datetime] = None
+ """The OAuth2 token expiration timestamp"""
+
+
+class DataSourceUpdateResponse(BaseModel):
+ id: str
+ """The ID of the data source"""
+
+ created_at: datetime
+ """The creation time of the data source"""
+
+ updated_at: datetime
+ """The last update time of the data source"""
+
+ type: Literal["notion", "linear"]
+ """The type of data source"""
+
+ name: str
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[AuthParams] = None
+ """Authentication parameters for a OAuth data source."""
+
+ object: Optional[Literal["data_source"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_sources/__init__.py b/src/mixedbread/types/data_sources/__init__.py
new file mode 100644
index 00000000..e02119c0
--- /dev/null
+++ b/src/mixedbread/types/data_sources/__init__.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .connector_list_params import ConnectorListParams as ConnectorListParams
+from .connector_create_params import ConnectorCreateParams as ConnectorCreateParams
+from .connector_list_response import ConnectorListResponse as ConnectorListResponse
+from .connector_update_params import ConnectorUpdateParams as ConnectorUpdateParams
+from .connector_create_response import ConnectorCreateResponse as ConnectorCreateResponse
+from .connector_delete_response import ConnectorDeleteResponse as ConnectorDeleteResponse
+from .connector_update_response import ConnectorUpdateResponse as ConnectorUpdateResponse
+from .connector_retrieve_response import ConnectorRetrieveResponse as ConnectorRetrieveResponse
diff --git a/src/mixedbread/types/data_sources/connector_create_params.py b/src/mixedbread/types/data_sources/connector_create_params.py
new file mode 100644
index 00000000..6b1f8ed4
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_create_params.py
@@ -0,0 +1,25 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Optional
+from typing_extensions import Required, TypedDict
+
+__all__ = ["ConnectorCreateParams"]
+
+
+class ConnectorCreateParams(TypedDict, total=False):
+ vector_store_id: Required[str]
+ """The ID of the vector store"""
+
+ name: str
+ """The name of the connector"""
+
+ trigger_sync: bool
+ """Whether the connector should be synced after creation"""
+
+ metadata: object
+ """The metadata of the connector"""
+
+ polling_interval: Optional[str]
+ """The polling interval of the connector"""
diff --git a/src/mixedbread/types/data_sources/connector_create_response.py b/src/mixedbread/types/data_sources/connector_create_response.py
new file mode 100644
index 00000000..583b3866
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_create_response.py
@@ -0,0 +1,53 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["ConnectorCreateResponse"]
+
+
+class ConnectorCreateResponse(BaseModel):
+ id: str
+ """The ID of the connector"""
+
+ created_at: datetime
+ """The creation time of the connector"""
+
+ updated_at: datetime
+ """The last update time of the connector"""
+
+ vector_store_id: str
+ """The ID of the vector store"""
+
+ data_source_id: str
+ """The ID of the data source"""
+
+ name: Optional[str] = None
+ """The name of the connector"""
+
+ metadata: object
+ """The metadata of the connector"""
+
+ polling_interval: str
+ """The polling interval of the connector"""
+
+ started_at: Optional[datetime] = None
+ """The start time of the connector"""
+
+ finished_at: Optional[datetime] = None
+ """The finish time of the connector"""
+
+ last_synced_at: Optional[datetime] = None
+ """The last sync time of the connector"""
+
+ status: Literal["idle", "pending", "in_progress", "cancelled", "completed", "failed"]
+ """The sync status of the connector"""
+
+ error: Optional[str] = None
+ """The sync error of the connector"""
+
+ object: Optional[Literal["data_source.connector"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_sources/connector_delete_response.py b/src/mixedbread/types/data_sources/connector_delete_response.py
new file mode 100644
index 00000000..1f320d3e
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_delete_response.py
@@ -0,0 +1,19 @@
+# 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__ = ["ConnectorDeleteResponse"]
+
+
+class ConnectorDeleteResponse(BaseModel):
+ id: str
+ """The ID of the connector"""
+
+ deleted: Optional[bool] = None
+ """Whether the connector was deleted"""
+
+ object: Optional[Literal["data_source.connector"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_sources/connector_list_params.py b/src/mixedbread/types/data_sources/connector_list_params.py
new file mode 100644
index 00000000..deda9f22
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_list_params.py
@@ -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 TypedDict
+
+__all__ = ["ConnectorListParams"]
+
+
+class ConnectorListParams(TypedDict, total=False):
+ limit: int
+ """Maximum number of items to return per page"""
+
+ offset: int
+ """Offset of the first item to return"""
diff --git a/src/mixedbread/types/data_sources/connector_list_response.py b/src/mixedbread/types/data_sources/connector_list_response.py
new file mode 100644
index 00000000..4a508789
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_list_response.py
@@ -0,0 +1,53 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["ConnectorListResponse"]
+
+
+class ConnectorListResponse(BaseModel):
+ id: str
+ """The ID of the connector"""
+
+ created_at: datetime
+ """The creation time of the connector"""
+
+ updated_at: datetime
+ """The last update time of the connector"""
+
+ vector_store_id: str
+ """The ID of the vector store"""
+
+ data_source_id: str
+ """The ID of the data source"""
+
+ name: Optional[str] = None
+ """The name of the connector"""
+
+ metadata: object
+ """The metadata of the connector"""
+
+ polling_interval: str
+ """The polling interval of the connector"""
+
+ started_at: Optional[datetime] = None
+ """The start time of the connector"""
+
+ finished_at: Optional[datetime] = None
+ """The finish time of the connector"""
+
+ last_synced_at: Optional[datetime] = None
+ """The last sync time of the connector"""
+
+ status: Literal["idle", "pending", "in_progress", "cancelled", "completed", "failed"]
+ """The sync status of the connector"""
+
+ error: Optional[str] = None
+ """The sync error of the connector"""
+
+ object: Optional[Literal["data_source.connector"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_sources/connector_retrieve_response.py b/src/mixedbread/types/data_sources/connector_retrieve_response.py
new file mode 100644
index 00000000..db2f80c5
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_retrieve_response.py
@@ -0,0 +1,53 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["ConnectorRetrieveResponse"]
+
+
+class ConnectorRetrieveResponse(BaseModel):
+ id: str
+ """The ID of the connector"""
+
+ created_at: datetime
+ """The creation time of the connector"""
+
+ updated_at: datetime
+ """The last update time of the connector"""
+
+ vector_store_id: str
+ """The ID of the vector store"""
+
+ data_source_id: str
+ """The ID of the data source"""
+
+ name: Optional[str] = None
+ """The name of the connector"""
+
+ metadata: object
+ """The metadata of the connector"""
+
+ polling_interval: str
+ """The polling interval of the connector"""
+
+ started_at: Optional[datetime] = None
+ """The start time of the connector"""
+
+ finished_at: Optional[datetime] = None
+ """The finish time of the connector"""
+
+ last_synced_at: Optional[datetime] = None
+ """The last sync time of the connector"""
+
+ status: Literal["idle", "pending", "in_progress", "cancelled", "completed", "failed"]
+ """The sync status of the connector"""
+
+ error: Optional[str] = None
+ """The sync error of the connector"""
+
+ object: Optional[Literal["data_source.connector"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_sources/connector_update_params.py b/src/mixedbread/types/data_sources/connector_update_params.py
new file mode 100644
index 00000000..80434be2
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_update_params.py
@@ -0,0 +1,25 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Dict, Optional
+from typing_extensions import Required, TypedDict
+
+__all__ = ["ConnectorUpdateParams"]
+
+
+class ConnectorUpdateParams(TypedDict, total=False):
+ data_source_id: Required[str]
+ """The ID of the data source to update a connector for"""
+
+ name: Optional[str]
+ """The name of the connector"""
+
+ metadata: Optional[Dict[str, object]]
+ """The metadata of the connector"""
+
+ trigger_sync: Optional[bool]
+ """Whether the connector should be synced after update"""
+
+ polling_interval: Optional[str]
+ """The polling interval of the connector"""
diff --git a/src/mixedbread/types/data_sources/connector_update_response.py b/src/mixedbread/types/data_sources/connector_update_response.py
new file mode 100644
index 00000000..4055a322
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_update_response.py
@@ -0,0 +1,53 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["ConnectorUpdateResponse"]
+
+
+class ConnectorUpdateResponse(BaseModel):
+ id: str
+ """The ID of the connector"""
+
+ created_at: datetime
+ """The creation time of the connector"""
+
+ updated_at: datetime
+ """The last update time of the connector"""
+
+ vector_store_id: str
+ """The ID of the vector store"""
+
+ data_source_id: str
+ """The ID of the data source"""
+
+ name: Optional[str] = None
+ """The name of the connector"""
+
+ metadata: object
+ """The metadata of the connector"""
+
+ polling_interval: str
+ """The polling interval of the connector"""
+
+ started_at: Optional[datetime] = None
+ """The start time of the connector"""
+
+ finished_at: Optional[datetime] = None
+ """The finish time of the connector"""
+
+ last_synced_at: Optional[datetime] = None
+ """The last sync time of the connector"""
+
+ status: Literal["idle", "pending", "in_progress", "cancelled", "completed", "failed"]
+ """The sync status of the connector"""
+
+ error: Optional[str] = None
+ """The sync error of the connector"""
+
+ object: Optional[Literal["data_source.connector"]] = None
+ """The type of the object"""
diff --git a/tests/api_resources/data_sources/__init__.py b/tests/api_resources/data_sources/__init__.py
new file mode 100644
index 00000000..fd8019a9
--- /dev/null
+++ b/tests/api_resources/data_sources/__init__.py
@@ -0,0 +1 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
new file mode 100644
index 00000000..f18a20d8
--- /dev/null
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -0,0 +1,543 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
+from mixedbread.types.data_sources import (
+ ConnectorListResponse,
+ ConnectorCreateResponse,
+ ConnectorDeleteResponse,
+ ConnectorUpdateResponse,
+ ConnectorRetrieveResponse,
+)
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestConnectors:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ connector = client.data_sources.connectors.create(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_id="vector_store_id",
+ )
+ assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
+ connector = client.data_sources.connectors.create(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_id="vector_store_id",
+ name="name",
+ trigger_sync=True,
+ metadata={},
+ polling_interval="polling_interval",
+ )
+ assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.data_sources.connectors.with_raw_response.create(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_id="vector_store_id",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = response.parse()
+ assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.data_sources.connectors.with_streaming_response.create(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_id="vector_store_id",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = response.parse()
+ assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_create(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ client.data_sources.connectors.with_raw_response.create(
+ data_source_id="",
+ vector_store_id="vector_store_id",
+ )
+
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ connector = client.data_sources.connectors.retrieve(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
+ response = client.data_sources.connectors.with_raw_response.retrieve(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = response.parse()
+ assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.data_sources.connectors.with_streaming_response.retrieve(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = response.parse()
+ assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ client.data_sources.connectors.with_raw_response.retrieve(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"):
+ client.data_sources.connectors.with_raw_response.retrieve(
+ connector_id="",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ @parametrize
+ def test_method_update(self, client: Mixedbread) -> None:
+ connector = client.data_sources.connectors.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+
+ @parametrize
+ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
+ connector = client.data_sources.connectors.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ metadata={"foo": "bar"},
+ trigger_sync=True,
+ polling_interval="polling_interval",
+ )
+ assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+
+ @parametrize
+ def test_raw_response_update(self, client: Mixedbread) -> None:
+ response = client.data_sources.connectors.with_raw_response.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = response.parse()
+ assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+
+ @parametrize
+ def test_streaming_response_update(self, client: Mixedbread) -> None:
+ with client.data_sources.connectors.with_streaming_response.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = response.parse()
+ assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_update(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ client.data_sources.connectors.with_raw_response.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"):
+ client.data_sources.connectors.with_raw_response.update(
+ connector_id="",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ connector = client.data_sources.connectors.list(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(SyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
+ connector = client.data_sources.connectors.list(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ limit=1000,
+ offset=0,
+ )
+ assert_matches_type(SyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Mixedbread) -> None:
+ response = client.data_sources.connectors.with_raw_response.list(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = response.parse()
+ assert_matches_type(SyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Mixedbread) -> None:
+ with client.data_sources.connectors.with_streaming_response.list(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = response.parse()
+ assert_matches_type(SyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_list(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ client.data_sources.connectors.with_raw_response.list(
+ data_source_id="",
+ )
+
+ @parametrize
+ def test_method_delete(self, client: Mixedbread) -> None:
+ connector = client.data_sources.connectors.delete(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ConnectorDeleteResponse, connector, path=["response"])
+
+ @parametrize
+ def test_raw_response_delete(self, client: Mixedbread) -> None:
+ response = client.data_sources.connectors.with_raw_response.delete(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = response.parse()
+ assert_matches_type(ConnectorDeleteResponse, connector, path=["response"])
+
+ @parametrize
+ def test_streaming_response_delete(self, client: Mixedbread) -> None:
+ with client.data_sources.connectors.with_streaming_response.delete(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = response.parse()
+ assert_matches_type(ConnectorDeleteResponse, connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_delete(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ client.data_sources.connectors.with_raw_response.delete(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"):
+ client.data_sources.connectors.with_raw_response.delete(
+ connector_id="",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+
+class TestAsyncConnectors:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ connector = await async_client.data_sources.connectors.create(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_id="vector_store_id",
+ )
+ assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ connector = await async_client.data_sources.connectors.create(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_id="vector_store_id",
+ name="name",
+ trigger_sync=True,
+ metadata={},
+ polling_interval="polling_interval",
+ )
+ assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.connectors.with_raw_response.create(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_id="vector_store_id",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = await response.parse()
+ assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.connectors.with_streaming_response.create(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_id="vector_store_id",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = await response.parse()
+ assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_create(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ await async_client.data_sources.connectors.with_raw_response.create(
+ data_source_id="",
+ vector_store_id="vector_store_id",
+ )
+
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
+ connector = await async_client.data_sources.connectors.retrieve(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.connectors.with_raw_response.retrieve(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = await response.parse()
+ assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.connectors.with_streaming_response.retrieve(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = await response.parse()
+ assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ await async_client.data_sources.connectors.with_raw_response.retrieve(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"):
+ await async_client.data_sources.connectors.with_raw_response.retrieve(
+ connector_id="",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ @parametrize
+ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
+ connector = await async_client.data_sources.connectors.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ connector = await async_client.data_sources.connectors.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ metadata={"foo": "bar"},
+ trigger_sync=True,
+ polling_interval="polling_interval",
+ )
+ assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.connectors.with_raw_response.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = await response.parse()
+ assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.connectors.with_streaming_response.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = await response.parse()
+ assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ await async_client.data_sources.connectors.with_raw_response.update(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"):
+ await async_client.data_sources.connectors.with_raw_response.update(
+ connector_id="",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ connector = await async_client.data_sources.connectors.list(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(AsyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ connector = await async_client.data_sources.connectors.list(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ limit=1000,
+ offset=0,
+ )
+ assert_matches_type(AsyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.connectors.with_raw_response.list(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = await response.parse()
+ assert_matches_type(AsyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.connectors.with_streaming_response.list(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = await response.parse()
+ assert_matches_type(AsyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ await async_client.data_sources.connectors.with_raw_response.list(
+ data_source_id="",
+ )
+
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
+ connector = await async_client.data_sources.connectors.delete(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(ConnectorDeleteResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.connectors.with_raw_response.delete(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ connector = await response.parse()
+ assert_matches_type(ConnectorDeleteResponse, connector, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.connectors.with_streaming_response.delete(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ connector = await response.parse()
+ assert_matches_type(ConnectorDeleteResponse, connector, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ await async_client.data_sources.connectors.with_raw_response.delete(
+ connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ data_source_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `connector_id` but received ''"):
+ await async_client.data_sources.connectors.with_raw_response.delete(
+ connector_id="",
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
diff --git a/tests/api_resources/test_chat.py b/tests/api_resources/test_chat.py
new file mode 100644
index 00000000..65341369
--- /dev/null
+++ b/tests/api_resources/test_chat.py
@@ -0,0 +1,71 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestChat:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create_completion(self, client: Mixedbread) -> None:
+ chat = client.chat.create_completion()
+ assert_matches_type(object, chat, path=["response"])
+
+ @parametrize
+ def test_raw_response_create_completion(self, client: Mixedbread) -> None:
+ response = client.chat.with_raw_response.create_completion()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ chat = response.parse()
+ assert_matches_type(object, chat, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create_completion(self, client: Mixedbread) -> None:
+ with client.chat.with_streaming_response.create_completion() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ chat = response.parse()
+ assert_matches_type(object, chat, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncChat:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create_completion(self, async_client: AsyncMixedbread) -> None:
+ chat = await async_client.chat.create_completion()
+ assert_matches_type(object, chat, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create_completion(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.chat.with_raw_response.create_completion()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ chat = await response.parse()
+ assert_matches_type(object, chat, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create_completion(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.chat.with_streaming_response.create_completion() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ chat = await response.parse()
+ assert_matches_type(object, chat, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
new file mode 100644
index 00000000..4d9ea104
--- /dev/null
+++ b/tests/api_resources/test_data_sources.py
@@ -0,0 +1,476 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types import (
+ DataSourceListResponse,
+ DataSourceCreateResponse,
+ DataSourceDeleteResponse,
+ DataSourceUpdateResponse,
+ DataSourceRetrieveResponse,
+)
+from mixedbread._utils import parse_datetime
+from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestDataSources:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.create(
+ type="notion",
+ name="name",
+ )
+ assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.create(
+ type="notion",
+ name="name",
+ metadata={},
+ auth_params={
+ "type": "oauth2",
+ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"),
+ "client_id": "client_id",
+ "client_secret": "client_secret",
+ "redirect_uri": "redirect_uri",
+ "scope": "scope",
+ "access_token": "access_token",
+ "refresh_token": "refresh_token",
+ "token_type": "token_type",
+ "expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
+ },
+ )
+ assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.data_sources.with_raw_response.create(
+ type="notion",
+ name="name",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = response.parse()
+ assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.data_sources.with_streaming_response.create(
+ type="notion",
+ name="name",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = response.parse()
+ assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
+ response = client.data_sources.with_raw_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = response.parse()
+ assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.data_sources.with_streaming_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = response.parse()
+ assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ client.data_sources.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ def test_method_update(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ metadata={},
+ auth_params={
+ "type": "oauth2",
+ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"),
+ "client_id": "client_id",
+ "client_secret": "client_secret",
+ "redirect_uri": "redirect_uri",
+ "scope": "scope",
+ "access_token": "access_token",
+ "refresh_token": "refresh_token",
+ "token_type": "token_type",
+ "expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
+ },
+ )
+ assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_raw_response_update(self, client: Mixedbread) -> None:
+ response = client.data_sources.with_raw_response.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = response.parse()
+ assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_streaming_response_update(self, client: Mixedbread) -> None:
+ with client.data_sources.with_streaming_response.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = response.parse()
+ assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_update(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ client.data_sources.with_raw_response.update(
+ data_source_id="",
+ )
+
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.list()
+ assert_matches_type(SyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.list(
+ limit=1000,
+ offset=0,
+ )
+ assert_matches_type(SyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Mixedbread) -> None:
+ response = client.data_sources.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = response.parse()
+ assert_matches_type(SyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Mixedbread) -> None:
+ with client.data_sources.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = response.parse()
+ assert_matches_type(SyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_delete(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_raw_response_delete(self, client: Mixedbread) -> None:
+ response = client.data_sources.with_raw_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = response.parse()
+ assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"])
+
+ @parametrize
+ def test_streaming_response_delete(self, client: Mixedbread) -> None:
+ with client.data_sources.with_streaming_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = response.parse()
+ assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_delete(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ client.data_sources.with_raw_response.delete(
+ "",
+ )
+
+
+class TestAsyncDataSources:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.create(
+ type="notion",
+ name="name",
+ )
+ assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.create(
+ type="notion",
+ name="name",
+ metadata={},
+ auth_params={
+ "type": "oauth2",
+ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"),
+ "client_id": "client_id",
+ "client_secret": "client_secret",
+ "redirect_uri": "redirect_uri",
+ "scope": "scope",
+ "access_token": "access_token",
+ "refresh_token": "refresh_token",
+ "token_type": "token_type",
+ "expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
+ },
+ )
+ assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.with_raw_response.create(
+ type="notion",
+ name="name",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = await response.parse()
+ assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.with_streaming_response.create(
+ type="notion",
+ name="name",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = await response.parse()
+ assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.with_raw_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = await response.parse()
+ assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.with_streaming_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = await response.parse()
+ assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ await async_client.data_sources.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ metadata={},
+ auth_params={
+ "type": "oauth2",
+ "created_at": parse_datetime("2019-12-27T18:11:19.117Z"),
+ "client_id": "client_id",
+ "client_secret": "client_secret",
+ "redirect_uri": "redirect_uri",
+ "scope": "scope",
+ "access_token": "access_token",
+ "refresh_token": "refresh_token",
+ "token_type": "token_type",
+ "expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
+ },
+ )
+ assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.with_raw_response.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = await response.parse()
+ assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.with_streaming_response.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = await response.parse()
+ assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ await async_client.data_sources.with_raw_response.update(
+ data_source_id="",
+ )
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.list()
+ assert_matches_type(AsyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.list(
+ limit=1000,
+ offset=0,
+ )
+ assert_matches_type(AsyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = await response.parse()
+ assert_matches_type(AsyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = await response.parse()
+ assert_matches_type(AsyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.with_raw_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = await response.parse()
+ assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.with_streaming_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = await response.parse()
+ assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ await async_client.data_sources.with_raw_response.delete(
+ "",
+ )
From 0105ef9098f40ae3acb6ab5d317ae3791ae9249d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 26 May 2025 12:32:00 +0000
Subject: [PATCH 143/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 68 +-
src/mixedbread/_client.py | 23 +-
src/mixedbread/resources/__init__.py | 14 +
src/mixedbread/resources/api_keys.py | 683 ++++++++++++++++++
.../resources/data_sources/connectors.py | 41 +-
.../resources/data_sources/data_sources.py | 63 +-
src/mixedbread/resources/embeddings.py | 14 +-
src/mixedbread/resources/parsing/jobs.py | 51 +-
src/mixedbread/types/__init__.py | 16 +-
src/mixedbread/types/api_key.py | 35 +
src/mixedbread/types/api_key_create_params.py | 19 +
src/mixedbread/types/api_key_created.py | 38 +
.../types/api_key_delete_response.py | 19 +
src/mixedbread/types/api_key_list_params.py | 15 +
src/mixedbread/types/client_embed_params.py | 9 +-
src/mixedbread/types/data_source.py | 37 +
.../types/data_source_create_params.py | 45 +-
.../types/data_source_create_response.py | 66 --
...sponse.py => data_source_oauth2_params.py} | 30 +-
.../types/data_source_oauth2_params_param.py | 42 ++
.../types/data_source_retrieve_response.py | 66 --
src/mixedbread/types/data_source_type.py | 7 +
.../types/data_source_update_params.py | 42 +-
.../types/data_source_update_response.py | 66 --
src/mixedbread/types/data_sources/__init__.py | 5 +-
.../data_sources/connector_create_response.py | 53 --
.../connector_retrieve_response.py | 53 --
.../data_sources/connector_update_response.py | 53 --
...t_response.py => data_source_connector.py} | 4 +-
.../types/embedding_create_params.py | 9 +-
.../types/embedding_create_response.py | 25 +-
src/mixedbread/types/encoding_format.py | 7 +
src/mixedbread/types/extractions/__init__.py | 4 +
.../extractions/content_create_params.py | 36 +-
.../types/extractions/extraction_job.py | 4 +-
.../types/extractions/image_url_input.py | 21 +
.../extractions/image_url_input_param.py | 20 +
.../types/extractions/text_input.py | 16 +
.../types/extractions/text_input_param.py | 15 +
src/mixedbread/types/object_type.py | 20 +
src/mixedbread/types/pagination_with_total.py | 18 +
src/mixedbread/types/parsing/__init__.py | 4 +
.../types/parsing/chunking_strategy.py | 7 +
src/mixedbread/types/parsing/element_type.py | 19 +
.../types/parsing/job_create_params.py | 26 +-
.../types/parsing/job_list_response.py | 3 +-
src/mixedbread/types/parsing/parsing_job.py | 40 +-
.../types/parsing/parsing_job_status.py | 7 +
src/mixedbread/types/parsing/return_format.py | 7 +
src/mixedbread/types/rerank_response.py | 18 +-
.../types/scored_vector_store_chunk.py | 30 +-
.../data_sources/test_connectors.py | 65 +-
tests/api_resources/parsing/test_jobs.py | 6 +-
tests/api_resources/test_api_keys.py | 460 ++++++++++++
tests/api_resources/test_data_sources.py | 65 +-
56 files changed, 1800 insertions(+), 833 deletions(-)
create mode 100644 src/mixedbread/resources/api_keys.py
create mode 100644 src/mixedbread/types/api_key.py
create mode 100644 src/mixedbread/types/api_key_create_params.py
create mode 100644 src/mixedbread/types/api_key_created.py
create mode 100644 src/mixedbread/types/api_key_delete_response.py
create mode 100644 src/mixedbread/types/api_key_list_params.py
create mode 100644 src/mixedbread/types/data_source.py
delete mode 100644 src/mixedbread/types/data_source_create_response.py
rename src/mixedbread/types/{data_source_list_response.py => data_source_oauth2_params.py} (55%)
create mode 100644 src/mixedbread/types/data_source_oauth2_params_param.py
delete mode 100644 src/mixedbread/types/data_source_retrieve_response.py
create mode 100644 src/mixedbread/types/data_source_type.py
delete mode 100644 src/mixedbread/types/data_source_update_response.py
delete mode 100644 src/mixedbread/types/data_sources/connector_create_response.py
delete mode 100644 src/mixedbread/types/data_sources/connector_retrieve_response.py
delete mode 100644 src/mixedbread/types/data_sources/connector_update_response.py
rename src/mixedbread/types/data_sources/{connector_list_response.py => data_source_connector.py} (94%)
create mode 100644 src/mixedbread/types/encoding_format.py
create mode 100644 src/mixedbread/types/extractions/image_url_input.py
create mode 100644 src/mixedbread/types/extractions/image_url_input_param.py
create mode 100644 src/mixedbread/types/extractions/text_input.py
create mode 100644 src/mixedbread/types/extractions/text_input_param.py
create mode 100644 src/mixedbread/types/object_type.py
create mode 100644 src/mixedbread/types/pagination_with_total.py
create mode 100644 src/mixedbread/types/parsing/chunking_strategy.py
create mode 100644 src/mixedbread/types/parsing/element_type.py
create mode 100644 src/mixedbread/types/parsing/parsing_job_status.py
create mode 100644 src/mixedbread/types/parsing/return_format.py
create mode 100644 tests/api_resources/test_api_keys.py
diff --git a/.stats.yml b/.stats.yml
index 2aac0f69..78883d24 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 43
+configured_endpoints: 49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: f6661e9fafda26e7e9f3fc06739a33ad
-config_hash: 70d47aa4a1dd8327383138a26d47d21a
+config_hash: 0619498f633d6a0d92ae15b21fd06d89
diff --git a/api.md b/api.md
index 141e338e..52d628b1 100644
--- a/api.md
+++ b/api.md
@@ -80,7 +80,15 @@ Methods:
Types:
```python
-from mixedbread.types.parsing import ParsingJob, JobListResponse, JobDeleteResponse
+from mixedbread.types.parsing import (
+ ChunkingStrategy,
+ ElementType,
+ ParsingJobStatus,
+ ParsingJob,
+ ReturnFormat,
+ JobListResponse,
+ JobDeleteResponse,
+)
```
Methods:
@@ -96,7 +104,7 @@ Methods:
Types:
```python
-from mixedbread.types import FileObject, FileDeleteResponse
+from mixedbread.types import FileObject, PaginationWithTotal, FileDeleteResponse
```
Methods:
@@ -142,7 +150,7 @@ Methods:
Types:
```python
-from mixedbread.types.extractions import ExtractionResult
+from mixedbread.types.extractions import ExtractionResult, ImageURLInput, TextInput
```
Methods:
@@ -151,6 +159,12 @@ Methods:
# Embeddings
+Types:
+
+```python
+from mixedbread.types import EncodingFormat, ObjectType
+```
+
Methods:
- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
@@ -173,20 +187,19 @@ Types:
```python
from mixedbread.types import (
- DataSourceCreateResponse,
- DataSourceRetrieveResponse,
- DataSourceUpdateResponse,
- DataSourceListResponse,
+ DataSource,
+ DataSourceOauth2Params,
+ DataSourceType,
DataSourceDeleteResponse,
)
```
Methods:
-- client.data_sources.create(\*\*params) -> DataSourceCreateResponse
-- client.data_sources.retrieve(data_source_id) -> DataSourceRetrieveResponse
-- client.data_sources.update(data_source_id, \*\*params) -> DataSourceUpdateResponse
-- client.data_sources.list(\*\*params) -> SyncLimitOffset[DataSourceListResponse]
+- client.data_sources.create(\*\*params) -> DataSource
+- client.data_sources.retrieve(data_source_id) -> DataSource
+- client.data_sources.update(data_source_id, \*\*params) -> DataSource
+- client.data_sources.list(\*\*params) -> SyncLimitOffset[DataSource]
- client.data_sources.delete(data_source_id) -> DataSourceDeleteResponse
## Connectors
@@ -194,19 +207,30 @@ Methods:
Types:
```python
-from mixedbread.types.data_sources import (
- ConnectorCreateResponse,
- ConnectorRetrieveResponse,
- ConnectorUpdateResponse,
- ConnectorListResponse,
- ConnectorDeleteResponse,
-)
+from mixedbread.types.data_sources import DataSourceConnector, ConnectorDeleteResponse
```
Methods:
-- client.data_sources.connectors.create(data_source_id, \*\*params) -> ConnectorCreateResponse
-- client.data_sources.connectors.retrieve(connector_id, \*, data_source_id) -> ConnectorRetrieveResponse
-- client.data_sources.connectors.update(connector_id, \*, data_source_id, \*\*params) -> ConnectorUpdateResponse
-- client.data_sources.connectors.list(data_source_id, \*\*params) -> SyncLimitOffset[ConnectorListResponse]
+- client.data_sources.connectors.create(data_source_id, \*\*params) -> DataSourceConnector
+- client.data_sources.connectors.retrieve(connector_id, \*, data_source_id) -> DataSourceConnector
+- client.data_sources.connectors.update(connector_id, \*, data_source_id, \*\*params) -> DataSourceConnector
+- client.data_sources.connectors.list(data_source_id, \*\*params) -> SyncLimitOffset[DataSourceConnector]
- client.data_sources.connectors.delete(connector_id, \*, data_source_id) -> ConnectorDeleteResponse
+
+# APIKeys
+
+Types:
+
+```python
+from mixedbread.types import APIKey, APIKeyCreated, APIKeyDeleteResponse
+```
+
+Methods:
+
+- client.api_keys.create(\*\*params) -> APIKeyCreated
+- client.api_keys.retrieve(api_key_id) -> APIKey
+- client.api_keys.list(\*\*params) -> SyncLimitOffset[APIKey]
+- client.api_keys.delete(api_key_id) -> APIKeyDeleteResponse
+- client.api_keys.reroll(api_key_id) -> APIKeyCreated
+- client.api_keys.revoke(api_key_id) -> APIKey
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 082f61ef..87e724e0 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -36,7 +36,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from .resources import chat, files, embeddings
+from .resources import chat, files, api_keys, embeddings
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, MixedbreadError
from ._base_client import (
@@ -48,6 +48,7 @@
from .resources.parsing import parsing
from .types.info_response import InfoResponse
from .resources.extractions import extractions
+from .types.encoding_format import EncodingFormat
from .types.rerank_response import RerankResponse
from .resources.data_sources import data_sources
from .resources.vector_stores import vector_stores
@@ -79,6 +80,7 @@ class Mixedbread(SyncAPIClient):
embeddings: embeddings.EmbeddingsResource
chat: chat.ChatResource
data_sources: data_sources.DataSourcesResource
+ api_keys: api_keys.APIKeysResource
with_raw_response: MixedbreadWithRawResponse
with_streaming_response: MixedbreadWithStreamedResponse
@@ -167,6 +169,7 @@ def __init__(
self.embeddings = embeddings.EmbeddingsResource(self)
self.chat = chat.ChatResource(self)
self.data_sources = data_sources.DataSourcesResource(self)
+ self.api_keys = api_keys.APIKeysResource(self)
self.with_raw_response = MixedbreadWithRawResponse(self)
self.with_streaming_response = MixedbreadWithStreamedResponse(self)
@@ -251,11 +254,7 @@ def embed(
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- | NotGiven = NOT_GIVEN,
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]] | 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,
@@ -444,6 +443,7 @@ class AsyncMixedbread(AsyncAPIClient):
embeddings: embeddings.AsyncEmbeddingsResource
chat: chat.AsyncChatResource
data_sources: data_sources.AsyncDataSourcesResource
+ api_keys: api_keys.AsyncAPIKeysResource
with_raw_response: AsyncMixedbreadWithRawResponse
with_streaming_response: AsyncMixedbreadWithStreamedResponse
@@ -532,6 +532,7 @@ def __init__(
self.embeddings = embeddings.AsyncEmbeddingsResource(self)
self.chat = chat.AsyncChatResource(self)
self.data_sources = data_sources.AsyncDataSourcesResource(self)
+ self.api_keys = api_keys.AsyncAPIKeysResource(self)
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)
@@ -616,11 +617,7 @@ async def embed(
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- | NotGiven = NOT_GIVEN,
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]] | 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,
@@ -810,6 +807,7 @@ def __init__(self, client: Mixedbread) -> None:
self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
self.chat = chat.ChatResourceWithRawResponse(client.chat)
self.data_sources = data_sources.DataSourcesResourceWithRawResponse(client.data_sources)
+ self.api_keys = api_keys.APIKeysResourceWithRawResponse(client.api_keys)
self.embed = to_raw_response_wrapper(
client.embed,
@@ -831,6 +829,7 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
self.chat = chat.AsyncChatResourceWithRawResponse(client.chat)
self.data_sources = data_sources.AsyncDataSourcesResourceWithRawResponse(client.data_sources)
+ self.api_keys = api_keys.AsyncAPIKeysResourceWithRawResponse(client.api_keys)
self.embed = async_to_raw_response_wrapper(
client.embed,
@@ -852,6 +851,7 @@ def __init__(self, client: Mixedbread) -> None:
self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
self.chat = chat.ChatResourceWithStreamingResponse(client.chat)
self.data_sources = data_sources.DataSourcesResourceWithStreamingResponse(client.data_sources)
+ self.api_keys = api_keys.APIKeysResourceWithStreamingResponse(client.api_keys)
self.embed = to_streamed_response_wrapper(
client.embed,
@@ -873,6 +873,7 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
self.chat = chat.AsyncChatResourceWithStreamingResponse(client.chat)
self.data_sources = data_sources.AsyncDataSourcesResourceWithStreamingResponse(client.data_sources)
+ self.api_keys = api_keys.AsyncAPIKeysResourceWithStreamingResponse(client.api_keys)
self.embed = async_to_streamed_response_wrapper(
client.embed,
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index 21f67148..241510a2 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -24,6 +24,14 @@
ParsingResourceWithStreamingResponse,
AsyncParsingResourceWithStreamingResponse,
)
+from .api_keys import (
+ APIKeysResource,
+ AsyncAPIKeysResource,
+ APIKeysResourceWithRawResponse,
+ AsyncAPIKeysResourceWithRawResponse,
+ APIKeysResourceWithStreamingResponse,
+ AsyncAPIKeysResourceWithStreamingResponse,
+)
from .embeddings import (
EmbeddingsResource,
AsyncEmbeddingsResource,
@@ -100,4 +108,10 @@
"AsyncDataSourcesResourceWithRawResponse",
"DataSourcesResourceWithStreamingResponse",
"AsyncDataSourcesResourceWithStreamingResponse",
+ "APIKeysResource",
+ "AsyncAPIKeysResource",
+ "APIKeysResourceWithRawResponse",
+ "AsyncAPIKeysResourceWithRawResponse",
+ "APIKeysResourceWithStreamingResponse",
+ "AsyncAPIKeysResourceWithStreamingResponse",
]
diff --git a/src/mixedbread/resources/api_keys.py b/src/mixedbread/resources/api_keys.py
new file mode 100644
index 00000000..9de4c7fe
--- /dev/null
+++ b/src/mixedbread/resources/api_keys.py
@@ -0,0 +1,683 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from datetime import datetime
+
+import httpx
+
+from ..types import api_key_list_params, api_key_create_params
+from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._utils import maybe_transform, async_maybe_transform
+from .._compat import cached_property
+from .._resource import SyncAPIResource, AsyncAPIResource
+from .._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..pagination import SyncLimitOffset, AsyncLimitOffset
+from .._base_client import AsyncPaginator, make_request_options
+from ..types.api_key import APIKey
+from ..types.api_key_created import APIKeyCreated
+from ..types.api_key_delete_response import APIKeyDeleteResponse
+
+__all__ = ["APIKeysResource", "AsyncAPIKeysResource"]
+
+
+class APIKeysResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> APIKeysResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return APIKeysResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> APIKeysResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return APIKeysResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ name: str | NotGiven = NOT_GIVEN,
+ expires_at: Union[str, datetime, None] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKeyCreated:
+ """
+ Create a new API key.
+
+ Args: params: The parameters for creating the API key.
+
+ Returns: ApiKeyCreated: The response containing the details of the created API
+ key.
+
+ Args:
+ name: A name/description for the API key
+
+ expires_at: Optional expiration datetime
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/api-keys",
+ body=maybe_transform(
+ {
+ "name": name,
+ "expires_at": expires_at,
+ },
+ api_key_create_params.APIKeyCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKeyCreated,
+ )
+
+ def retrieve(
+ self,
+ api_key_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKey:
+ """
+ Retrieve details of a specific API key by its ID.
+
+ Args: api_key_id: The ID of the API key to retrieve.
+
+ Returns: ApiKey: The response containing the API key details.
+
+ Args:
+ api_key_id: The ID of the API key to retrieve
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not api_key_id:
+ raise ValueError(f"Expected a non-empty value for `api_key_id` but received {api_key_id!r}")
+ return self._get(
+ f"/v1/api-keys/{api_key_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKey,
+ )
+
+ def list(
+ self,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> SyncLimitOffset[APIKey]:
+ """
+ List all API keys for the authenticated user.
+
+ Args: pagination: The pagination options
+
+ Returns: A list of API keys belonging to the user.
+
+ Args:
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/v1/api-keys",
+ page=SyncLimitOffset[APIKey],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ api_key_list_params.APIKeyListParams,
+ ),
+ ),
+ model=APIKey,
+ )
+
+ def delete(
+ self,
+ api_key_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKeyDeleteResponse:
+ """
+ Delete a specific API key by its ID.
+
+ Args: api_key_id: The ID of the API key to delete.
+
+ Returns: ApiKeyDeleted: The response containing the details of the deleted API
+ key.
+
+ Args:
+ api_key_id: The ID of the API key to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not api_key_id:
+ raise ValueError(f"Expected a non-empty value for `api_key_id` but received {api_key_id!r}")
+ return self._delete(
+ f"/v1/api-keys/{api_key_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKeyDeleteResponse,
+ )
+
+ def reroll(
+ self,
+ api_key_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKeyCreated:
+ """
+ Reroll the secret for a specific API key by its ID.
+
+ This generates a new secret key, invalidating the old one.
+
+ Args: api_key_id: The ID of the API key to reroll.
+
+ Returns: ApiKeyCreated: The response containing the API key details with the new
+ secret key.
+
+ Args:
+ api_key_id: The ID of the API key to reroll
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not api_key_id:
+ raise ValueError(f"Expected a non-empty value for `api_key_id` but received {api_key_id!r}")
+ return self._post(
+ f"/v1/api-keys/{api_key_id}/reroll",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKeyCreated,
+ )
+
+ def revoke(
+ self,
+ api_key_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKey:
+ """
+ Revoke a specific API key by its ID.
+
+ Args: api_key_id: The ID of the API key to revoke.
+
+ Returns: ApiKey: The response containing the details of the revoked API key.
+
+ Args:
+ api_key_id: The ID of the API key to revoke
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not api_key_id:
+ raise ValueError(f"Expected a non-empty value for `api_key_id` but received {api_key_id!r}")
+ return self._post(
+ f"/v1/api-keys/{api_key_id}/revoke",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKey,
+ )
+
+
+class AsyncAPIKeysResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncAPIKeysResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncAPIKeysResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncAPIKeysResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncAPIKeysResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ name: str | NotGiven = NOT_GIVEN,
+ expires_at: Union[str, datetime, None] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKeyCreated:
+ """
+ Create a new API key.
+
+ Args: params: The parameters for creating the API key.
+
+ Returns: ApiKeyCreated: The response containing the details of the created API
+ key.
+
+ Args:
+ name: A name/description for the API key
+
+ expires_at: Optional expiration datetime
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/api-keys",
+ body=await async_maybe_transform(
+ {
+ "name": name,
+ "expires_at": expires_at,
+ },
+ api_key_create_params.APIKeyCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKeyCreated,
+ )
+
+ async def retrieve(
+ self,
+ api_key_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKey:
+ """
+ Retrieve details of a specific API key by its ID.
+
+ Args: api_key_id: The ID of the API key to retrieve.
+
+ Returns: ApiKey: The response containing the API key details.
+
+ Args:
+ api_key_id: The ID of the API key to retrieve
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not api_key_id:
+ raise ValueError(f"Expected a non-empty value for `api_key_id` but received {api_key_id!r}")
+ return await self._get(
+ f"/v1/api-keys/{api_key_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKey,
+ )
+
+ def list(
+ self,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> AsyncPaginator[APIKey, AsyncLimitOffset[APIKey]]:
+ """
+ List all API keys for the authenticated user.
+
+ Args: pagination: The pagination options
+
+ Returns: A list of API keys belonging to the user.
+
+ Args:
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/v1/api-keys",
+ page=AsyncLimitOffset[APIKey],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ api_key_list_params.APIKeyListParams,
+ ),
+ ),
+ model=APIKey,
+ )
+
+ async def delete(
+ self,
+ api_key_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKeyDeleteResponse:
+ """
+ Delete a specific API key by its ID.
+
+ Args: api_key_id: The ID of the API key to delete.
+
+ Returns: ApiKeyDeleted: The response containing the details of the deleted API
+ key.
+
+ Args:
+ api_key_id: The ID of the API key to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not api_key_id:
+ raise ValueError(f"Expected a non-empty value for `api_key_id` but received {api_key_id!r}")
+ return await self._delete(
+ f"/v1/api-keys/{api_key_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKeyDeleteResponse,
+ )
+
+ async def reroll(
+ self,
+ api_key_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKeyCreated:
+ """
+ Reroll the secret for a specific API key by its ID.
+
+ This generates a new secret key, invalidating the old one.
+
+ Args: api_key_id: The ID of the API key to reroll.
+
+ Returns: ApiKeyCreated: The response containing the API key details with the new
+ secret key.
+
+ Args:
+ api_key_id: The ID of the API key to reroll
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not api_key_id:
+ raise ValueError(f"Expected a non-empty value for `api_key_id` but received {api_key_id!r}")
+ return await self._post(
+ f"/v1/api-keys/{api_key_id}/reroll",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKeyCreated,
+ )
+
+ async def revoke(
+ self,
+ api_key_id: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> APIKey:
+ """
+ Revoke a specific API key by its ID.
+
+ Args: api_key_id: The ID of the API key to revoke.
+
+ Returns: ApiKey: The response containing the details of the revoked API key.
+
+ Args:
+ api_key_id: The ID of the API key to revoke
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not api_key_id:
+ raise ValueError(f"Expected a non-empty value for `api_key_id` but received {api_key_id!r}")
+ return await self._post(
+ f"/v1/api-keys/{api_key_id}/revoke",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=APIKey,
+ )
+
+
+class APIKeysResourceWithRawResponse:
+ def __init__(self, api_keys: APIKeysResource) -> None:
+ self._api_keys = api_keys
+
+ self.create = to_raw_response_wrapper(
+ api_keys.create,
+ )
+ self.retrieve = to_raw_response_wrapper(
+ api_keys.retrieve,
+ )
+ self.list = to_raw_response_wrapper(
+ api_keys.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ api_keys.delete,
+ )
+ self.reroll = to_raw_response_wrapper(
+ api_keys.reroll,
+ )
+ self.revoke = to_raw_response_wrapper(
+ api_keys.revoke,
+ )
+
+
+class AsyncAPIKeysResourceWithRawResponse:
+ def __init__(self, api_keys: AsyncAPIKeysResource) -> None:
+ self._api_keys = api_keys
+
+ self.create = async_to_raw_response_wrapper(
+ api_keys.create,
+ )
+ self.retrieve = async_to_raw_response_wrapper(
+ api_keys.retrieve,
+ )
+ self.list = async_to_raw_response_wrapper(
+ api_keys.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ api_keys.delete,
+ )
+ self.reroll = async_to_raw_response_wrapper(
+ api_keys.reroll,
+ )
+ self.revoke = async_to_raw_response_wrapper(
+ api_keys.revoke,
+ )
+
+
+class APIKeysResourceWithStreamingResponse:
+ def __init__(self, api_keys: APIKeysResource) -> None:
+ self._api_keys = api_keys
+
+ self.create = to_streamed_response_wrapper(
+ api_keys.create,
+ )
+ self.retrieve = to_streamed_response_wrapper(
+ api_keys.retrieve,
+ )
+ self.list = to_streamed_response_wrapper(
+ api_keys.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ api_keys.delete,
+ )
+ self.reroll = to_streamed_response_wrapper(
+ api_keys.reroll,
+ )
+ self.revoke = to_streamed_response_wrapper(
+ api_keys.revoke,
+ )
+
+
+class AsyncAPIKeysResourceWithStreamingResponse:
+ def __init__(self, api_keys: AsyncAPIKeysResource) -> None:
+ self._api_keys = api_keys
+
+ self.create = async_to_streamed_response_wrapper(
+ api_keys.create,
+ )
+ self.retrieve = async_to_streamed_response_wrapper(
+ api_keys.retrieve,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ api_keys.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ api_keys.delete,
+ )
+ self.reroll = async_to_streamed_response_wrapper(
+ api_keys.reroll,
+ )
+ self.revoke = async_to_streamed_response_wrapper(
+ api_keys.revoke,
+ )
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index f05318ee..435ca0e1 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -19,11 +19,8 @@
from ...pagination import SyncLimitOffset, AsyncLimitOffset
from ..._base_client import AsyncPaginator, make_request_options
from ...types.data_sources import connector_list_params, connector_create_params, connector_update_params
-from ...types.data_sources.connector_list_response import ConnectorListResponse
-from ...types.data_sources.connector_create_response import ConnectorCreateResponse
+from ...types.data_sources.data_source_connector import DataSourceConnector
from ...types.data_sources.connector_delete_response import ConnectorDeleteResponse
-from ...types.data_sources.connector_update_response import ConnectorUpdateResponse
-from ...types.data_sources.connector_retrieve_response import ConnectorRetrieveResponse
__all__ = ["ConnectorsResource", "AsyncConnectorsResource"]
@@ -63,7 +60,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorCreateResponse:
+ ) -> DataSourceConnector:
"""
Create a new connector.
@@ -110,7 +107,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ConnectorCreateResponse,
+ cast_to=DataSourceConnector,
)
def retrieve(
@@ -124,7 +121,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorRetrieveResponse:
+ ) -> DataSourceConnector:
"""
Get a connector by ID.
@@ -155,7 +152,7 @@ def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ConnectorRetrieveResponse,
+ cast_to=DataSourceConnector,
)
def update(
@@ -173,7 +170,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorUpdateResponse:
+ ) -> DataSourceConnector:
"""
Update a connector.
@@ -222,7 +219,7 @@ def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ConnectorUpdateResponse,
+ cast_to=DataSourceConnector,
)
def list(
@@ -237,7 +234,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[ConnectorListResponse]:
+ ) -> SyncLimitOffset[DataSourceConnector]:
"""
Get all connectors for a data source.
@@ -265,7 +262,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
return self._get_api_list(
f"/v1/data_sources/{data_source_id}/connectors",
- page=SyncLimitOffset[ConnectorListResponse],
+ page=SyncLimitOffset[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -279,7 +276,7 @@ def list(
connector_list_params.ConnectorListParams,
),
),
- model=ConnectorListResponse,
+ model=DataSourceConnector,
)
def delete(
@@ -363,7 +360,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorCreateResponse:
+ ) -> DataSourceConnector:
"""
Create a new connector.
@@ -410,7 +407,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ConnectorCreateResponse,
+ cast_to=DataSourceConnector,
)
async def retrieve(
@@ -424,7 +421,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorRetrieveResponse:
+ ) -> DataSourceConnector:
"""
Get a connector by ID.
@@ -455,7 +452,7 @@ async def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ConnectorRetrieveResponse,
+ cast_to=DataSourceConnector,
)
async def update(
@@ -473,7 +470,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorUpdateResponse:
+ ) -> DataSourceConnector:
"""
Update a connector.
@@ -522,7 +519,7 @@ async def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=ConnectorUpdateResponse,
+ cast_to=DataSourceConnector,
)
def list(
@@ -537,7 +534,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[ConnectorListResponse, AsyncLimitOffset[ConnectorListResponse]]:
+ ) -> AsyncPaginator[DataSourceConnector, AsyncLimitOffset[DataSourceConnector]]:
"""
Get all connectors for a data source.
@@ -565,7 +562,7 @@ def list(
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
return self._get_api_list(
f"/v1/data_sources/{data_source_id}/connectors",
- page=AsyncLimitOffset[ConnectorListResponse],
+ page=AsyncLimitOffset[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -579,7 +576,7 @@ def list(
connector_list_params.ConnectorListParams,
),
),
- model=ConnectorListResponse,
+ model=DataSourceConnector,
)
async def delete(
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index e0a0d125..a579c6ac 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -3,11 +3,15 @@
from __future__ import annotations
from typing import Optional
-from typing_extensions import Literal
import httpx
-from ...types import data_source_list_params, data_source_create_params, data_source_update_params
+from ...types import (
+ DataSourceType,
+ data_source_list_params,
+ data_source_create_params,
+ data_source_update_params,
+)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
@@ -28,11 +32,10 @@
)
from ...pagination import SyncLimitOffset, AsyncLimitOffset
from ..._base_client import AsyncPaginator, make_request_options
-from ...types.data_source_list_response import DataSourceListResponse
-from ...types.data_source_create_response import DataSourceCreateResponse
+from ...types.data_source import DataSource
+from ...types.data_source_type import DataSourceType
from ...types.data_source_delete_response import DataSourceDeleteResponse
-from ...types.data_source_update_response import DataSourceUpdateResponse
-from ...types.data_source_retrieve_response import DataSourceRetrieveResponse
+from ...types.data_source_oauth2_params_param import DataSourceOauth2ParamsParam
__all__ = ["DataSourcesResource", "AsyncDataSourcesResource"]
@@ -64,17 +67,17 @@ def with_streaming_response(self) -> DataSourcesResourceWithStreamingResponse:
def create(
self,
*,
- type: Literal["notion", "linear"],
+ type: DataSourceType,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.AuthParams] | NotGiven = NOT_GIVEN,
+ auth_params: Optional[DataSourceOauth2ParamsParam] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceCreateResponse:
+ ) -> DataSource:
"""
Create a new data source.
@@ -113,7 +116,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DataSourceCreateResponse,
+ cast_to=DataSource,
)
def retrieve(
@@ -126,7 +129,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceRetrieveResponse:
+ ) -> DataSource:
"""
Get a data source by ID.
@@ -152,7 +155,7 @@ def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DataSourceRetrieveResponse,
+ cast_to=DataSource,
)
def update(
@@ -161,14 +164,14 @@ def update(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.AuthParams] | NotGiven = NOT_GIVEN,
+ auth_params: Optional[DataSourceOauth2ParamsParam] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceUpdateResponse:
+ ) -> DataSource:
"""Update a data source.
Args: data_source_id: The ID of the data source to update.
@@ -210,7 +213,7 @@ def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DataSourceUpdateResponse,
+ cast_to=DataSource,
)
def list(
@@ -224,7 +227,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[DataSourceListResponse]:
+ ) -> SyncLimitOffset[DataSource]:
"""
Get all data sources.
@@ -245,7 +248,7 @@ def list(
"""
return self._get_api_list(
"/v1/data_sources/",
- page=SyncLimitOffset[DataSourceListResponse],
+ page=SyncLimitOffset[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -259,7 +262,7 @@ def list(
data_source_list_params.DataSourceListParams,
),
),
- model=DataSourceListResponse,
+ model=DataSource,
)
def delete(
@@ -327,17 +330,17 @@ def with_streaming_response(self) -> AsyncDataSourcesResourceWithStreamingRespon
async def create(
self,
*,
- type: Literal["notion", "linear"],
+ type: DataSourceType,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.AuthParams] | NotGiven = NOT_GIVEN,
+ auth_params: Optional[DataSourceOauth2ParamsParam] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceCreateResponse:
+ ) -> DataSource:
"""
Create a new data source.
@@ -376,7 +379,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DataSourceCreateResponse,
+ cast_to=DataSource,
)
async def retrieve(
@@ -389,7 +392,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceRetrieveResponse:
+ ) -> DataSource:
"""
Get a data source by ID.
@@ -415,7 +418,7 @@ async def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DataSourceRetrieveResponse,
+ cast_to=DataSource,
)
async def update(
@@ -424,14 +427,14 @@ async def update(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.AuthParams] | NotGiven = NOT_GIVEN,
+ auth_params: Optional[DataSourceOauth2ParamsParam] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceUpdateResponse:
+ ) -> DataSource:
"""Update a data source.
Args: data_source_id: The ID of the data source to update.
@@ -473,7 +476,7 @@ async def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=DataSourceUpdateResponse,
+ cast_to=DataSource,
)
def list(
@@ -487,7 +490,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[DataSourceListResponse, AsyncLimitOffset[DataSourceListResponse]]:
+ ) -> AsyncPaginator[DataSource, AsyncLimitOffset[DataSource]]:
"""
Get all data sources.
@@ -508,7 +511,7 @@ def list(
"""
return self._get_api_list(
"/v1/data_sources/",
- page=AsyncLimitOffset[DataSourceListResponse],
+ page=AsyncLimitOffset[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -522,7 +525,7 @@ def list(
data_source_list_params.DataSourceListParams,
),
),
- model=DataSourceListResponse,
+ model=DataSource,
)
async def delete(
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index 72e10c5d..84d90cce 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -3,7 +3,6 @@
from __future__ import annotations
from typing import List, Union, Optional
-from typing_extensions import Literal
import httpx
@@ -19,6 +18,7 @@
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
+from ..types.encoding_format import EncodingFormat
from ..types.embedding_create_response import EmbeddingCreateResponse
__all__ = ["EmbeddingsResource", "AsyncEmbeddingsResource"]
@@ -52,11 +52,7 @@ def create(
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- | NotGiven = NOT_GIVEN,
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]] | 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,
@@ -142,11 +138,7 @@ async def create(
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
- | NotGiven = NOT_GIVEN,
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]] | 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/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index c512f2b2..2b31acd1 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -19,8 +19,11 @@
)
from ...pagination import SyncLimitOffset, AsyncLimitOffset
from ..._base_client import AsyncPaginator, make_request_options
-from ...types.parsing import job_list_params, job_create_params
+from ...types.parsing import ReturnFormat, ChunkingStrategy, job_list_params, job_create_params
from ...types.parsing.parsing_job import ParsingJob
+from ...types.parsing.element_type import ElementType
+from ...types.parsing.return_format import ReturnFormat
+from ...types.parsing.chunking_strategy import ChunkingStrategy
from ...types.parsing.job_list_response import JobListResponse
from ...types.parsing.job_delete_response import JobDeleteResponse
@@ -51,26 +54,9 @@ def create(
self,
*,
file_id: str,
- element_types: Optional[
- List[
- Literal[
- "caption",
- "footnote",
- "formula",
- "list-item",
- "page-footer",
- "page-header",
- "picture",
- "section-header",
- "table",
- "text",
- "title",
- ]
- ]
- ]
- | NotGiven = NOT_GIVEN,
- chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN,
- return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN,
+ element_types: Optional[List[ElementType]] | NotGiven = NOT_GIVEN,
+ chunking_strategy: ChunkingStrategy | NotGiven = NOT_GIVEN,
+ return_format: ReturnFormat | NotGiven = NOT_GIVEN,
mode: Literal["fast", "high_quality"] | 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.
@@ -317,26 +303,9 @@ async def create(
self,
*,
file_id: str,
- element_types: Optional[
- List[
- Literal[
- "caption",
- "footnote",
- "formula",
- "list-item",
- "page-footer",
- "page-header",
- "picture",
- "section-header",
- "table",
- "text",
- "title",
- ]
- ]
- ]
- | NotGiven = NOT_GIVEN,
- chunking_strategy: Literal["page"] | NotGiven = NOT_GIVEN,
- return_format: Literal["html", "markdown", "plain"] | NotGiven = NOT_GIVEN,
+ element_types: Optional[List[ElementType]] | NotGiven = NOT_GIVEN,
+ chunking_strategy: ChunkingStrategy | NotGiven = NOT_GIVEN,
+ return_format: ReturnFormat | NotGiven = NOT_GIVEN,
mode: Literal["fast", "high_quality"] | 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.
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 31efbe4f..e7310fd0 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -3,38 +3,46 @@
from __future__ import annotations
from .shared import Usage as Usage, SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
+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
from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
+from .api_key_created import APIKeyCreated as APIKeyCreated
+from .encoding_format import EncodingFormat as EncodingFormat
from .rerank_response import RerankResponse as RerankResponse
+from .data_source_type import DataSourceType as DataSourceType
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
from .file_update_params import FileUpdateParams as FileUpdateParams
+from .api_key_list_params import APIKeyListParams as APIKeyListParams
from .client_embed_params import ClientEmbedParams as ClientEmbedParams
from .expires_after_param import ExpiresAfterParam as ExpiresAfterParam
from .client_rerank_params import ClientRerankParams as ClientRerankParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
+from .api_key_create_params import APIKeyCreateParams as APIKeyCreateParams
+from .pagination_with_total import PaginationWithTotal as PaginationWithTotal
+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 .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_list_response import DataSourceListResponse as DataSourceListResponse
+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_create_response import DataSourceCreateResponse as DataSourceCreateResponse
from .data_source_delete_response import DataSourceDeleteResponse as DataSourceDeleteResponse
-from .data_source_update_response import DataSourceUpdateResponse as DataSourceUpdateResponse
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
-from .data_source_retrieve_response import DataSourceRetrieveResponse as DataSourceRetrieveResponse
+from .data_source_oauth2_params_param import DataSourceOauth2ParamsParam as DataSourceOauth2ParamsParam
from .vector_store_file_search_options_param import (
VectorStoreFileSearchOptionsParam as VectorStoreFileSearchOptionsParam,
)
diff --git a/src/mixedbread/types/api_key.py b/src/mixedbread/types/api_key.py
new file mode 100644
index 00000000..15e7cbc2
--- /dev/null
+++ b/src/mixedbread/types/api_key.py
@@ -0,0 +1,35 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["APIKey"]
+
+
+class APIKey(BaseModel):
+ id: str
+ """The ID of the API key"""
+
+ name: str
+ """The name of the API key"""
+
+ redacted_value: str
+ """The redacted value of the API key"""
+
+ expires_at: Optional[datetime] = None
+ """The expiration datetime of the API key"""
+
+ created_at: datetime
+ """The creation datetime of the API key"""
+
+ updated_at: datetime
+ """The last update datetime of the API key"""
+
+ last_active_at: Optional[datetime] = None
+ """The last active datetime of the API key"""
+
+ object: Optional[Literal["api_key"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/api_key_create_params.py b/src/mixedbread/types/api_key_create_params.py
new file mode 100644
index 00000000..074ae0e0
--- /dev/null
+++ b/src/mixedbread/types/api_key_create_params.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from datetime import datetime
+from typing_extensions import Annotated, TypedDict
+
+from .._utils import PropertyInfo
+
+__all__ = ["APIKeyCreateParams"]
+
+
+class APIKeyCreateParams(TypedDict, total=False):
+ name: str
+ """A name/description for the API key"""
+
+ expires_at: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
+ """Optional expiration datetime"""
diff --git a/src/mixedbread/types/api_key_created.py b/src/mixedbread/types/api_key_created.py
new file mode 100644
index 00000000..052910e8
--- /dev/null
+++ b/src/mixedbread/types/api_key_created.py
@@ -0,0 +1,38 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["APIKeyCreated"]
+
+
+class APIKeyCreated(BaseModel):
+ id: str
+ """The ID of the API key"""
+
+ name: str
+ """The name of the API key"""
+
+ redacted_value: str
+ """The redacted value of the API key"""
+
+ expires_at: Optional[datetime] = None
+ """The expiration datetime of the API key"""
+
+ created_at: datetime
+ """The creation datetime of the API key"""
+
+ updated_at: datetime
+ """The last update datetime of the API key"""
+
+ last_active_at: Optional[datetime] = None
+ """The last active datetime of the API key"""
+
+ object: Optional[Literal["api_key"]] = None
+ """The type of the object"""
+
+ value: str
+ """The value of the API key"""
diff --git a/src/mixedbread/types/api_key_delete_response.py b/src/mixedbread/types/api_key_delete_response.py
new file mode 100644
index 00000000..e3fc0590
--- /dev/null
+++ b/src/mixedbread/types/api_key_delete_response.py
@@ -0,0 +1,19 @@
+# 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__ = ["APIKeyDeleteResponse"]
+
+
+class APIKeyDeleteResponse(BaseModel):
+ id: str
+ """The ID of the deleted API key"""
+
+ deleted: bool
+ """Whether the API key was deleted"""
+
+ object: Optional[Literal["api_key"]] = None
+ """The type of the object deleted"""
diff --git a/src/mixedbread/types/api_key_list_params.py b/src/mixedbread/types/api_key_list_params.py
new file mode 100644
index 00000000..748045a4
--- /dev/null
+++ b/src/mixedbread/types/api_key_list_params.py
@@ -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 TypedDict
+
+__all__ = ["APIKeyListParams"]
+
+
+class APIKeyListParams(TypedDict, total=False):
+ limit: int
+ """Maximum number of items to return per page"""
+
+ offset: int
+ """Offset of the first item to return"""
diff --git a/src/mixedbread/types/client_embed_params.py b/src/mixedbread/types/client_embed_params.py
index 3f27c1a3..9636bb6a 100644
--- a/src/mixedbread/types/client_embed_params.py
+++ b/src/mixedbread/types/client_embed_params.py
@@ -3,7 +3,9 @@
from __future__ import annotations
from typing import List, Union, Optional
-from typing_extensions import Literal, Required, TypedDict
+from typing_extensions import Required, TypedDict
+
+from .encoding_format import EncodingFormat
__all__ = ["ClientEmbedParams"]
@@ -24,10 +26,7 @@ class ClientEmbedParams(TypedDict, total=False):
normalized: bool
"""Whether to normalize the embeddings."""
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]]
"""The encoding format(s) of the embeddings.
Can be a single format or a list of formats.
diff --git a/src/mixedbread/types/data_source.py b/src/mixedbread/types/data_source.py
new file mode 100644
index 00000000..d02682e1
--- /dev/null
+++ b/src/mixedbread/types/data_source.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .data_source_type import DataSourceType
+from .data_source_oauth2_params import DataSourceOauth2Params
+
+__all__ = ["DataSource"]
+
+
+class DataSource(BaseModel):
+ id: str
+ """The ID of the data source"""
+
+ created_at: datetime
+ """The creation time of the data source"""
+
+ updated_at: datetime
+ """The last update time of the data source"""
+
+ type: DataSourceType
+ """The type of data source"""
+
+ name: str
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[DataSourceOauth2Params] = None
+ """Authentication parameters for a OAuth data source."""
+
+ object: Optional[Literal["data_source"]] = None
+ """The type of the object"""
diff --git a/src/mixedbread/types/data_source_create_params.py b/src/mixedbread/types/data_source_create_params.py
index 6483d336..af01ebdd 100644
--- a/src/mixedbread/types/data_source_create_params.py
+++ b/src/mixedbread/types/data_source_create_params.py
@@ -2,17 +2,17 @@
from __future__ import annotations
-from typing import Union, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypedDict
+from typing import Optional
+from typing_extensions import Required, TypedDict
-from .._utils import PropertyInfo
+from .data_source_type import DataSourceType
+from .data_source_oauth2_params_param import DataSourceOauth2ParamsParam
-__all__ = ["DataSourceCreateParams", "AuthParams"]
+__all__ = ["DataSourceCreateParams"]
class DataSourceCreateParams(TypedDict, total=False):
- type: Required[Literal["notion", "linear"]]
+ type: Required[DataSourceType]
"""The type of data source to create"""
name: Required[str]
@@ -21,36 +21,5 @@ class DataSourceCreateParams(TypedDict, total=False):
metadata: object
"""The metadata of the data source"""
- auth_params: Optional[AuthParams]
+ auth_params: Optional[DataSourceOauth2ParamsParam]
"""Authentication parameters for a OAuth data source."""
-
-
-class AuthParams(TypedDict, total=False):
- type: Literal["oauth2"]
-
- created_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
- """The timestamp when the OAuth2 credentials were created"""
-
- client_id: Required[str]
- """The OAuth2 client ID"""
-
- client_secret: Required[str]
- """The OAuth2 client secret"""
-
- redirect_uri: Required[str]
- """The OAuth2 redirect URI"""
-
- scope: Required[str]
- """The OAuth2 scope"""
-
- access_token: Optional[str]
- """The OAuth2 access token"""
-
- refresh_token: Optional[str]
- """The OAuth2 refresh token"""
-
- token_type: Optional[str]
- """The OAuth2 token type"""
-
- expires_on: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
- """The OAuth2 token expiration timestamp"""
diff --git a/src/mixedbread/types/data_source_create_response.py b/src/mixedbread/types/data_source_create_response.py
deleted file mode 100644
index c8ff098e..00000000
--- a/src/mixedbread/types/data_source_create_response.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["DataSourceCreateResponse", "AuthParams"]
-
-
-class AuthParams(BaseModel):
- type: Optional[Literal["oauth2"]] = None
-
- created_at: Optional[datetime] = None
- """The timestamp when the OAuth2 credentials were created"""
-
- client_id: str
- """The OAuth2 client ID"""
-
- client_secret: str
- """The OAuth2 client secret"""
-
- redirect_uri: str
- """The OAuth2 redirect URI"""
-
- scope: str
- """The OAuth2 scope"""
-
- access_token: Optional[str] = None
- """The OAuth2 access token"""
-
- refresh_token: Optional[str] = None
- """The OAuth2 refresh token"""
-
- token_type: Optional[str] = None
- """The OAuth2 token type"""
-
- expires_on: Optional[datetime] = None
- """The OAuth2 token expiration timestamp"""
-
-
-class DataSourceCreateResponse(BaseModel):
- id: str
- """The ID of the data source"""
-
- created_at: datetime
- """The creation time of the data source"""
-
- updated_at: datetime
- """The last update time of the data source"""
-
- type: Literal["notion", "linear"]
- """The type of data source"""
-
- name: str
- """The name of the data source"""
-
- metadata: object
- """The metadata of the data source"""
-
- auth_params: Optional[AuthParams] = None
- """Authentication parameters for a OAuth data source."""
-
- object: Optional[Literal["data_source"]] = None
- """The type of the object"""
diff --git a/src/mixedbread/types/data_source_list_response.py b/src/mixedbread/types/data_source_oauth2_params.py
similarity index 55%
rename from src/mixedbread/types/data_source_list_response.py
rename to src/mixedbread/types/data_source_oauth2_params.py
index afe40837..5cda3db5 100644
--- a/src/mixedbread/types/data_source_list_response.py
+++ b/src/mixedbread/types/data_source_oauth2_params.py
@@ -6,10 +6,10 @@
from .._models import BaseModel
-__all__ = ["DataSourceListResponse", "AuthParams"]
+__all__ = ["DataSourceOauth2Params"]
-class AuthParams(BaseModel):
+class DataSourceOauth2Params(BaseModel):
type: Optional[Literal["oauth2"]] = None
created_at: Optional[datetime] = None
@@ -38,29 +38,3 @@ class AuthParams(BaseModel):
expires_on: Optional[datetime] = None
"""The OAuth2 token expiration timestamp"""
-
-
-class DataSourceListResponse(BaseModel):
- id: str
- """The ID of the data source"""
-
- created_at: datetime
- """The creation time of the data source"""
-
- updated_at: datetime
- """The last update time of the data source"""
-
- type: Literal["notion", "linear"]
- """The type of data source"""
-
- name: str
- """The name of the data source"""
-
- metadata: object
- """The metadata of the data source"""
-
- auth_params: Optional[AuthParams] = None
- """Authentication parameters for a OAuth data source."""
-
- object: Optional[Literal["data_source"]] = None
- """The type of the object"""
diff --git a/src/mixedbread/types/data_source_oauth2_params_param.py b/src/mixedbread/types/data_source_oauth2_params_param.py
new file mode 100644
index 00000000..72ff4b56
--- /dev/null
+++ b/src/mixedbread/types/data_source_oauth2_params_param.py
@@ -0,0 +1,42 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Optional
+from datetime import datetime
+from typing_extensions import Literal, Required, Annotated, TypedDict
+
+from .._utils import PropertyInfo
+
+__all__ = ["DataSourceOauth2ParamsParam"]
+
+
+class DataSourceOauth2ParamsParam(TypedDict, total=False):
+ type: Literal["oauth2"]
+
+ created_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
+ """The timestamp when the OAuth2 credentials were created"""
+
+ client_id: Required[str]
+ """The OAuth2 client ID"""
+
+ client_secret: Required[str]
+ """The OAuth2 client secret"""
+
+ redirect_uri: Required[str]
+ """The OAuth2 redirect URI"""
+
+ scope: Required[str]
+ """The OAuth2 scope"""
+
+ access_token: Optional[str]
+ """The OAuth2 access token"""
+
+ refresh_token: Optional[str]
+ """The OAuth2 refresh token"""
+
+ token_type: Optional[str]
+ """The OAuth2 token type"""
+
+ expires_on: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
+ """The OAuth2 token expiration timestamp"""
diff --git a/src/mixedbread/types/data_source_retrieve_response.py b/src/mixedbread/types/data_source_retrieve_response.py
deleted file mode 100644
index e6eda38d..00000000
--- a/src/mixedbread/types/data_source_retrieve_response.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["DataSourceRetrieveResponse", "AuthParams"]
-
-
-class AuthParams(BaseModel):
- type: Optional[Literal["oauth2"]] = None
-
- created_at: Optional[datetime] = None
- """The timestamp when the OAuth2 credentials were created"""
-
- client_id: str
- """The OAuth2 client ID"""
-
- client_secret: str
- """The OAuth2 client secret"""
-
- redirect_uri: str
- """The OAuth2 redirect URI"""
-
- scope: str
- """The OAuth2 scope"""
-
- access_token: Optional[str] = None
- """The OAuth2 access token"""
-
- refresh_token: Optional[str] = None
- """The OAuth2 refresh token"""
-
- token_type: Optional[str] = None
- """The OAuth2 token type"""
-
- expires_on: Optional[datetime] = None
- """The OAuth2 token expiration timestamp"""
-
-
-class DataSourceRetrieveResponse(BaseModel):
- id: str
- """The ID of the data source"""
-
- created_at: datetime
- """The creation time of the data source"""
-
- updated_at: datetime
- """The last update time of the data source"""
-
- type: Literal["notion", "linear"]
- """The type of data source"""
-
- name: str
- """The name of the data source"""
-
- metadata: object
- """The metadata of the data source"""
-
- auth_params: Optional[AuthParams] = None
- """Authentication parameters for a OAuth data source."""
-
- object: Optional[Literal["data_source"]] = None
- """The type of the object"""
diff --git a/src/mixedbread/types/data_source_type.py b/src/mixedbread/types/data_source_type.py
new file mode 100644
index 00000000..0851808b
--- /dev/null
+++ b/src/mixedbread/types/data_source_type.py
@@ -0,0 +1,7 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["DataSourceType"]
+
+DataSourceType: TypeAlias = Literal["notion", "linear"]
diff --git a/src/mixedbread/types/data_source_update_params.py b/src/mixedbread/types/data_source_update_params.py
index d5bc1c00..609704a0 100644
--- a/src/mixedbread/types/data_source_update_params.py
+++ b/src/mixedbread/types/data_source_update_params.py
@@ -2,13 +2,12 @@
from __future__ import annotations
-from typing import Union, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypedDict
+from typing import Optional
+from typing_extensions import TypedDict
-from .._utils import PropertyInfo
+from .data_source_oauth2_params_param import DataSourceOauth2ParamsParam
-__all__ = ["DataSourceUpdateParams", "AuthParams"]
+__all__ = ["DataSourceUpdateParams"]
class DataSourceUpdateParams(TypedDict, total=False):
@@ -18,36 +17,5 @@ class DataSourceUpdateParams(TypedDict, total=False):
metadata: object
"""The metadata of the data source"""
- auth_params: Optional[AuthParams]
+ auth_params: Optional[DataSourceOauth2ParamsParam]
"""Authentication parameters for a OAuth data source."""
-
-
-class AuthParams(TypedDict, total=False):
- type: Literal["oauth2"]
-
- created_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
- """The timestamp when the OAuth2 credentials were created"""
-
- client_id: Required[str]
- """The OAuth2 client ID"""
-
- client_secret: Required[str]
- """The OAuth2 client secret"""
-
- redirect_uri: Required[str]
- """The OAuth2 redirect URI"""
-
- scope: Required[str]
- """The OAuth2 scope"""
-
- access_token: Optional[str]
- """The OAuth2 access token"""
-
- refresh_token: Optional[str]
- """The OAuth2 refresh token"""
-
- token_type: Optional[str]
- """The OAuth2 token type"""
-
- expires_on: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
- """The OAuth2 token expiration timestamp"""
diff --git a/src/mixedbread/types/data_source_update_response.py b/src/mixedbread/types/data_source_update_response.py
deleted file mode 100644
index 8820151e..00000000
--- a/src/mixedbread/types/data_source_update_response.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["DataSourceUpdateResponse", "AuthParams"]
-
-
-class AuthParams(BaseModel):
- type: Optional[Literal["oauth2"]] = None
-
- created_at: Optional[datetime] = None
- """The timestamp when the OAuth2 credentials were created"""
-
- client_id: str
- """The OAuth2 client ID"""
-
- client_secret: str
- """The OAuth2 client secret"""
-
- redirect_uri: str
- """The OAuth2 redirect URI"""
-
- scope: str
- """The OAuth2 scope"""
-
- access_token: Optional[str] = None
- """The OAuth2 access token"""
-
- refresh_token: Optional[str] = None
- """The OAuth2 refresh token"""
-
- token_type: Optional[str] = None
- """The OAuth2 token type"""
-
- expires_on: Optional[datetime] = None
- """The OAuth2 token expiration timestamp"""
-
-
-class DataSourceUpdateResponse(BaseModel):
- id: str
- """The ID of the data source"""
-
- created_at: datetime
- """The creation time of the data source"""
-
- updated_at: datetime
- """The last update time of the data source"""
-
- type: Literal["notion", "linear"]
- """The type of data source"""
-
- name: str
- """The name of the data source"""
-
- metadata: object
- """The metadata of the data source"""
-
- auth_params: Optional[AuthParams] = None
- """Authentication parameters for a OAuth data source."""
-
- object: Optional[Literal["data_source"]] = None
- """The type of the object"""
diff --git a/src/mixedbread/types/data_sources/__init__.py b/src/mixedbread/types/data_sources/__init__.py
index e02119c0..c35b6f2e 100644
--- a/src/mixedbread/types/data_sources/__init__.py
+++ b/src/mixedbread/types/data_sources/__init__.py
@@ -3,10 +3,7 @@
from __future__ import annotations
from .connector_list_params import ConnectorListParams as ConnectorListParams
+from .data_source_connector import DataSourceConnector as DataSourceConnector
from .connector_create_params import ConnectorCreateParams as ConnectorCreateParams
-from .connector_list_response import ConnectorListResponse as ConnectorListResponse
from .connector_update_params import ConnectorUpdateParams as ConnectorUpdateParams
-from .connector_create_response import ConnectorCreateResponse as ConnectorCreateResponse
from .connector_delete_response import ConnectorDeleteResponse as ConnectorDeleteResponse
-from .connector_update_response import ConnectorUpdateResponse as ConnectorUpdateResponse
-from .connector_retrieve_response import ConnectorRetrieveResponse as ConnectorRetrieveResponse
diff --git a/src/mixedbread/types/data_sources/connector_create_response.py b/src/mixedbread/types/data_sources/connector_create_response.py
deleted file mode 100644
index 583b3866..00000000
--- a/src/mixedbread/types/data_sources/connector_create_response.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-
-__all__ = ["ConnectorCreateResponse"]
-
-
-class ConnectorCreateResponse(BaseModel):
- id: str
- """The ID of the connector"""
-
- created_at: datetime
- """The creation time of the connector"""
-
- updated_at: datetime
- """The last update time of the connector"""
-
- vector_store_id: str
- """The ID of the vector store"""
-
- data_source_id: str
- """The ID of the data source"""
-
- name: Optional[str] = None
- """The name of the connector"""
-
- metadata: object
- """The metadata of the connector"""
-
- polling_interval: str
- """The polling interval of the connector"""
-
- started_at: Optional[datetime] = None
- """The start time of the connector"""
-
- finished_at: Optional[datetime] = None
- """The finish time of the connector"""
-
- last_synced_at: Optional[datetime] = None
- """The last sync time of the connector"""
-
- status: Literal["idle", "pending", "in_progress", "cancelled", "completed", "failed"]
- """The sync status of the connector"""
-
- error: Optional[str] = None
- """The sync error of the connector"""
-
- object: Optional[Literal["data_source.connector"]] = None
- """The type of the object"""
diff --git a/src/mixedbread/types/data_sources/connector_retrieve_response.py b/src/mixedbread/types/data_sources/connector_retrieve_response.py
deleted file mode 100644
index db2f80c5..00000000
--- a/src/mixedbread/types/data_sources/connector_retrieve_response.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-
-__all__ = ["ConnectorRetrieveResponse"]
-
-
-class ConnectorRetrieveResponse(BaseModel):
- id: str
- """The ID of the connector"""
-
- created_at: datetime
- """The creation time of the connector"""
-
- updated_at: datetime
- """The last update time of the connector"""
-
- vector_store_id: str
- """The ID of the vector store"""
-
- data_source_id: str
- """The ID of the data source"""
-
- name: Optional[str] = None
- """The name of the connector"""
-
- metadata: object
- """The metadata of the connector"""
-
- polling_interval: str
- """The polling interval of the connector"""
-
- started_at: Optional[datetime] = None
- """The start time of the connector"""
-
- finished_at: Optional[datetime] = None
- """The finish time of the connector"""
-
- last_synced_at: Optional[datetime] = None
- """The last sync time of the connector"""
-
- status: Literal["idle", "pending", "in_progress", "cancelled", "completed", "failed"]
- """The sync status of the connector"""
-
- error: Optional[str] = None
- """The sync error of the connector"""
-
- object: Optional[Literal["data_source.connector"]] = None
- """The type of the object"""
diff --git a/src/mixedbread/types/data_sources/connector_update_response.py b/src/mixedbread/types/data_sources/connector_update_response.py
deleted file mode 100644
index 4055a322..00000000
--- a/src/mixedbread/types/data_sources/connector_update_response.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-
-__all__ = ["ConnectorUpdateResponse"]
-
-
-class ConnectorUpdateResponse(BaseModel):
- id: str
- """The ID of the connector"""
-
- created_at: datetime
- """The creation time of the connector"""
-
- updated_at: datetime
- """The last update time of the connector"""
-
- vector_store_id: str
- """The ID of the vector store"""
-
- data_source_id: str
- """The ID of the data source"""
-
- name: Optional[str] = None
- """The name of the connector"""
-
- metadata: object
- """The metadata of the connector"""
-
- polling_interval: str
- """The polling interval of the connector"""
-
- started_at: Optional[datetime] = None
- """The start time of the connector"""
-
- finished_at: Optional[datetime] = None
- """The finish time of the connector"""
-
- last_synced_at: Optional[datetime] = None
- """The last sync time of the connector"""
-
- status: Literal["idle", "pending", "in_progress", "cancelled", "completed", "failed"]
- """The sync status of the connector"""
-
- error: Optional[str] = None
- """The sync error of the connector"""
-
- object: Optional[Literal["data_source.connector"]] = None
- """The type of the object"""
diff --git a/src/mixedbread/types/data_sources/connector_list_response.py b/src/mixedbread/types/data_sources/data_source_connector.py
similarity index 94%
rename from src/mixedbread/types/data_sources/connector_list_response.py
rename to src/mixedbread/types/data_sources/data_source_connector.py
index 4a508789..d4276970 100644
--- a/src/mixedbread/types/data_sources/connector_list_response.py
+++ b/src/mixedbread/types/data_sources/data_source_connector.py
@@ -6,10 +6,10 @@
from ..._models import BaseModel
-__all__ = ["ConnectorListResponse"]
+__all__ = ["DataSourceConnector"]
-class ConnectorListResponse(BaseModel):
+class DataSourceConnector(BaseModel):
id: str
"""The ID of the connector"""
diff --git a/src/mixedbread/types/embedding_create_params.py b/src/mixedbread/types/embedding_create_params.py
index 6c9b29f6..e78f3b9a 100644
--- a/src/mixedbread/types/embedding_create_params.py
+++ b/src/mixedbread/types/embedding_create_params.py
@@ -3,7 +3,9 @@
from __future__ import annotations
from typing import List, Union, Optional
-from typing_extensions import Literal, Required, TypedDict
+from typing_extensions import Required, TypedDict
+
+from .encoding_format import EncodingFormat
__all__ = ["EmbeddingCreateParams"]
@@ -24,10 +26,7 @@ class EmbeddingCreateParams(TypedDict, total=False):
normalized: bool
"""Whether to normalize the embeddings."""
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]]
"""The encoding format(s) of the embeddings.
Can be a single format or a list of formats.
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index 24f996e9..d7389135 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -1,11 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
-from typing_extensions import Literal
from .._models import BaseModel
from .embedding import Embedding
+from .object_type import ObjectType
from .shared.usage import Usage
+from .encoding_format import EncodingFormat
from .multi_encoding_embedding import MultiEncodingEmbedding
__all__ = ["EmbeddingCreateResponse"]
@@ -21,31 +22,13 @@ class EmbeddingCreateResponse(BaseModel):
data: Union[List[Embedding], List[MultiEncodingEmbedding]]
"""The created embeddings."""
- object: Optional[
- Literal[
- "list",
- "parsing_job",
- "extraction_job",
- "embedding",
- "embedding_dict",
- "rank_result",
- "file",
- "vector_store",
- "vector_store.file",
- "api_key",
- "data_source",
- "data_source.connector",
- ]
- ] = None
+ object: Optional[ObjectType] = None
"""The object type of the response"""
normalized: bool
"""Whether the embeddings are normalized."""
- encoding_format: Union[
- Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"],
- List[Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]],
- ]
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]]
"""The encoding formats of the embeddings."""
dimensions: Optional[int] = None
diff --git a/src/mixedbread/types/encoding_format.py b/src/mixedbread/types/encoding_format.py
new file mode 100644
index 00000000..74960945
--- /dev/null
+++ b/src/mixedbread/types/encoding_format.py
@@ -0,0 +1,7 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["EncodingFormat"]
+
+EncodingFormat: TypeAlias = Literal["float", "float16", "base64", "binary", "ubinary", "int8", "uint8"]
diff --git a/src/mixedbread/types/extractions/__init__.py b/src/mixedbread/types/extractions/__init__.py
index 6457c670..22892cfe 100644
--- a/src/mixedbread/types/extractions/__init__.py
+++ b/src/mixedbread/types/extractions/__init__.py
@@ -2,13 +2,17 @@
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
from .created_json_schema import CreatedJsonSchema as CreatedJsonSchema
from .enhanced_json_schema import EnhancedJsonSchema as EnhancedJsonSchema
from .schema_create_params import SchemaCreateParams as SchemaCreateParams
from .content_create_params import ContentCreateParams as ContentCreateParams
+from .image_url_input_param import ImageURLInputParam as ImageURLInputParam
from .schema_enhance_params import SchemaEnhanceParams as SchemaEnhanceParams
from .validated_json_schema import ValidatedJsonSchema as ValidatedJsonSchema
from .schema_validate_params import SchemaValidateParams as SchemaValidateParams
diff --git a/src/mixedbread/types/extractions/content_create_params.py b/src/mixedbread/types/extractions/content_create_params.py
index 4e3d3ef9..713deb65 100644
--- a/src/mixedbread/types/extractions/content_create_params.py
+++ b/src/mixedbread/types/extractions/content_create_params.py
@@ -3,15 +3,12 @@
from __future__ import annotations
from typing import Dict, List, Union, Iterable, Optional
-from typing_extensions import Literal, Required, TypeAlias, TypedDict
+from typing_extensions import Required, TypeAlias, TypedDict
-__all__ = [
- "ContentCreateParams",
- "ContentUnionMember2",
- "ContentUnionMember2TextInput",
- "ContentUnionMember2ImageURLInput",
- "ContentUnionMember2ImageURLInputImageURL",
-]
+from .text_input_param import TextInputParam
+from .image_url_input_param import ImageURLInputParam
+
+__all__ = ["ContentCreateParams", "ContentUnionMember2"]
class ContentCreateParams(TypedDict, total=False):
@@ -25,25 +22,4 @@ class ContentCreateParams(TypedDict, total=False):
"""Additional instructions for the extraction"""
-class ContentUnionMember2TextInput(TypedDict, total=False):
- type: Literal["text"]
- """Input type identifier"""
-
- text: Required[str]
- """Text content to process"""
-
-
-class ContentUnionMember2ImageURLInputImageURL(TypedDict, total=False):
- url: Required[str]
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class ContentUnionMember2ImageURLInput(TypedDict, total=False):
- type: Literal["image_url"]
- """Input type identifier"""
-
- image_url: Required[ContentUnionMember2ImageURLInputImageURL]
- """The image input specification."""
-
-
-ContentUnionMember2: TypeAlias = Union[ContentUnionMember2TextInput, ContentUnionMember2ImageURLInput]
+ContentUnionMember2: TypeAlias = Union[TextInputParam, ImageURLInputParam]
diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py
index d6430d4b..9c6114e3 100644
--- a/src/mixedbread/types/extractions/extraction_job.py
+++ b/src/mixedbread/types/extractions/extraction_job.py
@@ -2,10 +2,10 @@
from typing import Dict, Optional
from datetime import datetime
-from typing_extensions import Literal
from ..._models import BaseModel
from .extraction_result import ExtractionResult
+from ..parsing.parsing_job_status import ParsingJobStatus
__all__ = ["ExtractionJob"]
@@ -32,7 +32,7 @@ class ExtractionJob(BaseModel):
finished_at: Optional[datetime] = None
"""When the job finished processing"""
- status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
+ status: ParsingJobStatus
"""Current status of the job"""
result: Optional[ExtractionResult] = None
diff --git a/src/mixedbread/types/extractions/image_url_input.py b/src/mixedbread/types/extractions/image_url_input.py
new file mode 100644
index 00000000..90392503
--- /dev/null
+++ b/src/mixedbread/types/extractions/image_url_input.py
@@ -0,0 +1,21 @@
+# 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/image_url_input_param.py b/src/mixedbread/types/extractions/image_url_input_param.py
new file mode 100644
index 00000000..6c361176
--- /dev/null
+++ b/src/mixedbread/types/extractions/image_url_input_param.py
@@ -0,0 +1,20 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ImageURLInputParam", "ImageURL"]
+
+
+class ImageURL(TypedDict, total=False):
+ url: Required[str]
+ """The image URL. Can be either a URL or a Data URI."""
+
+
+class ImageURLInputParam(TypedDict, total=False):
+ type: Literal["image_url"]
+ """Input type identifier"""
+
+ image_url: Required[ImageURL]
+ """The image input specification."""
diff --git a/src/mixedbread/types/extractions/text_input.py b/src/mixedbread/types/extractions/text_input.py
new file mode 100644
index 00000000..dde3cee0
--- /dev/null
+++ b/src/mixedbread/types/extractions/text_input.py
@@ -0,0 +1,16 @@
+# 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/extractions/text_input_param.py b/src/mixedbread/types/extractions/text_input_param.py
new file mode 100644
index 00000000..d8829079
--- /dev/null
+++ b/src/mixedbread/types/extractions/text_input_param.py
@@ -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 Literal, Required, TypedDict
+
+__all__ = ["TextInputParam"]
+
+
+class TextInputParam(TypedDict, total=False):
+ type: Literal["text"]
+ """Input type identifier"""
+
+ text: Required[str]
+ """Text content to process"""
diff --git a/src/mixedbread/types/object_type.py b/src/mixedbread/types/object_type.py
new file mode 100644
index 00000000..aecff986
--- /dev/null
+++ b/src/mixedbread/types/object_type.py
@@ -0,0 +1,20 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["ObjectType"]
+
+ObjectType: TypeAlias = Literal[
+ "list",
+ "parsing_job",
+ "extraction_job",
+ "embedding",
+ "embedding_dict",
+ "rank_result",
+ "file",
+ "vector_store",
+ "vector_store.file",
+ "api_key",
+ "data_source",
+ "data_source.connector",
+]
diff --git a/src/mixedbread/types/pagination_with_total.py b/src/mixedbread/types/pagination_with_total.py
new file mode 100644
index 00000000..2e6bd456
--- /dev/null
+++ b/src/mixedbread/types/pagination_with_total.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+
+from .._models import BaseModel
+
+__all__ = ["PaginationWithTotal"]
+
+
+class PaginationWithTotal(BaseModel):
+ limit: Optional[int] = None
+ """Maximum number of items to return per page"""
+
+ offset: Optional[int] = None
+ """Offset of the first item to return"""
+
+ total: Optional[int] = None
+ """Total number of items available"""
diff --git a/src/mixedbread/types/parsing/__init__.py b/src/mixedbread/types/parsing/__init__.py
index da250167..d3e38bbe 100644
--- a/src/mixedbread/types/parsing/__init__.py
+++ b/src/mixedbread/types/parsing/__init__.py
@@ -3,7 +3,11 @@
from __future__ import annotations
from .parsing_job import ParsingJob as ParsingJob
+from .element_type import ElementType as ElementType
+from .return_format import ReturnFormat as ReturnFormat
from .job_list_params import JobListParams as JobListParams
+from .chunking_strategy import ChunkingStrategy as ChunkingStrategy
from .job_create_params import JobCreateParams as JobCreateParams
from .job_list_response import JobListResponse as JobListResponse
+from .parsing_job_status import ParsingJobStatus as ParsingJobStatus
from .job_delete_response import JobDeleteResponse as JobDeleteResponse
diff --git a/src/mixedbread/types/parsing/chunking_strategy.py b/src/mixedbread/types/parsing/chunking_strategy.py
new file mode 100644
index 00000000..7848a25f
--- /dev/null
+++ b/src/mixedbread/types/parsing/chunking_strategy.py
@@ -0,0 +1,7 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["ChunkingStrategy"]
+
+ChunkingStrategy: TypeAlias = Literal["page"]
diff --git a/src/mixedbread/types/parsing/element_type.py b/src/mixedbread/types/parsing/element_type.py
new file mode 100644
index 00000000..011208d8
--- /dev/null
+++ b/src/mixedbread/types/parsing/element_type.py
@@ -0,0 +1,19 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["ElementType"]
+
+ElementType: TypeAlias = Literal[
+ "caption",
+ "footnote",
+ "formula",
+ "list-item",
+ "page-footer",
+ "page-header",
+ "picture",
+ "section-header",
+ "table",
+ "text",
+ "title",
+]
diff --git a/src/mixedbread/types/parsing/job_create_params.py b/src/mixedbread/types/parsing/job_create_params.py
index a8e25307..7f624260 100644
--- a/src/mixedbread/types/parsing/job_create_params.py
+++ b/src/mixedbread/types/parsing/job_create_params.py
@@ -5,6 +5,10 @@
from typing import List, Optional
from typing_extensions import Literal, Required, TypedDict
+from .element_type import ElementType
+from .return_format import ReturnFormat
+from .chunking_strategy import ChunkingStrategy
+
__all__ = ["JobCreateParams"]
@@ -12,29 +16,13 @@ class JobCreateParams(TypedDict, total=False):
file_id: Required[str]
"""The ID of the file to parse"""
- element_types: Optional[
- List[
- Literal[
- "caption",
- "footnote",
- "formula",
- "list-item",
- "page-footer",
- "page-header",
- "picture",
- "section-header",
- "table",
- "text",
- "title",
- ]
- ]
- ]
+ element_types: Optional[List[ElementType]]
"""The elements to extract from the document"""
- chunking_strategy: Literal["page"]
+ chunking_strategy: ChunkingStrategy
"""The strategy to use for chunking the content"""
- return_format: Literal["html", "markdown", "plain"]
+ return_format: ReturnFormat
"""The format of the returned content"""
mode: Literal["fast", "high_quality"]
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index c9136d2f..509d1620 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -5,6 +5,7 @@
from typing_extensions import Literal
from ..._models import BaseModel
+from .parsing_job_status import ParsingJobStatus
__all__ = ["JobListResponse"]
@@ -16,7 +17,7 @@ class JobListResponse(BaseModel):
file_id: str
"""The ID of the file to parse"""
- status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
+ status: ParsingJobStatus
"""The status of the job"""
started_at: Optional[datetime] = None
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index 959a7ef8..026f0d7d 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -5,24 +5,16 @@
from typing_extensions import Literal
from ..._models import BaseModel
+from .element_type import ElementType
+from .return_format import ReturnFormat
+from .chunking_strategy import ChunkingStrategy
+from .parsing_job_status import ParsingJobStatus
__all__ = ["ParsingJob", "Result", "ResultChunk", "ResultChunkElement"]
class ResultChunkElement(BaseModel):
- type: Literal[
- "caption",
- "footnote",
- "formula",
- "list-item",
- "page-footer",
- "page-header",
- "picture",
- "section-header",
- "table",
- "text",
- "title",
- ]
+ type: ElementType
"""The type of the extracted element"""
confidence: float
@@ -53,27 +45,13 @@ class ResultChunk(BaseModel):
class Result(BaseModel):
- chunking_strategy: Literal["page"]
+ chunking_strategy: ChunkingStrategy
"""The strategy used for chunking the document"""
- return_format: Literal["html", "markdown", "plain"]
+ return_format: ReturnFormat
"""The format of the returned content"""
- element_types: List[
- Literal[
- "caption",
- "footnote",
- "formula",
- "list-item",
- "page-footer",
- "page-header",
- "picture",
- "section-header",
- "table",
- "text",
- "title",
- ]
- ]
+ element_types: List[ElementType]
"""The types of elements extracted"""
chunks: List[ResultChunk]
@@ -90,7 +68,7 @@ class ParsingJob(BaseModel):
file_id: str
"""The ID of the file to parse"""
- status: Literal["pending", "in_progress", "cancelled", "completed", "failed"]
+ status: ParsingJobStatus
"""The status of the job"""
error: Optional[object] = None
diff --git a/src/mixedbread/types/parsing/parsing_job_status.py b/src/mixedbread/types/parsing/parsing_job_status.py
new file mode 100644
index 00000000..03e03a48
--- /dev/null
+++ b/src/mixedbread/types/parsing/parsing_job_status.py
@@ -0,0 +1,7 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["ParsingJobStatus"]
+
+ParsingJobStatus: TypeAlias = Literal["pending", "in_progress", "cancelled", "completed", "failed"]
diff --git a/src/mixedbread/types/parsing/return_format.py b/src/mixedbread/types/parsing/return_format.py
new file mode 100644
index 00000000..2b080722
--- /dev/null
+++ b/src/mixedbread/types/parsing/return_format.py
@@ -0,0 +1,7 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["ReturnFormat"]
+
+ReturnFormat: TypeAlias = Literal["html", "markdown", "plain"]
diff --git a/src/mixedbread/types/rerank_response.py b/src/mixedbread/types/rerank_response.py
index ef0d117d..af6d5ff2 100644
--- a/src/mixedbread/types/rerank_response.py
+++ b/src/mixedbread/types/rerank_response.py
@@ -4,6 +4,7 @@
from typing_extensions import Literal
from .._models import BaseModel
+from .object_type import ObjectType
from .shared.usage import Usage
__all__ = ["RerankResponse", "Data"]
@@ -33,22 +34,7 @@ class RerankResponse(BaseModel):
data: List[Data]
"""The ranked documents."""
- object: Optional[
- Literal[
- "list",
- "parsing_job",
- "extraction_job",
- "embedding",
- "embedding_dict",
- "rank_result",
- "file",
- "vector_store",
- "vector_store.file",
- "api_key",
- "data_source",
- "data_source.connector",
- ]
- ] = None
+ object: Optional[ObjectType] = None
"""The object type of the response"""
top_k: int
diff --git a/src/mixedbread/types/scored_vector_store_chunk.py b/src/mixedbread/types/scored_vector_store_chunk.py
index 87276ad7..98516a61 100644
--- a/src/mixedbread/types/scored_vector_store_chunk.py
+++ b/src/mixedbread/types/scored_vector_store_chunk.py
@@ -1,35 +1,15 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Dict, Union, Optional
-from typing_extensions import Literal, TypeAlias
+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", "ValueImageURLInput", "ValueImageURLInputImageURL", "ValueTextInput"]
+__all__ = ["ScoredVectorStoreChunk", "Value"]
-
-class ValueImageURLInputImageURL(BaseModel):
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class ValueImageURLInput(BaseModel):
- type: Optional[Literal["image_url"]] = None
- """Input type identifier"""
-
- image_url: ValueImageURLInputImageURL
- """The image input specification."""
-
-
-class ValueTextInput(BaseModel):
- type: Optional[Literal["text"]] = None
- """Input type identifier"""
-
- text: str
- """Text content to process"""
-
-
-Value: TypeAlias = Union[str, ValueImageURLInput, ValueTextInput, Dict[str, object], None]
+Value: TypeAlias = Union[str, ImageURLInput, TextInput, Dict[str, object], None]
class ScoredVectorStoreChunk(BaseModel):
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index f18a20d8..f25e9ce0 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -11,11 +11,8 @@
from tests.utils import assert_matches_type
from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
from mixedbread.types.data_sources import (
- ConnectorListResponse,
- ConnectorCreateResponse,
+ DataSourceConnector,
ConnectorDeleteResponse,
- ConnectorUpdateResponse,
- ConnectorRetrieveResponse,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -30,7 +27,7 @@ def test_method_create(self, client: Mixedbread) -> None:
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
vector_store_id="vector_store_id",
)
- assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
@@ -42,7 +39,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
metadata={},
polling_interval="polling_interval",
)
- assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
def test_raw_response_create(self, client: Mixedbread) -> None:
@@ -54,7 +51,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Mixedbread) -> None:
@@ -66,7 +63,7 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -84,7 +81,7 @@ def test_method_retrieve(self, client: Mixedbread) -> None:
connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
def test_raw_response_retrieve(self, client: Mixedbread) -> None:
@@ -96,7 +93,7 @@ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
@@ -108,7 +105,7 @@ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -132,7 +129,7 @@ def test_method_update(self, client: Mixedbread) -> None:
connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
def test_method_update_with_all_params(self, client: Mixedbread) -> None:
@@ -144,7 +141,7 @@ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
trigger_sync=True,
polling_interval="polling_interval",
)
- assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
def test_raw_response_update(self, client: Mixedbread) -> None:
@@ -156,7 +153,7 @@ def test_raw_response_update(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Mixedbread) -> None:
@@ -168,7 +165,7 @@ def test_streaming_response_update(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -191,7 +188,7 @@ def test_method_list(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(SyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+ assert_matches_type(SyncLimitOffset[DataSourceConnector], connector, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -200,7 +197,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
limit=1000,
offset=0,
)
- assert_matches_type(SyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+ assert_matches_type(SyncLimitOffset[DataSourceConnector], connector, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -211,7 +208,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(SyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+ assert_matches_type(SyncLimitOffset[DataSourceConnector], connector, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -222,7 +219,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(SyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+ assert_matches_type(SyncLimitOffset[DataSourceConnector], connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -291,7 +288,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
vector_store_id="vector_store_id",
)
- assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -303,7 +300,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
metadata={},
polling_interval="polling_interval",
)
- assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -315,7 +312,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -327,7 +324,7 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorCreateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -345,7 +342,7 @@ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
@@ -357,7 +354,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> Non
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
@@ -369,7 +366,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread)
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorRetrieveResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -393,7 +390,7 @@ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
connector_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -405,7 +402,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread
trigger_sync=True,
polling_interval="polling_interval",
)
- assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
@@ -417,7 +414,7 @@ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
@@ -429,7 +426,7 @@ async def test_streaming_response_update(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorUpdateResponse, connector, path=["response"])
+ assert_matches_type(DataSourceConnector, connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -452,7 +449,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(AsyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+ assert_matches_type(AsyncLimitOffset[DataSourceConnector], connector, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -461,7 +458,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
limit=1000,
offset=0,
)
- assert_matches_type(AsyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+ assert_matches_type(AsyncLimitOffset[DataSourceConnector], connector, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -472,7 +469,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(AsyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+ assert_matches_type(AsyncLimitOffset[DataSourceConnector], connector, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -483,7 +480,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(AsyncLimitOffset[ConnectorListResponse], connector, path=["response"])
+ assert_matches_type(AsyncLimitOffset[DataSourceConnector], connector, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index a82ef6a0..6ddcf2da 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -10,7 +10,11 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
-from mixedbread.types.parsing import ParsingJob, JobListResponse, JobDeleteResponse
+from mixedbread.types.parsing import (
+ ParsingJob,
+ JobListResponse,
+ JobDeleteResponse,
+)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
diff --git a/tests/api_resources/test_api_keys.py b/tests/api_resources/test_api_keys.py
new file mode 100644
index 00000000..531fadfe
--- /dev/null
+++ b/tests/api_resources/test_api_keys.py
@@ -0,0 +1,460 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types import APIKey, APIKeyCreated, APIKeyDeleteResponse
+from mixedbread._utils import parse_datetime
+from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestAPIKeys:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ api_key = client.api_keys.create()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
+ api_key = client.api_keys.create(
+ name="name",
+ expires_at=parse_datetime("2019-12-27T18:11:19.117Z"),
+ )
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.api_keys.with_raw_response.create()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = response.parse()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.api_keys.with_streaming_response.create() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = response.parse()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ api_key = client.api_keys.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
+ response = client.api_keys.with_raw_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = response.parse()
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.api_keys.with_streaming_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = response.parse()
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_id` but received ''"):
+ client.api_keys.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ api_key = client.api_keys.list()
+ assert_matches_type(SyncLimitOffset[APIKey], api_key, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
+ api_key = client.api_keys.list(
+ limit=1000,
+ offset=0,
+ )
+ assert_matches_type(SyncLimitOffset[APIKey], api_key, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Mixedbread) -> None:
+ response = client.api_keys.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = response.parse()
+ assert_matches_type(SyncLimitOffset[APIKey], api_key, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Mixedbread) -> None:
+ with client.api_keys.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = response.parse()
+ assert_matches_type(SyncLimitOffset[APIKey], api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_delete(self, client: Mixedbread) -> None:
+ api_key = client.api_keys.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"])
+
+ @parametrize
+ def test_raw_response_delete(self, client: Mixedbread) -> None:
+ response = client.api_keys.with_raw_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = response.parse()
+ assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"])
+
+ @parametrize
+ def test_streaming_response_delete(self, client: Mixedbread) -> None:
+ with client.api_keys.with_streaming_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = response.parse()
+ assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_delete(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_id` but received ''"):
+ client.api_keys.with_raw_response.delete(
+ "",
+ )
+
+ @parametrize
+ def test_method_reroll(self, client: Mixedbread) -> None:
+ api_key = client.api_keys.reroll(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ def test_raw_response_reroll(self, client: Mixedbread) -> None:
+ response = client.api_keys.with_raw_response.reroll(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = response.parse()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ def test_streaming_response_reroll(self, client: Mixedbread) -> None:
+ with client.api_keys.with_streaming_response.reroll(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = response.parse()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_reroll(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_id` but received ''"):
+ client.api_keys.with_raw_response.reroll(
+ "",
+ )
+
+ @parametrize
+ def test_method_revoke(self, client: Mixedbread) -> None:
+ api_key = client.api_keys.revoke(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ @parametrize
+ def test_raw_response_revoke(self, client: Mixedbread) -> None:
+ response = client.api_keys.with_raw_response.revoke(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = response.parse()
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ @parametrize
+ def test_streaming_response_revoke(self, client: Mixedbread) -> None:
+ with client.api_keys.with_streaming_response.revoke(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = response.parse()
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_revoke(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_id` but received ''"):
+ client.api_keys.with_raw_response.revoke(
+ "",
+ )
+
+
+class TestAsyncAPIKeys:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ api_key = await async_client.api_keys.create()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ api_key = await async_client.api_keys.create(
+ name="name",
+ expires_at=parse_datetime("2019-12-27T18:11:19.117Z"),
+ )
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.api_keys.with_raw_response.create()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = await response.parse()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.api_keys.with_streaming_response.create() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = await response.parse()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
+ api_key = await async_client.api_keys.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.api_keys.with_raw_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = await response.parse()
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.api_keys.with_streaming_response.retrieve(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = await response.parse()
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_id` but received ''"):
+ await async_client.api_keys.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ api_key = await async_client.api_keys.list()
+ assert_matches_type(AsyncLimitOffset[APIKey], api_key, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ api_key = await async_client.api_keys.list(
+ limit=1000,
+ offset=0,
+ )
+ assert_matches_type(AsyncLimitOffset[APIKey], api_key, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.api_keys.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = await response.parse()
+ assert_matches_type(AsyncLimitOffset[APIKey], api_key, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.api_keys.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = await response.parse()
+ assert_matches_type(AsyncLimitOffset[APIKey], api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
+ api_key = await async_client.api_keys.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"])
+
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.api_keys.with_raw_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = await response.parse()
+ assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.api_keys.with_streaming_response.delete(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = await response.parse()
+ assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_id` but received ''"):
+ await async_client.api_keys.with_raw_response.delete(
+ "",
+ )
+
+ @parametrize
+ async def test_method_reroll(self, async_client: AsyncMixedbread) -> None:
+ api_key = await async_client.api_keys.reroll(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ async def test_raw_response_reroll(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.api_keys.with_raw_response.reroll(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = await response.parse()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_reroll(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.api_keys.with_streaming_response.reroll(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = await response.parse()
+ assert_matches_type(APIKeyCreated, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_reroll(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_id` but received ''"):
+ await async_client.api_keys.with_raw_response.reroll(
+ "",
+ )
+
+ @parametrize
+ async def test_method_revoke(self, async_client: AsyncMixedbread) -> None:
+ api_key = await async_client.api_keys.revoke(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ @parametrize
+ async def test_raw_response_revoke(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.api_keys.with_raw_response.revoke(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ api_key = await response.parse()
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_revoke(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.api_keys.with_streaming_response.revoke(
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ api_key = await response.parse()
+ assert_matches_type(APIKey, api_key, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_revoke(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_id` but received ''"):
+ await async_client.api_keys.with_raw_response.revoke(
+ "",
+ )
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index 4d9ea104..be95dcb7 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -10,11 +10,8 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
from mixedbread.types import (
- DataSourceListResponse,
- DataSourceCreateResponse,
+ DataSource,
DataSourceDeleteResponse,
- DataSourceUpdateResponse,
- DataSourceRetrieveResponse,
)
from mixedbread._utils import parse_datetime
from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
@@ -31,7 +28,7 @@ def test_method_create(self, client: Mixedbread) -> None:
type="notion",
name="name",
)
- assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
@@ -52,7 +49,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
"expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
},
)
- assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
def test_raw_response_create(self, client: Mixedbread) -> None:
@@ -64,7 +61,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Mixedbread) -> None:
@@ -76,7 +73,7 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -85,7 +82,7 @@ def test_method_retrieve(self, client: Mixedbread) -> None:
data_source = client.data_sources.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
def test_raw_response_retrieve(self, client: Mixedbread) -> None:
@@ -96,7 +93,7 @@ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
@@ -107,7 +104,7 @@ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -123,7 +120,7 @@ def test_method_update(self, client: Mixedbread) -> None:
data_source = client.data_sources.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
def test_method_update_with_all_params(self, client: Mixedbread) -> None:
@@ -144,7 +141,7 @@ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
"expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
},
)
- assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
def test_raw_response_update(self, client: Mixedbread) -> None:
@@ -155,7 +152,7 @@ def test_raw_response_update(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Mixedbread) -> None:
@@ -166,7 +163,7 @@ def test_streaming_response_update(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -180,7 +177,7 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
data_source = client.data_sources.list()
- assert_matches_type(SyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+ assert_matches_type(SyncLimitOffset[DataSource], data_source, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -188,7 +185,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
limit=1000,
offset=0,
)
- assert_matches_type(SyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+ assert_matches_type(SyncLimitOffset[DataSource], data_source, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -197,7 +194,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(SyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+ assert_matches_type(SyncLimitOffset[DataSource], data_source, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -206,7 +203,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(SyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+ assert_matches_type(SyncLimitOffset[DataSource], data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -258,7 +255,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
type="notion",
name="name",
)
- assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -279,7 +276,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
"expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
},
)
- assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -291,7 +288,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -303,7 +300,7 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceCreateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -312,7 +309,7 @@ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
@@ -323,7 +320,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> Non
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
@@ -334,7 +331,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread)
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceRetrieveResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -350,7 +347,7 @@ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -371,7 +368,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread
"expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
},
)
- assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
@@ -382,7 +379,7 @@ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
@@ -393,7 +390,7 @@ async def test_streaming_response_update(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"])
+ assert_matches_type(DataSource, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -407,7 +404,7 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.list()
- assert_matches_type(AsyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+ assert_matches_type(AsyncLimitOffset[DataSource], data_source, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -415,7 +412,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
limit=1000,
offset=0,
)
- assert_matches_type(AsyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+ assert_matches_type(AsyncLimitOffset[DataSource], data_source, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -424,7 +421,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(AsyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+ assert_matches_type(AsyncLimitOffset[DataSource], data_source, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -433,7 +430,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(AsyncLimitOffset[DataSourceListResponse], data_source, path=["response"])
+ assert_matches_type(AsyncLimitOffset[DataSource], data_source, path=["response"])
assert cast(Any, response.is_closed) is True
From 50a6fac0089c6e2e7fea1638d7a59309ef2bb77b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 26 May 2025 12:32:44 +0000
Subject: [PATCH 144/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index cce92405..da59f99e 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.3.1"
+ ".": "0.4.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 91395731..1b83a9b4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.3.1"
+version = "0.4.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 7e6e8c04..57b9c213 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.3.1" # x-release-please-version
+__version__ = "0.4.0" # x-release-please-version
From 58c8828e21c9cf6505c8690dc9981d9d44f82203 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 26 May 2025 12:40:08 +0000
Subject: [PATCH 145/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 5 +-
src/mixedbread/types/__init__.py | 5 +-
src/mixedbread/types/extractions/__init__.py | 2 -
.../types/extractions/image_url_input.py | 21 --------
.../types/extractions/text_input.py | 16 ------
src/mixedbread/types/rerank_response.py | 3 +-
.../types/scored_audio_url_input_chunk.py | 51 +++++++++++++++++++
.../types/scored_image_url_input_chunk.py | 51 +++++++++++++++++++
.../types/scored_text_input_chunk.py | 40 +++++++++++++++
.../types/scored_vector_store_chunk.py | 38 --------------
.../types/scored_video_url_input_chunk.py | 51 +++++++++++++++++++
.../vector_store_question_answering_params.py | 3 ++
...ector_store_question_answering_response.py | 18 +++++--
.../types/vector_store_search_response.py | 19 +++++--
.../vector_stores/scored_vector_store_file.py | 19 +++++--
tests/api_resources/test_vector_stores.py | 14 +++--
17 files changed, 259 insertions(+), 101 deletions(-)
delete mode 100644 src/mixedbread/types/extractions/image_url_input.py
delete mode 100644 src/mixedbread/types/extractions/text_input.py
create mode 100644 src/mixedbread/types/scored_audio_url_input_chunk.py
create mode 100644 src/mixedbread/types/scored_image_url_input_chunk.py
create mode 100644 src/mixedbread/types/scored_text_input_chunk.py
delete mode 100644 src/mixedbread/types/scored_vector_store_chunk.py
create mode 100644 src/mixedbread/types/scored_video_url_input_chunk.py
diff --git a/.stats.yml b/.stats.yml
index 78883d24..217fbbbc 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: c148e761adac63c2bc1f5f2acfedcb24
diff --git a/api.md b/api.md
index 52d628b1..a4b6ba19 100644
--- a/api.md
+++ b/api.md
@@ -32,7 +32,10 @@ Types:
from mixedbread.types import (
ExpiresAfter,
FileCounts,
- ScoredVectorStoreChunk,
+ ScoredAudioURLInputChunk,
+ ScoredImageURLInputChunk,
+ ScoredTextInputChunk,
+ ScoredVideoURLInputChunk,
VectorStore,
VectorStoreChunkSearchOptions,
VectorStoreFileSearchOptions,
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index e7310fd0..8fd7bc6b 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -29,17 +29,20 @@
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
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/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_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/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"])
From 7091994781c3bf07afb21e0a16fe646a3078bfda Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 26 May 2025 12:41:06 +0000
Subject: [PATCH 146/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
api.md | 20 +--
.../resources/vector_stores/files.py | 5 +-
.../resources/vector_stores/vector_stores.py | 59 ++++----
src/mixedbread/types/__init__.py | 17 +--
src/mixedbread/types/expires_after.py | 16 --
src/mixedbread/types/expires_after_param.py | 15 --
src/mixedbread/types/file_counts.py | 24 ---
.../types/scored_audio_url_input_chunk.py | 51 -------
.../types/scored_image_url_input_chunk.py | 51 -------
.../types/scored_text_input_chunk.py | 40 -----
...vector_store_chunk_search_options_param.py | 18 ---
.../types/vector_store_create_params.py | 16 +-
.../types/vector_store_create_response.py | 75 ++++++++++
.../vector_store_file_search_options_param.py | 24 ---
...store.py => vector_store_list_response.py} | 31 +++-
.../vector_store_question_answering_params.py | 16 +-
...ector_store_question_answering_response.py | 141 +++++++++++++++++-
.../types/vector_store_retrieve_response.py | 75 ++++++++++
.../types/vector_store_search_params.py | 17 ++-
.../types/vector_store_search_response.py | 136 ++++++++++++++++-
.../types/vector_store_update_params.py | 16 +-
.../types/vector_store_update_response.py | 75 ++++++++++
.../types/vector_stores/file_search_params.py | 23 ++-
.../vector_stores/scored_vector_store_file.py | 139 ++++++++++++++++-
tests/api_resources/test_vector_stores.py | 65 ++++----
26 files changed, 800 insertions(+), 367 deletions(-)
delete mode 100644 src/mixedbread/types/expires_after.py
delete mode 100644 src/mixedbread/types/expires_after_param.py
delete mode 100644 src/mixedbread/types/file_counts.py
delete mode 100644 src/mixedbread/types/scored_audio_url_input_chunk.py
delete mode 100644 src/mixedbread/types/scored_image_url_input_chunk.py
delete mode 100644 src/mixedbread/types/scored_text_input_chunk.py
delete mode 100644 src/mixedbread/types/vector_store_chunk_search_options_param.py
create mode 100644 src/mixedbread/types/vector_store_create_response.py
delete mode 100644 src/mixedbread/types/vector_store_file_search_options_param.py
rename src/mixedbread/types/{vector_store.py => vector_store_list_response.py} (64%)
create mode 100644 src/mixedbread/types/vector_store_retrieve_response.py
create mode 100644 src/mixedbread/types/vector_store_update_response.py
diff --git a/.stats.yml b/.stats.yml
index 217fbbbc..d7063b0f 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: 07482ed86f5ccf7b480c514d6d5ebb15
-config_hash: c148e761adac63c2bc1f5f2acfedcb24
+config_hash: a3a88b6c5d74153fc5e19da6d8509bf7
diff --git a/api.md b/api.md
index a4b6ba19..23c225b0 100644
--- a/api.md
+++ b/api.md
@@ -30,15 +30,11 @@ Types:
```python
from mixedbread.types import (
- ExpiresAfter,
- FileCounts,
- ScoredAudioURLInputChunk,
- ScoredImageURLInputChunk,
- ScoredTextInputChunk,
ScoredVideoURLInputChunk,
- VectorStore,
- VectorStoreChunkSearchOptions,
- VectorStoreFileSearchOptions,
+ VectorStoreCreateResponse,
+ VectorStoreRetrieveResponse,
+ VectorStoreUpdateResponse,
+ VectorStoreListResponse,
VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
@@ -47,10 +43,10 @@ from mixedbread.types import (
Methods:
-- client.vector_stores.create(\*\*params) -> VectorStore
-- client.vector_stores.retrieve(vector_store_id) -> VectorStore
-- client.vector_stores.update(vector_store_id, \*\*params) -> VectorStore
-- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStore]
+- client.vector_stores.create(\*\*params) -> VectorStoreCreateResponse
+- client.vector_stores.retrieve(vector_store_id) -> VectorStoreRetrieveResponse
+- client.vector_stores.update(vector_store_id, \*\*params) -> VectorStoreUpdateResponse
+- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStoreListResponse]
- client.vector_stores.delete(vector_store_id) -> VectorStoreDeleteResponse
- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 526a2903..f0e77c8d 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -22,7 +22,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"]
@@ -257,7 +256,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,
@@ -551,7 +550,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/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 18b25941..9ca63f0d 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -33,11 +33,12 @@
)
from ...pagination import SyncLimitOffset, AsyncLimitOffset
from ..._base_client import AsyncPaginator, make_request_options
-from ...types.vector_store import VectorStore
-from ...types.expires_after_param import ExpiresAfterParam
+from ...types.vector_store_list_response import VectorStoreListResponse
+from ...types.vector_store_create_response import VectorStoreCreateResponse
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
-from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
+from ...types.vector_store_update_response import VectorStoreUpdateResponse
+from ...types.vector_store_retrieve_response import VectorStoreRetrieveResponse
from ...types.vector_store_question_answering_response import VectorStoreQuestionAnsweringResponse
__all__ = ["VectorStoresResource", "AsyncVectorStoresResource"]
@@ -72,7 +73,7 @@ def create(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[vector_store_create_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -81,7 +82,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
+ ) -> VectorStoreCreateResponse:
"""
Create a new vector store.
@@ -124,7 +125,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStore,
+ cast_to=VectorStoreCreateResponse,
)
def retrieve(
@@ -137,7 +138,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
+ ) -> VectorStoreRetrieveResponse:
"""
Get a vector store by ID.
@@ -163,7 +164,7 @@ def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStore,
+ cast_to=VectorStoreRetrieveResponse,
)
def update(
@@ -172,7 +173,7 @@ def update(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[vector_store_update_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -180,7 +181,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
+ ) -> VectorStoreUpdateResponse:
"""
Update a vector store by ID.
@@ -225,7 +226,7 @@ def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStore,
+ cast_to=VectorStoreUpdateResponse,
)
def list(
@@ -239,7 +240,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[VectorStore]:
+ ) -> SyncLimitOffset[VectorStoreListResponse]:
"""
List all vector stores.
@@ -262,7 +263,7 @@ def list(
"""
return self._get_api_list(
"/v1/vector_stores",
- page=SyncLimitOffset[VectorStore],
+ page=SyncLimitOffset[VectorStoreListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -276,7 +277,7 @@ def list(
vector_store_list_params.VectorStoreListParams,
),
),
- model=VectorStore,
+ model=VectorStoreListResponse,
)
def delete(
@@ -325,7 +326,7 @@ def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -390,7 +391,7 @@ def search(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: vector_store_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,
@@ -482,7 +483,7 @@ async def create(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[vector_store_create_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -491,7 +492,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
+ ) -> VectorStoreCreateResponse:
"""
Create a new vector store.
@@ -534,7 +535,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStore,
+ cast_to=VectorStoreCreateResponse,
)
async def retrieve(
@@ -547,7 +548,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
+ ) -> VectorStoreRetrieveResponse:
"""
Get a vector store by ID.
@@ -573,7 +574,7 @@ async def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStore,
+ cast_to=VectorStoreRetrieveResponse,
)
async def update(
@@ -582,7 +583,7 @@ async def update(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[vector_store_update_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -590,7 +591,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
+ ) -> VectorStoreUpdateResponse:
"""
Update a vector store by ID.
@@ -635,7 +636,7 @@ async def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStore,
+ cast_to=VectorStoreUpdateResponse,
)
def list(
@@ -649,7 +650,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[VectorStore, AsyncLimitOffset[VectorStore]]:
+ ) -> AsyncPaginator[VectorStoreListResponse, AsyncLimitOffset[VectorStoreListResponse]]:
"""
List all vector stores.
@@ -672,7 +673,7 @@ def list(
"""
return self._get_api_list(
"/v1/vector_stores",
- page=AsyncLimitOffset[VectorStore],
+ page=AsyncLimitOffset[VectorStoreListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -686,7 +687,7 @@ def list(
vector_store_list_params.VectorStoreListParams,
),
),
- model=VectorStore,
+ model=VectorStoreListResponse,
)
async def delete(
@@ -735,7 +736,7 @@ async def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -800,7 +801,7 @@ async def search(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
+ search_options: vector_store_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 8fd7bc6b..d38a6b06 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -6,11 +6,8 @@
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
-from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
from .api_key_created import APIKeyCreated as APIKeyCreated
from .encoding_format import EncodingFormat as EncodingFormat
@@ -21,7 +18,6 @@
from .file_update_params import FileUpdateParams as FileUpdateParams
from .api_key_list_params import APIKeyListParams as APIKeyListParams
from .client_embed_params import ClientEmbedParams as ClientEmbedParams
-from .expires_after_param import ExpiresAfterParam as ExpiresAfterParam
from .client_rerank_params import ClientRerankParams as ClientRerankParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .api_key_create_params import APIKeyCreateParams as APIKeyCreateParams
@@ -29,7 +25,6 @@
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
@@ -37,24 +32,20 @@
from .data_source_update_params import DataSourceUpdateParams as DataSourceUpdateParams
from .embedding_create_response import EmbeddingCreateResponse as EmbeddingCreateResponse
from .vector_store_create_params import VectorStoreCreateParams as VectorStoreCreateParams
+from .vector_store_list_response import VectorStoreListResponse as VectorStoreListResponse
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_create_response import VectorStoreCreateResponse as VectorStoreCreateResponse
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
+from .vector_store_update_response import VectorStoreUpdateResponse as VectorStoreUpdateResponse
+from .vector_store_retrieve_response import VectorStoreRetrieveResponse as VectorStoreRetrieveResponse
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,
)
-from .vector_store_chunk_search_options_param import (
- VectorStoreChunkSearchOptionsParam as VectorStoreChunkSearchOptionsParam,
-)
from .vector_store_question_answering_response import (
VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
)
diff --git a/src/mixedbread/types/expires_after.py b/src/mixedbread/types/expires_after.py
deleted file mode 100644
index 8550ad0a..00000000
--- a/src/mixedbread/types/expires_after.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__ = ["ExpiresAfter"]
-
-
-class ExpiresAfter(BaseModel):
- anchor: Optional[Literal["last_active_at"]] = None
- """Anchor date for the expiration policy"""
-
- days: Optional[int] = None
- """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/expires_after_param.py b/src/mixedbread/types/expires_after_param.py
deleted file mode 100644
index e7b4bee0..00000000
--- a/src/mixedbread/types/expires_after_param.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Literal, TypedDict
-
-__all__ = ["ExpiresAfterParam"]
-
-
-class ExpiresAfterParam(TypedDict, total=False):
- anchor: Literal["last_active_at"]
- """Anchor date for the expiration policy"""
-
- days: int
- """Number of days after which the vector store expires"""
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/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
deleted file mode 100644
index b514f1bd..00000000
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ /dev/null
@@ -1,51 +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__ = ["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
deleted file mode 100644
index ec6ba9dd..00000000
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ /dev/null
@@ -1,51 +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__ = ["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
deleted file mode 100644
index 42870062..00000000
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ /dev/null
@@ -1,40 +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__ = ["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/vector_store_chunk_search_options_param.py b/src/mixedbread/types/vector_store_chunk_search_options_param.py
deleted file mode 100644
index a2396bec..00000000
--- a/src/mixedbread/types/vector_store_chunk_search_options_param.py
+++ /dev/null
@@ -1,18 +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__ = ["VectorStoreChunkSearchOptionsParam"]
-
-
-class VectorStoreChunkSearchOptionsParam(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"""
diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py
index 3013c59c..31fc3526 100644
--- a/src/mixedbread/types/vector_store_create_params.py
+++ b/src/mixedbread/types/vector_store_create_params.py
@@ -3,11 +3,9 @@
from __future__ import annotations
from typing import List, Optional
-from typing_extensions import TypedDict
+from typing_extensions import Literal, TypedDict
-from .expires_after_param import ExpiresAfterParam
-
-__all__ = ["VectorStoreCreateParams"]
+__all__ = ["VectorStoreCreateParams", "ExpiresAfter"]
class VectorStoreCreateParams(TypedDict, total=False):
@@ -17,7 +15,7 @@ class VectorStoreCreateParams(TypedDict, total=False):
description: Optional[str]
"""Description of the vector store"""
- expires_after: Optional[ExpiresAfterParam]
+ expires_after: Optional[ExpiresAfter]
"""Represents an expiration policy for a vector store."""
metadata: object
@@ -25,3 +23,11 @@ class VectorStoreCreateParams(TypedDict, total=False):
file_ids: Optional[List[str]]
"""Optional list of file IDs"""
+
+
+class ExpiresAfter(TypedDict, total=False):
+ anchor: Literal["last_active_at"]
+ """Anchor date for the expiration policy"""
+
+ days: int
+ """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/vector_store_create_response.py b/src/mixedbread/types/vector_store_create_response.py
new file mode 100644
index 00000000..69946db2
--- /dev/null
+++ b/src/mixedbread/types/vector_store_create_response.py
@@ -0,0 +1,75 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["VectorStoreCreateResponse", "FileCounts", "ExpiresAfter"]
+
+
+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 ExpiresAfter(BaseModel):
+ anchor: Optional[Literal["last_active_at"]] = None
+ """Anchor date for the expiration policy"""
+
+ days: Optional[int] = None
+ """Number of days after which the vector store expires"""
+
+
+class VectorStoreCreateResponse(BaseModel):
+ id: str
+ """Unique identifier for the vector store"""
+
+ name: str
+ """Name of the vector store"""
+
+ description: Optional[str] = None
+ """Detailed description of the vector store's purpose and contents"""
+
+ metadata: Optional[object] = None
+ """Additional metadata associated with the vector store"""
+
+ file_counts: Optional[FileCounts] = None
+ """Counts of files in different states"""
+
+ expires_after: Optional[ExpiresAfter] = None
+ """Represents an expiration policy for a vector store."""
+
+ status: Optional[Literal["expired", "in_progress", "completed"]] = None
+ """Processing status of the vector store"""
+
+ created_at: datetime
+ """Timestamp when the vector store was created"""
+
+ updated_at: datetime
+ """Timestamp when the vector store was last updated"""
+
+ last_active_at: Optional[datetime] = None
+ """Timestamp when the vector store was last used"""
+
+ usage_bytes: Optional[int] = None
+ """Total storage usage in bytes"""
+
+ expires_at: Optional[datetime] = None
+ """Optional expiration timestamp for the vector store"""
+
+ object: Optional[Literal["vector_store"]] = None
+ """Type of the object"""
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.py b/src/mixedbread/types/vector_store_list_response.py
similarity index 64%
rename from src/mixedbread/types/vector_store.py
rename to src/mixedbread/types/vector_store_list_response.py
index b310d3e6..4d4b2ded 100644
--- a/src/mixedbread/types/vector_store.py
+++ b/src/mixedbread/types/vector_store_list_response.py
@@ -5,13 +5,36 @@
from typing_extensions import Literal
from .._models import BaseModel
-from .file_counts import FileCounts
-from .expires_after import ExpiresAfter
-__all__ = ["VectorStore"]
+__all__ = ["VectorStoreListResponse", "FileCounts", "ExpiresAfter"]
-class VectorStore(BaseModel):
+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 ExpiresAfter(BaseModel):
+ anchor: Optional[Literal["last_active_at"]] = None
+ """Anchor date for the expiration policy"""
+
+ days: Optional[int] = None
+ """Number of days after which the vector store expires"""
+
+
+class VectorStoreListResponse(BaseModel):
id: str
"""Unique identifier for the vector store"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index abb7919b..16083394 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -6,9 +6,8 @@
from typing_extensions import Required, TypeAlias, TypedDict
from .shared_params.search_filter_condition import SearchFilterCondition
-from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
+__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "SearchOptions", "QaOptions"]
class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
@@ -27,7 +26,7 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: VectorStoreChunkSearchOptionsParam
+ search_options: SearchOptions
"""Search configuration options"""
stream: bool
@@ -42,6 +41,17 @@ class VectorStoreQuestionAnsweringParams(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"""
+
+
class QaOptions(TypedDict, total=False):
cite: bool
"""Whether to use citations"""
diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py
index 2a477a87..71240d6f 100644
--- a/src/mixedbread/types/vector_store_question_answering_response.py
+++ b/src/mixedbread/types/vector_store_question_answering_response.py
@@ -1,19 +1,148 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
-from typing_extensions import Annotated, TypeAlias
+from typing_extensions import Literal, Annotated, TypeAlias
from .._utils import PropertyInfo
from .._models import BaseModel
-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", "Source"]
+__all__ = [
+ "VectorStoreQuestionAnsweringResponse",
+ "Source",
+ "SourceScoredTextInputChunk",
+ "SourceScoredImageURLInputChunk",
+ "SourceScoredImageURLInputChunkImageURL",
+ "SourceScoredAudioURLInputChunk",
+ "SourceScoredAudioURLInputChunkAudioURL",
+]
+
+
+class SourceScoredTextInputChunk(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"""
+
+
+class SourceScoredImageURLInputChunkImageURL(BaseModel):
+ url: str
+ """The image URL. Can be either a URL or a Data URI."""
+
+
+class SourceScoredImageURLInputChunk(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: SourceScoredImageURLInputChunkImageURL
+ """The image input specification."""
+
+ ocr_text: Optional[str] = None
+ """ocr text of the image"""
+
+ summary: Optional[str] = None
+ """summary of the image"""
+
+
+class SourceScoredAudioURLInputChunkAudioURL(BaseModel):
+ url: str
+ """The audio URL. Can be either a URL or a Data URI."""
+
+
+class SourceScoredAudioURLInputChunk(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: SourceScoredAudioURLInputChunkAudioURL
+ """The audio input specification."""
+
+ transcription: Optional[str] = None
+ """speech recognition (sr) text of the audio"""
+
+ summary: Optional[str] = None
+ """summary of the audio"""
+
Source: TypeAlias = Annotated[
- Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
+ Union[
+ SourceScoredTextInputChunk,
+ SourceScoredImageURLInputChunk,
+ SourceScoredAudioURLInputChunk,
+ ScoredVideoURLInputChunk,
+ ],
PropertyInfo(discriminator="type"),
]
diff --git a/src/mixedbread/types/vector_store_retrieve_response.py b/src/mixedbread/types/vector_store_retrieve_response.py
new file mode 100644
index 00000000..02cffa65
--- /dev/null
+++ b/src/mixedbread/types/vector_store_retrieve_response.py
@@ -0,0 +1,75 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["VectorStoreRetrieveResponse", "FileCounts", "ExpiresAfter"]
+
+
+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 ExpiresAfter(BaseModel):
+ anchor: Optional[Literal["last_active_at"]] = None
+ """Anchor date for the expiration policy"""
+
+ days: Optional[int] = None
+ """Number of days after which the vector store expires"""
+
+
+class VectorStoreRetrieveResponse(BaseModel):
+ id: str
+ """Unique identifier for the vector store"""
+
+ name: str
+ """Name of the vector store"""
+
+ description: Optional[str] = None
+ """Detailed description of the vector store's purpose and contents"""
+
+ metadata: Optional[object] = None
+ """Additional metadata associated with the vector store"""
+
+ file_counts: Optional[FileCounts] = None
+ """Counts of files in different states"""
+
+ expires_after: Optional[ExpiresAfter] = None
+ """Represents an expiration policy for a vector store."""
+
+ status: Optional[Literal["expired", "in_progress", "completed"]] = None
+ """Processing status of the vector store"""
+
+ created_at: datetime
+ """Timestamp when the vector store was created"""
+
+ updated_at: datetime
+ """Timestamp when the vector store was last updated"""
+
+ last_active_at: Optional[datetime] = None
+ """Timestamp when the vector store was last used"""
+
+ usage_bytes: Optional[int] = None
+ """Total storage usage in bytes"""
+
+ expires_at: Optional[datetime] = None
+ """Optional expiration timestamp for the vector store"""
+
+ object: Optional[Literal["vector_store"]] = None
+ """Type of the object"""
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index e0edc1bb..7a28385c 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_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_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
+__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions"]
class VectorStoreSearchParams(TypedDict, total=False):
@@ -24,7 +23,7 @@ class VectorStoreSearchParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: VectorStoreChunkSearchOptionsParam
+ search_options: SearchOptions
"""Search configuration options"""
@@ -32,4 +31,16 @@ class VectorStoreSearchParams(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"""
+
+
from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py
index 50143c9f..c1f8e788 100644
--- a/src/mixedbread/types/vector_store_search_response.py
+++ b/src/mixedbread/types/vector_store_search_response.py
@@ -5,15 +5,141 @@
from .._utils import PropertyInfo
from .._models import BaseModel
-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", "Data"]
+__all__ = [
+ "VectorStoreSearchResponse",
+ "Data",
+ "DataScoredTextInputChunk",
+ "DataScoredImageURLInputChunk",
+ "DataScoredImageURLInputChunkImageURL",
+ "DataScoredAudioURLInputChunk",
+ "DataScoredAudioURLInputChunkAudioURL",
+]
+
+
+class DataScoredTextInputChunk(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"""
+
+
+class DataScoredImageURLInputChunkImageURL(BaseModel):
+ url: str
+ """The image URL. Can be either a URL or a Data URI."""
+
+
+class DataScoredImageURLInputChunk(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: DataScoredImageURLInputChunkImageURL
+ """The image input specification."""
+
+ ocr_text: Optional[str] = None
+ """ocr text of the image"""
+
+ summary: Optional[str] = None
+ """summary of the image"""
+
+
+class DataScoredAudioURLInputChunkAudioURL(BaseModel):
+ url: str
+ """The audio URL. Can be either a URL or a Data URI."""
+
+
+class DataScoredAudioURLInputChunk(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: DataScoredAudioURLInputChunkAudioURL
+ """The audio input specification."""
+
+ transcription: Optional[str] = None
+ """speech recognition (sr) text of the audio"""
+
+ summary: Optional[str] = None
+ """summary of the audio"""
+
Data: TypeAlias = Annotated[
- Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
+ Union[
+ DataScoredTextInputChunk, DataScoredImageURLInputChunk, DataScoredAudioURLInputChunk, ScoredVideoURLInputChunk
+ ],
PropertyInfo(discriminator="type"),
]
diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py
index d8e6a83b..99c6a113 100644
--- a/src/mixedbread/types/vector_store_update_params.py
+++ b/src/mixedbread/types/vector_store_update_params.py
@@ -3,11 +3,9 @@
from __future__ import annotations
from typing import Optional
-from typing_extensions import TypedDict
+from typing_extensions import Literal, TypedDict
-from .expires_after_param import ExpiresAfterParam
-
-__all__ = ["VectorStoreUpdateParams"]
+__all__ = ["VectorStoreUpdateParams", "ExpiresAfter"]
class VectorStoreUpdateParams(TypedDict, total=False):
@@ -17,8 +15,16 @@ class VectorStoreUpdateParams(TypedDict, total=False):
description: Optional[str]
"""New description"""
- expires_after: Optional[ExpiresAfterParam]
+ expires_after: Optional[ExpiresAfter]
"""Represents an expiration policy for a vector store."""
metadata: object
"""Optional metadata key-value pairs"""
+
+
+class ExpiresAfter(TypedDict, total=False):
+ anchor: Literal["last_active_at"]
+ """Anchor date for the expiration policy"""
+
+ days: int
+ """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/vector_store_update_response.py b/src/mixedbread/types/vector_store_update_response.py
new file mode 100644
index 00000000..532d9082
--- /dev/null
+++ b/src/mixedbread/types/vector_store_update_response.py
@@ -0,0 +1,75 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+
+__all__ = ["VectorStoreUpdateResponse", "FileCounts", "ExpiresAfter"]
+
+
+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 ExpiresAfter(BaseModel):
+ anchor: Optional[Literal["last_active_at"]] = None
+ """Anchor date for the expiration policy"""
+
+ days: Optional[int] = None
+ """Number of days after which the vector store expires"""
+
+
+class VectorStoreUpdateResponse(BaseModel):
+ id: str
+ """Unique identifier for the vector store"""
+
+ name: str
+ """Name of the vector store"""
+
+ description: Optional[str] = None
+ """Detailed description of the vector store's purpose and contents"""
+
+ metadata: Optional[object] = None
+ """Additional metadata associated with the vector store"""
+
+ file_counts: Optional[FileCounts] = None
+ """Counts of files in different states"""
+
+ expires_after: Optional[ExpiresAfter] = None
+ """Represents an expiration policy for a vector store."""
+
+ status: Optional[Literal["expired", "in_progress", "completed"]] = None
+ """Processing status of the vector store"""
+
+ created_at: datetime
+ """Timestamp when the vector store was created"""
+
+ updated_at: datetime
+ """Timestamp when the vector store was last updated"""
+
+ last_active_at: Optional[datetime] = None
+ """Timestamp when the vector store was last used"""
+
+ usage_bytes: Optional[int] = None
+ """Total storage usage in bytes"""
+
+ expires_at: Optional[datetime] = None
+ """Optional expiration timestamp for the vector store"""
+
+ object: Optional[Literal["vector_store"]] = None
+ """Type of the object"""
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 7c702c1c..ee5a2db8 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -6,15 +6,144 @@
from ..._utils import PropertyInfo
from ..._models import BaseModel
-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", "Chunk"]
+__all__ = [
+ "ScoredVectorStoreFile",
+ "Chunk",
+ "ChunkScoredTextInputChunk",
+ "ChunkScoredImageURLInputChunk",
+ "ChunkScoredImageURLInputChunkImageURL",
+ "ChunkScoredAudioURLInputChunk",
+ "ChunkScoredAudioURLInputChunkAudioURL",
+]
+
+
+class ChunkScoredTextInputChunk(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"""
+
+
+class ChunkScoredImageURLInputChunkImageURL(BaseModel):
+ url: str
+ """The image URL. Can be either a URL or a Data URI."""
+
+
+class ChunkScoredImageURLInputChunk(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: ChunkScoredImageURLInputChunkImageURL
+ """The image input specification."""
+
+ ocr_text: Optional[str] = None
+ """ocr text of the image"""
+
+ summary: Optional[str] = None
+ """summary of the image"""
+
+
+class ChunkScoredAudioURLInputChunkAudioURL(BaseModel):
+ url: str
+ """The audio URL. Can be either a URL or a Data URI."""
+
+
+class ChunkScoredAudioURLInputChunk(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: ChunkScoredAudioURLInputChunkAudioURL
+ """The audio input specification."""
+
+ transcription: Optional[str] = None
+ """speech recognition (sr) text of the audio"""
+
+ summary: Optional[str] = None
+ """summary of the audio"""
+
Chunk: TypeAlias = Annotated[
- Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
+ Union[
+ ChunkScoredTextInputChunk,
+ ChunkScoredImageURLInputChunk,
+ ChunkScoredAudioURLInputChunk,
+ ScoredVideoURLInputChunk,
+ ],
PropertyInfo(discriminator="type"),
]
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 4cbe5b96..9c7c2941 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -10,9 +10,12 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
from mixedbread.types import (
- VectorStore,
+ VectorStoreListResponse,
+ VectorStoreCreateResponse,
VectorStoreDeleteResponse,
VectorStoreSearchResponse,
+ VectorStoreUpdateResponse,
+ VectorStoreRetrieveResponse,
VectorStoreQuestionAnsweringResponse,
)
from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
@@ -26,7 +29,7 @@ class TestVectorStores:
@parametrize
def test_method_create(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.create()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
@@ -40,7 +43,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
metadata={},
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_create(self, client: Mixedbread) -> None:
@@ -49,7 +52,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Mixedbread) -> None:
@@ -58,7 +61,7 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -67,7 +70,7 @@ def test_method_retrieve(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_retrieve(self, client: Mixedbread) -> None:
@@ -78,7 +81,7 @@ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
@parametrize
def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
@@ -89,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -105,7 +108,7 @@ def test_method_update(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.update(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
@parametrize
def test_method_update_with_all_params(self, client: Mixedbread) -> None:
@@ -119,7 +122,7 @@ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
},
metadata={},
)
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_update(self, client: Mixedbread) -> None:
@@ -130,7 +133,7 @@ def test_raw_response_update(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Mixedbread) -> None:
@@ -141,7 +144,7 @@ def test_streaming_response_update(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -155,7 +158,7 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list()
- assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -163,7 +166,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
limit=1000,
offset=0,
)
- assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -172,7 +175,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -181,7 +184,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -404,7 +407,7 @@ class TestAsyncVectorStores:
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.create()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -418,7 +421,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
metadata={},
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -427,7 +430,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -436,7 +439,7 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -445,7 +448,7 @@ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
@@ -456,7 +459,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> Non
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
@@ -467,7 +470,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread)
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -483,7 +486,7 @@ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.update(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -497,7 +500,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread
},
metadata={},
)
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
@@ -508,7 +511,7 @@ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
@@ -519,7 +522,7 @@ async def test_streaming_response_update(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -533,7 +536,7 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list()
- assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -541,7 +544,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
limit=1000,
offset=0,
)
- assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -550,7 +553,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -559,7 +562,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
From 15ce06352730fca623fce59e5e8fb7f34dc26b8e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 26 May 2025 12:41:26 +0000
Subject: [PATCH 147/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
api.md | 18 ++-
.../resources/vector_stores/vector_stores.py | 59 ++++----
src/mixedbread/types/__init__.py | 13 +-
src/mixedbread/types/expires_after.py | 16 ++
src/mixedbread/types/expires_after_param.py | 15 ++
.../types/scored_audio_url_input_chunk.py | 51 +++++++
.../types/scored_image_url_input_chunk.py | 51 +++++++
.../types/scored_text_input_chunk.py | 40 +++++
...store_list_response.py => vector_store.py} | 13 +-
...vector_store_chunk_search_options_param.py | 18 +++
.../types/vector_store_create_params.py | 16 +-
.../types/vector_store_create_response.py | 75 ----------
.../vector_store_question_answering_params.py | 16 +-
...ector_store_question_answering_response.py | 141 +-----------------
.../types/vector_store_retrieve_response.py | 75 ----------
.../types/vector_store_search_params.py | 17 +--
.../types/vector_store_search_response.py | 136 +----------------
.../types/vector_store_update_params.py | 16 +-
.../types/vector_store_update_response.py | 75 ----------
.../vector_stores/scored_vector_store_file.py | 139 +----------------
tests/api_resources/test_vector_stores.py | 65 ++++----
22 files changed, 306 insertions(+), 761 deletions(-)
create mode 100644 src/mixedbread/types/expires_after.py
create mode 100644 src/mixedbread/types/expires_after_param.py
create mode 100644 src/mixedbread/types/scored_audio_url_input_chunk.py
create mode 100644 src/mixedbread/types/scored_image_url_input_chunk.py
create mode 100644 src/mixedbread/types/scored_text_input_chunk.py
rename src/mixedbread/types/{vector_store_list_response.py => vector_store.py} (84%)
create mode 100644 src/mixedbread/types/vector_store_chunk_search_options_param.py
delete mode 100644 src/mixedbread/types/vector_store_create_response.py
delete mode 100644 src/mixedbread/types/vector_store_retrieve_response.py
delete mode 100644 src/mixedbread/types/vector_store_update_response.py
diff --git a/.stats.yml b/.stats.yml
index d7063b0f..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: 07482ed86f5ccf7b480c514d6d5ebb15
-config_hash: a3a88b6c5d74153fc5e19da6d8509bf7
+config_hash: 167171738605c297aa5e8bc73abc66e3
diff --git a/api.md b/api.md
index 23c225b0..ff98c770 100644
--- a/api.md
+++ b/api.md
@@ -30,11 +30,13 @@ Types:
```python
from mixedbread.types import (
+ ExpiresAfter,
+ ScoredAudioURLInputChunk,
+ ScoredImageURLInputChunk,
+ ScoredTextInputChunk,
ScoredVideoURLInputChunk,
- VectorStoreCreateResponse,
- VectorStoreRetrieveResponse,
- VectorStoreUpdateResponse,
- VectorStoreListResponse,
+ VectorStore,
+ VectorStoreChunkSearchOptions,
VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
@@ -43,10 +45,10 @@ from mixedbread.types import (
Methods:
-- client.vector_stores.create(\*\*params) -> VectorStoreCreateResponse
-- client.vector_stores.retrieve(vector_store_id) -> VectorStoreRetrieveResponse
-- client.vector_stores.update(vector_store_id, \*\*params) -> VectorStoreUpdateResponse
-- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStoreListResponse]
+- client.vector_stores.create(\*\*params) -> VectorStore
+- client.vector_stores.retrieve(vector_store_id) -> VectorStore
+- client.vector_stores.update(vector_store_id, \*\*params) -> VectorStore
+- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStore]
- client.vector_stores.delete(vector_store_id) -> VectorStoreDeleteResponse
- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 9ca63f0d..18b25941 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -33,12 +33,11 @@
)
from ...pagination import SyncLimitOffset, AsyncLimitOffset
from ..._base_client import AsyncPaginator, make_request_options
-from ...types.vector_store_list_response import VectorStoreListResponse
-from ...types.vector_store_create_response import VectorStoreCreateResponse
+from ...types.vector_store import VectorStore
+from ...types.expires_after_param import ExpiresAfterParam
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
-from ...types.vector_store_update_response import VectorStoreUpdateResponse
-from ...types.vector_store_retrieve_response import VectorStoreRetrieveResponse
+from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
from ...types.vector_store_question_answering_response import VectorStoreQuestionAnsweringResponse
__all__ = ["VectorStoresResource", "AsyncVectorStoresResource"]
@@ -73,7 +72,7 @@ def create(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[vector_store_create_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -82,7 +81,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreCreateResponse:
+ ) -> VectorStore:
"""
Create a new vector store.
@@ -125,7 +124,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreCreateResponse,
+ cast_to=VectorStore,
)
def retrieve(
@@ -138,7 +137,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreRetrieveResponse:
+ ) -> VectorStore:
"""
Get a vector store by ID.
@@ -164,7 +163,7 @@ def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreRetrieveResponse,
+ cast_to=VectorStore,
)
def update(
@@ -173,7 +172,7 @@ def update(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[vector_store_update_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -181,7 +180,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreUpdateResponse:
+ ) -> VectorStore:
"""
Update a vector store by ID.
@@ -226,7 +225,7 @@ def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreUpdateResponse,
+ cast_to=VectorStore,
)
def list(
@@ -240,7 +239,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[VectorStoreListResponse]:
+ ) -> SyncLimitOffset[VectorStore]:
"""
List all vector stores.
@@ -263,7 +262,7 @@ def list(
"""
return self._get_api_list(
"/v1/vector_stores",
- page=SyncLimitOffset[VectorStoreListResponse],
+ page=SyncLimitOffset[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -277,7 +276,7 @@ def list(
vector_store_list_params.VectorStoreListParams,
),
),
- model=VectorStoreListResponse,
+ model=VectorStore,
)
def delete(
@@ -326,7 +325,7 @@ def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -391,7 +390,7 @@ def search(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: vector_store_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreChunkSearchOptionsParam | 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,
@@ -483,7 +482,7 @@ async def create(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[vector_store_create_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -492,7 +491,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreCreateResponse:
+ ) -> VectorStore:
"""
Create a new vector store.
@@ -535,7 +534,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreCreateResponse,
+ cast_to=VectorStore,
)
async def retrieve(
@@ -548,7 +547,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreRetrieveResponse:
+ ) -> VectorStore:
"""
Get a vector store by ID.
@@ -574,7 +573,7 @@ async def retrieve(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreRetrieveResponse,
+ cast_to=VectorStore,
)
async def update(
@@ -583,7 +582,7 @@ async def update(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[vector_store_update_params.ExpiresAfter] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | 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.
@@ -591,7 +590,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreUpdateResponse:
+ ) -> VectorStore:
"""
Update a vector store by ID.
@@ -636,7 +635,7 @@ async def update(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=VectorStoreUpdateResponse,
+ cast_to=VectorStore,
)
def list(
@@ -650,7 +649,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[VectorStoreListResponse, AsyncLimitOffset[VectorStoreListResponse]]:
+ ) -> AsyncPaginator[VectorStore, AsyncLimitOffset[VectorStore]]:
"""
List all vector stores.
@@ -673,7 +672,7 @@ def list(
"""
return self._get_api_list(
"/v1/vector_stores",
- page=AsyncLimitOffset[VectorStoreListResponse],
+ page=AsyncLimitOffset[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -687,7 +686,7 @@ def list(
vector_store_list_params.VectorStoreListParams,
),
),
- model=VectorStoreListResponse,
+ model=VectorStore,
)
async def delete(
@@ -736,7 +735,7 @@ async def question_answering(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: vector_store_question_answering_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -801,7 +800,7 @@ async def search(
vector_store_ids: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- search_options: vector_store_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ search_options: VectorStoreChunkSearchOptionsParam | 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 d38a6b06..56f206a5 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -8,6 +8,8 @@
from .data_source import DataSource as DataSource
from .file_object import FileObject as FileObject
from .object_type import ObjectType as ObjectType
+from .vector_store import VectorStore as VectorStore
+from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
from .api_key_created import APIKeyCreated as APIKeyCreated
from .encoding_format import EncodingFormat as EncodingFormat
@@ -18,6 +20,7 @@
from .file_update_params import FileUpdateParams as FileUpdateParams
from .api_key_list_params import APIKeyListParams as APIKeyListParams
from .client_embed_params import ClientEmbedParams as ClientEmbedParams
+from .expires_after_param import ExpiresAfterParam as ExpiresAfterParam
from .client_rerank_params import ClientRerankParams as ClientRerankParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .api_key_create_params import APIKeyCreateParams as APIKeyCreateParams
@@ -25,6 +28,7 @@
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
@@ -32,20 +36,21 @@
from .data_source_update_params import DataSourceUpdateParams as DataSourceUpdateParams
from .embedding_create_response import EmbeddingCreateResponse as EmbeddingCreateResponse
from .vector_store_create_params import VectorStoreCreateParams as VectorStoreCreateParams
-from .vector_store_list_response import VectorStoreListResponse as VectorStoreListResponse
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_create_response import VectorStoreCreateResponse as VectorStoreCreateResponse
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
-from .vector_store_update_response import VectorStoreUpdateResponse as VectorStoreUpdateResponse
-from .vector_store_retrieve_response import VectorStoreRetrieveResponse as VectorStoreRetrieveResponse
from .data_source_oauth2_params_param import DataSourceOauth2ParamsParam as DataSourceOauth2ParamsParam
from .vector_store_question_answering_params import (
VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams,
)
+from .vector_store_chunk_search_options_param import (
+ VectorStoreChunkSearchOptionsParam as VectorStoreChunkSearchOptionsParam,
+)
from .vector_store_question_answering_response import (
VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
)
diff --git a/src/mixedbread/types/expires_after.py b/src/mixedbread/types/expires_after.py
new file mode 100644
index 00000000..8550ad0a
--- /dev/null
+++ b/src/mixedbread/types/expires_after.py
@@ -0,0 +1,16 @@
+# 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__ = ["ExpiresAfter"]
+
+
+class ExpiresAfter(BaseModel):
+ anchor: Optional[Literal["last_active_at"]] = None
+ """Anchor date for the expiration policy"""
+
+ days: Optional[int] = None
+ """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/expires_after_param.py b/src/mixedbread/types/expires_after_param.py
new file mode 100644
index 00000000..e7b4bee0
--- /dev/null
+++ b/src/mixedbread/types/expires_after_param.py
@@ -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 Literal, TypedDict
+
+__all__ = ["ExpiresAfterParam"]
+
+
+class ExpiresAfterParam(TypedDict, total=False):
+ anchor: Literal["last_active_at"]
+ """Anchor date for the expiration policy"""
+
+ days: int
+ """Number of days after which the vector store expires"""
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/vector_store_list_response.py b/src/mixedbread/types/vector_store.py
similarity index 84%
rename from src/mixedbread/types/vector_store_list_response.py
rename to src/mixedbread/types/vector_store.py
index 4d4b2ded..65cb0ede 100644
--- a/src/mixedbread/types/vector_store_list_response.py
+++ b/src/mixedbread/types/vector_store.py
@@ -5,8 +5,9 @@
from typing_extensions import Literal
from .._models import BaseModel
+from .expires_after import ExpiresAfter
-__all__ = ["VectorStoreListResponse", "FileCounts", "ExpiresAfter"]
+__all__ = ["VectorStore", "FileCounts"]
class FileCounts(BaseModel):
@@ -26,15 +27,7 @@ class FileCounts(BaseModel):
"""Total number of files"""
-class ExpiresAfter(BaseModel):
- anchor: Optional[Literal["last_active_at"]] = None
- """Anchor date for the expiration policy"""
-
- days: Optional[int] = None
- """Number of days after which the vector store expires"""
-
-
-class VectorStoreListResponse(BaseModel):
+class VectorStore(BaseModel):
id: str
"""Unique identifier for the vector store"""
diff --git a/src/mixedbread/types/vector_store_chunk_search_options_param.py b/src/mixedbread/types/vector_store_chunk_search_options_param.py
new file mode 100644
index 00000000..a2396bec
--- /dev/null
+++ b/src/mixedbread/types/vector_store_chunk_search_options_param.py
@@ -0,0 +1,18 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import TypedDict
+
+__all__ = ["VectorStoreChunkSearchOptionsParam"]
+
+
+class VectorStoreChunkSearchOptionsParam(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"""
diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py
index 31fc3526..3013c59c 100644
--- a/src/mixedbread/types/vector_store_create_params.py
+++ b/src/mixedbread/types/vector_store_create_params.py
@@ -3,9 +3,11 @@
from __future__ import annotations
from typing import List, Optional
-from typing_extensions import Literal, TypedDict
+from typing_extensions import TypedDict
-__all__ = ["VectorStoreCreateParams", "ExpiresAfter"]
+from .expires_after_param import ExpiresAfterParam
+
+__all__ = ["VectorStoreCreateParams"]
class VectorStoreCreateParams(TypedDict, total=False):
@@ -15,7 +17,7 @@ class VectorStoreCreateParams(TypedDict, total=False):
description: Optional[str]
"""Description of the vector store"""
- expires_after: Optional[ExpiresAfter]
+ expires_after: Optional[ExpiresAfterParam]
"""Represents an expiration policy for a vector store."""
metadata: object
@@ -23,11 +25,3 @@ class VectorStoreCreateParams(TypedDict, total=False):
file_ids: Optional[List[str]]
"""Optional list of file IDs"""
-
-
-class ExpiresAfter(TypedDict, total=False):
- anchor: Literal["last_active_at"]
- """Anchor date for the expiration policy"""
-
- days: int
- """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/vector_store_create_response.py b/src/mixedbread/types/vector_store_create_response.py
deleted file mode 100644
index 69946db2..00000000
--- a/src/mixedbread/types/vector_store_create_response.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["VectorStoreCreateResponse", "FileCounts", "ExpiresAfter"]
-
-
-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 ExpiresAfter(BaseModel):
- anchor: Optional[Literal["last_active_at"]] = None
- """Anchor date for the expiration policy"""
-
- days: Optional[int] = None
- """Number of days after which the vector store expires"""
-
-
-class VectorStoreCreateResponse(BaseModel):
- id: str
- """Unique identifier for the vector store"""
-
- name: str
- """Name of the vector store"""
-
- description: Optional[str] = None
- """Detailed description of the vector store's purpose and contents"""
-
- metadata: Optional[object] = None
- """Additional metadata associated with the vector store"""
-
- file_counts: Optional[FileCounts] = None
- """Counts of files in different states"""
-
- expires_after: Optional[ExpiresAfter] = None
- """Represents an expiration policy for a vector store."""
-
- status: Optional[Literal["expired", "in_progress", "completed"]] = None
- """Processing status of the vector store"""
-
- created_at: datetime
- """Timestamp when the vector store was created"""
-
- updated_at: datetime
- """Timestamp when the vector store was last updated"""
-
- last_active_at: Optional[datetime] = None
- """Timestamp when the vector store was last used"""
-
- usage_bytes: Optional[int] = None
- """Total storage usage in bytes"""
-
- expires_at: Optional[datetime] = None
- """Optional expiration timestamp for the vector store"""
-
- object: Optional[Literal["vector_store"]] = None
- """Type of the object"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index 16083394..abb7919b 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -6,8 +6,9 @@
from typing_extensions import Required, TypeAlias, TypedDict
from .shared_params.search_filter_condition import SearchFilterCondition
+from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "SearchOptions", "QaOptions"]
+__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
@@ -26,7 +27,7 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: SearchOptions
+ search_options: VectorStoreChunkSearchOptionsParam
"""Search configuration options"""
stream: bool
@@ -41,17 +42,6 @@ class VectorStoreQuestionAnsweringParams(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"""
-
-
class QaOptions(TypedDict, total=False):
cite: bool
"""Whether to use citations"""
diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py
index 71240d6f..2a477a87 100644
--- a/src/mixedbread/types/vector_store_question_answering_response.py
+++ b/src/mixedbread/types/vector_store_question_answering_response.py
@@ -1,148 +1,19 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
-from typing_extensions import Literal, Annotated, TypeAlias
+from typing_extensions import Annotated, TypeAlias
from .._utils import PropertyInfo
from .._models import BaseModel
+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",
- "Source",
- "SourceScoredTextInputChunk",
- "SourceScoredImageURLInputChunk",
- "SourceScoredImageURLInputChunkImageURL",
- "SourceScoredAudioURLInputChunk",
- "SourceScoredAudioURLInputChunkAudioURL",
-]
-
-
-class SourceScoredTextInputChunk(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"""
-
-
-class SourceScoredImageURLInputChunkImageURL(BaseModel):
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class SourceScoredImageURLInputChunk(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: SourceScoredImageURLInputChunkImageURL
- """The image input specification."""
-
- ocr_text: Optional[str] = None
- """ocr text of the image"""
-
- summary: Optional[str] = None
- """summary of the image"""
-
-
-class SourceScoredAudioURLInputChunkAudioURL(BaseModel):
- url: str
- """The audio URL. Can be either a URL or a Data URI."""
-
-
-class SourceScoredAudioURLInputChunk(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: SourceScoredAudioURLInputChunkAudioURL
- """The audio input specification."""
-
- transcription: Optional[str] = None
- """speech recognition (sr) text of the audio"""
-
- summary: Optional[str] = None
- """summary of the audio"""
-
+__all__ = ["VectorStoreQuestionAnsweringResponse", "Source"]
Source: TypeAlias = Annotated[
- Union[
- SourceScoredTextInputChunk,
- SourceScoredImageURLInputChunk,
- SourceScoredAudioURLInputChunk,
- ScoredVideoURLInputChunk,
- ],
+ Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
PropertyInfo(discriminator="type"),
]
diff --git a/src/mixedbread/types/vector_store_retrieve_response.py b/src/mixedbread/types/vector_store_retrieve_response.py
deleted file mode 100644
index 02cffa65..00000000
--- a/src/mixedbread/types/vector_store_retrieve_response.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["VectorStoreRetrieveResponse", "FileCounts", "ExpiresAfter"]
-
-
-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 ExpiresAfter(BaseModel):
- anchor: Optional[Literal["last_active_at"]] = None
- """Anchor date for the expiration policy"""
-
- days: Optional[int] = None
- """Number of days after which the vector store expires"""
-
-
-class VectorStoreRetrieveResponse(BaseModel):
- id: str
- """Unique identifier for the vector store"""
-
- name: str
- """Name of the vector store"""
-
- description: Optional[str] = None
- """Detailed description of the vector store's purpose and contents"""
-
- metadata: Optional[object] = None
- """Additional metadata associated with the vector store"""
-
- file_counts: Optional[FileCounts] = None
- """Counts of files in different states"""
-
- expires_after: Optional[ExpiresAfter] = None
- """Represents an expiration policy for a vector store."""
-
- status: Optional[Literal["expired", "in_progress", "completed"]] = None
- """Processing status of the vector store"""
-
- created_at: datetime
- """Timestamp when the vector store was created"""
-
- updated_at: datetime
- """Timestamp when the vector store was last updated"""
-
- last_active_at: Optional[datetime] = None
- """Timestamp when the vector store was last used"""
-
- usage_bytes: Optional[int] = None
- """Total storage usage in bytes"""
-
- expires_at: Optional[datetime] = None
- """Optional expiration timestamp for the vector store"""
-
- object: Optional[Literal["vector_store"]] = None
- """Type of the object"""
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 7a28385c..e0edc1bb 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -6,8 +6,9 @@
from typing_extensions import Required, TypeAlias, TypedDict
from .shared_params.search_filter_condition import SearchFilterCondition
+from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions"]
+__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
class VectorStoreSearchParams(TypedDict, total=False):
@@ -23,7 +24,7 @@ class VectorStoreSearchParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- search_options: SearchOptions
+ search_options: VectorStoreChunkSearchOptionsParam
"""Search configuration options"""
@@ -31,16 +32,4 @@ class VectorStoreSearchParams(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"""
-
-
from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py
index c1f8e788..50143c9f 100644
--- a/src/mixedbread/types/vector_store_search_response.py
+++ b/src/mixedbread/types/vector_store_search_response.py
@@ -5,141 +5,15 @@
from .._utils import PropertyInfo
from .._models import BaseModel
+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",
- "Data",
- "DataScoredTextInputChunk",
- "DataScoredImageURLInputChunk",
- "DataScoredImageURLInputChunkImageURL",
- "DataScoredAudioURLInputChunk",
- "DataScoredAudioURLInputChunkAudioURL",
-]
-
-
-class DataScoredTextInputChunk(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"""
-
-
-class DataScoredImageURLInputChunkImageURL(BaseModel):
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class DataScoredImageURLInputChunk(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: DataScoredImageURLInputChunkImageURL
- """The image input specification."""
-
- ocr_text: Optional[str] = None
- """ocr text of the image"""
-
- summary: Optional[str] = None
- """summary of the image"""
-
-
-class DataScoredAudioURLInputChunkAudioURL(BaseModel):
- url: str
- """The audio URL. Can be either a URL or a Data URI."""
-
-
-class DataScoredAudioURLInputChunk(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: DataScoredAudioURLInputChunkAudioURL
- """The audio input specification."""
-
- transcription: Optional[str] = None
- """speech recognition (sr) text of the audio"""
-
- summary: Optional[str] = None
- """summary of the audio"""
-
+__all__ = ["VectorStoreSearchResponse", "Data"]
Data: TypeAlias = Annotated[
- Union[
- DataScoredTextInputChunk, DataScoredImageURLInputChunk, DataScoredAudioURLInputChunk, ScoredVideoURLInputChunk
- ],
+ Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
PropertyInfo(discriminator="type"),
]
diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py
index 99c6a113..d8e6a83b 100644
--- a/src/mixedbread/types/vector_store_update_params.py
+++ b/src/mixedbread/types/vector_store_update_params.py
@@ -3,9 +3,11 @@
from __future__ import annotations
from typing import Optional
-from typing_extensions import Literal, TypedDict
+from typing_extensions import TypedDict
-__all__ = ["VectorStoreUpdateParams", "ExpiresAfter"]
+from .expires_after_param import ExpiresAfterParam
+
+__all__ = ["VectorStoreUpdateParams"]
class VectorStoreUpdateParams(TypedDict, total=False):
@@ -15,16 +17,8 @@ class VectorStoreUpdateParams(TypedDict, total=False):
description: Optional[str]
"""New description"""
- expires_after: Optional[ExpiresAfter]
+ expires_after: Optional[ExpiresAfterParam]
"""Represents an expiration policy for a vector store."""
metadata: object
"""Optional metadata key-value pairs"""
-
-
-class ExpiresAfter(TypedDict, total=False):
- anchor: Literal["last_active_at"]
- """Anchor date for the expiration policy"""
-
- days: int
- """Number of days after which the vector store expires"""
diff --git a/src/mixedbread/types/vector_store_update_response.py b/src/mixedbread/types/vector_store_update_response.py
deleted file mode 100644
index 532d9082..00000000
--- a/src/mixedbread/types/vector_store_update_response.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-
-__all__ = ["VectorStoreUpdateResponse", "FileCounts", "ExpiresAfter"]
-
-
-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 ExpiresAfter(BaseModel):
- anchor: Optional[Literal["last_active_at"]] = None
- """Anchor date for the expiration policy"""
-
- days: Optional[int] = None
- """Number of days after which the vector store expires"""
-
-
-class VectorStoreUpdateResponse(BaseModel):
- id: str
- """Unique identifier for the vector store"""
-
- name: str
- """Name of the vector store"""
-
- description: Optional[str] = None
- """Detailed description of the vector store's purpose and contents"""
-
- metadata: Optional[object] = None
- """Additional metadata associated with the vector store"""
-
- file_counts: Optional[FileCounts] = None
- """Counts of files in different states"""
-
- expires_after: Optional[ExpiresAfter] = None
- """Represents an expiration policy for a vector store."""
-
- status: Optional[Literal["expired", "in_progress", "completed"]] = None
- """Processing status of the vector store"""
-
- created_at: datetime
- """Timestamp when the vector store was created"""
-
- updated_at: datetime
- """Timestamp when the vector store was last updated"""
-
- last_active_at: Optional[datetime] = None
- """Timestamp when the vector store was last used"""
-
- usage_bytes: Optional[int] = None
- """Total storage usage in bytes"""
-
- expires_at: Optional[datetime] = None
- """Optional expiration timestamp for the vector store"""
-
- object: Optional[Literal["vector_store"]] = None
- """Type of the object"""
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 ee5a2db8..7c702c1c 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -6,144 +6,15 @@
from ..._utils import PropertyInfo
from ..._models import BaseModel
+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",
- "Chunk",
- "ChunkScoredTextInputChunk",
- "ChunkScoredImageURLInputChunk",
- "ChunkScoredImageURLInputChunkImageURL",
- "ChunkScoredAudioURLInputChunk",
- "ChunkScoredAudioURLInputChunkAudioURL",
-]
-
-
-class ChunkScoredTextInputChunk(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"""
-
-
-class ChunkScoredImageURLInputChunkImageURL(BaseModel):
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
-
-class ChunkScoredImageURLInputChunk(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: ChunkScoredImageURLInputChunkImageURL
- """The image input specification."""
-
- ocr_text: Optional[str] = None
- """ocr text of the image"""
-
- summary: Optional[str] = None
- """summary of the image"""
-
-
-class ChunkScoredAudioURLInputChunkAudioURL(BaseModel):
- url: str
- """The audio URL. Can be either a URL or a Data URI."""
-
-
-class ChunkScoredAudioURLInputChunk(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: ChunkScoredAudioURLInputChunkAudioURL
- """The audio input specification."""
-
- transcription: Optional[str] = None
- """speech recognition (sr) text of the audio"""
-
- summary: Optional[str] = None
- """summary of the audio"""
-
+__all__ = ["ScoredVectorStoreFile", "Chunk"]
Chunk: TypeAlias = Annotated[
- Union[
- ChunkScoredTextInputChunk,
- ChunkScoredImageURLInputChunk,
- ChunkScoredAudioURLInputChunk,
- ScoredVideoURLInputChunk,
- ],
+ Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
PropertyInfo(discriminator="type"),
]
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 9c7c2941..4cbe5b96 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -10,12 +10,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
from mixedbread.types import (
- VectorStoreListResponse,
- VectorStoreCreateResponse,
+ VectorStore,
VectorStoreDeleteResponse,
VectorStoreSearchResponse,
- VectorStoreUpdateResponse,
- VectorStoreRetrieveResponse,
VectorStoreQuestionAnsweringResponse,
)
from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
@@ -29,7 +26,7 @@ class TestVectorStores:
@parametrize
def test_method_create(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.create()
- assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
@@ -43,7 +40,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
metadata={},
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
- assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_raw_response_create(self, client: Mixedbread) -> None:
@@ -52,7 +49,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_streaming_response_create(self, client: Mixedbread) -> None:
@@ -61,7 +58,7 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -70,7 +67,7 @@ def test_method_retrieve(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_raw_response_retrieve(self, client: Mixedbread) -> None:
@@ -81,7 +78,7 @@ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
@@ -92,7 +89,7 @@ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -108,7 +105,7 @@ def test_method_update(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.update(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_method_update_with_all_params(self, client: Mixedbread) -> None:
@@ -122,7 +119,7 @@ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
},
metadata={},
)
- assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_raw_response_update(self, client: Mixedbread) -> None:
@@ -133,7 +130,7 @@ def test_raw_response_update(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_streaming_response_update(self, client: Mixedbread) -> None:
@@ -144,7 +141,7 @@ def test_streaming_response_update(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -158,7 +155,7 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list()
- assert_matches_type(SyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -166,7 +163,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
limit=1000,
offset=0,
)
- assert_matches_type(SyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -175,7 +172,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -184,7 +181,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
+ assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -407,7 +404,7 @@ class TestAsyncVectorStores:
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.create()
- assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -421,7 +418,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
metadata={},
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
- assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -430,7 +427,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
@@ -439,7 +436,7 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreCreateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -448,7 +445,7 @@ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.retrieve(
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
@@ -459,7 +456,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> Non
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
@@ -470,7 +467,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread)
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreRetrieveResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -486,7 +483,7 @@ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.update(
vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -500,7 +497,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread
},
metadata={},
)
- assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
@@ -511,7 +508,7 @@ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
@@ -522,7 +519,7 @@ async def test_streaming_response_update(self, async_client: AsyncMixedbread) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreUpdateResponse, vector_store, path=["response"])
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -536,7 +533,7 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list()
- assert_matches_type(AsyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -544,7 +541,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
limit=1000,
offset=0,
)
- assert_matches_type(AsyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -553,7 +550,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -562,7 +559,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStoreListResponse], vector_store, path=["response"])
+ assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
From 411a8bcf2570b3d3786989effeb0b88b0d9154b4 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 26 May 2025 12:42:07 +0000
Subject: [PATCH 148/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
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/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
From 9fcb44c019d59e8188353e884300e381ad4d87aa Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 26 May 2025 12:50:42 +0000
Subject: [PATCH 149/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 71c5ffa2..da69ce2e 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_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-bbf11a05fbd60f1c01433d449fe047bae912bee6f89aca14de94f571f6e8ddcd.yml
openapi_spec_hash: 07482ed86f5ccf7b480c514d6d5ebb15
-config_hash: 167171738605c297aa5e8bc73abc66e3
+config_hash: 28515a341c943d404cec2b4ec971021e
From e03fbc1cb386d80763deeec9753974ebdbdc4976 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 28 May 2025 03:33:42 +0000
Subject: [PATCH 150/375] fix(docs/api): remove references to nonexistent types
---
api.md | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/api.md b/api.md
index ff98c770..b1dab112 100644
--- a/api.md
+++ b/api.md
@@ -172,15 +172,9 @@ Methods:
# Chat
-Types:
-
-```python
-from mixedbread.types import ChatCreateCompletionResponse
-```
-
Methods:
-- client.chat.create_completion() -> object
+- client.chat.create_completion() -> object
# DataSources
From ed0a64597e52675eabad290992c5de0808c5f526 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 30 May 2025 16:51:03 +0000
Subject: [PATCH 151/375] feat(api): api update
---
.stats.yml | 4 +-
.../resources/data_sources/connectors.py | 38 ++++++++++++++-----
.../data_sources/connector_create_params.py | 13 +++++--
.../data_sources/connector_update_params.py | 13 +++++--
.../extractions/image_url_input_param.py | 3 ++
.../types/scored_image_url_input_chunk.py | 3 ++
...vector_store_chunk_search_options_param.py | 25 +++++++++++-
.../types/vector_stores/file_search_params.py | 29 +++++++++++++-
.../data_sources/test_connectors.py | 8 ++--
tests/api_resources/test_vector_stores.py | 4 ++
.../api_resources/vector_stores/test_files.py | 2 +
11 files changed, 118 insertions(+), 24 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index da69ce2e..edaf77ec 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-bbf11a05fbd60f1c01433d449fe047bae912bee6f89aca14de94f571f6e8ddcd.yml
-openapi_spec_hash: 07482ed86f5ccf7b480c514d6d5ebb15
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-08aa9c34eafe55108752adaa0390b538f4e69791beb05428bb0ed512da41bce0.yml
+openapi_spec_hash: 7c793082d79ddc66bb8b3ff43daf5902
config_hash: 28515a341c943d404cec2b4ec971021e
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index 435ca0e1..c9ab8400 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import Dict, Optional
+from typing import Dict, Union, Optional
import httpx
@@ -53,7 +53,7 @@ def create(
name: str | NotGiven = NOT_GIVEN,
trigger_sync: bool | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- polling_interval: Optional[str] | NotGiven = NOT_GIVEN,
+ polling_interval: Union[int, str, None] | 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,
@@ -80,7 +80,12 @@ def create(
metadata: The metadata of the connector
- polling_interval: The polling interval of the connector
+ polling_interval: Polling interval for the connector. Defaults to 30 minutes if not specified. Can
+ be provided as:
+
+ - int: Number of seconds (e.g., 1800 for 30 minutes)
+ - str: Duration string (e.g., '30m', '1h', '2d') or ISO 8601 format (e.g.,
+ 'PT30M', 'P1D') Valid range: 15 seconds to 30 days
extra_headers: Send extra headers
@@ -163,7 +168,7 @@ def update(
name: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
trigger_sync: Optional[bool] | NotGiven = NOT_GIVEN,
- polling_interval: Optional[str] | NotGiven = NOT_GIVEN,
+ polling_interval: Union[int, str, None] | 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,
@@ -191,7 +196,12 @@ def update(
trigger_sync: Whether the connector should be synced after update
- polling_interval: The polling interval of the connector
+ polling_interval: Polling interval for the connector. Defaults to 30 minutes if not specified. Can
+ be provided as:
+
+ - int: Number of seconds (e.g., 1800 for 30 minutes)
+ - str: Duration string (e.g., '30m', '1h', '2d') or ISO 8601 format (e.g.,
+ 'PT30M', 'P1D') Valid range: 15 seconds to 30 days
extra_headers: Send extra headers
@@ -353,7 +363,7 @@ async def create(
name: str | NotGiven = NOT_GIVEN,
trigger_sync: bool | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- polling_interval: Optional[str] | NotGiven = NOT_GIVEN,
+ polling_interval: Union[int, str, None] | 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,
@@ -380,7 +390,12 @@ async def create(
metadata: The metadata of the connector
- polling_interval: The polling interval of the connector
+ polling_interval: Polling interval for the connector. Defaults to 30 minutes if not specified. Can
+ be provided as:
+
+ - int: Number of seconds (e.g., 1800 for 30 minutes)
+ - str: Duration string (e.g., '30m', '1h', '2d') or ISO 8601 format (e.g.,
+ 'PT30M', 'P1D') Valid range: 15 seconds to 30 days
extra_headers: Send extra headers
@@ -463,7 +478,7 @@ async def update(
name: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
trigger_sync: Optional[bool] | NotGiven = NOT_GIVEN,
- polling_interval: Optional[str] | NotGiven = NOT_GIVEN,
+ polling_interval: Union[int, str, None] | 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,
@@ -491,7 +506,12 @@ async def update(
trigger_sync: Whether the connector should be synced after update
- polling_interval: The polling interval of the connector
+ polling_interval: Polling interval for the connector. Defaults to 30 minutes if not specified. Can
+ be provided as:
+
+ - int: Number of seconds (e.g., 1800 for 30 minutes)
+ - str: Duration string (e.g., '30m', '1h', '2d') or ISO 8601 format (e.g.,
+ 'PT30M', 'P1D') Valid range: 15 seconds to 30 days
extra_headers: Send extra headers
diff --git a/src/mixedbread/types/data_sources/connector_create_params.py b/src/mixedbread/types/data_sources/connector_create_params.py
index 6b1f8ed4..43c23c67 100644
--- a/src/mixedbread/types/data_sources/connector_create_params.py
+++ b/src/mixedbread/types/data_sources/connector_create_params.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import Optional
+from typing import Union
from typing_extensions import Required, TypedDict
__all__ = ["ConnectorCreateParams"]
@@ -21,5 +21,12 @@ class ConnectorCreateParams(TypedDict, total=False):
metadata: object
"""The metadata of the connector"""
- polling_interval: Optional[str]
- """The polling interval of the connector"""
+ polling_interval: Union[int, str, None]
+ """Polling interval for the connector.
+
+ Defaults to 30 minutes if not specified. Can be provided as:
+
+ - int: Number of seconds (e.g., 1800 for 30 minutes)
+ - str: Duration string (e.g., '30m', '1h', '2d') or ISO 8601 format (e.g.,
+ 'PT30M', 'P1D') Valid range: 15 seconds to 30 days
+ """
diff --git a/src/mixedbread/types/data_sources/connector_update_params.py b/src/mixedbread/types/data_sources/connector_update_params.py
index 80434be2..7e0d112b 100644
--- a/src/mixedbread/types/data_sources/connector_update_params.py
+++ b/src/mixedbread/types/data_sources/connector_update_params.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import Dict, Optional
+from typing import Dict, Union, Optional
from typing_extensions import Required, TypedDict
__all__ = ["ConnectorUpdateParams"]
@@ -21,5 +21,12 @@ class ConnectorUpdateParams(TypedDict, total=False):
trigger_sync: Optional[bool]
"""Whether the connector should be synced after update"""
- polling_interval: Optional[str]
- """The polling interval of the connector"""
+ polling_interval: Union[int, str, None]
+ """Polling interval for the connector.
+
+ Defaults to 30 minutes if not specified. Can be provided as:
+
+ - int: Number of seconds (e.g., 1800 for 30 minutes)
+ - str: Duration string (e.g., '30m', '1h', '2d') or ISO 8601 format (e.g.,
+ 'PT30M', 'P1D') Valid range: 15 seconds to 30 days
+ """
diff --git a/src/mixedbread/types/extractions/image_url_input_param.py b/src/mixedbread/types/extractions/image_url_input_param.py
index 6c361176..a4480f76 100644
--- a/src/mixedbread/types/extractions/image_url_input_param.py
+++ b/src/mixedbread/types/extractions/image_url_input_param.py
@@ -11,6 +11,9 @@ class ImageURL(TypedDict, total=False):
url: Required[str]
"""The image URL. Can be either a URL or a Data URI."""
+ format: str
+ """The image format/mimetype"""
+
class ImageURLInputParam(TypedDict, total=False):
type: Literal["image_url"]
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index ec6ba9dd..f160a46d 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -12,6 +12,9 @@ class ImageURL(BaseModel):
url: str
"""The image URL. Can be either a URL or a Data URI."""
+ format: Optional[str] = None
+ """The image format/mimetype"""
+
class ScoredImageURLInputChunk(BaseModel):
chunk_index: int
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 a2396bec..f5fb8437 100644
--- a/src/mixedbread/types/vector_store_chunk_search_options_param.py
+++ b/src/mixedbread/types/vector_store_chunk_search_options_param.py
@@ -2,9 +2,27 @@
from __future__ import annotations
-from typing_extensions import TypedDict
+from typing import List, Union, Optional
+from typing_extensions import TypeAlias, TypedDict
-__all__ = ["VectorStoreChunkSearchOptionsParam"]
+__all__ = ["VectorStoreChunkSearchOptionsParam", "Rerank", "RerankRerankConfig"]
+
+
+class RerankRerankConfig(TypedDict, total=False):
+ model: str
+ """The name of the reranking model"""
+
+ with_metadata: Union[bool, List[str]]
+ """Whether to include metadata in the reranked results"""
+
+ top_k: Optional[int]
+ """Maximum number of results to return after reranking.
+
+ If None, returns all reranked results.
+ """
+
+
+Rerank: TypeAlias = Union[bool, RerankRerankConfig]
class VectorStoreChunkSearchOptionsParam(TypedDict, total=False):
@@ -14,5 +32,8 @@ class VectorStoreChunkSearchOptionsParam(TypedDict, total=False):
rewrite_query: bool
"""Whether to rewrite the query"""
+ rerank: Optional[Rerank]
+ """Whether to rerank results and optional reranking configuration"""
+
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 c34d7611..65e84d9f 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -7,7 +7,14 @@
from ..shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions"]
+__all__ = [
+ "FileSearchParams",
+ "Filters",
+ "FiltersUnionMember2",
+ "SearchOptions",
+ "SearchOptionsRerank",
+ "SearchOptionsRerankRerankConfig",
+]
class FileSearchParams(TypedDict, total=False):
@@ -32,6 +39,23 @@ class FileSearchParams(TypedDict, total=False):
Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+class SearchOptionsRerankRerankConfig(TypedDict, total=False):
+ model: str
+ """The name of the reranking model"""
+
+ with_metadata: Union[bool, List[str]]
+ """Whether to include metadata in the reranked results"""
+
+ top_k: Optional[int]
+ """Maximum number of results to return after reranking.
+
+ If None, returns all reranked results.
+ """
+
+
+SearchOptionsRerank: TypeAlias = Union[bool, SearchOptionsRerankRerankConfig]
+
+
class SearchOptions(TypedDict, total=False):
score_threshold: float
"""Minimum similarity score threshold"""
@@ -39,6 +63,9 @@ class SearchOptions(TypedDict, total=False):
rewrite_query: bool
"""Whether to rewrite the query"""
+ rerank: Optional[SearchOptionsRerank]
+ """Whether to rerank results and optional reranking configuration"""
+
return_metadata: bool
"""Whether to return file metadata"""
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index f25e9ce0..fb95955d 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -37,7 +37,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
name="name",
trigger_sync=True,
metadata={},
- polling_interval="polling_interval",
+ polling_interval=1800,
)
assert_matches_type(DataSourceConnector, connector, path=["response"])
@@ -139,7 +139,7 @@ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
name="name",
metadata={"foo": "bar"},
trigger_sync=True,
- polling_interval="polling_interval",
+ polling_interval=1800,
)
assert_matches_type(DataSourceConnector, connector, path=["response"])
@@ -298,7 +298,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
name="name",
trigger_sync=True,
metadata={},
- polling_interval="polling_interval",
+ polling_interval=1800,
)
assert_matches_type(DataSourceConnector, connector, path=["response"])
@@ -400,7 +400,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread
name="name",
metadata={"foo": "bar"},
trigger_sync=True,
- polling_interval="polling_interval",
+ polling_interval=1800,
)
assert_matches_type(DataSourceConnector, connector, path=["response"])
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 4cbe5b96..f2b1dbae 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -277,6 +277,7 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
search_options={
"score_threshold": 0,
"rewrite_query": True,
+ "rerank": True,
"return_metadata": True,
},
stream=True,
@@ -366,6 +367,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
search_options={
"score_threshold": 0,
"rewrite_query": True,
+ "rerank": True,
"return_metadata": True,
},
)
@@ -655,6 +657,7 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
search_options={
"score_threshold": 0,
"rewrite_query": True,
+ "rerank": True,
"return_metadata": True,
},
stream=True,
@@ -744,6 +747,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
search_options={
"score_threshold": 0,
"rewrite_query": True,
+ "rerank": True,
"return_metadata": True,
},
)
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index e089a591..d2e1c542 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -275,6 +275,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
search_options={
"score_threshold": 0,
"rewrite_query": True,
+ "rerank": True,
"return_metadata": True,
"return_chunks": True,
"chunks_per_file": 0,
@@ -565,6 +566,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
search_options={
"score_threshold": 0,
"rewrite_query": True,
+ "rerank": True,
"return_metadata": True,
"return_chunks": True,
"chunks_per_file": 0,
From 9a0c8908dd78a97da7b8cdceb5964711e08aee7b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 31 May 2025 05:03:03 +0000
Subject: [PATCH 152/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 6 -
src/mixedbread/_client.py | 10 +-
src/mixedbread/resources/__init__.py | 14 ---
src/mixedbread/resources/chat.py | 164 ---------------------------
tests/api_resources/test_chat.py | 71 ------------
6 files changed, 3 insertions(+), 266 deletions(-)
delete mode 100644 src/mixedbread/resources/chat.py
delete mode 100644 tests/api_resources/test_chat.py
diff --git a/.stats.yml b/.stats.yml
index edaf77ec..ad284778 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 49
+configured_endpoints: 48
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-08aa9c34eafe55108752adaa0390b538f4e69791beb05428bb0ed512da41bce0.yml
openapi_spec_hash: 7c793082d79ddc66bb8b3ff43daf5902
-config_hash: 28515a341c943d404cec2b4ec971021e
+config_hash: 356855b953f227221cc8b1262aaafa2a
diff --git a/api.md b/api.md
index b1dab112..4852078d 100644
--- a/api.md
+++ b/api.md
@@ -170,12 +170,6 @@ Methods:
- client.embeddings.create(\*\*params) -> EmbeddingCreateResponse
-# Chat
-
-Methods:
-
-- client.chat.create_completion() -> object
-
# DataSources
Types:
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 87e724e0..f75adc2f 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -36,7 +36,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from .resources import chat, files, api_keys, embeddings
+from .resources import files, api_keys, embeddings
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, MixedbreadError
from ._base_client import (
@@ -78,7 +78,6 @@ class Mixedbread(SyncAPIClient):
files: files.FilesResource
extractions: extractions.ExtractionsResource
embeddings: embeddings.EmbeddingsResource
- chat: chat.ChatResource
data_sources: data_sources.DataSourcesResource
api_keys: api_keys.APIKeysResource
with_raw_response: MixedbreadWithRawResponse
@@ -167,7 +166,6 @@ def __init__(
self.files = files.FilesResource(self)
self.extractions = extractions.ExtractionsResource(self)
self.embeddings = embeddings.EmbeddingsResource(self)
- self.chat = chat.ChatResource(self)
self.data_sources = data_sources.DataSourcesResource(self)
self.api_keys = api_keys.APIKeysResource(self)
self.with_raw_response = MixedbreadWithRawResponse(self)
@@ -441,7 +439,6 @@ class AsyncMixedbread(AsyncAPIClient):
files: files.AsyncFilesResource
extractions: extractions.AsyncExtractionsResource
embeddings: embeddings.AsyncEmbeddingsResource
- chat: chat.AsyncChatResource
data_sources: data_sources.AsyncDataSourcesResource
api_keys: api_keys.AsyncAPIKeysResource
with_raw_response: AsyncMixedbreadWithRawResponse
@@ -530,7 +527,6 @@ def __init__(
self.files = files.AsyncFilesResource(self)
self.extractions = extractions.AsyncExtractionsResource(self)
self.embeddings = embeddings.AsyncEmbeddingsResource(self)
- self.chat = chat.AsyncChatResource(self)
self.data_sources = data_sources.AsyncDataSourcesResource(self)
self.api_keys = api_keys.AsyncAPIKeysResource(self)
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
@@ -805,7 +801,6 @@ def __init__(self, client: Mixedbread) -> None:
self.files = files.FilesResourceWithRawResponse(client.files)
self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
- self.chat = chat.ChatResourceWithRawResponse(client.chat)
self.data_sources = data_sources.DataSourcesResourceWithRawResponse(client.data_sources)
self.api_keys = api_keys.APIKeysResourceWithRawResponse(client.api_keys)
@@ -827,7 +822,6 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
- self.chat = chat.AsyncChatResourceWithRawResponse(client.chat)
self.data_sources = data_sources.AsyncDataSourcesResourceWithRawResponse(client.data_sources)
self.api_keys = api_keys.AsyncAPIKeysResourceWithRawResponse(client.api_keys)
@@ -849,7 +843,6 @@ def __init__(self, client: Mixedbread) -> None:
self.files = files.FilesResourceWithStreamingResponse(client.files)
self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
- self.chat = chat.ChatResourceWithStreamingResponse(client.chat)
self.data_sources = data_sources.DataSourcesResourceWithStreamingResponse(client.data_sources)
self.api_keys = api_keys.APIKeysResourceWithStreamingResponse(client.api_keys)
@@ -871,7 +864,6 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
- self.chat = chat.AsyncChatResourceWithStreamingResponse(client.chat)
self.data_sources = data_sources.AsyncDataSourcesResourceWithStreamingResponse(client.data_sources)
self.api_keys = api_keys.AsyncAPIKeysResourceWithStreamingResponse(client.api_keys)
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index 241510a2..284cc1cb 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -1,13 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from .chat import (
- ChatResource,
- AsyncChatResource,
- ChatResourceWithRawResponse,
- AsyncChatResourceWithRawResponse,
- ChatResourceWithStreamingResponse,
- AsyncChatResourceWithStreamingResponse,
-)
from .files import (
FilesResource,
AsyncFilesResource,
@@ -96,12 +88,6 @@
"AsyncEmbeddingsResourceWithRawResponse",
"EmbeddingsResourceWithStreamingResponse",
"AsyncEmbeddingsResourceWithStreamingResponse",
- "ChatResource",
- "AsyncChatResource",
- "ChatResourceWithRawResponse",
- "AsyncChatResourceWithRawResponse",
- "ChatResourceWithStreamingResponse",
- "AsyncChatResourceWithStreamingResponse",
"DataSourcesResource",
"AsyncDataSourcesResource",
"DataSourcesResourceWithRawResponse",
diff --git a/src/mixedbread/resources/chat.py b/src/mixedbread/resources/chat.py
deleted file mode 100644
index f9b1b0ce..00000000
--- a/src/mixedbread/resources/chat.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import httpx
-
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from .._compat import cached_property
-from .._resource import SyncAPIResource, AsyncAPIResource
-from .._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from .._base_client import make_request_options
-
-__all__ = ["ChatResource", "AsyncChatResource"]
-
-
-class ChatResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> ChatResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return ChatResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> ChatResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return ChatResourceWithStreamingResponse(self)
-
- def create_completion(
- self,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
- """
- Create a chat completion using the provided parameters.
-
- Generates a completion response based on the chat messages and model parameters
- provided. The response can be either a full completion or streamed chunks
- depending on the request parameters.
-
- Args: params: Parameters for creating the chat completion including messages,
- model selection, and generation settings user: The authenticated user making the
- request
-
- Returns: Either a ChatCompletion containing the full response, or
- ChatCompletionChunk for streaming
-
- Raises: HTTPException: If there is an error creating the completion (500)
- """
- return self._post(
- "/v1/chat/completions",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=object,
- )
-
-
-class AsyncChatResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncChatResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncChatResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncChatResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncChatResourceWithStreamingResponse(self)
-
- async def create_completion(
- self,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> object:
- """
- Create a chat completion using the provided parameters.
-
- Generates a completion response based on the chat messages and model parameters
- provided. The response can be either a full completion or streamed chunks
- depending on the request parameters.
-
- Args: params: Parameters for creating the chat completion including messages,
- model selection, and generation settings user: The authenticated user making the
- request
-
- Returns: Either a ChatCompletion containing the full response, or
- ChatCompletionChunk for streaming
-
- Raises: HTTPException: If there is an error creating the completion (500)
- """
- return await self._post(
- "/v1/chat/completions",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=object,
- )
-
-
-class ChatResourceWithRawResponse:
- def __init__(self, chat: ChatResource) -> None:
- self._chat = chat
-
- self.create_completion = to_raw_response_wrapper(
- chat.create_completion,
- )
-
-
-class AsyncChatResourceWithRawResponse:
- def __init__(self, chat: AsyncChatResource) -> None:
- self._chat = chat
-
- self.create_completion = async_to_raw_response_wrapper(
- chat.create_completion,
- )
-
-
-class ChatResourceWithStreamingResponse:
- def __init__(self, chat: ChatResource) -> None:
- self._chat = chat
-
- self.create_completion = to_streamed_response_wrapper(
- chat.create_completion,
- )
-
-
-class AsyncChatResourceWithStreamingResponse:
- def __init__(self, chat: AsyncChatResource) -> None:
- self._chat = chat
-
- self.create_completion = async_to_streamed_response_wrapper(
- chat.create_completion,
- )
diff --git a/tests/api_resources/test_chat.py b/tests/api_resources/test_chat.py
deleted file mode 100644
index 65341369..00000000
--- a/tests/api_resources/test_chat.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestChat:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create_completion(self, client: Mixedbread) -> None:
- chat = client.chat.create_completion()
- assert_matches_type(object, chat, path=["response"])
-
- @parametrize
- def test_raw_response_create_completion(self, client: Mixedbread) -> None:
- response = client.chat.with_raw_response.create_completion()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- chat = response.parse()
- assert_matches_type(object, chat, path=["response"])
-
- @parametrize
- def test_streaming_response_create_completion(self, client: Mixedbread) -> None:
- with client.chat.with_streaming_response.create_completion() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- chat = response.parse()
- assert_matches_type(object, chat, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncChat:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- async def test_method_create_completion(self, async_client: AsyncMixedbread) -> None:
- chat = await async_client.chat.create_completion()
- assert_matches_type(object, chat, path=["response"])
-
- @parametrize
- async def test_raw_response_create_completion(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.chat.with_raw_response.create_completion()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- chat = await response.parse()
- assert_matches_type(object, chat, path=["response"])
-
- @parametrize
- async def test_streaming_response_create_completion(self, async_client: AsyncMixedbread) -> None:
- async with async_client.chat.with_streaming_response.create_completion() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- chat = await response.parse()
- assert_matches_type(object, chat, path=["response"])
-
- assert cast(Any, response.is_closed) is True
From 72da911cea5196b044c0c72466d2cad089b3da8d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 3 Jun 2025 02:29:46 +0000
Subject: [PATCH 153/375] chore(docs): remove reference to rye shell
---
CONTRIBUTING.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e9ccd896..0b147f05 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -17,8 +17,7 @@ $ rye sync --all-features
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
```sh
-$ rye shell
-# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
+# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate
# now you can omit the `rye run` prefix
From 048e5d2215e3b8db1f237e9390816b7edcc698bf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 3 Jun 2025 02:42:12 +0000
Subject: [PATCH 154/375] chore(docs): remove unnecessary param examples
---
README.md | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 831cfdec..24d13985 100644
--- a/README.md
+++ b/README.md
@@ -152,10 +152,7 @@ from mixedbread import Mixedbread
client = Mixedbread()
vector_store = client.vector_stores.create(
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
+ expires_after={},
)
print(vector_store.expires_after)
```
From 40fcc28c8c99865c3402249e81a6ac7b2f445a03 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 3 Jun 2025 03:45:28 +0000
Subject: [PATCH 155/375] feat(client): add follow_redirects request option
---
src/mixedbread/_base_client.py | 6 ++++
src/mixedbread/_models.py | 2 ++
src/mixedbread/_types.py | 2 ++
tests/test_client.py | 54 ++++++++++++++++++++++++++++++++++
4 files changed, 64 insertions(+)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 72f949dc..34276f55 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -960,6 +960,9 @@ def request(
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth
+ if options.follow_redirects is not None:
+ kwargs["follow_redirects"] = options.follow_redirects
+
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
response = None
@@ -1460,6 +1463,9 @@ async def request(
if self.custom_auth is not None:
kwargs["auth"] = self.custom_auth
+ if options.follow_redirects is not None:
+ kwargs["follow_redirects"] = options.follow_redirects
+
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
response = None
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 798956f1..4f214980 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
idempotency_key: str
json_data: Body
extra_json: AnyMapping
+ follow_redirects: bool
@final
@@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
files: Union[HttpxRequestFiles, None] = None
idempotency_key: Union[str, None] = None
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
+ follow_redirects: Union[bool, None] = None
# It should be noted that we cannot use `json` here as that would override
# a BaseModel method in an incompatible fashion.
diff --git a/src/mixedbread/_types.py b/src/mixedbread/_types.py
index b1e781f8..6fdd2f2b 100644
--- a/src/mixedbread/_types.py
+++ b/src/mixedbread/_types.py
@@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
params: Query
extra_json: AnyMapping
idempotency_key: str
+ follow_redirects: bool
# Sentinel class used until PEP 0661 is accepted
@@ -215,3 +216,4 @@ class _GenericAlias(Protocol):
class HttpxSendArgs(TypedDict, total=False):
auth: httpx.Auth
+ follow_redirects: bool
diff --git a/tests/test_client.py b/tests/test_client.py
index 4d16384d..61377980 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -836,6 +836,33 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
+ @pytest.mark.respx(base_url=base_url)
+ def test_follow_redirects(self, respx_mock: MockRouter) -> None:
+ # Test that the default follow_redirects=True allows following redirects
+ respx_mock.post("/redirect").mock(
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
+ )
+ respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
+
+ response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
+ assert response.status_code == 200
+ assert response.json() == {"status": "ok"}
+
+ @pytest.mark.respx(base_url=base_url)
+ def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
+ # Test that follow_redirects=False prevents following redirects
+ respx_mock.post("/redirect").mock(
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
+ )
+
+ with pytest.raises(APIStatusError) as exc_info:
+ self.client.post(
+ "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
+ )
+
+ assert exc_info.value.response.status_code == 302
+ assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
+
class TestAsyncMixedbread:
client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
@@ -1671,3 +1698,30 @@ async def test_main() -> None:
raise AssertionError("calling get_platform using asyncify resulted in a hung process")
time.sleep(0.1)
+
+ @pytest.mark.respx(base_url=base_url)
+ async def test_follow_redirects(self, respx_mock: MockRouter) -> None:
+ # Test that the default follow_redirects=True allows following redirects
+ respx_mock.post("/redirect").mock(
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
+ )
+ respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
+
+ response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
+ assert response.status_code == 200
+ assert response.json() == {"status": "ok"}
+
+ @pytest.mark.respx(base_url=base_url)
+ async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
+ # Test that follow_redirects=False prevents following redirects
+ respx_mock.post("/redirect").mock(
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
+ )
+
+ with pytest.raises(APIStatusError) as exc_info:
+ await self.client.post(
+ "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
+ )
+
+ assert exc_info.value.response.status_code == 302
+ assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
From 148951e3feb357aea0abb886d14ab4db16d82e96 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 3 Jun 2025 08:25:00 +0000
Subject: [PATCH 156/375] feat(api): api update
---
.stats.yml | 6 +-
api.md | 9 -
.../resources/vector_stores/files.py | 483 +-----------------
.../resources/vector_stores/vector_stores.py | 368 ++-----------
src/mixedbread/types/__init__.py | 2 -
.../types/vector_store_delete_response.py | 19 -
.../vector_store_question_answering_params.py | 11 +-
.../types/vector_store_search_params.py | 9 +-
.../types/vector_store_update_params.py | 24 -
.../types/vector_stores/__init__.py | 4 -
.../types/vector_stores/file_create_params.py | 26 -
.../vector_stores/file_delete_response.py | 19 -
.../types/vector_stores/file_list_params.py | 15 -
.../types/vector_stores/file_search_params.py | 9 +-
.../types/vector_stores/vector_store_file.py | 41 --
tests/api_resources/test_vector_stores.py | 303 +----------
.../api_resources/vector_stores/test_files.py | 417 +--------------
17 files changed, 108 insertions(+), 1657 deletions(-)
delete mode 100644 src/mixedbread/types/vector_store_delete_response.py
delete mode 100644 src/mixedbread/types/vector_store_update_params.py
delete mode 100644 src/mixedbread/types/vector_stores/file_create_params.py
delete mode 100644 src/mixedbread/types/vector_stores/file_delete_response.py
delete mode 100644 src/mixedbread/types/vector_stores/file_list_params.py
delete mode 100644 src/mixedbread/types/vector_stores/vector_store_file.py
diff --git a/.stats.yml b/.stats.yml
index ad284778..c866a6b1 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 48
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-08aa9c34eafe55108752adaa0390b538f4e69791beb05428bb0ed512da41bce0.yml
-openapi_spec_hash: 7c793082d79ddc66bb8b3ff43daf5902
+configured_endpoints: 41
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-1e610a163c03f43caa65295f9fc5baf467f848ec588289f1111ff559d190e501.yml
+openapi_spec_hash: ef3971cea2dd00e88561e52e267043dd
config_hash: 356855b953f227221cc8b1262aaafa2a
diff --git a/api.md b/api.md
index 4852078d..91e8b7cf 100644
--- a/api.md
+++ b/api.md
@@ -37,7 +37,6 @@ from mixedbread.types import (
ScoredVideoURLInputChunk,
VectorStore,
VectorStoreChunkSearchOptions,
- VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
)
@@ -46,10 +45,7 @@ from mixedbread.types import (
Methods:
- client.vector_stores.create(\*\*params) -> VectorStore
-- client.vector_stores.retrieve(vector_store_id) -> VectorStore
-- client.vector_stores.update(vector_store_id, \*\*params) -> VectorStore
- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStore]
-- client.vector_stores.delete(vector_store_id) -> VectorStoreDeleteResponse
- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
@@ -61,17 +57,12 @@ Types:
from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFile,
- FileDeleteResponse,
FileSearchResponse,
)
```
Methods:
-- client.vector_stores.files.create(vector_store_id, \*\*params) -> VectorStoreFile
-- client.vector_stores.files.retrieve(file_id, \*, vector_store_id) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_id, \*\*params) -> SyncLimitOffset[VectorStoreFile]
-- client.vector_stores.files.delete(file_id, \*, vector_store_id) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
# Parsing
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index f0e77c8d..6c06e4c5 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import List, Optional
+from typing import List, Union, Iterable, Optional
import httpx
@@ -16,11 +16,8 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncLimitOffset, AsyncLimitOffset
-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.vector_store_file import VectorStoreFile
-from ...types.vector_stores.file_delete_response import FileDeleteResponse
+from ..._base_client import make_request_options
+from ...types.vector_stores import file_search_params
from ...types.vector_stores.file_search_response import FileSearchResponse
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -46,216 +43,15 @@ def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
"""
return FilesResourceWithStreamingResponse(self)
- def create(
- self,
- vector_store_id: str,
- *,
- file_id: str,
- metadata: object | NotGiven = NOT_GIVEN,
- experimental: file_create_params.Experimental | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreFile:
- """
- Upload a new file to a vector store for indexing.
-
- Args: vector_store_id: The ID of the vector store to upload to file: The file to
- upload and index
-
- Returns: VectorStoreFile: Details of the uploaded and indexed file
-
- Args:
- vector_store_id: The ID of the vector store
-
- file_id: ID of the file to add
-
- metadata: Optional metadata for the file
-
- experimental: Strategy for adding the file
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return self._post(
- f"/v1/vector_stores/{vector_store_id}/files",
- body=maybe_transform(
- {
- "file_id": file_id,
- "metadata": metadata,
- "experimental": experimental,
- },
- file_create_params.FileCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreFile,
- )
-
- def retrieve(
- self,
- file_id: str,
- *,
- vector_store_id: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreFile:
- """
- Get details of a specific file in a vector store.
-
- Args: vector_store_id: The ID of the vector store file_id: The ID of the file
-
- Returns: VectorStoreFile: Details of the vector store file
-
- Args:
- vector_store_id: The ID of the vector store
-
- file_id: The ID of the file
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return self._get(
- f"/v1/vector_stores/{vector_store_id}/files/{file_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreFile,
- )
-
- def list(
- self,
- vector_store_id: str,
- *,
- limit: int | NotGiven = NOT_GIVEN,
- offset: int | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[VectorStoreFile]:
- """
- List files indexed in a vector store with pagination.
-
- Args: vector_store_id: The ID of the vector store pagination: Pagination
- parameters
-
- Returns: VectorStoreFileListResponse: Paginated list of vector store files
-
- Args:
- vector_store_id: The ID of the vector store
-
- limit: Maximum number of items to return per page
-
- offset: Offset of the first item to return
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return self._get_api_list(
- f"/v1/vector_stores/{vector_store_id}/files",
- page=SyncLimitOffset[VectorStoreFile],
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=maybe_transform(
- {
- "limit": limit,
- "offset": offset,
- },
- file_list_params.FileListParams,
- ),
- ),
- model=VectorStoreFile,
- )
-
- def delete(
- self,
- file_id: str,
- *,
- vector_store_id: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileDeleteResponse:
- """
- Delete a file from a vector store.
-
- Args: vector_store_id: The ID of the vector store file_id: The ID of the file to
- delete
-
- Returns: VectorStoreFileDeleted: The deleted file
-
- Args:
- vector_store_id: The ID of the vector store
-
- file_id: The ID of the file to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return self._delete(
- f"/v1/vector_stores/{vector_store_id}/files/{file_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileDeleteResponse,
- )
-
def search(
self,
*,
query: str,
- vector_store_ids: List[str],
+ vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], List[str], None] | 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.
@@ -285,12 +81,14 @@ def search(
Args:
query: Search query text
- vector_store_ids: IDs of vector stores to search
+ vector_store_identifiers: IDs or names of vector stores to search
top_k: Number of results to return
filters: Optional filter conditions
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
search_options: Search configuration options
extra_headers: Send extra headers
@@ -306,9 +104,11 @@ def search(
body=maybe_transform(
{
"query": query,
+ "vector_store_identifiers": vector_store_identifiers,
"vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
+ "file_ids": file_ids,
"search_options": search_options,
},
file_search_params.FileSearchParams,
@@ -340,216 +140,15 @@ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
"""
return AsyncFilesResourceWithStreamingResponse(self)
- async def create(
- self,
- vector_store_id: str,
- *,
- file_id: str,
- metadata: object | NotGiven = NOT_GIVEN,
- experimental: file_create_params.Experimental | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreFile:
- """
- Upload a new file to a vector store for indexing.
-
- Args: vector_store_id: The ID of the vector store to upload to file: The file to
- upload and index
-
- Returns: VectorStoreFile: Details of the uploaded and indexed file
-
- Args:
- vector_store_id: The ID of the vector store
-
- file_id: ID of the file to add
-
- metadata: Optional metadata for the file
-
- experimental: Strategy for adding the file
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return await self._post(
- f"/v1/vector_stores/{vector_store_id}/files",
- body=await async_maybe_transform(
- {
- "file_id": file_id,
- "metadata": metadata,
- "experimental": experimental,
- },
- file_create_params.FileCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreFile,
- )
-
- async def retrieve(
- self,
- file_id: str,
- *,
- vector_store_id: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreFile:
- """
- Get details of a specific file in a vector store.
-
- Args: vector_store_id: The ID of the vector store file_id: The ID of the file
-
- Returns: VectorStoreFile: Details of the vector store file
-
- Args:
- vector_store_id: The ID of the vector store
-
- file_id: The ID of the file
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return await self._get(
- f"/v1/vector_stores/{vector_store_id}/files/{file_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreFile,
- )
-
- def list(
- self,
- vector_store_id: str,
- *,
- limit: int | NotGiven = NOT_GIVEN,
- offset: int | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[VectorStoreFile, AsyncLimitOffset[VectorStoreFile]]:
- """
- List files indexed in a vector store with pagination.
-
- Args: vector_store_id: The ID of the vector store pagination: Pagination
- parameters
-
- Returns: VectorStoreFileListResponse: Paginated list of vector store files
-
- Args:
- vector_store_id: The ID of the vector store
-
- limit: Maximum number of items to return per page
-
- offset: Offset of the first item to return
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return self._get_api_list(
- f"/v1/vector_stores/{vector_store_id}/files",
- page=AsyncLimitOffset[VectorStoreFile],
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=maybe_transform(
- {
- "limit": limit,
- "offset": offset,
- },
- file_list_params.FileListParams,
- ),
- ),
- model=VectorStoreFile,
- )
-
- async def delete(
- self,
- file_id: str,
- *,
- vector_store_id: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileDeleteResponse:
- """
- Delete a file from a vector store.
-
- Args: vector_store_id: The ID of the vector store file_id: The ID of the file to
- delete
-
- Returns: VectorStoreFileDeleted: The deleted file
-
- Args:
- vector_store_id: The ID of the vector store
-
- file_id: The ID of the file to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return await self._delete(
- f"/v1/vector_stores/{vector_store_id}/files/{file_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileDeleteResponse,
- )
-
async def search(
self,
*,
query: str,
- vector_store_ids: List[str],
+ vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], List[str], None] | 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.
@@ -579,12 +178,14 @@ async def search(
Args:
query: Search query text
- vector_store_ids: IDs of vector stores to search
+ vector_store_identifiers: IDs or names of vector stores to search
top_k: Number of results to return
filters: Optional filter conditions
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
search_options: Search configuration options
extra_headers: Send extra headers
@@ -600,9 +201,11 @@ async def search(
body=await async_maybe_transform(
{
"query": query,
+ "vector_store_identifiers": vector_store_identifiers,
"vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
+ "file_ids": file_ids,
"search_options": search_options,
},
file_search_params.FileSearchParams,
@@ -618,18 +221,6 @@ class FilesResourceWithRawResponse:
def __init__(self, files: FilesResource) -> None:
self._files = files
- self.create = to_raw_response_wrapper(
- files.create,
- )
- self.retrieve = to_raw_response_wrapper(
- files.retrieve,
- )
- self.list = to_raw_response_wrapper(
- files.list,
- )
- self.delete = to_raw_response_wrapper(
- files.delete,
- )
self.search = to_raw_response_wrapper(
files.search,
)
@@ -639,18 +230,6 @@ class AsyncFilesResourceWithRawResponse:
def __init__(self, files: AsyncFilesResource) -> None:
self._files = files
- self.create = async_to_raw_response_wrapper(
- files.create,
- )
- self.retrieve = async_to_raw_response_wrapper(
- files.retrieve,
- )
- self.list = async_to_raw_response_wrapper(
- files.list,
- )
- self.delete = async_to_raw_response_wrapper(
- files.delete,
- )
self.search = async_to_raw_response_wrapper(
files.search,
)
@@ -660,18 +239,6 @@ class FilesResourceWithStreamingResponse:
def __init__(self, files: FilesResource) -> None:
self._files = files
- self.create = to_streamed_response_wrapper(
- files.create,
- )
- self.retrieve = to_streamed_response_wrapper(
- files.retrieve,
- )
- self.list = to_streamed_response_wrapper(
- files.list,
- )
- self.delete = to_streamed_response_wrapper(
- files.delete,
- )
self.search = to_streamed_response_wrapper(
files.search,
)
@@ -681,18 +248,6 @@ class AsyncFilesResourceWithStreamingResponse:
def __init__(self, files: AsyncFilesResource) -> None:
self._files = files
- self.create = async_to_streamed_response_wrapper(
- files.create,
- )
- self.retrieve = async_to_streamed_response_wrapper(
- files.retrieve,
- )
- self.list = async_to_streamed_response_wrapper(
- files.list,
- )
- self.delete = async_to_streamed_response_wrapper(
- files.delete,
- )
self.search = async_to_streamed_response_wrapper(
files.search,
)
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 18b25941..b71f9a47 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import List, Optional
+from typing import List, Union, Iterable, Optional
import httpx
@@ -18,7 +18,6 @@
vector_store_list_params,
vector_store_create_params,
vector_store_search_params,
- vector_store_update_params,
vector_store_question_answering_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -35,7 +34,6 @@
from ..._base_client import AsyncPaginator, make_request_options
from ...types.vector_store import VectorStore
from ...types.expires_after_param import ExpiresAfterParam
-from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
from ...types.vector_store_question_answering_response import VectorStoreQuestionAnsweringResponse
@@ -127,107 +125,6 @@ def create(
cast_to=VectorStore,
)
- def retrieve(
- self,
- vector_store_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
- """
- Get a vector store by ID.
-
- Args: vector_store_id: The ID of the vector store to retrieve.
-
- Returns: VectorStore: The response containing the vector store details.
-
- Args:
- vector_store_id: The ID of the vector store
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return self._get(
- f"/v1/vector_stores/{vector_store_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
- def update(
- self,
- vector_store_id: str,
- *,
- name: Optional[str] | NotGiven = NOT_GIVEN,
- description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
- metadata: object | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
- """
- Update a vector store by ID.
-
- Args: vector_store_id: The ID of the vector store to update.
- vector_store_update: VectorStoreCreate object containing the name, description,
- and metadata.
-
- Returns: VectorStore: The response containing the updated vector store details.
-
- Args:
- vector_store_id: The ID of the vector store
-
- name: New name for the vector store
-
- description: New description
-
- expires_after: Represents an expiration policy for a vector store.
-
- metadata: Optional metadata key-value pairs
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return self._put(
- f"/v1/vector_stores/{vector_store_id}",
- body=maybe_transform(
- {
- "name": name,
- "description": description,
- "expires_after": expires_after,
- "metadata": metadata,
- },
- vector_store_update_params.VectorStoreUpdateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
def list(
self,
*,
@@ -279,52 +176,15 @@ def list(
model=VectorStore,
)
- def delete(
- self,
- vector_store_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreDeleteResponse:
- """
- Delete a vector store by ID.
-
- Args: vector_store_id: The ID of the vector store to delete.
-
- Returns: VectorStore: The response containing the deleted vector store details.
-
- Args:
- vector_store_id: The ID of the vector store to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return self._delete(
- f"/v1/vector_stores/{vector_store_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreDeleteResponse,
- )
-
def question_answering(
self,
*,
query: str | NotGiven = NOT_GIVEN,
- vector_store_ids: List[str],
+ vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
@@ -343,12 +203,14 @@ def question_answering(
If not provided, the question will be extracted from the
passed messages.
- vector_store_ids: IDs of vector stores to search
+ vector_store_identifiers: IDs or names of vector stores to search
top_k: Number of results to return
filters: Optional filter conditions
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
search_options: Search configuration options
stream: Whether to stream the answer
@@ -368,9 +230,11 @@ def question_answering(
body=maybe_transform(
{
"query": query,
+ "vector_store_identifiers": vector_store_identifiers,
"vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
+ "file_ids": file_ids,
"search_options": search_options,
"stream": stream,
"qa_options": qa_options,
@@ -387,9 +251,11 @@ def search(
self,
*,
query: str,
- vector_store_ids: List[str],
+ vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
search_options: VectorStoreChunkSearchOptionsParam | 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.
@@ -406,7 +272,9 @@ def search(
relevance-scored results.
Args: search_params: Search configuration including: - query text or
- embeddings - metadata filters - pagination parameters - sorting preferences
+ embeddings - vector_store_ids: List of vector stores to search - file_ids:
+ Optional list of file IDs to filter chunks by (or tuple of list and condition
+ operator) - metadata filters - pagination parameters - sorting preferences
\\__state: API state dependency \\__ctx: Service context dependency
Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks
@@ -418,12 +286,14 @@ def search(
Args:
query: Search query text
- vector_store_ids: IDs of vector stores to search
+ vector_store_identifiers: IDs or names of vector stores to search
top_k: Number of results to return
filters: Optional filter conditions
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
search_options: Search configuration options
extra_headers: Send extra headers
@@ -439,9 +309,11 @@ def search(
body=maybe_transform(
{
"query": query,
+ "vector_store_identifiers": vector_store_identifiers,
"vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
+ "file_ids": file_ids,
"search_options": search_options,
},
vector_store_search_params.VectorStoreSearchParams,
@@ -537,107 +409,6 @@ async def create(
cast_to=VectorStore,
)
- async def retrieve(
- self,
- vector_store_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
- """
- Get a vector store by ID.
-
- Args: vector_store_id: The ID of the vector store to retrieve.
-
- Returns: VectorStore: The response containing the vector store details.
-
- Args:
- vector_store_id: The ID of the vector store
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return await self._get(
- f"/v1/vector_stores/{vector_store_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
- async def update(
- self,
- vector_store_id: str,
- *,
- name: Optional[str] | NotGiven = NOT_GIVEN,
- description: Optional[str] | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
- metadata: object | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStore:
- """
- Update a vector store by ID.
-
- Args: vector_store_id: The ID of the vector store to update.
- vector_store_update: VectorStoreCreate object containing the name, description,
- and metadata.
-
- Returns: VectorStore: The response containing the updated vector store details.
-
- Args:
- vector_store_id: The ID of the vector store
-
- name: New name for the vector store
-
- description: New description
-
- expires_after: Represents an expiration policy for a vector store.
-
- metadata: Optional metadata key-value pairs
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return await self._put(
- f"/v1/vector_stores/{vector_store_id}",
- body=await async_maybe_transform(
- {
- "name": name,
- "description": description,
- "expires_after": expires_after,
- "metadata": metadata,
- },
- vector_store_update_params.VectorStoreUpdateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
def list(
self,
*,
@@ -689,52 +460,15 @@ def list(
model=VectorStore,
)
- async def delete(
- self,
- vector_store_id: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreDeleteResponse:
- """
- Delete a vector store by ID.
-
- Args: vector_store_id: The ID of the vector store to delete.
-
- Returns: VectorStore: The response containing the deleted vector store details.
-
- Args:
- vector_store_id: The ID of the vector store to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_id:
- raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
- return await self._delete(
- f"/v1/vector_stores/{vector_store_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreDeleteResponse,
- )
-
async def question_answering(
self,
*,
query: str | NotGiven = NOT_GIVEN,
- vector_store_ids: List[str],
+ vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
@@ -753,12 +487,14 @@ async def question_answering(
If not provided, the question will be extracted from the
passed messages.
- vector_store_ids: IDs of vector stores to search
+ vector_store_identifiers: IDs or names of vector stores to search
top_k: Number of results to return
filters: Optional filter conditions
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
search_options: Search configuration options
stream: Whether to stream the answer
@@ -778,9 +514,11 @@ async def question_answering(
body=await async_maybe_transform(
{
"query": query,
+ "vector_store_identifiers": vector_store_identifiers,
"vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
+ "file_ids": file_ids,
"search_options": search_options,
"stream": stream,
"qa_options": qa_options,
@@ -797,9 +535,11 @@ async def search(
self,
*,
query: str,
- vector_store_ids: List[str],
+ vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
search_options: VectorStoreChunkSearchOptionsParam | 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.
@@ -816,7 +556,9 @@ async def search(
relevance-scored results.
Args: search_params: Search configuration including: - query text or
- embeddings - metadata filters - pagination parameters - sorting preferences
+ embeddings - vector_store_ids: List of vector stores to search - file_ids:
+ Optional list of file IDs to filter chunks by (or tuple of list and condition
+ operator) - metadata filters - pagination parameters - sorting preferences
\\__state: API state dependency \\__ctx: Service context dependency
Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks
@@ -828,12 +570,14 @@ async def search(
Args:
query: Search query text
- vector_store_ids: IDs of vector stores to search
+ vector_store_identifiers: IDs or names of vector stores to search
top_k: Number of results to return
filters: Optional filter conditions
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
search_options: Search configuration options
extra_headers: Send extra headers
@@ -849,9 +593,11 @@ async def search(
body=await async_maybe_transform(
{
"query": query,
+ "vector_store_identifiers": vector_store_identifiers,
"vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
+ "file_ids": file_ids,
"search_options": search_options,
},
vector_store_search_params.VectorStoreSearchParams,
@@ -870,18 +616,9 @@ def __init__(self, vector_stores: VectorStoresResource) -> None:
self.create = to_raw_response_wrapper(
vector_stores.create,
)
- self.retrieve = to_raw_response_wrapper(
- vector_stores.retrieve,
- )
- self.update = to_raw_response_wrapper(
- vector_stores.update,
- )
self.list = to_raw_response_wrapper(
vector_stores.list,
)
- self.delete = to_raw_response_wrapper(
- vector_stores.delete,
- )
self.question_answering = to_raw_response_wrapper(
vector_stores.question_answering,
)
@@ -901,18 +638,9 @@ def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self.create = async_to_raw_response_wrapper(
vector_stores.create,
)
- self.retrieve = async_to_raw_response_wrapper(
- vector_stores.retrieve,
- )
- self.update = async_to_raw_response_wrapper(
- vector_stores.update,
- )
self.list = async_to_raw_response_wrapper(
vector_stores.list,
)
- self.delete = async_to_raw_response_wrapper(
- vector_stores.delete,
- )
self.question_answering = async_to_raw_response_wrapper(
vector_stores.question_answering,
)
@@ -932,18 +660,9 @@ def __init__(self, vector_stores: VectorStoresResource) -> None:
self.create = to_streamed_response_wrapper(
vector_stores.create,
)
- self.retrieve = to_streamed_response_wrapper(
- vector_stores.retrieve,
- )
- self.update = to_streamed_response_wrapper(
- vector_stores.update,
- )
self.list = to_streamed_response_wrapper(
vector_stores.list,
)
- self.delete = to_streamed_response_wrapper(
- vector_stores.delete,
- )
self.question_answering = to_streamed_response_wrapper(
vector_stores.question_answering,
)
@@ -963,18 +682,9 @@ def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self.create = async_to_streamed_response_wrapper(
vector_stores.create,
)
- self.retrieve = async_to_streamed_response_wrapper(
- vector_stores.retrieve,
- )
- self.update = async_to_streamed_response_wrapper(
- vector_stores.update,
- )
self.list = async_to_streamed_response_wrapper(
vector_stores.list,
)
- self.delete = async_to_streamed_response_wrapper(
- vector_stores.delete,
- )
self.question_answering = async_to_streamed_response_wrapper(
vector_stores.question_answering,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 56f206a5..f6c35fcd 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -37,12 +37,10 @@
from .embedding_create_response import EmbeddingCreateResponse as EmbeddingCreateResponse
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_question_answering_params import (
diff --git a/src/mixedbread/types/vector_store_delete_response.py b/src/mixedbread/types/vector_store_delete_response.py
deleted file mode 100644
index 6643d44b..00000000
--- a/src/mixedbread/types/vector_store_delete_response.py
+++ /dev/null
@@ -1,19 +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__ = ["VectorStoreDeleteResponse"]
-
-
-class VectorStoreDeleteResponse(BaseModel):
- id: str
- """ID of the deleted vector store"""
-
- deleted: bool
- """Whether the deletion was successful"""
-
- object: Optional[Literal["vector_store"]] = None
- """Type of the deleted object"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index abb7919b..b34189b3 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -3,7 +3,7 @@
from __future__ import annotations
from typing import List, Union, Iterable, Optional
-from typing_extensions import Required, TypeAlias, TypedDict
+from typing_extensions import TypeAlias, TypedDict
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
@@ -18,8 +18,10 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
If not provided, the question will be extracted from the passed messages.
"""
- vector_store_ids: Required[List[str]]
- """IDs of vector stores to search"""
+ vector_store_identifiers: Optional[List[str]]
+ """IDs or names of vector stores to search"""
+
+ vector_store_ids: Optional[List[str]]
top_k: int
"""Number of results to return"""
@@ -27,6 +29,9 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
+ file_ids: Union[Iterable[object], List[str], None]
+ """Optional list of file IDs to filter chunks by (inclusion filter)"""
+
search_options: VectorStoreChunkSearchOptionsParam
"""Search configuration options"""
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index e0edc1bb..48fc21e1 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -15,8 +15,10 @@ class VectorStoreSearchParams(TypedDict, total=False):
query: Required[str]
"""Search query text"""
- vector_store_ids: Required[List[str]]
- """IDs of vector stores to search"""
+ vector_store_identifiers: Optional[List[str]]
+ """IDs or names of vector stores to search"""
+
+ vector_store_ids: Optional[List[str]]
top_k: int
"""Number of results to return"""
@@ -24,6 +26,9 @@ class VectorStoreSearchParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
+ file_ids: Union[Iterable[object], List[str], None]
+ """Optional list of file IDs to filter chunks by (inclusion filter)"""
+
search_options: VectorStoreChunkSearchOptionsParam
"""Search configuration options"""
diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py
deleted file mode 100644
index d8e6a83b..00000000
--- a/src/mixedbread/types/vector_store_update_params.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 import Optional
-from typing_extensions import TypedDict
-
-from .expires_after_param import ExpiresAfterParam
-
-__all__ = ["VectorStoreUpdateParams"]
-
-
-class VectorStoreUpdateParams(TypedDict, total=False):
- name: Optional[str]
- """New name for the vector store"""
-
- description: Optional[str]
- """New description"""
-
- expires_after: Optional[ExpiresAfterParam]
- """Represents an expiration policy for a vector store."""
-
- metadata: object
- """Optional metadata key-value pairs"""
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index e1af64d5..0c304acf 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -2,10 +2,6 @@
from __future__ import annotations
-from .file_list_params import FileListParams as FileListParams
-from .vector_store_file import VectorStoreFile as VectorStoreFile
-from .file_create_params import FileCreateParams as FileCreateParams
from .file_search_params import FileSearchParams as FileSearchParams
-from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .file_search_response import FileSearchResponse as FileSearchResponse
from .scored_vector_store_file import ScoredVectorStoreFile as ScoredVectorStoreFile
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
deleted file mode 100644
index e94f5505..00000000
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing_extensions import Literal, Required, TypedDict
-
-__all__ = ["FileCreateParams", "Experimental"]
-
-
-class FileCreateParams(TypedDict, total=False):
- file_id: Required[str]
- """ID of the file to add"""
-
- metadata: object
- """Optional metadata for the file"""
-
- experimental: Experimental
- """Strategy for adding the file"""
-
-
-class Experimental(TypedDict, total=False):
- parsing_strategy: Literal["fast", "high_quality"]
- """Strategy for adding the file"""
-
- contextualization: bool
- """Whether to contextualize the file"""
diff --git a/src/mixedbread/types/vector_stores/file_delete_response.py b/src/mixedbread/types/vector_stores/file_delete_response.py
deleted file mode 100644
index c56ec7b4..00000000
--- a/src/mixedbread/types/vector_stores/file_delete_response.py
+++ /dev/null
@@ -1,19 +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__ = ["FileDeleteResponse"]
-
-
-class FileDeleteResponse(BaseModel):
- id: str
- """ID of the deleted file"""
-
- deleted: Optional[bool] = None
- """Whether the deletion was successful"""
-
- object: Optional[Literal["vector_store.file"]] = None
- """Type of the deleted object"""
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
deleted file mode 100644
index 7ecfdf54..00000000
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ /dev/null
@@ -1,15 +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__ = ["FileListParams"]
-
-
-class FileListParams(TypedDict, total=False):
- limit: int
- """Maximum number of items to return per page"""
-
- offset: int
- """Offset of the first item to return"""
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 65e84d9f..2844c28a 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -21,8 +21,10 @@ class FileSearchParams(TypedDict, total=False):
query: Required[str]
"""Search query text"""
- vector_store_ids: Required[List[str]]
- """IDs of vector stores to search"""
+ vector_store_identifiers: Optional[List[str]]
+ """IDs or names of vector stores to search"""
+
+ vector_store_ids: Optional[List[str]]
top_k: int
"""Number of results to return"""
@@ -30,6 +32,9 @@ class FileSearchParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
+ file_ids: Union[Iterable[object], List[str], None]
+ """Optional list of file IDs to filter chunks by (inclusion filter)"""
+
search_options: SearchOptions
"""Search configuration options"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
deleted file mode 100644
index 39bdb685..00000000
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-
-__all__ = ["VectorStoreFile"]
-
-
-class VectorStoreFile(BaseModel):
- id: str
- """Unique identifier for the file"""
-
- filename: Optional[str] = None
- """Name of the file"""
-
- metadata: Optional[object] = None
- """Optional file metadata"""
-
- status: Optional[str] = None
- """Processing status of the file"""
-
- last_error: Optional[object] = None
- """Last error message if processing failed"""
-
- vector_store_id: str
- """ID of the containing vector store"""
-
- created_at: datetime
- """Timestamp of vector store file creation"""
-
- version: Optional[int] = None
- """Version number of the file"""
-
- usage_bytes: Optional[int] = None
- """Storage usage in bytes"""
-
- object: Optional[Literal["vector_store.file"]] = None
- """Type of the object"""
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index f2b1dbae..8cec05d2 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -11,7 +11,6 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
VectorStore,
- VectorStoreDeleteResponse,
VectorStoreSearchResponse,
VectorStoreQuestionAnsweringResponse,
)
@@ -62,96 +61,6 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
assert cast(Any, response.is_closed) is True
- @parametrize
- def test_method_retrieve(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_retrieve(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- client.vector_stores.with_raw_response.retrieve(
- "",
- )
-
- @parametrize
- def test_method_update(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.update(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- 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="description",
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- )
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_update(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.update(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_update(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.update(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_update(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- client.vector_stores.with_raw_response.update(
- vector_store_id="",
- )
-
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list()
@@ -185,56 +94,17 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert cast(Any, response.is_closed) is True
- @parametrize
- def test_method_delete(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.delete(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_delete(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.delete(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_delete(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.delete(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_delete(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- client.vector_stores.with_raw_response.delete(
- "",
- )
-
@parametrize
def test_method_question_answering(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
+ vector_store = client.vector_stores.question_answering()
assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
def test_method_question_answering_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.question_answering(
query="x",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ vector_store_identifiers=["string"],
+ vector_store_ids=["string"],
top_k=1,
filters={
"all": [
@@ -274,6 +144,7 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
},
],
},
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
"score_threshold": 0,
"rewrite_query": True,
@@ -290,9 +161,7 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
@parametrize
def test_raw_response_question_answering(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
+ response = client.vector_stores.with_raw_response.question_answering()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -301,9 +170,7 @@ def test_raw_response_question_answering(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_question_answering(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- ) as response:
+ with client.vector_stores.with_streaming_response.question_answering() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -316,7 +183,6 @@ def test_streaming_response_question_answering(self, client: Mixedbread) -> None
def test_method_search(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@@ -324,7 +190,8 @@ def test_method_search(self, client: Mixedbread) -> None:
def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ vector_store_identifiers=["string"],
+ vector_store_ids=["string"],
top_k=1,
filters={
"all": [
@@ -364,6 +231,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
},
],
},
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
"score_threshold": 0,
"rewrite_query": True,
@@ -377,7 +245,6 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
def test_raw_response_search(self, client: Mixedbread) -> None:
response = client.vector_stores.with_raw_response.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert response.is_closed is True
@@ -389,7 +256,6 @@ def test_raw_response_search(self, client: Mixedbread) -> None:
def test_streaming_response_search(self, client: Mixedbread) -> None:
with client.vector_stores.with_streaming_response.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -442,96 +308,6 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
assert cast(Any, response.is_closed) is True
- @parametrize
- async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.retrieve(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- await async_client.vector_stores.with_raw_response.retrieve(
- "",
- )
-
- @parametrize
- async def test_method_update(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.update(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.update(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- name="x",
- description="description",
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- )
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.update(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.update(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- await async_client.vector_stores.with_raw_response.update(
- vector_store_id="",
- )
-
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list()
@@ -565,56 +341,17 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert cast(Any, response.is_closed) is True
- @parametrize
- async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.delete(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.delete(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.delete(
- "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- await async_client.vector_stores.with_raw_response.delete(
- "",
- )
-
@parametrize
async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
+ vector_store = await async_client.vector_stores.question_answering()
assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
async def test_method_question_answering_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.question_answering(
query="x",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ vector_store_identifiers=["string"],
+ vector_store_ids=["string"],
top_k=1,
filters={
"all": [
@@ -654,6 +391,7 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
},
],
},
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
"score_threshold": 0,
"rewrite_query": True,
@@ -670,9 +408,7 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
@parametrize
async def test_raw_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
+ response = await async_client.vector_stores.with_raw_response.question_answering()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -681,9 +417,7 @@ async def test_raw_response_question_answering(self, async_client: AsyncMixedbre
@parametrize
async def test_streaming_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.question_answering(
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- ) as response:
+ async with async_client.vector_stores.with_streaming_response.question_answering() as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -696,7 +430,6 @@ async def test_streaming_response_question_answering(self, async_client: AsyncMi
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@@ -704,7 +437,8 @@ async def test_method_search(self, async_client: AsyncMixedbread) -> None:
async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ vector_store_identifiers=["string"],
+ vector_store_ids=["string"],
top_k=1,
filters={
"all": [
@@ -744,6 +478,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
},
],
},
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
"score_threshold": 0,
"rewrite_query": True,
@@ -757,7 +492,6 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
response = await async_client.vector_stores.with_raw_response.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert response.is_closed is True
@@ -769,7 +503,6 @@ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
async with async_client.vector_stores.with_streaming_response.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index d2e1c542..c8e4ab51 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -9,12 +9,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
-from mixedbread.types.vector_stores import (
- VectorStoreFile,
- FileDeleteResponse,
- FileSearchResponse,
-)
+from mixedbread.types.vector_stores import FileSearchResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -22,209 +17,10 @@
class TestFiles:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.create(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- def test_method_create_with_all_params(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.create(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- metadata={},
- experimental={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
- )
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.vector_stores.files.with_raw_response.create(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.create(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_create(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- client.vector_stores.files.with_raw_response.create(
- vector_store_id="",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- @parametrize
- def test_method_retrieve(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- 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(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- client.vector_stores.files.with_raw_response.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- client.vector_stores.files.with_raw_response.retrieve(
- file_id="",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- @parametrize
- def test_method_list(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.list(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
-
- @parametrize
- def test_method_list_with_all_params(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.list(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=1000,
- offset=0,
- )
- assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
-
- @parametrize
- def test_raw_response_list(self, client: Mixedbread) -> None:
- response = client.vector_stores.files.with_raw_response.list(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
-
- @parametrize
- def test_streaming_response_list(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.list(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_list(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- client.vector_stores.files.with_raw_response.list(
- vector_store_id="",
- )
-
- @parametrize
- def test_method_delete(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- def test_raw_response_delete(self, client: Mixedbread) -> None:
- response = client.vector_stores.files.with_raw_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- def test_streaming_response_delete(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_delete(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- client.vector_stores.files.with_raw_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- client.vector_stores.files.with_raw_response.delete(
- file_id="",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
@parametrize
def test_method_search(self, client: Mixedbread) -> None:
file = client.vector_stores.files.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(FileSearchResponse, file, path=["response"])
@@ -232,7 +28,8 @@ def test_method_search(self, client: Mixedbread) -> None:
def test_method_search_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ vector_store_identifiers=["string"],
+ vector_store_ids=["string"],
top_k=1,
filters={
"all": [
@@ -272,6 +69,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
},
],
},
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
"score_threshold": 0,
"rewrite_query": True,
@@ -287,7 +85,6 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
def test_raw_response_search(self, client: Mixedbread) -> None:
response = client.vector_stores.files.with_raw_response.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert response.is_closed is True
@@ -299,7 +96,6 @@ def test_raw_response_search(self, client: Mixedbread) -> None:
def test_streaming_response_search(self, client: Mixedbread) -> None:
with client.vector_stores.files.with_streaming_response.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -313,209 +109,10 @@ def test_streaming_response_search(self, client: Mixedbread) -> None:
class TestAsyncFiles:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.create(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.create(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- metadata={},
- experimental={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
- )
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.files.with_raw_response.create(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.create(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_create(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.create(
- vector_store_id="",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- @parametrize
- async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- 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(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.retrieve(
- file_id="",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- @parametrize
- async def test_method_list(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.list(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
-
- @parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.list(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=1000,
- offset=0,
- )
- assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
-
- @parametrize
- async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.files.with_raw_response.list(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
-
- @parametrize
- async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.list(
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.list(
- vector_store_id="",
- )
-
- @parametrize
- async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.files.with_raw_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `vector_store_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.delete(
- file_id="",
- vector_store_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
@parametrize
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(FileSearchResponse, file, path=["response"])
@@ -523,7 +120,8 @@ async def test_method_search(self, async_client: AsyncMixedbread) -> None:
async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ vector_store_identifiers=["string"],
+ vector_store_ids=["string"],
top_k=1,
filters={
"all": [
@@ -563,6 +161,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
},
],
},
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
"score_threshold": 0,
"rewrite_query": True,
@@ -578,7 +177,6 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
response = await async_client.vector_stores.files.with_raw_response.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert response.is_closed is True
@@ -590,7 +188,6 @@ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
async with async_client.vector_stores.files.with_streaming_response.search(
query="how to configure SSL",
- vector_store_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
From 42d17f05a56c1b81028a4bfb42d10763c20f0877 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 4 Jun 2025 11:14:09 +0000
Subject: [PATCH 157/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 9 +
.../resources/vector_stores/files.py | 479 +++++++++++++++++-
.../resources/vector_stores/vector_stores.py | 330 ++++++++++++
src/mixedbread/types/__init__.py | 2 +
.../types/vector_store_delete_response.py | 19 +
.../types/vector_store_update_params.py | 24 +
.../types/vector_stores/__init__.py | 4 +
.../types/vector_stores/file_create_params.py | 26 +
.../vector_stores/file_delete_response.py | 19 +
.../types/vector_stores/file_list_params.py | 15 +
.../types/vector_stores/vector_store_file.py | 41 ++
tests/api_resources/test_vector_stores.py | 269 ++++++++++
.../api_resources/vector_stores/test_files.py | 419 ++++++++++++++-
14 files changed, 1655 insertions(+), 5 deletions(-)
create mode 100644 src/mixedbread/types/vector_store_delete_response.py
create mode 100644 src/mixedbread/types/vector_store_update_params.py
create mode 100644 src/mixedbread/types/vector_stores/file_create_params.py
create mode 100644 src/mixedbread/types/vector_stores/file_delete_response.py
create mode 100644 src/mixedbread/types/vector_stores/file_list_params.py
create mode 100644 src/mixedbread/types/vector_stores/vector_store_file.py
diff --git a/.stats.yml b/.stats.yml
index c866a6b1..d5cba8e8 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 41
+configured_endpoints: 48
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-1e610a163c03f43caa65295f9fc5baf467f848ec588289f1111ff559d190e501.yml
openapi_spec_hash: ef3971cea2dd00e88561e52e267043dd
-config_hash: 356855b953f227221cc8b1262aaafa2a
+config_hash: 8545159b6ba2d638b8a2e7bbed6f04e7
diff --git a/api.md b/api.md
index 91e8b7cf..0008e67f 100644
--- a/api.md
+++ b/api.md
@@ -37,6 +37,7 @@ from mixedbread.types import (
ScoredVideoURLInputChunk,
VectorStore,
VectorStoreChunkSearchOptions,
+ VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
)
@@ -45,7 +46,10 @@ from mixedbread.types import (
Methods:
- client.vector_stores.create(\*\*params) -> VectorStore
+- client.vector_stores.retrieve(vector_store_identifier) -> VectorStore
+- client.vector_stores.update(vector_store_identifier, \*\*params) -> VectorStore
- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStore]
+- client.vector_stores.delete(vector_store_identifier) -> VectorStoreDeleteResponse
- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
@@ -57,12 +61,17 @@ Types:
from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFile,
+ FileDeleteResponse,
FileSearchResponse,
)
```
Methods:
+- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
+- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier) -> VectorStoreFile
+- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> SyncLimitOffset[VectorStoreFile]
+- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
# Parsing
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 6c06e4c5..59d9167a 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -16,8 +16,11 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
-from ...types.vector_stores import file_search_params
+from ...pagination import SyncLimitOffset, AsyncLimitOffset
+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.vector_store_file import VectorStoreFile
+from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -43,6 +46,218 @@ def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
"""
return FilesResourceWithStreamingResponse(self)
+ def create(
+ self,
+ vector_store_identifier: str,
+ *,
+ file_id: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ experimental: file_create_params.Experimental | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStoreFile:
+ """
+ Upload a new file to a vector store for indexing.
+
+ Args: vector_store_identifier: The ID or name of the vector store to upload to
+ file: The file to upload and index
+
+ Returns: VectorStoreFile: Details of the uploaded and indexed file
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ file_id: ID of the file to add
+
+ metadata: Optional metadata for the file
+
+ experimental: Strategy for adding the file
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return self._post(
+ f"/v1/vector_stores/{vector_store_identifier}/files",
+ body=maybe_transform(
+ {
+ "file_id": file_id,
+ "metadata": metadata,
+ "experimental": experimental,
+ },
+ file_create_params.FileCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=VectorStoreFile,
+ )
+
+ def retrieve(
+ self,
+ file_id: str,
+ *,
+ vector_store_identifier: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStoreFile:
+ """
+ Get details of a specific file in a vector store.
+
+ Args: vector_store_identifier: The ID or name of the vector store file_id: The
+ ID of the file
+
+ Returns: VectorStoreFile: Details of the vector store file
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ file_id: The ID of the file
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ 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
+ ),
+ cast_to=VectorStoreFile,
+ )
+
+ def list(
+ self,
+ vector_store_identifier: str,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> SyncLimitOffset[VectorStoreFile]:
+ """
+ List files indexed in a vector store with pagination.
+
+ Args: vector_store_identifier: The ID or name of the vector store pagination:
+ Pagination parameters
+
+ Returns: VectorStoreFileListResponse: Paginated list of vector store files
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return self._get_api_list(
+ f"/v1/vector_stores/{vector_store_identifier}/files",
+ page=SyncLimitOffset[VectorStoreFile],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ file_list_params.FileListParams,
+ ),
+ ),
+ model=VectorStoreFile,
+ )
+
+ def delete(
+ self,
+ file_id: str,
+ *,
+ vector_store_identifier: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> FileDeleteResponse:
+ """
+ Delete a file from a vector store.
+
+ Args: vector_store_identifier: The ID or name of the vector store file_id: The
+ ID of the file to delete
+
+ Returns: VectorStoreFileDeleted: The deleted file
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ file_id: The ID of the file to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ return self._delete(
+ 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
+ ),
+ cast_to=FileDeleteResponse,
+ )
+
def search(
self,
*,
@@ -140,6 +355,218 @@ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
"""
return AsyncFilesResourceWithStreamingResponse(self)
+ async def create(
+ self,
+ vector_store_identifier: str,
+ *,
+ file_id: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ experimental: file_create_params.Experimental | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStoreFile:
+ """
+ Upload a new file to a vector store for indexing.
+
+ Args: vector_store_identifier: The ID or name of the vector store to upload to
+ file: The file to upload and index
+
+ Returns: VectorStoreFile: Details of the uploaded and indexed file
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ file_id: ID of the file to add
+
+ metadata: Optional metadata for the file
+
+ experimental: Strategy for adding the file
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return await self._post(
+ f"/v1/vector_stores/{vector_store_identifier}/files",
+ body=await async_maybe_transform(
+ {
+ "file_id": file_id,
+ "metadata": metadata,
+ "experimental": experimental,
+ },
+ file_create_params.FileCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=VectorStoreFile,
+ )
+
+ async def retrieve(
+ self,
+ file_id: str,
+ *,
+ vector_store_identifier: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStoreFile:
+ """
+ Get details of a specific file in a vector store.
+
+ Args: vector_store_identifier: The ID or name of the vector store file_id: The
+ ID of the file
+
+ Returns: VectorStoreFile: Details of the vector store file
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ file_id: The ID of the file
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ 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
+ ),
+ cast_to=VectorStoreFile,
+ )
+
+ def list(
+ self,
+ vector_store_identifier: str,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ offset: int | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> AsyncPaginator[VectorStoreFile, AsyncLimitOffset[VectorStoreFile]]:
+ """
+ List files indexed in a vector store with pagination.
+
+ Args: vector_store_identifier: The ID or name of the vector store pagination:
+ Pagination parameters
+
+ Returns: VectorStoreFileListResponse: Paginated list of vector store files
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ limit: Maximum number of items to return per page
+
+ offset: Offset of the first item to return
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return self._get_api_list(
+ f"/v1/vector_stores/{vector_store_identifier}/files",
+ page=AsyncLimitOffset[VectorStoreFile],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "offset": offset,
+ },
+ file_list_params.FileListParams,
+ ),
+ ),
+ model=VectorStoreFile,
+ )
+
+ async def delete(
+ self,
+ file_id: str,
+ *,
+ vector_store_identifier: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> FileDeleteResponse:
+ """
+ Delete a file from a vector store.
+
+ Args: vector_store_identifier: The ID or name of the vector store file_id: The
+ ID of the file to delete
+
+ Returns: VectorStoreFileDeleted: The deleted file
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ file_id: The ID of the file to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ return await self._delete(
+ 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
+ ),
+ cast_to=FileDeleteResponse,
+ )
+
async def search(
self,
*,
@@ -221,6 +648,18 @@ class FilesResourceWithRawResponse:
def __init__(self, files: FilesResource) -> None:
self._files = files
+ self.create = to_raw_response_wrapper(
+ files.create,
+ )
+ self.retrieve = to_raw_response_wrapper(
+ files.retrieve,
+ )
+ self.list = to_raw_response_wrapper(
+ files.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ files.delete,
+ )
self.search = to_raw_response_wrapper(
files.search,
)
@@ -230,6 +669,18 @@ class AsyncFilesResourceWithRawResponse:
def __init__(self, files: AsyncFilesResource) -> None:
self._files = files
+ self.create = async_to_raw_response_wrapper(
+ files.create,
+ )
+ self.retrieve = async_to_raw_response_wrapper(
+ files.retrieve,
+ )
+ self.list = async_to_raw_response_wrapper(
+ files.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ files.delete,
+ )
self.search = async_to_raw_response_wrapper(
files.search,
)
@@ -239,6 +690,18 @@ class FilesResourceWithStreamingResponse:
def __init__(self, files: FilesResource) -> None:
self._files = files
+ self.create = to_streamed_response_wrapper(
+ files.create,
+ )
+ self.retrieve = to_streamed_response_wrapper(
+ files.retrieve,
+ )
+ self.list = to_streamed_response_wrapper(
+ files.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ files.delete,
+ )
self.search = to_streamed_response_wrapper(
files.search,
)
@@ -248,6 +711,18 @@ class AsyncFilesResourceWithStreamingResponse:
def __init__(self, files: AsyncFilesResource) -> None:
self._files = files
+ self.create = async_to_streamed_response_wrapper(
+ files.create,
+ )
+ self.retrieve = async_to_streamed_response_wrapper(
+ files.retrieve,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ files.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ files.delete,
+ )
self.search = async_to_streamed_response_wrapper(
files.search,
)
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index b71f9a47..de10bc08 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -18,6 +18,7 @@
vector_store_list_params,
vector_store_create_params,
vector_store_search_params,
+ vector_store_update_params,
vector_store_question_answering_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
@@ -34,6 +35,7 @@
from ..._base_client import AsyncPaginator, make_request_options
from ...types.vector_store import VectorStore
from ...types.expires_after_param import ExpiresAfterParam
+from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
from ...types.vector_store_question_answering_response import VectorStoreQuestionAnsweringResponse
@@ -125,6 +127,111 @@ def create(
cast_to=VectorStore,
)
+ def retrieve(
+ self,
+ vector_store_identifier: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStore:
+ """
+ Get a vector store by ID or name.
+
+ Args: vector_store_identifier: The ID or name of the vector store to retrieve.
+
+ Returns: VectorStore: The response containing the vector store details.
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return self._get(
+ f"/v1/vector_stores/{vector_store_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=VectorStore,
+ )
+
+ def update(
+ self,
+ vector_store_identifier: str,
+ *,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
+ description: Optional[str] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
+ metadata: object | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStore:
+ """
+ Update a vector store by ID or name.
+
+ Args: vector_store_identifier: The ID or name of the vector store to update.
+ vector_store_update: VectorStoreCreate object containing the name, description,
+ and metadata.
+
+ Returns: VectorStore: The response containing the updated vector store details.
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ name: New name for the vector store
+
+ description: New description
+
+ expires_after: Represents an expiration policy for a vector store.
+
+ metadata: Optional metadata key-value pairs
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return self._put(
+ f"/v1/vector_stores/{vector_store_identifier}",
+ body=maybe_transform(
+ {
+ "name": name,
+ "description": description,
+ "expires_after": expires_after,
+ "metadata": metadata,
+ },
+ vector_store_update_params.VectorStoreUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=VectorStore,
+ )
+
def list(
self,
*,
@@ -176,6 +283,47 @@ def list(
model=VectorStore,
)
+ def delete(
+ self,
+ vector_store_identifier: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStoreDeleteResponse:
+ """
+ Delete a vector store by ID or name.
+
+ Args: vector_store_identifier: The ID or name of the vector store to delete.
+
+ Returns: VectorStore: The response containing the deleted vector store details.
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return self._delete(
+ f"/v1/vector_stores/{vector_store_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=VectorStoreDeleteResponse,
+ )
+
def question_answering(
self,
*,
@@ -409,6 +557,111 @@ async def create(
cast_to=VectorStore,
)
+ async def retrieve(
+ self,
+ vector_store_identifier: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStore:
+ """
+ Get a vector store by ID or name.
+
+ Args: vector_store_identifier: The ID or name of the vector store to retrieve.
+
+ Returns: VectorStore: The response containing the vector store details.
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return await self._get(
+ f"/v1/vector_stores/{vector_store_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=VectorStore,
+ )
+
+ async def update(
+ self,
+ vector_store_identifier: str,
+ *,
+ name: Optional[str] | NotGiven = NOT_GIVEN,
+ description: Optional[str] | NotGiven = NOT_GIVEN,
+ expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
+ metadata: object | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStore:
+ """
+ Update a vector store by ID or name.
+
+ Args: vector_store_identifier: The ID or name of the vector store to update.
+ vector_store_update: VectorStoreCreate object containing the name, description,
+ and metadata.
+
+ Returns: VectorStore: The response containing the updated vector store details.
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ name: New name for the vector store
+
+ description: New description
+
+ expires_after: Represents an expiration policy for a vector store.
+
+ metadata: Optional metadata key-value pairs
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return await self._put(
+ f"/v1/vector_stores/{vector_store_identifier}",
+ body=await async_maybe_transform(
+ {
+ "name": name,
+ "description": description,
+ "expires_after": expires_after,
+ "metadata": metadata,
+ },
+ vector_store_update_params.VectorStoreUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=VectorStore,
+ )
+
def list(
self,
*,
@@ -460,6 +713,47 @@ def list(
model=VectorStore,
)
+ async def delete(
+ self,
+ vector_store_identifier: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> VectorStoreDeleteResponse:
+ """
+ Delete a vector store by ID or name.
+
+ Args: vector_store_identifier: The ID or name of the vector store to delete.
+
+ Returns: VectorStore: The response containing the deleted vector store details.
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return await self._delete(
+ f"/v1/vector_stores/{vector_store_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=VectorStoreDeleteResponse,
+ )
+
async def question_answering(
self,
*,
@@ -616,9 +910,18 @@ def __init__(self, vector_stores: VectorStoresResource) -> None:
self.create = to_raw_response_wrapper(
vector_stores.create,
)
+ self.retrieve = to_raw_response_wrapper(
+ vector_stores.retrieve,
+ )
+ self.update = to_raw_response_wrapper(
+ vector_stores.update,
+ )
self.list = to_raw_response_wrapper(
vector_stores.list,
)
+ self.delete = to_raw_response_wrapper(
+ vector_stores.delete,
+ )
self.question_answering = to_raw_response_wrapper(
vector_stores.question_answering,
)
@@ -638,9 +941,18 @@ def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self.create = async_to_raw_response_wrapper(
vector_stores.create,
)
+ self.retrieve = async_to_raw_response_wrapper(
+ vector_stores.retrieve,
+ )
+ self.update = async_to_raw_response_wrapper(
+ vector_stores.update,
+ )
self.list = async_to_raw_response_wrapper(
vector_stores.list,
)
+ self.delete = async_to_raw_response_wrapper(
+ vector_stores.delete,
+ )
self.question_answering = async_to_raw_response_wrapper(
vector_stores.question_answering,
)
@@ -660,9 +972,18 @@ def __init__(self, vector_stores: VectorStoresResource) -> None:
self.create = to_streamed_response_wrapper(
vector_stores.create,
)
+ self.retrieve = to_streamed_response_wrapper(
+ vector_stores.retrieve,
+ )
+ self.update = to_streamed_response_wrapper(
+ vector_stores.update,
+ )
self.list = to_streamed_response_wrapper(
vector_stores.list,
)
+ self.delete = to_streamed_response_wrapper(
+ vector_stores.delete,
+ )
self.question_answering = to_streamed_response_wrapper(
vector_stores.question_answering,
)
@@ -682,9 +1003,18 @@ def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self.create = async_to_streamed_response_wrapper(
vector_stores.create,
)
+ self.retrieve = async_to_streamed_response_wrapper(
+ vector_stores.retrieve,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ vector_stores.update,
+ )
self.list = async_to_streamed_response_wrapper(
vector_stores.list,
)
+ self.delete = async_to_streamed_response_wrapper(
+ vector_stores.delete,
+ )
self.question_answering = async_to_streamed_response_wrapper(
vector_stores.question_answering,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index f6c35fcd..56f206a5 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -37,10 +37,12 @@
from .embedding_create_response import EmbeddingCreateResponse as EmbeddingCreateResponse
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_question_answering_params import (
diff --git a/src/mixedbread/types/vector_store_delete_response.py b/src/mixedbread/types/vector_store_delete_response.py
new file mode 100644
index 00000000..6643d44b
--- /dev/null
+++ b/src/mixedbread/types/vector_store_delete_response.py
@@ -0,0 +1,19 @@
+# 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__ = ["VectorStoreDeleteResponse"]
+
+
+class VectorStoreDeleteResponse(BaseModel):
+ id: str
+ """ID of the deleted vector store"""
+
+ deleted: bool
+ """Whether the deletion was successful"""
+
+ object: Optional[Literal["vector_store"]] = None
+ """Type of the deleted object"""
diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py
new file mode 100644
index 00000000..d8e6a83b
--- /dev/null
+++ b/src/mixedbread/types/vector_store_update_params.py
@@ -0,0 +1,24 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Optional
+from typing_extensions import TypedDict
+
+from .expires_after_param import ExpiresAfterParam
+
+__all__ = ["VectorStoreUpdateParams"]
+
+
+class VectorStoreUpdateParams(TypedDict, total=False):
+ name: Optional[str]
+ """New name for the vector store"""
+
+ description: Optional[str]
+ """New description"""
+
+ expires_after: Optional[ExpiresAfterParam]
+ """Represents an expiration policy for a vector store."""
+
+ metadata: object
+ """Optional metadata key-value pairs"""
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index 0c304acf..e1af64d5 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -2,6 +2,10 @@
from __future__ import annotations
+from .file_list_params import FileListParams as FileListParams
+from .vector_store_file import VectorStoreFile as VectorStoreFile
+from .file_create_params import FileCreateParams as FileCreateParams
from .file_search_params import FileSearchParams as FileSearchParams
+from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .file_search_response import FileSearchResponse as FileSearchResponse
from .scored_vector_store_file import ScoredVectorStoreFile as ScoredVectorStoreFile
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
new file mode 100644
index 00000000..e94f5505
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -0,0 +1,26 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["FileCreateParams", "Experimental"]
+
+
+class FileCreateParams(TypedDict, total=False):
+ file_id: Required[str]
+ """ID of the file to add"""
+
+ metadata: object
+ """Optional metadata for the file"""
+
+ experimental: Experimental
+ """Strategy for adding the file"""
+
+
+class Experimental(TypedDict, total=False):
+ parsing_strategy: Literal["fast", "high_quality"]
+ """Strategy for adding the file"""
+
+ contextualization: bool
+ """Whether to contextualize the file"""
diff --git a/src/mixedbread/types/vector_stores/file_delete_response.py b/src/mixedbread/types/vector_stores/file_delete_response.py
new file mode 100644
index 00000000..c56ec7b4
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_delete_response.py
@@ -0,0 +1,19 @@
+# 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__ = ["FileDeleteResponse"]
+
+
+class FileDeleteResponse(BaseModel):
+ id: str
+ """ID of the deleted file"""
+
+ deleted: Optional[bool] = None
+ """Whether the deletion was successful"""
+
+ object: Optional[Literal["vector_store.file"]] = None
+ """Type of the deleted object"""
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
new file mode 100644
index 00000000..7ecfdf54
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -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 TypedDict
+
+__all__ = ["FileListParams"]
+
+
+class FileListParams(TypedDict, total=False):
+ limit: int
+ """Maximum number of items to return per page"""
+
+ offset: int
+ """Offset of the first item to return"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
new file mode 100644
index 00000000..39bdb685
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -0,0 +1,41 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["VectorStoreFile"]
+
+
+class VectorStoreFile(BaseModel):
+ id: str
+ """Unique identifier for the file"""
+
+ filename: Optional[str] = None
+ """Name of the file"""
+
+ metadata: Optional[object] = None
+ """Optional file metadata"""
+
+ status: Optional[str] = None
+ """Processing status of the file"""
+
+ last_error: Optional[object] = None
+ """Last error message if processing failed"""
+
+ vector_store_id: str
+ """ID of the containing vector store"""
+
+ created_at: datetime
+ """Timestamp of vector store file creation"""
+
+ version: Optional[int] = None
+ """Version number of the file"""
+
+ usage_bytes: Optional[int] = None
+ """Storage usage in bytes"""
+
+ object: Optional[Literal["vector_store.file"]] = None
+ """Type of the object"""
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 8cec05d2..9bc29d69 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -11,6 +11,7 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
VectorStore,
+ VectorStoreDeleteResponse,
VectorStoreSearchResponse,
VectorStoreQuestionAnsweringResponse,
)
@@ -61,6 +62,100 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
assert cast(Any, response.is_closed) is True
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ vector_store = client.vector_stores.retrieve(
+ "vector_store_identifier",
+ )
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
+ response = client.vector_stores.with_raw_response.retrieve(
+ "vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vector_store = response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.vector_stores.with_streaming_response.retrieve(
+ "vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vector_store = response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ def test_method_update(self, client: Mixedbread) -> None:
+ vector_store = client.vector_stores.update(
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
+ vector_store = client.vector_stores.update(
+ vector_store_identifier="vector_store_identifier",
+ name="x",
+ description="description",
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ )
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ def test_raw_response_update(self, client: Mixedbread) -> None:
+ response = client.vector_stores.with_raw_response.update(
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vector_store = response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_update(self, client: Mixedbread) -> None:
+ with client.vector_stores.with_streaming_response.update(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vector_store = response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_update(self, client: Mixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.with_raw_response.update(
+ vector_store_identifier="",
+ )
+
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list()
@@ -94,6 +189,46 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert cast(Any, response.is_closed) is True
+ @parametrize
+ def test_method_delete(self, client: Mixedbread) -> None:
+ vector_store = client.vector_stores.delete(
+ "vector_store_identifier",
+ )
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
+
+ @parametrize
+ def test_raw_response_delete(self, client: Mixedbread) -> None:
+ response = client.vector_stores.with_raw_response.delete(
+ "vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vector_store = response.parse()
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_delete(self, client: Mixedbread) -> None:
+ with client.vector_stores.with_streaming_response.delete(
+ "vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vector_store = response.parse()
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_delete(self, client: Mixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.with_raw_response.delete(
+ "",
+ )
+
@parametrize
def test_method_question_answering(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.question_answering()
@@ -308,6 +443,100 @@ async def test_streaming_response_create(self, async_client: AsyncMixedbread) ->
assert cast(Any, response.is_closed) is True
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
+ vector_store = await async_client.vector_stores.retrieve(
+ "vector_store_identifier",
+ )
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.vector_stores.with_raw_response.retrieve(
+ "vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vector_store = await response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.with_streaming_response.retrieve(
+ "vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vector_store = await response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
+ vector_store = await async_client.vector_stores.update(
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ vector_store = await async_client.vector_stores.update(
+ vector_store_identifier="vector_store_identifier",
+ name="x",
+ description="description",
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ )
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.vector_stores.with_raw_response.update(
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vector_store = await response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.with_streaming_response.update(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vector_store = await response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.with_raw_response.update(
+ vector_store_identifier="",
+ )
+
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list()
@@ -341,6 +570,46 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert cast(Any, response.is_closed) is True
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
+ vector_store = await async_client.vector_stores.delete(
+ "vector_store_identifier",
+ )
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.vector_stores.with_raw_response.delete(
+ "vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ vector_store = await response.parse()
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.with_streaming_response.delete(
+ "vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vector_store = await response.parse()
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.with_raw_response.delete(
+ "",
+ )
+
@parametrize
async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.question_answering()
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index c8e4ab51..6a4128de 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -9,7 +9,12 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types.vector_stores import FileSearchResponse
+from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
+from mixedbread.types.vector_stores import (
+ VectorStoreFile,
+ FileDeleteResponse,
+ FileSearchResponse,
+)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -17,6 +22,212 @@
class TestFiles:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ metadata={},
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
+ )
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.vector_stores.files.with_raw_response.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.vector_stores.files.with_streaming_response.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_create(self, client: Mixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.create(
+ vector_store_identifier="",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.retrieve(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ )
+ 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(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.vector_stores.files.with_streaming_response.retrieve(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.retrieve(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ client.vector_stores.files.with_raw_response.retrieve(
+ file_id="",
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ limit=1000,
+ offset=0,
+ )
+ assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Mixedbread) -> None:
+ response = client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Mixedbread) -> None:
+ with client.vector_stores.files.with_streaming_response.list(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_list(self, client: Mixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="",
+ )
+
+ @parametrize
+ def test_method_delete(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.delete(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_delete(self, client: Mixedbread) -> None:
+ response = client.vector_stores.files.with_raw_response.delete(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_delete(self, client: Mixedbread) -> None:
+ with client.vector_stores.files.with_streaming_response.delete(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_delete(self, client: Mixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.delete(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ client.vector_stores.files.with_raw_response.delete(
+ file_id="",
+ vector_store_identifier="vector_store_identifier",
+ )
+
@parametrize
def test_method_search(self, client: Mixedbread) -> None:
file = client.vector_stores.files.search(
@@ -109,6 +320,212 @@ def test_streaming_response_search(self, client: Mixedbread) -> None:
class TestAsyncFiles:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.vector_stores.files.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.vector_stores.files.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ metadata={},
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
+ )
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.vector_stores.files.with_raw_response.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.files.with_streaming_response.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_create(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.create(
+ vector_store_identifier="",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ @parametrize
+ async def test_method_retrieve(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",
+ )
+ 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(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.files.with_streaming_response.retrieve(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.retrieve(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ await async_client.vector_stores.files.with_raw_response.retrieve(
+ file_id="",
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ limit=1000,
+ offset=0,
+ )
+ assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.files.with_streaming_response.list(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="",
+ )
+
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.vector_stores.files.delete(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.vector_stores.files.with_raw_response.delete(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.files.with_streaming_response.delete(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.delete(
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ vector_store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ await async_client.vector_stores.files.with_raw_response.delete(
+ file_id="",
+ vector_store_identifier="vector_store_identifier",
+ )
+
@parametrize
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.search(
From 211ac0ebaab8518813fc3235ffbd5d43b720c44c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 10 Jun 2025 15:25:26 +0000
Subject: [PATCH 158/375] feat(api): api update
---
.stats.yml | 4 +-
.../resources/data_sources/data_sources.py | 311 ++++++++++++++++--
src/mixedbread/types/__init__.py | 1 -
src/mixedbread/types/data_source.py | 23 +-
.../types/data_source_create_params.py | 64 +++-
.../types/data_source_oauth2_params.py | 16 +-
.../types/data_source_oauth2_params_param.py | 42 ---
.../types/data_source_update_params.py | 68 +++-
src/mixedbread/types/vector_store.py | 3 +
.../vector_stores/scored_vector_store_file.py | 2 +-
.../types/vector_stores/vector_store_file.py | 2 +-
tests/api_resources/test_data_sources.py | 289 ++++++++++++----
12 files changed, 655 insertions(+), 170 deletions(-)
delete mode 100644 src/mixedbread/types/data_source_oauth2_params_param.py
diff --git a/.stats.yml b/.stats.yml
index d5cba8e8..bb18ecff 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 48
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-1e610a163c03f43caa65295f9fc5baf467f848ec588289f1111ff559d190e501.yml
-openapi_spec_hash: ef3971cea2dd00e88561e52e267043dd
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-6b06bb4445b89267baa75d56ef71b875f980c2cb38e1884a74f699feaee6a7ce.yml
+openapi_spec_hash: 75094130ee0b736a9b3e928df7c942d2
config_hash: 8545159b6ba2d638b8a2e7bbed6f04e7
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index a579c6ac..1f3fc0f9 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -3,17 +3,13 @@
from __future__ import annotations
from typing import Optional
+from typing_extensions import overload
import httpx
-from ...types import (
- DataSourceType,
- data_source_list_params,
- data_source_create_params,
- data_source_update_params,
-)
+from ...types import DataSourceType, data_source_list_params, data_source_create_params, data_source_update_params
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
-from ..._utils import maybe_transform, async_maybe_transform
+from ..._utils import required_args, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from .connectors import (
ConnectorsResource,
@@ -35,7 +31,6 @@
from ...types.data_source import DataSource
from ...types.data_source_type import DataSourceType
from ...types.data_source_delete_response import DataSourceDeleteResponse
-from ...types.data_source_oauth2_params_param import DataSourceOauth2ParamsParam
__all__ = ["DataSourcesResource", "AsyncDataSourcesResource"]
@@ -64,13 +59,15 @@ def with_streaming_response(self) -> DataSourcesResourceWithStreamingResponse:
"""
return DataSourcesResourceWithStreamingResponse(self)
+ @overload
def create(
self,
*,
- type: DataSourceType,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[DataSourceOauth2ParamsParam] | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
@@ -92,7 +89,8 @@ def create(
metadata: The metadata of the data source
- auth_params: Authentication parameters for a OAuth data source.
+ auth_params: The authentication parameters of the data source. Notion supports OAuth2 and API
+ key.
extra_headers: Send extra headers
@@ -102,6 +100,67 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ ...
+
+ @overload
+ def create(
+ self,
+ *,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSource:
+ """
+ Create a new data source.
+
+ Args: params: The data source to create.
+
+ Returns: The created data source.
+
+ Args:
+ type: The type of data source to create
+
+ name: The name of the data source
+
+ metadata: The metadata of the data source
+
+ auth_params: Base class for OAuth2 create or update parameters.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @required_args(["name"])
+ def create(
+ self,
+ *,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
+ | Optional[data_source_create_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSource:
return self._post(
"/v1/data_sources/",
body=maybe_transform(
@@ -158,13 +217,16 @@ def retrieve(
cast_to=DataSource,
)
+ @overload
def update(
self,
data_source_id: str,
*,
- name: Optional[str] | NotGiven = NOT_GIVEN,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[DataSourceOauth2ParamsParam] | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
@@ -184,11 +246,14 @@ def update(
Args:
data_source_id: The ID of the data source to update
+ type: The type of data source to create
+
name: The name of the data source
metadata: The metadata of the data source
- auth_params: Authentication parameters for a OAuth data source.
+ auth_params: The authentication parameters of the data source. Notion supports OAuth2 and API
+ key.
extra_headers: Send extra headers
@@ -198,12 +263,80 @@ def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ ...
+
+ @overload
+ def update(
+ self,
+ data_source_id: str,
+ *,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSource:
+ """Update a data source.
+
+ Args: data_source_id: The ID of the data source to update.
+
+ params: The data
+ source to update.
+
+ Returns: The updated data source.
+
+ Args:
+ data_source_id: The ID of the data source to update
+
+ type: The type of data source to create
+
+ name: The name of the data source
+
+ metadata: The metadata of the data source
+
+ auth_params: Base class for OAuth2 create or update parameters.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @required_args(["name"])
+ def update(
+ self,
+ data_source_id: str,
+ *,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
+ | Optional[data_source_update_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSource:
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
return self._put(
f"/v1/data_sources/{data_source_id}",
body=maybe_transform(
{
+ "type": type,
"name": name,
"metadata": metadata,
"auth_params": auth_params,
@@ -327,13 +460,15 @@ def with_streaming_response(self) -> AsyncDataSourcesResourceWithStreamingRespon
"""
return AsyncDataSourcesResourceWithStreamingResponse(self)
+ @overload
async def create(
self,
*,
- type: DataSourceType,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[DataSourceOauth2ParamsParam] | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
@@ -355,7 +490,8 @@ async def create(
metadata: The metadata of the data source
- auth_params: Authentication parameters for a OAuth data source.
+ auth_params: The authentication parameters of the data source. Notion supports OAuth2 and API
+ key.
extra_headers: Send extra headers
@@ -365,6 +501,67 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ ...
+
+ @overload
+ async def create(
+ self,
+ *,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSource:
+ """
+ Create a new data source.
+
+ Args: params: The data source to create.
+
+ Returns: The created data source.
+
+ Args:
+ type: The type of data source to create
+
+ name: The name of the data source
+
+ metadata: The metadata of the data source
+
+ auth_params: Base class for OAuth2 create or update parameters.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @required_args(["name"])
+ async def create(
+ self,
+ *,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
+ | Optional[data_source_create_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSource:
return await self._post(
"/v1/data_sources/",
body=await async_maybe_transform(
@@ -421,13 +618,64 @@ async def retrieve(
cast_to=DataSource,
)
+ @overload
+ async def update(
+ self,
+ data_source_id: str,
+ *,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSource:
+ """Update a data source.
+
+ Args: data_source_id: The ID of the data source to update.
+
+ params: The data
+ source to update.
+
+ Returns: The updated data source.
+
+ Args:
+ data_source_id: The ID of the data source to update
+
+ type: The type of data source to create
+
+ name: The name of the data source
+
+ metadata: The metadata of the data source
+
+ auth_params: The authentication parameters of the data source. Notion supports OAuth2 and API
+ key.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @overload
async def update(
self,
data_source_id: str,
*,
- name: Optional[str] | NotGiven = NOT_GIVEN,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[DataSourceOauth2ParamsParam] | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
@@ -447,11 +695,13 @@ async def update(
Args:
data_source_id: The ID of the data source to update
+ type: The type of data source to create
+
name: The name of the data source
metadata: The metadata of the data source
- auth_params: Authentication parameters for a OAuth data source.
+ auth_params: Base class for OAuth2 create or update parameters.
extra_headers: Send extra headers
@@ -461,12 +711,33 @@ async def update(
timeout: Override the client-level default timeout for this request, in seconds
"""
+ ...
+
+ @required_args(["name"])
+ async def update(
+ self,
+ data_source_id: str,
+ *,
+ type: DataSourceType | NotGiven = NOT_GIVEN,
+ name: str,
+ metadata: object | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
+ | Optional[data_source_update_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DataSource:
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
return await self._put(
f"/v1/data_sources/{data_source_id}",
body=await async_maybe_transform(
{
+ "type": type,
"name": name,
"metadata": metadata,
"auth_params": auth_params,
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 56f206a5..4b299a86 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -44,7 +44,6 @@
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_question_answering_params import (
VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams,
)
diff --git a/src/mixedbread/types/data_source.py b/src/mixedbread/types/data_source.py
index d02682e1..eefb4d3d 100644
--- a/src/mixedbread/types/data_source.py
+++ b/src/mixedbread/types/data_source.py
@@ -1,14 +1,27 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
+from typing import 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 .data_source_type import DataSourceType
from .data_source_oauth2_params import DataSourceOauth2Params
-__all__ = ["DataSource"]
+__all__ = ["DataSource", "AuthParams", "AuthParamsDataSourceAPIKeyParams"]
+
+
+class AuthParamsDataSourceAPIKeyParams(BaseModel):
+ type: Optional[Literal["api_key"]] = None
+
+ api_key: str
+ """The API key"""
+
+
+AuthParams: TypeAlias = Annotated[
+ Union[DataSourceOauth2Params, AuthParamsDataSourceAPIKeyParams, None], PropertyInfo(discriminator="type")
+]
class DataSource(BaseModel):
@@ -30,8 +43,8 @@ class DataSource(BaseModel):
metadata: object
"""The metadata of the data source"""
- auth_params: Optional[DataSourceOauth2Params] = None
- """Authentication parameters for a OAuth data source."""
+ auth_params: Optional[AuthParams] = None
+ """Authentication parameters"""
object: Optional[Literal["data_source"]] = None
"""The type of the object"""
diff --git a/src/mixedbread/types/data_source_create_params.py b/src/mixedbread/types/data_source_create_params.py
index af01ebdd..e9794cdb 100644
--- a/src/mixedbread/types/data_source_create_params.py
+++ b/src/mixedbread/types/data_source_create_params.py
@@ -2,17 +2,24 @@
from __future__ import annotations
-from typing import Optional
-from typing_extensions import Required, TypedDict
+from typing import Union, Optional
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
from .data_source_type import DataSourceType
-from .data_source_oauth2_params_param import DataSourceOauth2ParamsParam
-__all__ = ["DataSourceCreateParams"]
+__all__ = [
+ "DataSourceCreateParams",
+ "NotionDataSourceCreateOrUpdateParams",
+ "NotionDataSourceCreateOrUpdateParamsAuthParams",
+ "NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams",
+ "NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams",
+ "LinearDataSourceCreateOrUpdateParams",
+ "LinearDataSourceCreateOrUpdateParamsAuthParams",
+]
-class DataSourceCreateParams(TypedDict, total=False):
- type: Required[DataSourceType]
+class NotionDataSourceCreateOrUpdateParams(TypedDict, total=False):
+ type: DataSourceType
"""The type of data source to create"""
name: Required[str]
@@ -21,5 +28,46 @@ class DataSourceCreateParams(TypedDict, total=False):
metadata: object
"""The metadata of the data source"""
- auth_params: Optional[DataSourceOauth2ParamsParam]
- """Authentication parameters for a OAuth data source."""
+ auth_params: Optional[NotionDataSourceCreateOrUpdateParamsAuthParams]
+ """The authentication parameters of the data source.
+
+ Notion supports OAuth2 and API key.
+ """
+
+
+class NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams(TypedDict, total=False):
+ type: Literal["oauth2"]
+
+
+class NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
+ type: Literal["api_key"]
+
+ api_key: Required[str]
+ """The API key"""
+
+
+NotionDataSourceCreateOrUpdateParamsAuthParams: TypeAlias = Union[
+ NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams,
+ NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams,
+]
+
+
+class LinearDataSourceCreateOrUpdateParams(TypedDict, total=False):
+ type: DataSourceType
+ """The type of data source to create"""
+
+ name: Required[str]
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[LinearDataSourceCreateOrUpdateParamsAuthParams]
+ """Base class for OAuth2 create or update parameters."""
+
+
+class LinearDataSourceCreateOrUpdateParamsAuthParams(TypedDict, total=False):
+ type: Literal["oauth2"]
+
+
+DataSourceCreateParams: TypeAlias = Union[NotionDataSourceCreateOrUpdateParams, LinearDataSourceCreateOrUpdateParams]
diff --git a/src/mixedbread/types/data_source_oauth2_params.py b/src/mixedbread/types/data_source_oauth2_params.py
index 5cda3db5..3e9c8a90 100644
--- a/src/mixedbread/types/data_source_oauth2_params.py
+++ b/src/mixedbread/types/data_source_oauth2_params.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
@@ -15,16 +15,7 @@ class DataSourceOauth2Params(BaseModel):
created_at: Optional[datetime] = None
"""The timestamp when the OAuth2 credentials were created"""
- client_id: str
- """The OAuth2 client ID"""
-
- client_secret: str
- """The OAuth2 client secret"""
-
- redirect_uri: str
- """The OAuth2 redirect URI"""
-
- scope: str
+ scope: Optional[str] = None
"""The OAuth2 scope"""
access_token: Optional[str] = None
@@ -38,3 +29,6 @@ class DataSourceOauth2Params(BaseModel):
expires_on: Optional[datetime] = None
"""The OAuth2 token expiration timestamp"""
+
+ additional_params: Optional[Dict[str, object]] = None
+ """Additional parameters for the OAuth2 flow"""
diff --git a/src/mixedbread/types/data_source_oauth2_params_param.py b/src/mixedbread/types/data_source_oauth2_params_param.py
deleted file mode 100644
index 72ff4b56..00000000
--- a/src/mixedbread/types/data_source_oauth2_params_param.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union, Optional
-from datetime import datetime
-from typing_extensions import Literal, Required, Annotated, TypedDict
-
-from .._utils import PropertyInfo
-
-__all__ = ["DataSourceOauth2ParamsParam"]
-
-
-class DataSourceOauth2ParamsParam(TypedDict, total=False):
- type: Literal["oauth2"]
-
- created_at: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
- """The timestamp when the OAuth2 credentials were created"""
-
- client_id: Required[str]
- """The OAuth2 client ID"""
-
- client_secret: Required[str]
- """The OAuth2 client secret"""
-
- redirect_uri: Required[str]
- """The OAuth2 redirect URI"""
-
- scope: Required[str]
- """The OAuth2 scope"""
-
- access_token: Optional[str]
- """The OAuth2 access token"""
-
- refresh_token: Optional[str]
- """The OAuth2 refresh token"""
-
- token_type: Optional[str]
- """The OAuth2 token type"""
-
- expires_on: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
- """The OAuth2 token expiration timestamp"""
diff --git a/src/mixedbread/types/data_source_update_params.py b/src/mixedbread/types/data_source_update_params.py
index 609704a0..23d34c4a 100644
--- a/src/mixedbread/types/data_source_update_params.py
+++ b/src/mixedbread/types/data_source_update_params.py
@@ -2,20 +2,72 @@
from __future__ import annotations
-from typing import Optional
-from typing_extensions import TypedDict
+from typing import Union, Optional
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
-from .data_source_oauth2_params_param import DataSourceOauth2ParamsParam
+from .data_source_type import DataSourceType
-__all__ = ["DataSourceUpdateParams"]
+__all__ = [
+ "DataSourceUpdateParams",
+ "NotionDataSourceCreateOrUpdateParams",
+ "NotionDataSourceCreateOrUpdateParamsAuthParams",
+ "NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams",
+ "NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams",
+ "LinearDataSourceCreateOrUpdateParams",
+ "LinearDataSourceCreateOrUpdateParamsAuthParams",
+]
-class DataSourceUpdateParams(TypedDict, total=False):
- name: Optional[str]
+class NotionDataSourceCreateOrUpdateParams(TypedDict, total=False):
+ type: DataSourceType
+ """The type of data source to create"""
+
+ name: Required[str]
"""The name of the data source"""
metadata: object
"""The metadata of the data source"""
- auth_params: Optional[DataSourceOauth2ParamsParam]
- """Authentication parameters for a OAuth data source."""
+ auth_params: Optional[NotionDataSourceCreateOrUpdateParamsAuthParams]
+ """The authentication parameters of the data source.
+
+ Notion supports OAuth2 and API key.
+ """
+
+
+class NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams(TypedDict, total=False):
+ type: Literal["oauth2"]
+
+
+class NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
+ type: Literal["api_key"]
+
+ api_key: Required[str]
+ """The API key"""
+
+
+NotionDataSourceCreateOrUpdateParamsAuthParams: TypeAlias = Union[
+ NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams,
+ NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams,
+]
+
+
+class LinearDataSourceCreateOrUpdateParams(TypedDict, total=False):
+ type: DataSourceType
+ """The type of data source to create"""
+
+ name: Required[str]
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[LinearDataSourceCreateOrUpdateParamsAuthParams]
+ """Base class for OAuth2 create or update parameters."""
+
+
+class LinearDataSourceCreateOrUpdateParamsAuthParams(TypedDict, total=False):
+ type: Literal["oauth2"]
+
+
+DataSourceUpdateParams: TypeAlias = Union[NotionDataSourceCreateOrUpdateParams, LinearDataSourceCreateOrUpdateParams]
diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py
index 65cb0ede..c2ab8879 100644
--- a/src/mixedbread/types/vector_store.py
+++ b/src/mixedbread/types/vector_store.py
@@ -11,6 +11,9 @@
class FileCounts(BaseModel):
+ pending: Optional[int] = None
+ """Number of files waiting to be processed"""
+
in_progress: Optional[int] = None
"""Number of files currently being processed"""
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 7c702c1c..919dffec 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -29,7 +29,7 @@ class ScoredVectorStoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
- status: Optional[str] = None
+ status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None
"""Processing status of the file"""
last_error: Optional[object] = None
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 39bdb685..d6e5efda 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -19,7 +19,7 @@ class VectorStoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
- status: Optional[str] = None
+ status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None
"""Processing status of the file"""
last_error: Optional[object] = None
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index be95dcb7..28f502e2 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -13,7 +13,6 @@
DataSource,
DataSourceDeleteResponse,
)
-from mixedbread._utils import parse_datetime
from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,38 +22,25 @@ class TestDataSources:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@parametrize
- def test_method_create(self, client: Mixedbread) -> None:
+ def test_method_create_overload_1(self, client: Mixedbread) -> None:
data_source = client.data_sources.create(
- type="notion",
name="name",
)
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- def test_method_create_with_all_params(self, client: Mixedbread) -> None:
+ def test_method_create_with_all_params_overload_1(self, client: Mixedbread) -> None:
data_source = client.data_sources.create(
type="notion",
name="name",
metadata={},
- auth_params={
- "type": "oauth2",
- "created_at": parse_datetime("2019-12-27T18:11:19.117Z"),
- "client_id": "client_id",
- "client_secret": "client_secret",
- "redirect_uri": "redirect_uri",
- "scope": "scope",
- "access_token": "access_token",
- "refresh_token": "refresh_token",
- "token_type": "token_type",
- "expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
- },
+ auth_params={"type": "oauth2"},
)
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
+ def test_raw_response_create_overload_1(self, client: Mixedbread) -> None:
response = client.data_sources.with_raw_response.create(
- type="notion",
name="name",
)
@@ -64,10 +50,50 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
+ def test_streaming_response_create_overload_1(self, client: Mixedbread) -> None:
with client.data_sources.with_streaming_response.create(
+ name="name",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = response.parse()
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_create_overload_2(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.create(
+ name="name",
+ )
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params_overload_2(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.create(
type="notion",
name="name",
+ metadata={},
+ auth_params={"type": "oauth2"},
+ )
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ def test_raw_response_create_overload_2(self, client: Mixedbread) -> None:
+ response = client.data_sources.with_raw_response.create(
+ name="name",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = response.parse()
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create_overload_2(self, client: Mixedbread) -> None:
+ with client.data_sources.with_streaming_response.create(
+ name="name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -116,37 +142,29 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
)
@parametrize
- def test_method_update(self, client: Mixedbread) -> None:
+ def test_method_update_overload_1(self, client: Mixedbread) -> None:
data_source = client.data_sources.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
)
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- def test_method_update_with_all_params(self, client: Mixedbread) -> None:
+ def test_method_update_with_all_params_overload_1(self, client: Mixedbread) -> None:
data_source = client.data_sources.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ type="notion",
name="name",
metadata={},
- auth_params={
- "type": "oauth2",
- "created_at": parse_datetime("2019-12-27T18:11:19.117Z"),
- "client_id": "client_id",
- "client_secret": "client_secret",
- "redirect_uri": "redirect_uri",
- "scope": "scope",
- "access_token": "access_token",
- "refresh_token": "refresh_token",
- "token_type": "token_type",
- "expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
- },
+ auth_params={"type": "oauth2"},
)
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- def test_raw_response_update(self, client: Mixedbread) -> None:
+ def test_raw_response_update_overload_1(self, client: Mixedbread) -> None:
response = client.data_sources.with_raw_response.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
)
assert response.is_closed is True
@@ -155,9 +173,63 @@ def test_raw_response_update(self, client: Mixedbread) -> None:
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- def test_streaming_response_update(self, client: Mixedbread) -> None:
+ def test_streaming_response_update_overload_1(self, client: Mixedbread) -> None:
with client.data_sources.with_streaming_response.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = response.parse()
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_update_overload_1(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ client.data_sources.with_raw_response.update(
+ data_source_id="",
+ name="name",
+ )
+
+ @parametrize
+ def test_method_update_overload_2(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ )
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ def test_method_update_with_all_params_overload_2(self, client: Mixedbread) -> None:
+ data_source = client.data_sources.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ type="notion",
+ name="name",
+ metadata={},
+ auth_params={"type": "oauth2"},
+ )
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ def test_raw_response_update_overload_2(self, client: Mixedbread) -> None:
+ response = client.data_sources.with_raw_response.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = response.parse()
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ def test_streaming_response_update_overload_2(self, client: Mixedbread) -> None:
+ with client.data_sources.with_streaming_response.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -168,10 +240,11 @@ def test_streaming_response_update(self, client: Mixedbread) -> None:
assert cast(Any, response.is_closed) is True
@parametrize
- def test_path_params_update(self, client: Mixedbread) -> None:
+ def test_path_params_update_overload_2(self, client: Mixedbread) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
client.data_sources.with_raw_response.update(
data_source_id="",
+ name="name",
)
@parametrize
@@ -250,38 +323,25 @@ class TestAsyncDataSources:
parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
@parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ async def test_method_create_overload_1(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.create(
- type="notion",
name="name",
)
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ async def test_method_create_with_all_params_overload_1(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.create(
type="notion",
name="name",
metadata={},
- auth_params={
- "type": "oauth2",
- "created_at": parse_datetime("2019-12-27T18:11:19.117Z"),
- "client_id": "client_id",
- "client_secret": "client_secret",
- "redirect_uri": "redirect_uri",
- "scope": "scope",
- "access_token": "access_token",
- "refresh_token": "refresh_token",
- "token_type": "token_type",
- "expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
- },
+ auth_params={"type": "oauth2"},
)
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ async def test_raw_response_create_overload_1(self, async_client: AsyncMixedbread) -> None:
response = await async_client.data_sources.with_raw_response.create(
- type="notion",
name="name",
)
@@ -291,10 +351,50 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async def test_streaming_response_create_overload_1(self, async_client: AsyncMixedbread) -> None:
async with async_client.data_sources.with_streaming_response.create(
+ name="name",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = await response.parse()
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_create_overload_2(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.create(
+ name="name",
+ )
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params_overload_2(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.create(
type="notion",
name="name",
+ metadata={},
+ auth_params={"type": "oauth2"},
+ )
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create_overload_2(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.with_raw_response.create(
+ name="name",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = await response.parse()
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create_overload_2(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.with_streaming_response.create(
+ name="name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -343,37 +443,29 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
)
@parametrize
- async def test_method_update(self, async_client: AsyncMixedbread) -> None:
+ async def test_method_update_overload_1(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
)
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ async def test_method_update_with_all_params_overload_1(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ type="notion",
name="name",
metadata={},
- auth_params={
- "type": "oauth2",
- "created_at": parse_datetime("2019-12-27T18:11:19.117Z"),
- "client_id": "client_id",
- "client_secret": "client_secret",
- "redirect_uri": "redirect_uri",
- "scope": "scope",
- "access_token": "access_token",
- "refresh_token": "refresh_token",
- "token_type": "token_type",
- "expires_on": parse_datetime("2019-12-27T18:11:19.117Z"),
- },
+ auth_params={"type": "oauth2"},
)
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
+ async def test_raw_response_update_overload_1(self, async_client: AsyncMixedbread) -> None:
response = await async_client.data_sources.with_raw_response.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
)
assert response.is_closed is True
@@ -382,9 +474,63 @@ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
assert_matches_type(DataSource, data_source, path=["response"])
@parametrize
- async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
+ async def test_streaming_response_update_overload_1(self, async_client: AsyncMixedbread) -> None:
async with async_client.data_sources.with_streaming_response.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ data_source = await response.parse()
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_update_overload_1(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
+ await async_client.data_sources.with_raw_response.update(
+ data_source_id="",
+ name="name",
+ )
+
+ @parametrize
+ async def test_method_update_overload_2(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ )
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ async def test_method_update_with_all_params_overload_2(self, async_client: AsyncMixedbread) -> None:
+ data_source = await async_client.data_sources.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ type="notion",
+ name="name",
+ metadata={},
+ auth_params={"type": "oauth2"},
+ )
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ async def test_raw_response_update_overload_2(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.data_sources.with_raw_response.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ data_source = await response.parse()
+ assert_matches_type(DataSource, data_source, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_update_overload_2(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.data_sources.with_streaming_response.update(
+ data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ name="name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -395,10 +541,11 @@ async def test_streaming_response_update(self, async_client: AsyncMixedbread) ->
assert cast(Any, response.is_closed) is True
@parametrize
- async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
+ async def test_path_params_update_overload_2(self, async_client: AsyncMixedbread) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
await async_client.data_sources.with_raw_response.update(
data_source_id="",
+ name="name",
)
@parametrize
From d0252440f1deaf3a04bafe5c8cfe7484024dd0d1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 11 Jun 2025 11:25:10 +0000
Subject: [PATCH 159/375] feat(api): api update
---
.stats.yml | 4 ++--
.../resources/vector_stores/vector_stores.py | 18 ++++++++++++++----
.../types/vector_store_list_params.py | 4 ++++
tests/api_resources/test_vector_stores.py | 2 ++
4 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index bb18ecff..c6e434cd 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 48
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-6b06bb4445b89267baa75d56ef71b875f980c2cb38e1884a74f699feaee6a7ce.yml
-openapi_spec_hash: 75094130ee0b736a9b3e928df7c942d2
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-a331b701867ba3d3dd907c8389fde663be4fda24c91e23f54f4dde8a6ade683f.yml
+openapi_spec_hash: 95587d9746abb97d5b294bfedf86b782
config_hash: 8545159b6ba2d638b8a2e7bbed6f04e7
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index de10bc08..2d476dac 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -237,6 +237,7 @@ def list(
*,
limit: int | NotGiven = NOT_GIVEN,
offset: int | NotGiven = NOT_GIVEN,
+ q: Optional[str] | 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,
@@ -245,9 +246,10 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncLimitOffset[VectorStore]:
"""
- List all vector stores.
+ List all vector stores with optional search.
- Args: pagination: The pagination options.
+ Args: pagination: The pagination options. q: Optional search query to filter
+ vector stores.
Returns: VectorStoreListResponse: The list of vector stores.
@@ -256,6 +258,8 @@ def list(
offset: Offset of the first item to return
+ q: Search query for fuzzy matching over name and description fields
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -276,6 +280,7 @@ def list(
{
"limit": limit,
"offset": offset,
+ "q": q,
},
vector_store_list_params.VectorStoreListParams,
),
@@ -667,6 +672,7 @@ def list(
*,
limit: int | NotGiven = NOT_GIVEN,
offset: int | NotGiven = NOT_GIVEN,
+ q: Optional[str] | 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,
@@ -675,9 +681,10 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[VectorStore, AsyncLimitOffset[VectorStore]]:
"""
- List all vector stores.
+ List all vector stores with optional search.
- Args: pagination: The pagination options.
+ Args: pagination: The pagination options. q: Optional search query to filter
+ vector stores.
Returns: VectorStoreListResponse: The list of vector stores.
@@ -686,6 +693,8 @@ def list(
offset: Offset of the first item to return
+ q: Search query for fuzzy matching over name and description fields
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -706,6 +715,7 @@ def list(
{
"limit": limit,
"offset": offset,
+ "q": q,
},
vector_store_list_params.VectorStoreListParams,
),
diff --git a/src/mixedbread/types/vector_store_list_params.py b/src/mixedbread/types/vector_store_list_params.py
index 39225421..4f649424 100644
--- a/src/mixedbread/types/vector_store_list_params.py
+++ b/src/mixedbread/types/vector_store_list_params.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Optional
from typing_extensions import TypedDict
__all__ = ["VectorStoreListParams"]
@@ -13,3 +14,6 @@ class VectorStoreListParams(TypedDict, total=False):
offset: int
"""Offset of the first item to return"""
+
+ q: Optional[str]
+ """Search query for fuzzy matching over name and description fields"""
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 9bc29d69..0dfbf64a 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -166,6 +166,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list(
limit=1000,
offset=0,
+ q="x",
)
assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
@@ -547,6 +548,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
vector_store = await async_client.vector_stores.list(
limit=1000,
offset=0,
+ q="x",
)
assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
From 3e733b5ef5194855b26dc67f7d9e3e04adccc78a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 13 Jun 2025 02:15:54 +0000
Subject: [PATCH 160/375] chore(tests): run tests in parallel
---
pyproject.toml | 3 ++-
requirements-dev.lock | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index b6e83d86..ca2ef6ca 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -54,6 +54,7 @@ dev-dependencies = [
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
+ "pytest-xdist>=3.6.1",
]
[tool.rye.scripts]
@@ -125,7 +126,7 @@ replacement = '[\1](https://github.com/mixedbread-ai/mixedbread-python/tree/main
[tool.pytest.ini_options]
testpaths = ["tests"]
-addopts = "--tb=short"
+addopts = "--tb=short -n auto"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
diff --git a/requirements-dev.lock b/requirements-dev.lock
index 4d2d4266..e4090452 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -30,6 +30,8 @@ distro==1.8.0
exceptiongroup==1.2.2
# via anyio
# via pytest
+execnet==2.1.1
+ # via pytest-xdist
filelock==3.12.4
# via virtualenv
h11==0.14.0
@@ -72,7 +74,9 @@ pygments==2.18.0
pyright==1.1.399
pytest==8.3.3
# via pytest-asyncio
+ # via pytest-xdist
pytest-asyncio==0.24.0
+pytest-xdist==3.7.0
python-dateutil==2.8.2
# via time-machine
pytz==2023.3.post1
From 9b2cbdd147c10253a05d57dbfd0526aa918587ed Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 13 Jun 2025 02:40:31 +0000
Subject: [PATCH 161/375] fix(client): correctly parse binary response | stream
---
src/mixedbread/_base_client.py | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 34276f55..44036510 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -1071,7 +1071,14 @@ def _process_response(
) -> ResponseT:
origin = get_origin(cast_to) or cast_to
- if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
+ if (
+ inspect.isclass(origin)
+ and issubclass(origin, BaseAPIResponse)
+ # we only want to actually return the custom BaseAPIResponse class if we're
+ # returning the raw response, or if we're not streaming SSE, as if we're streaming
+ # SSE then `cast_to` doesn't actively reflect the type we need to parse into
+ and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
+ ):
if not issubclass(origin, APIResponse):
raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}")
@@ -1574,7 +1581,14 @@ async def _process_response(
) -> ResponseT:
origin = get_origin(cast_to) or cast_to
- if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse):
+ if (
+ inspect.isclass(origin)
+ and issubclass(origin, BaseAPIResponse)
+ # we only want to actually return the custom BaseAPIResponse class if we're
+ # returning the raw response, or if we're not streaming SSE, as if we're streaming
+ # SSE then `cast_to` doesn't actively reflect the type we need to parse into
+ and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER)))
+ ):
if not issubclass(origin, AsyncAPIResponse):
raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}")
From e9d1433809768888666a77656e797fd162ed494c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 16 Jun 2025 09:47:27 +0000
Subject: [PATCH 162/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 2aca35ae..4208b5cb 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.5.0"
+ ".": "0.6.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index ca2ef6ca..6de28979 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.5.0"
+version = "0.6.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 7a42cf4e..6060c6be 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.5.0" # x-release-please-version
+__version__ = "0.6.0" # x-release-please-version
From f997c6568c87d260305602214b6468e8fc09aa6d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 16 Jun 2025 09:51:13 +0000
Subject: [PATCH 163/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 11 ++
src/mixedbread/_client.py | 10 +-
src/mixedbread/resources/__init__.py | 14 ++
src/mixedbread/resources/chat.py | 164 ++++++++++++++++++
.../resources/data_sources/data_sources.py | 49 +++---
src/mixedbread/types/__init__.py | 3 +
.../types/data_source_create_params.py | 36 ++--
.../types/data_source_update_params.py | 36 ++--
.../types/linear_data_source_param.py | 25 +++
.../types/notion_data_source_param.py | 38 ++++
src/mixedbread/types/oauth2_params.py | 11 ++
...vector_store_chunk_search_options_param.py | 21 +--
.../types/vector_stores/__init__.py | 2 +
.../types/vector_stores/file_search_params.py | 27 +--
.../vector_stores/rerank_config_param.py | 22 +++
.../vector_stores/scored_vector_store_file.py | 3 +-
.../types/vector_stores/vector_store_file.py | 3 +-
.../vector_stores/vector_store_file_status.py | 7 +
tests/api_resources/test_chat.py | 71 ++++++++
20 files changed, 438 insertions(+), 119 deletions(-)
create mode 100644 src/mixedbread/resources/chat.py
create mode 100644 src/mixedbread/types/linear_data_source_param.py
create mode 100644 src/mixedbread/types/notion_data_source_param.py
create mode 100644 src/mixedbread/types/oauth2_params.py
create mode 100644 src/mixedbread/types/vector_stores/rerank_config_param.py
create mode 100644 src/mixedbread/types/vector_stores/vector_store_file_status.py
create mode 100644 tests/api_resources/test_chat.py
diff --git a/.stats.yml b/.stats.yml
index c6e434cd..d4c15816 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 48
+configured_endpoints: 49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-a331b701867ba3d3dd907c8389fde663be4fda24c91e23f54f4dde8a6ade683f.yml
openapi_spec_hash: 95587d9746abb97d5b294bfedf86b782
-config_hash: 8545159b6ba2d638b8a2e7bbed6f04e7
+config_hash: ca0dfb431a44ea42464c42b224addf36
diff --git a/api.md b/api.md
index 0008e67f..20463369 100644
--- a/api.md
+++ b/api.md
@@ -59,7 +59,9 @@ Types:
```python
from mixedbread.types.vector_stores import (
+ RerankConfig,
ScoredVectorStoreFile,
+ VectorStoreFileStatus,
VectorStoreFile,
FileDeleteResponse,
FileSearchResponse,
@@ -179,6 +181,9 @@ from mixedbread.types import (
DataSource,
DataSourceOauth2Params,
DataSourceType,
+ LinearDataSource,
+ NotionDataSource,
+ Oauth2Params,
DataSourceDeleteResponse,
)
```
@@ -223,3 +228,9 @@ Methods:
- client.api_keys.delete(api_key_id) -> APIKeyDeleteResponse
- client.api_keys.reroll(api_key_id) -> APIKeyCreated
- client.api_keys.revoke(api_key_id) -> APIKey
+
+# Chat
+
+Methods:
+
+- client.chat.create_completion() -> object
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index f75adc2f..bd402d87 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -36,7 +36,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from .resources import files, api_keys, embeddings
+from .resources import chat, files, api_keys, embeddings
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, MixedbreadError
from ._base_client import (
@@ -80,6 +80,7 @@ class Mixedbread(SyncAPIClient):
embeddings: embeddings.EmbeddingsResource
data_sources: data_sources.DataSourcesResource
api_keys: api_keys.APIKeysResource
+ chat: chat.ChatResource
with_raw_response: MixedbreadWithRawResponse
with_streaming_response: MixedbreadWithStreamedResponse
@@ -168,6 +169,7 @@ def __init__(
self.embeddings = embeddings.EmbeddingsResource(self)
self.data_sources = data_sources.DataSourcesResource(self)
self.api_keys = api_keys.APIKeysResource(self)
+ self.chat = chat.ChatResource(self)
self.with_raw_response = MixedbreadWithRawResponse(self)
self.with_streaming_response = MixedbreadWithStreamedResponse(self)
@@ -441,6 +443,7 @@ class AsyncMixedbread(AsyncAPIClient):
embeddings: embeddings.AsyncEmbeddingsResource
data_sources: data_sources.AsyncDataSourcesResource
api_keys: api_keys.AsyncAPIKeysResource
+ chat: chat.AsyncChatResource
with_raw_response: AsyncMixedbreadWithRawResponse
with_streaming_response: AsyncMixedbreadWithStreamedResponse
@@ -529,6 +532,7 @@ def __init__(
self.embeddings = embeddings.AsyncEmbeddingsResource(self)
self.data_sources = data_sources.AsyncDataSourcesResource(self)
self.api_keys = api_keys.AsyncAPIKeysResource(self)
+ self.chat = chat.AsyncChatResource(self)
self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)
@@ -803,6 +807,7 @@ def __init__(self, client: Mixedbread) -> None:
self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
self.data_sources = data_sources.DataSourcesResourceWithRawResponse(client.data_sources)
self.api_keys = api_keys.APIKeysResourceWithRawResponse(client.api_keys)
+ self.chat = chat.ChatResourceWithRawResponse(client.chat)
self.embed = to_raw_response_wrapper(
client.embed,
@@ -824,6 +829,7 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
self.data_sources = data_sources.AsyncDataSourcesResourceWithRawResponse(client.data_sources)
self.api_keys = api_keys.AsyncAPIKeysResourceWithRawResponse(client.api_keys)
+ self.chat = chat.AsyncChatResourceWithRawResponse(client.chat)
self.embed = async_to_raw_response_wrapper(
client.embed,
@@ -845,6 +851,7 @@ def __init__(self, client: Mixedbread) -> None:
self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
self.data_sources = data_sources.DataSourcesResourceWithStreamingResponse(client.data_sources)
self.api_keys = api_keys.APIKeysResourceWithStreamingResponse(client.api_keys)
+ self.chat = chat.ChatResourceWithStreamingResponse(client.chat)
self.embed = to_streamed_response_wrapper(
client.embed,
@@ -866,6 +873,7 @@ def __init__(self, client: AsyncMixedbread) -> None:
self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
self.data_sources = data_sources.AsyncDataSourcesResourceWithStreamingResponse(client.data_sources)
self.api_keys = api_keys.AsyncAPIKeysResourceWithStreamingResponse(client.api_keys)
+ self.chat = chat.AsyncChatResourceWithStreamingResponse(client.chat)
self.embed = async_to_streamed_response_wrapper(
client.embed,
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index 284cc1cb..0b3e0954 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -1,5 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from .chat import (
+ ChatResource,
+ AsyncChatResource,
+ ChatResourceWithRawResponse,
+ AsyncChatResourceWithRawResponse,
+ ChatResourceWithStreamingResponse,
+ AsyncChatResourceWithStreamingResponse,
+)
from .files import (
FilesResource,
AsyncFilesResource,
@@ -100,4 +108,10 @@
"AsyncAPIKeysResourceWithRawResponse",
"APIKeysResourceWithStreamingResponse",
"AsyncAPIKeysResourceWithStreamingResponse",
+ "ChatResource",
+ "AsyncChatResource",
+ "ChatResourceWithRawResponse",
+ "AsyncChatResourceWithRawResponse",
+ "ChatResourceWithStreamingResponse",
+ "AsyncChatResourceWithStreamingResponse",
]
diff --git a/src/mixedbread/resources/chat.py b/src/mixedbread/resources/chat.py
new file mode 100644
index 00000000..f9b1b0ce
--- /dev/null
+++ b/src/mixedbread/resources/chat.py
@@ -0,0 +1,164 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import httpx
+
+from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._compat import cached_property
+from .._resource import SyncAPIResource, AsyncAPIResource
+from .._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from .._base_client import make_request_options
+
+__all__ = ["ChatResource", "AsyncChatResource"]
+
+
+class ChatResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> ChatResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return ChatResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ChatResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return ChatResourceWithStreamingResponse(self)
+
+ def create_completion(
+ self,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> object:
+ """
+ Create a chat completion using the provided parameters.
+
+ Generates a completion response based on the chat messages and model parameters
+ provided. The response can be either a full completion or streamed chunks
+ depending on the request parameters.
+
+ Args: params: Parameters for creating the chat completion including messages,
+ model selection, and generation settings user: The authenticated user making the
+ request
+
+ Returns: Either a ChatCompletion containing the full response, or
+ ChatCompletionChunk for streaming
+
+ Raises: HTTPException: If there is an error creating the completion (500)
+ """
+ return self._post(
+ "/v1/chat/completions",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=object,
+ )
+
+
+class AsyncChatResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncChatResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncChatResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncChatResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncChatResourceWithStreamingResponse(self)
+
+ async def create_completion(
+ self,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> object:
+ """
+ Create a chat completion using the provided parameters.
+
+ Generates a completion response based on the chat messages and model parameters
+ provided. The response can be either a full completion or streamed chunks
+ depending on the request parameters.
+
+ Args: params: Parameters for creating the chat completion including messages,
+ model selection, and generation settings user: The authenticated user making the
+ request
+
+ Returns: Either a ChatCompletion containing the full response, or
+ ChatCompletionChunk for streaming
+
+ Raises: HTTPException: If there is an error creating the completion (500)
+ """
+ return await self._post(
+ "/v1/chat/completions",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=object,
+ )
+
+
+class ChatResourceWithRawResponse:
+ def __init__(self, chat: ChatResource) -> None:
+ self._chat = chat
+
+ self.create_completion = to_raw_response_wrapper(
+ chat.create_completion,
+ )
+
+
+class AsyncChatResourceWithRawResponse:
+ def __init__(self, chat: AsyncChatResource) -> None:
+ self._chat = chat
+
+ self.create_completion = async_to_raw_response_wrapper(
+ chat.create_completion,
+ )
+
+
+class ChatResourceWithStreamingResponse:
+ def __init__(self, chat: ChatResource) -> None:
+ self._chat = chat
+
+ self.create_completion = to_streamed_response_wrapper(
+ chat.create_completion,
+ )
+
+
+class AsyncChatResourceWithStreamingResponse:
+ def __init__(self, chat: AsyncChatResource) -> None:
+ self._chat = chat
+
+ self.create_completion = async_to_streamed_response_wrapper(
+ chat.create_completion,
+ )
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index 1f3fc0f9..d1fcf526 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -7,7 +7,13 @@
import httpx
-from ...types import DataSourceType, data_source_list_params, data_source_create_params, data_source_update_params
+from ...types import (
+ Oauth2Params,
+ DataSourceType,
+ data_source_list_params,
+ data_source_create_params,
+ data_source_update_params,
+)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import required_args, maybe_transform, async_maybe_transform
from ..._compat import cached_property
@@ -29,6 +35,7 @@
from ...pagination import SyncLimitOffset, AsyncLimitOffset
from ..._base_client import AsyncPaginator, make_request_options
from ...types.data_source import DataSource
+from ...types.oauth2_params import Oauth2Params
from ...types.data_source_type import DataSourceType
from ...types.data_source_delete_response import DataSourceDeleteResponse
@@ -66,8 +73,7 @@ def create(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
- | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | 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,
@@ -109,8 +115,7 @@ def create(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
- | NotGiven = NOT_GIVEN,
+ auth_params: Optional[Oauth2Params] | 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,
@@ -151,8 +156,8 @@ def create(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
- | Optional[data_source_create_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams]
+ | Optional[Oauth2Params]
| 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.
@@ -225,8 +230,7 @@ def update(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
- | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | 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,
@@ -273,8 +277,7 @@ def update(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
- | NotGiven = NOT_GIVEN,
+ auth_params: Optional[Oauth2Params] | 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,
@@ -320,8 +323,8 @@ def update(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
- | Optional[data_source_update_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams]
+ | Optional[Oauth2Params]
| 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.
@@ -467,8 +470,7 @@ async def create(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
- | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | 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,
@@ -510,8 +512,7 @@ async def create(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
- | NotGiven = NOT_GIVEN,
+ auth_params: Optional[Oauth2Params] | 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,
@@ -552,8 +553,8 @@ async def create(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
- | Optional[data_source_create_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams]
+ | Optional[Oauth2Params]
| 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.
@@ -626,8 +627,7 @@ async def update(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
- | NotGiven = NOT_GIVEN,
+ auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | 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,
@@ -674,8 +674,7 @@ async def update(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
- | NotGiven = NOT_GIVEN,
+ auth_params: Optional[Oauth2Params] | 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,
@@ -721,8 +720,8 @@ async def update(
type: DataSourceType | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.NotionDataSourceCreateOrUpdateParamsAuthParams]
- | Optional[data_source_update_params.LinearDataSourceCreateOrUpdateParamsAuthParams]
+ auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams]
+ | Optional[Oauth2Params]
| 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.
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 4b299a86..5fead10f 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -11,6 +11,7 @@
from .vector_store import VectorStore as VectorStore
from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
+from .oauth2_params import Oauth2Params as Oauth2Params
from .api_key_created import APIKeyCreated as APIKeyCreated
from .encoding_format import EncodingFormat as EncodingFormat
from .rerank_response import RerankResponse as RerankResponse
@@ -29,7 +30,9 @@
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 .linear_data_source_param import LinearDataSourceParam as LinearDataSourceParam
from .multi_encoding_embedding import MultiEncodingEmbedding as MultiEncodingEmbedding
+from .notion_data_source_param import NotionDataSourceParam as NotionDataSourceParam
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
diff --git a/src/mixedbread/types/data_source_create_params.py b/src/mixedbread/types/data_source_create_params.py
index e9794cdb..caa23d67 100644
--- a/src/mixedbread/types/data_source_create_params.py
+++ b/src/mixedbread/types/data_source_create_params.py
@@ -5,20 +5,19 @@
from typing import Union, Optional
from typing_extensions import Literal, Required, TypeAlias, TypedDict
+from .oauth2_params import Oauth2Params
from .data_source_type import DataSourceType
__all__ = [
"DataSourceCreateParams",
- "NotionDataSourceCreateOrUpdateParams",
- "NotionDataSourceCreateOrUpdateParamsAuthParams",
- "NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams",
- "NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams",
- "LinearDataSourceCreateOrUpdateParams",
- "LinearDataSourceCreateOrUpdateParamsAuthParams",
+ "NotionDataSource",
+ "NotionDataSourceAuthParams",
+ "NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams",
+ "LinearDataSource",
]
-class NotionDataSourceCreateOrUpdateParams(TypedDict, total=False):
+class NotionDataSource(TypedDict, total=False):
type: DataSourceType
"""The type of data source to create"""
@@ -28,31 +27,24 @@ class NotionDataSourceCreateOrUpdateParams(TypedDict, total=False):
metadata: object
"""The metadata of the data source"""
- auth_params: Optional[NotionDataSourceCreateOrUpdateParamsAuthParams]
+ auth_params: Optional[NotionDataSourceAuthParams]
"""The authentication parameters of the data source.
Notion supports OAuth2 and API key.
"""
-class NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams(TypedDict, total=False):
- type: Literal["oauth2"]
-
-
-class NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
+class NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
type: Literal["api_key"]
api_key: Required[str]
"""The API key"""
-NotionDataSourceCreateOrUpdateParamsAuthParams: TypeAlias = Union[
- NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams,
- NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams,
-]
+NotionDataSourceAuthParams: TypeAlias = Union[Oauth2Params, NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams]
-class LinearDataSourceCreateOrUpdateParams(TypedDict, total=False):
+class LinearDataSource(TypedDict, total=False):
type: DataSourceType
"""The type of data source to create"""
@@ -62,12 +54,8 @@ class LinearDataSourceCreateOrUpdateParams(TypedDict, total=False):
metadata: object
"""The metadata of the data source"""
- auth_params: Optional[LinearDataSourceCreateOrUpdateParamsAuthParams]
+ auth_params: Optional[Oauth2Params]
"""Base class for OAuth2 create or update parameters."""
-class LinearDataSourceCreateOrUpdateParamsAuthParams(TypedDict, total=False):
- type: Literal["oauth2"]
-
-
-DataSourceCreateParams: TypeAlias = Union[NotionDataSourceCreateOrUpdateParams, LinearDataSourceCreateOrUpdateParams]
+DataSourceCreateParams: TypeAlias = Union[NotionDataSource, LinearDataSource]
diff --git a/src/mixedbread/types/data_source_update_params.py b/src/mixedbread/types/data_source_update_params.py
index 23d34c4a..6c283f81 100644
--- a/src/mixedbread/types/data_source_update_params.py
+++ b/src/mixedbread/types/data_source_update_params.py
@@ -5,20 +5,19 @@
from typing import Union, Optional
from typing_extensions import Literal, Required, TypeAlias, TypedDict
+from .oauth2_params import Oauth2Params
from .data_source_type import DataSourceType
__all__ = [
"DataSourceUpdateParams",
- "NotionDataSourceCreateOrUpdateParams",
- "NotionDataSourceCreateOrUpdateParamsAuthParams",
- "NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams",
- "NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams",
- "LinearDataSourceCreateOrUpdateParams",
- "LinearDataSourceCreateOrUpdateParamsAuthParams",
+ "NotionDataSource",
+ "NotionDataSourceAuthParams",
+ "NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams",
+ "LinearDataSource",
]
-class NotionDataSourceCreateOrUpdateParams(TypedDict, total=False):
+class NotionDataSource(TypedDict, total=False):
type: DataSourceType
"""The type of data source to create"""
@@ -28,31 +27,24 @@ class NotionDataSourceCreateOrUpdateParams(TypedDict, total=False):
metadata: object
"""The metadata of the data source"""
- auth_params: Optional[NotionDataSourceCreateOrUpdateParamsAuthParams]
+ auth_params: Optional[NotionDataSourceAuthParams]
"""The authentication parameters of the data source.
Notion supports OAuth2 and API key.
"""
-class NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams(TypedDict, total=False):
- type: Literal["oauth2"]
-
-
-class NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
+class NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
type: Literal["api_key"]
api_key: Required[str]
"""The API key"""
-NotionDataSourceCreateOrUpdateParamsAuthParams: TypeAlias = Union[
- NotionDataSourceCreateOrUpdateParamsAuthParamsOAuth2CreateOrUpdateParams,
- NotionDataSourceCreateOrUpdateParamsAuthParamsAPIKeyCreateOrUpdateParams,
-]
+NotionDataSourceAuthParams: TypeAlias = Union[Oauth2Params, NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams]
-class LinearDataSourceCreateOrUpdateParams(TypedDict, total=False):
+class LinearDataSource(TypedDict, total=False):
type: DataSourceType
"""The type of data source to create"""
@@ -62,12 +54,8 @@ class LinearDataSourceCreateOrUpdateParams(TypedDict, total=False):
metadata: object
"""The metadata of the data source"""
- auth_params: Optional[LinearDataSourceCreateOrUpdateParamsAuthParams]
+ auth_params: Optional[Oauth2Params]
"""Base class for OAuth2 create or update parameters."""
-class LinearDataSourceCreateOrUpdateParamsAuthParams(TypedDict, total=False):
- type: Literal["oauth2"]
-
-
-DataSourceUpdateParams: TypeAlias = Union[NotionDataSourceCreateOrUpdateParams, LinearDataSourceCreateOrUpdateParams]
+DataSourceUpdateParams: TypeAlias = Union[NotionDataSource, LinearDataSource]
diff --git a/src/mixedbread/types/linear_data_source_param.py b/src/mixedbread/types/linear_data_source_param.py
new file mode 100644
index 00000000..9dbe8904
--- /dev/null
+++ b/src/mixedbread/types/linear_data_source_param.py
@@ -0,0 +1,25 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Optional
+from typing_extensions import Required, TypedDict
+
+from .oauth2_params import Oauth2Params
+from .data_source_type import DataSourceType
+
+__all__ = ["LinearDataSourceParam"]
+
+
+class LinearDataSourceParam(TypedDict, total=False):
+ type: DataSourceType
+ """The type of data source to create"""
+
+ name: Required[str]
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[Oauth2Params]
+ """Base class for OAuth2 create or update parameters."""
diff --git a/src/mixedbread/types/notion_data_source_param.py b/src/mixedbread/types/notion_data_source_param.py
new file mode 100644
index 00000000..914c502f
--- /dev/null
+++ b/src/mixedbread/types/notion_data_source_param.py
@@ -0,0 +1,38 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Optional
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
+
+from .oauth2_params import Oauth2Params
+from .data_source_type import DataSourceType
+
+__all__ = ["NotionDataSourceParam", "AuthParams", "AuthParamsAPIKeyCreateOrUpdateParams"]
+
+
+class AuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
+ type: Literal["api_key"]
+
+ api_key: Required[str]
+ """The API key"""
+
+
+AuthParams: TypeAlias = Union[Oauth2Params, AuthParamsAPIKeyCreateOrUpdateParams]
+
+
+class NotionDataSourceParam(TypedDict, total=False):
+ type: DataSourceType
+ """The type of data source to create"""
+
+ name: Required[str]
+ """The name of the data source"""
+
+ metadata: object
+ """The metadata of the data source"""
+
+ auth_params: Optional[AuthParams]
+ """The authentication parameters of the data source.
+
+ Notion supports OAuth2 and API key.
+ """
diff --git a/src/mixedbread/types/oauth2_params.py b/src/mixedbread/types/oauth2_params.py
new file mode 100644
index 00000000..6b0e2fa8
--- /dev/null
+++ b/src/mixedbread/types/oauth2_params.py
@@ -0,0 +1,11 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, TypedDict
+
+__all__ = ["Oauth2Params"]
+
+
+class Oauth2Params(TypedDict, total=False):
+ type: Literal["oauth2"]
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 f5fb8437..eed57858 100644
--- a/src/mixedbread/types/vector_store_chunk_search_options_param.py
+++ b/src/mixedbread/types/vector_store_chunk_search_options_param.py
@@ -2,27 +2,14 @@
from __future__ import annotations
-from typing import List, Union, Optional
+from typing import Union, Optional
from typing_extensions import TypeAlias, TypedDict
-__all__ = ["VectorStoreChunkSearchOptionsParam", "Rerank", "RerankRerankConfig"]
+from .vector_stores.rerank_config_param import RerankConfigParam
+__all__ = ["VectorStoreChunkSearchOptionsParam", "Rerank"]
-class RerankRerankConfig(TypedDict, total=False):
- model: str
- """The name of the reranking model"""
-
- with_metadata: Union[bool, List[str]]
- """Whether to include metadata in the reranked results"""
-
- top_k: Optional[int]
- """Maximum number of results to return after reranking.
-
- If None, returns all reranked results.
- """
-
-
-Rerank: TypeAlias = Union[bool, RerankRerankConfig]
+Rerank: TypeAlias = Union[bool, RerankConfigParam]
class VectorStoreChunkSearchOptionsParam(TypedDict, total=False):
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index e1af64d5..6ce1aafe 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -6,6 +6,8 @@
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
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_search_response import FileSearchResponse as FileSearchResponse
from .scored_vector_store_file import ScoredVectorStoreFile as ScoredVectorStoreFile
+from .vector_store_file_status import VectorStoreFileStatus as VectorStoreFileStatus
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 2844c28a..17886660 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -5,16 +5,10 @@
from typing import List, Union, Iterable, Optional
from typing_extensions import Required, TypeAlias, TypedDict
+from .rerank_config_param import RerankConfigParam
from ..shared_params.search_filter_condition import SearchFilterCondition
-__all__ = [
- "FileSearchParams",
- "Filters",
- "FiltersUnionMember2",
- "SearchOptions",
- "SearchOptionsRerank",
- "SearchOptionsRerankRerankConfig",
-]
+__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions", "SearchOptionsRerank"]
class FileSearchParams(TypedDict, total=False):
@@ -43,22 +37,7 @@ class FileSearchParams(TypedDict, total=False):
Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
-
-class SearchOptionsRerankRerankConfig(TypedDict, total=False):
- model: str
- """The name of the reranking model"""
-
- with_metadata: Union[bool, List[str]]
- """Whether to include metadata in the reranked results"""
-
- top_k: Optional[int]
- """Maximum number of results to return after reranking.
-
- If None, returns all reranked results.
- """
-
-
-SearchOptionsRerank: TypeAlias = Union[bool, SearchOptionsRerankRerankConfig]
+SearchOptionsRerank: TypeAlias = Union[bool, RerankConfigParam]
class SearchOptions(TypedDict, total=False):
diff --git a/src/mixedbread/types/vector_stores/rerank_config_param.py b/src/mixedbread/types/vector_stores/rerank_config_param.py
new file mode 100644
index 00000000..da1f0a33
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/rerank_config_param.py
@@ -0,0 +1,22 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Optional
+from typing_extensions import TypedDict
+
+__all__ = ["RerankConfigParam"]
+
+
+class RerankConfigParam(TypedDict, total=False):
+ model: str
+ """The name of the reranking model"""
+
+ with_metadata: Union[bool, List[str]]
+ """Whether to include metadata in the reranked results"""
+
+ top_k: Optional[int]
+ """Maximum number of results to return after reranking.
+
+ If None, returns all reranked results.
+ """
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 919dffec..225806b2 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -7,6 +7,7 @@
from ..._utils import PropertyInfo
from ..._models import BaseModel
from ..scored_text_input_chunk import ScoredTextInputChunk
+from .vector_store_file_status import VectorStoreFileStatus
from ..scored_audio_url_input_chunk import ScoredAudioURLInputChunk
from ..scored_image_url_input_chunk import ScoredImageURLInputChunk
from ..scored_video_url_input_chunk import ScoredVideoURLInputChunk
@@ -29,7 +30,7 @@ class ScoredVectorStoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
- status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None
+ status: Optional[VectorStoreFileStatus] = None
"""Processing status of the file"""
last_error: Optional[object] = None
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index d6e5efda..642c066f 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -5,6 +5,7 @@
from typing_extensions import Literal
from ..._models import BaseModel
+from .vector_store_file_status import VectorStoreFileStatus
__all__ = ["VectorStoreFile"]
@@ -19,7 +20,7 @@ class VectorStoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
- status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None
+ status: Optional[VectorStoreFileStatus] = None
"""Processing status of the file"""
last_error: Optional[object] = None
diff --git a/src/mixedbread/types/vector_stores/vector_store_file_status.py b/src/mixedbread/types/vector_stores/vector_store_file_status.py
new file mode 100644
index 00000000..12e80abd
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/vector_store_file_status.py
@@ -0,0 +1,7 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["VectorStoreFileStatus"]
+
+VectorStoreFileStatus: TypeAlias = Literal["pending", "in_progress", "cancelled", "completed", "failed"]
diff --git a/tests/api_resources/test_chat.py b/tests/api_resources/test_chat.py
new file mode 100644
index 00000000..65341369
--- /dev/null
+++ b/tests/api_resources/test_chat.py
@@ -0,0 +1,71 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestChat:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create_completion(self, client: Mixedbread) -> None:
+ chat = client.chat.create_completion()
+ assert_matches_type(object, chat, path=["response"])
+
+ @parametrize
+ def test_raw_response_create_completion(self, client: Mixedbread) -> None:
+ response = client.chat.with_raw_response.create_completion()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ chat = response.parse()
+ assert_matches_type(object, chat, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create_completion(self, client: Mixedbread) -> None:
+ with client.chat.with_streaming_response.create_completion() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ chat = response.parse()
+ assert_matches_type(object, chat, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncChat:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_create_completion(self, async_client: AsyncMixedbread) -> None:
+ chat = await async_client.chat.create_completion()
+ assert_matches_type(object, chat, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create_completion(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.chat.with_raw_response.create_completion()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ chat = await response.parse()
+ assert_matches_type(object, chat, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create_completion(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.chat.with_streaming_response.create_completion() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ chat = await response.parse()
+ assert_matches_type(object, chat, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
From ec3cfbff9922595b365cec6d649eb5b6891bab5d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 16 Jun 2025 10:12:26 +0000
Subject: [PATCH 164/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 4208b5cb..1b77f506 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.6.0"
+ ".": "0.7.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 6de28979..a2c8b86e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.6.0"
+version = "0.7.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 6060c6be..d3e3c3b6 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.6.0" # x-release-please-version
+__version__ = "0.7.0" # x-release-please-version
From 1d8ccc58c89f20d77dae255b01bb605ba30acf49 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 16 Jun 2025 10:15:53 +0000
Subject: [PATCH 165/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 1b77f506..1bc57136 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.7.0"
+ ".": "0.7.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index a2c8b86e..45ded62f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.7.0"
+version = "0.7.1"
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 d3e3c3b6..670e6ae2 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.7.0" # x-release-please-version
+__version__ = "0.7.1" # x-release-please-version
From 08148a6aaf0baaaad5c7fb8a7e696dfb00284dcc Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 16 Jun 2025 13:25:32 +0000
Subject: [PATCH 166/375] feat(api): api update
---
.stats.yml | 4 ++--
.../resources/vector_stores/vector_stores.py | 16 ++++++++++++++++
src/mixedbread/types/vector_store.py | 3 +++
.../types/vector_store_create_params.py | 3 +++
.../types/vector_store_update_params.py | 3 +++
tests/api_resources/test_vector_stores.py | 4 ++++
6 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index d4c15816..8b1b4e11 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-a331b701867ba3d3dd907c8389fde663be4fda24c91e23f54f4dde8a6ade683f.yml
-openapi_spec_hash: 95587d9746abb97d5b294bfedf86b782
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-258cd9419639d2d3d821e9c63a336fb7fecc362f376a7f606868445bcef995cd.yml
+openapi_spec_hash: e2c4cf1543194f94f3b0baad6a5735ba
config_hash: ca0dfb431a44ea42464c42b224addf36
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 2d476dac..8c125cfb 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -72,6 +72,7 @@ def create(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
+ is_public: bool | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
@@ -95,6 +96,8 @@ def create(
description: Description of the vector store
+ is_public: Whether the vector store can be accessed by anyone with valid login credentials
+
expires_after: Represents an expiration policy for a vector store.
metadata: Optional metadata key-value pairs
@@ -115,6 +118,7 @@ def create(
{
"name": name,
"description": description,
+ "is_public": is_public,
"expires_after": expires_after,
"metadata": metadata,
"file_ids": file_ids,
@@ -174,6 +178,7 @@ def update(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
+ is_public: Optional[bool] | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -199,6 +204,8 @@ def update(
description: New description
+ is_public: Whether the vector store can be accessed by anyone with valid login credentials
+
expires_after: Represents an expiration policy for a vector store.
metadata: Optional metadata key-value pairs
@@ -221,6 +228,7 @@ def update(
{
"name": name,
"description": description,
+ "is_public": is_public,
"expires_after": expires_after,
"metadata": metadata,
},
@@ -507,6 +515,7 @@ async def create(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
+ is_public: bool | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
@@ -530,6 +539,8 @@ async def create(
description: Description of the vector store
+ is_public: Whether the vector store can be accessed by anyone with valid login credentials
+
expires_after: Represents an expiration policy for a vector store.
metadata: Optional metadata key-value pairs
@@ -550,6 +561,7 @@ async def create(
{
"name": name,
"description": description,
+ "is_public": is_public,
"expires_after": expires_after,
"metadata": metadata,
"file_ids": file_ids,
@@ -609,6 +621,7 @@ async def update(
*,
name: Optional[str] | NotGiven = NOT_GIVEN,
description: Optional[str] | NotGiven = NOT_GIVEN,
+ is_public: Optional[bool] | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -634,6 +647,8 @@ async def update(
description: New description
+ is_public: Whether the vector store can be accessed by anyone with valid login credentials
+
expires_after: Represents an expiration policy for a vector store.
metadata: Optional metadata key-value pairs
@@ -656,6 +671,7 @@ async def update(
{
"name": name,
"description": description,
+ "is_public": is_public,
"expires_after": expires_after,
"metadata": metadata,
},
diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py
index c2ab8879..331c9913 100644
--- a/src/mixedbread/types/vector_store.py
+++ b/src/mixedbread/types/vector_store.py
@@ -40,6 +40,9 @@ class VectorStore(BaseModel):
description: Optional[str] = None
"""Detailed description of the vector store's purpose and contents"""
+ is_public: Optional[bool] = None
+ """Whether the vector store can be accessed by anyone with valid login credentials"""
+
metadata: Optional[object] = None
"""Additional metadata associated with the vector store"""
diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py
index 3013c59c..39ee001b 100644
--- a/src/mixedbread/types/vector_store_create_params.py
+++ b/src/mixedbread/types/vector_store_create_params.py
@@ -17,6 +17,9 @@ class VectorStoreCreateParams(TypedDict, total=False):
description: Optional[str]
"""Description of the vector store"""
+ is_public: bool
+ """Whether the vector store can be accessed by anyone with valid login credentials"""
+
expires_after: Optional[ExpiresAfterParam]
"""Represents an expiration policy for a vector store."""
diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py
index d8e6a83b..7bf9e2ed 100644
--- a/src/mixedbread/types/vector_store_update_params.py
+++ b/src/mixedbread/types/vector_store_update_params.py
@@ -17,6 +17,9 @@ class VectorStoreUpdateParams(TypedDict, total=False):
description: Optional[str]
"""New description"""
+ is_public: Optional[bool]
+ """Whether the vector store can be accessed by anyone with valid login credentials"""
+
expires_after: Optional[ExpiresAfterParam]
"""Represents an expiration policy for a vector store."""
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 0dfbf64a..538f55dc 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -33,6 +33,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.create(
name="Technical Documentation",
description="Contains technical specifications and guides",
+ is_public=False,
expires_after={
"anchor": "last_active_at",
"days": 0,
@@ -115,6 +116,7 @@ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
vector_store_identifier="vector_store_identifier",
name="x",
description="description",
+ is_public=True,
expires_after={
"anchor": "last_active_at",
"days": 0,
@@ -415,6 +417,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
vector_store = await async_client.vector_stores.create(
name="Technical Documentation",
description="Contains technical specifications and guides",
+ is_public=False,
expires_after={
"anchor": "last_active_at",
"days": 0,
@@ -497,6 +500,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread
vector_store_identifier="vector_store_identifier",
name="x",
description="description",
+ is_public=True,
expires_after={
"anchor": "last_active_at",
"days": 0,
From 38c61fa32bd005d039098b381f1eccdb6b42916c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 17 Jun 2025 02:47:04 +0000
Subject: [PATCH 167/375] chore(tests): add tests for httpx client
instantiation & proxies
---
tests/test_client.py | 46 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/tests/test_client.py b/tests/test_client.py
index 61377980..14fe9a45 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -31,6 +31,8 @@
DEFAULT_TIMEOUT,
HTTPX_DEFAULT_TIMEOUT,
BaseClient,
+ DefaultHttpxClient,
+ DefaultAsyncHttpxClient,
make_request_options,
)
from mixedbread.types.vector_store_create_params import VectorStoreCreateParams
@@ -836,6 +838,28 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
+ 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")
+
+ client = DefaultHttpxClient()
+
+ mounts = tuple(client._mounts.items())
+ assert len(mounts) == 1
+ assert mounts[0][0].pattern == "https://"
+
+ @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning")
+ def test_default_client_creation(self) -> None:
+ # Ensure that the client can be initialized without any exceptions
+ DefaultHttpxClient(
+ verify=True,
+ cert=None,
+ trust_env=True,
+ http1=True,
+ http2=False,
+ limits=httpx.Limits(max_connections=100, max_keepalive_connections=20),
+ )
+
@pytest.mark.respx(base_url=base_url)
def test_follow_redirects(self, respx_mock: MockRouter) -> None:
# Test that the default follow_redirects=True allows following redirects
@@ -1699,6 +1723,28 @@ async def test_main() -> None:
time.sleep(0.1)
+ 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")
+
+ client = DefaultAsyncHttpxClient()
+
+ mounts = tuple(client._mounts.items())
+ assert len(mounts) == 1
+ assert mounts[0][0].pattern == "https://"
+
+ @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning")
+ async def test_default_client_creation(self) -> None:
+ # Ensure that the client can be initialized without any exceptions
+ DefaultAsyncHttpxClient(
+ verify=True,
+ cert=None,
+ trust_env=True,
+ http1=True,
+ http2=False,
+ limits=httpx.Limits(max_connections=100, max_keepalive_connections=20),
+ )
+
@pytest.mark.respx(base_url=base_url)
async def test_follow_redirects(self, respx_mock: MockRouter) -> None:
# Test that the default follow_redirects=True allows following redirects
From 056452dc4ac2a230e411785aa605041a50c8455e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 17 Jun 2025 04:16:30 +0000
Subject: [PATCH 168/375] chore(internal): update conftest.py
---
tests/conftest.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/conftest.py b/tests/conftest.py
index 95be7245..61ded35a 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,3 +1,5 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
from __future__ import annotations
import os
From ff7891830c2780cb09780024cdf991f9ba807c2a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 17 Jun 2025 06:47:41 +0000
Subject: [PATCH 169/375] chore(ci): enable for pull requests
---
.github/workflows/ci.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e42d2173..546cbbef 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,6 +7,10 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
+ pull_request:
+ branches-ignore:
+ - 'stl-preview-head/**'
+ - 'stl-preview-base/**'
jobs:
lint:
From 5cfc400dd1e917fd24bfcadc28016a349e9e7035 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 17 Jun 2025 13:01:44 +0000
Subject: [PATCH 170/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 1bc57136..6538ca91 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.7.1"
+ ".": "0.8.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 45ded62f..3c8e4489 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.7.1"
+version = "0.8.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 670e6ae2..dd1d30f9 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.7.1" # x-release-please-version
+__version__ = "0.8.0" # x-release-please-version
From 995c3f0947af38ccf6981f953b0633b0b0c54dc5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 18 Jun 2025 02:19:35 +0000
Subject: [PATCH 171/375] chore(readme): update badges
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 24d13985..9481c5b1 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Mixedbread API Python SDK API library
-[](https://pypi.org/project/mixedbread/)
+[![PyPI version]()](https://pypi.org/project/mixedbread/)
The Mixedbread API Python SDK library provides convenient access to the Mixedbread REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
From ea253f2b092c42c8e005b6762fa27fb6120a0fdf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 18 Jun 2025 05:56:11 +0000
Subject: [PATCH 172/375] fix(tests): fix: tests which call HTTP endpoints
directly with the example parameters
---
tests/test_client.py | 45 ++++++++++++--------------------------------
1 file changed, 12 insertions(+), 33 deletions(-)
diff --git a/tests/test_client.py b/tests/test_client.py
index 14fe9a45..7c75ca18 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -23,9 +23,7 @@
from mixedbread import Mixedbread, AsyncMixedbread, APIResponseValidationError
from mixedbread._types import Omit
-from mixedbread._utils import maybe_transform
from mixedbread._models import BaseModel, FinalRequestOptions
-from mixedbread._constants import RAW_RESPONSE_HEADER
from mixedbread._exceptions import APIStatusError, APITimeoutError, MixedbreadError, APIResponseValidationError
from mixedbread._base_client import (
DEFAULT_TIMEOUT,
@@ -35,7 +33,6 @@
DefaultAsyncHttpxClient,
make_request_options,
)
-from mixedbread.types.vector_store_create_params import VectorStoreCreateParams
from .utils import update_env
@@ -733,32 +730,21 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
+ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Mixedbread) -> None:
respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
- self.client.post(
- "/v1/vector_stores",
- body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
- cast_to=httpx.Response,
- options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
- )
+ client.vector_stores.with_streaming_response.create().__enter__()
assert _get_open_connections(self.client) == 0
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
+ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Mixedbread) -> None:
respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
- self.client.post(
- "/v1/vector_stores",
- body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
- cast_to=httpx.Response,
- options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
- )
-
+ client.vector_stores.with_streaming_response.create().__enter__()
assert _get_open_connections(self.client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@@ -1568,32 +1554,25 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
+ async def test_retrying_timeout_errors_doesnt_leak(
+ self, respx_mock: MockRouter, async_client: AsyncMixedbread
+ ) -> None:
respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
- await self.client.post(
- "/v1/vector_stores",
- body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
- cast_to=httpx.Response,
- options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
- )
+ await async_client.vector_stores.with_streaming_response.create().__aenter__()
assert _get_open_connections(self.client) == 0
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
+ async def test_retrying_status_errors_doesnt_leak(
+ self, respx_mock: MockRouter, async_client: AsyncMixedbread
+ ) -> None:
respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
- await self.client.post(
- "/v1/vector_stores",
- body=cast(object, maybe_transform({}, VectorStoreCreateParams)),
- cast_to=httpx.Response,
- options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
- )
-
+ await async_client.vector_stores.with_streaming_response.create().__aenter__()
assert _get_open_connections(self.client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
From 2c9980382bed85f20988ab7fa90fbd61d143249f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 18 Jun 2025 06:07:44 +0000
Subject: [PATCH 173/375] chore(internal): codegen related update
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 6538ca91..2b28d6ec 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.8.0"
+ ".": "0.8.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 3c8e4489..0bdfeffa 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.8.0"
+version = "0.8.1"
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 dd1d30f9..cebff629 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.8.0" # x-release-please-version
+__version__ = "0.8.1" # x-release-please-version
From 8541d9bc8932ca65952711d12e81dbb2a913c682 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 19 Jun 2025 02:57:14 +0000
Subject: [PATCH 174/375] docs(client): fix httpx.Timeout documentation
reference
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 9481c5b1..7879dba2 100644
--- a/README.md
+++ b/README.md
@@ -239,7 +239,7 @@ client.with_options(max_retries=5).vector_stores.create()
### Timeouts
By default requests time out after 1 minute. You can configure this with a `timeout` option,
-which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
+which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
```python
from mixedbread import Mixedbread
From 950b9bbd471162d3df3ed163f16f8e4f8e2e3c3a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 21 Jun 2025 04:17:08 +0000
Subject: [PATCH 175/375] feat(client): add support for aiohttp
---
README.md | 32 ++++++++++++++
pyproject.toml | 2 +
requirements-dev.lock | 27 ++++++++++++
requirements.lock | 27 ++++++++++++
src/mixedbread/__init__.py | 3 +-
src/mixedbread/_base_client.py | 22 ++++++++++
.../data_sources/test_connectors.py | 4 +-
.../api_resources/extractions/test_content.py | 4 +-
tests/api_resources/extractions/test_jobs.py | 4 +-
.../api_resources/extractions/test_schema.py | 4 +-
tests/api_resources/parsing/test_jobs.py | 4 +-
tests/api_resources/test_api_keys.py | 4 +-
tests/api_resources/test_chat.py | 4 +-
tests/api_resources/test_client.py | 4 +-
tests/api_resources/test_data_sources.py | 4 +-
tests/api_resources/test_embeddings.py | 4 +-
tests/api_resources/test_files.py | 4 +-
tests/api_resources/test_vector_stores.py | 4 +-
.../api_resources/vector_stores/test_files.py | 4 +-
tests/conftest.py | 43 ++++++++++++++++---
20 files changed, 188 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
index 7879dba2..901b0d7d 100644
--- a/README.md
+++ b/README.md
@@ -68,6 +68,38 @@ asyncio.run(main())
Functionality between the synchronous and asynchronous clients is otherwise identical.
+### With aiohttp
+
+By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
+
+You can enable this by installing `aiohttp`:
+
+```sh
+# install from PyPI
+pip install mixedbread[aiohttp]
+```
+
+Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
+
+```python
+import os
+import asyncio
+from mixedbread import DefaultAioHttpClient
+from mixedbread import AsyncMixedbread
+
+
+async def main() -> None:
+ async with AsyncMixedbread(
+ api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
+ http_client=DefaultAioHttpClient(),
+ ) as client:
+ vector_store = await client.vector_stores.create()
+ print(vector_store.id)
+
+
+asyncio.run(main())
+```
+
## Using types
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
diff --git a/pyproject.toml b/pyproject.toml
index 0bdfeffa..8078cb72 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -37,6 +37,8 @@ classifiers = [
Homepage = "https://github.com/mixedbread-ai/mixedbread-python"
Repository = "https://github.com/mixedbread-ai/mixedbread-python"
+[project.optional-dependencies]
+aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
[tool.rye]
managed = true
diff --git a/requirements-dev.lock b/requirements-dev.lock
index e4090452..ca2c5c9e 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -10,6 +10,13 @@
# universal: false
-e file:.
+aiohappyeyeballs==2.6.1
+ # via aiohttp
+aiohttp==3.12.8
+ # via httpx-aiohttp
+ # via mixedbread
+aiosignal==1.3.2
+ # via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
@@ -17,6 +24,10 @@ anyio==4.4.0
# via mixedbread
argcomplete==3.1.2
# via nox
+async-timeout==5.0.1
+ # via aiohttp
+attrs==25.3.0
+ # via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
@@ -34,16 +45,23 @@ execnet==2.1.1
# via pytest-xdist
filelock==3.12.4
# via virtualenv
+frozenlist==1.6.2
+ # via aiohttp
+ # via aiosignal
h11==0.14.0
# via httpcore
httpcore==1.0.2
# via httpx
httpx==0.28.1
+ # via httpx-aiohttp
# via mixedbread
# via respx
+httpx-aiohttp==0.1.6
+ # via mixedbread
idna==3.4
# via anyio
# via httpx
+ # via yarl
importlib-metadata==7.0.0
iniconfig==2.0.0
# via pytest
@@ -51,6 +69,9 @@ markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
+multidict==6.4.4
+ # via aiohttp
+ # via yarl
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
@@ -65,6 +86,9 @@ platformdirs==3.11.0
# via virtualenv
pluggy==1.5.0
# via pytest
+propcache==0.3.1
+ # via aiohttp
+ # via yarl
pydantic==2.10.3
# via mixedbread
pydantic-core==2.27.1
@@ -98,11 +122,14 @@ tomli==2.0.2
typing-extensions==4.12.2
# via anyio
# via mixedbread
+ # via multidict
# via mypy
# via pydantic
# via pydantic-core
# via pyright
virtualenv==20.24.5
# via nox
+yarl==1.20.0
+ # via aiohttp
zipp==3.17.0
# via importlib-metadata
diff --git a/requirements.lock b/requirements.lock
index f81f62cc..2b940d36 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -10,11 +10,22 @@
# universal: false
-e file:.
+aiohappyeyeballs==2.6.1
+ # via aiohttp
+aiohttp==3.12.8
+ # via httpx-aiohttp
+ # via mixedbread
+aiosignal==1.3.2
+ # via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via httpx
# via mixedbread
+async-timeout==5.0.1
+ # via aiohttp
+attrs==25.3.0
+ # via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
@@ -22,15 +33,28 @@ distro==1.8.0
# via mixedbread
exceptiongroup==1.2.2
# via anyio
+frozenlist==1.6.2
+ # via aiohttp
+ # via aiosignal
h11==0.14.0
# via httpcore
httpcore==1.0.2
# via httpx
httpx==0.28.1
+ # via httpx-aiohttp
+ # via mixedbread
+httpx-aiohttp==0.1.6
# via mixedbread
idna==3.4
# via anyio
# via httpx
+ # via yarl
+multidict==6.4.4
+ # via aiohttp
+ # via yarl
+propcache==0.3.1
+ # via aiohttp
+ # via yarl
pydantic==2.10.3
# via mixedbread
pydantic-core==2.27.1
@@ -41,5 +65,8 @@ sniffio==1.3.0
typing-extensions==4.12.2
# via anyio
# via mixedbread
+ # via multidict
# via pydantic
# via pydantic-core
+yarl==1.20.0
+ # via aiohttp
diff --git a/src/mixedbread/__init__.py b/src/mixedbread/__init__.py
index 022e49ef..df2a2fb2 100644
--- a/src/mixedbread/__init__.py
+++ b/src/mixedbread/__init__.py
@@ -37,7 +37,7 @@
UnprocessableEntityError,
APIResponseValidationError,
)
-from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient
+from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient
from ._utils._logs import setup_logging as _setup_logging
__all__ = [
@@ -80,6 +80,7 @@
"DEFAULT_CONNECTION_LIMITS",
"DefaultHttpxClient",
"DefaultAsyncHttpxClient",
+ "DefaultAioHttpClient",
]
if not _t.TYPE_CHECKING:
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 44036510..8ec40870 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -1289,6 +1289,24 @@ def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)
+try:
+ import httpx_aiohttp
+except ImportError:
+
+ class _DefaultAioHttpClient(httpx.AsyncClient):
+ def __init__(self, **_kwargs: Any) -> None:
+ raise RuntimeError("To use the aiohttp client you must have installed the package with the `aiohttp` extra")
+else:
+
+ class _DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore
+ def __init__(self, **kwargs: Any) -> None:
+ kwargs.setdefault("timeout", DEFAULT_TIMEOUT)
+ kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS)
+ kwargs.setdefault("follow_redirects", True)
+
+ super().__init__(**kwargs)
+
+
if TYPE_CHECKING:
DefaultAsyncHttpxClient = httpx.AsyncClient
"""An alias to `httpx.AsyncClient` that provides the same defaults that this SDK
@@ -1297,8 +1315,12 @@ def __init__(self, **kwargs: Any) -> None:
This is useful because overriding the `http_client` with your own instance of
`httpx.AsyncClient` will result in httpx's defaults being used, not ours.
"""
+
+ DefaultAioHttpClient = httpx.AsyncClient
+ """An alias to `httpx.AsyncClient` that changes the default HTTP transport to `aiohttp`."""
else:
DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient
+ DefaultAioHttpClient = _DefaultAioHttpClient
class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient):
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index fb95955d..5520ee52 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -280,7 +280,9 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
class TestAsyncConnectors:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/extractions/test_content.py b/tests/api_resources/extractions/test_content.py
index daf0b307..63ee1aed 100644
--- a/tests/api_resources/extractions/test_content.py
+++ b/tests/api_resources/extractions/test_content.py
@@ -62,7 +62,9 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
class TestAsyncContent:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/extractions/test_jobs.py b/tests/api_resources/extractions/test_jobs.py
index 312512c7..b79a66a4 100644
--- a/tests/api_resources/extractions/test_jobs.py
+++ b/tests/api_resources/extractions/test_jobs.py
@@ -91,7 +91,9 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
class TestAsyncJobs:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/extractions/test_schema.py b/tests/api_resources/extractions/test_schema.py
index 9e538d07..3de149ff 100644
--- a/tests/api_resources/extractions/test_schema.py
+++ b/tests/api_resources/extractions/test_schema.py
@@ -116,7 +116,9 @@ def test_streaming_response_validate(self, client: Mixedbread) -> None:
class TestAsyncSchema:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 6ddcf2da..64e12e9c 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -213,7 +213,9 @@ def test_path_params_cancel(self, client: Mixedbread) -> None:
class TestAsyncJobs:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/test_api_keys.py b/tests/api_resources/test_api_keys.py
index 531fadfe..7da5d8aa 100644
--- a/tests/api_resources/test_api_keys.py
+++ b/tests/api_resources/test_api_keys.py
@@ -239,7 +239,9 @@ def test_path_params_revoke(self, client: Mixedbread) -> None:
class TestAsyncAPIKeys:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/test_chat.py b/tests/api_resources/test_chat.py
index 65341369..a60009fc 100644
--- a/tests/api_resources/test_chat.py
+++ b/tests/api_resources/test_chat.py
@@ -43,7 +43,9 @@ def test_streaming_response_create_completion(self, client: Mixedbread) -> None:
class TestAsyncChat:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create_completion(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py
index e05d9df6..7a05f7de 100644
--- a/tests/api_resources/test_client.py
+++ b/tests/api_resources/test_client.py
@@ -141,7 +141,9 @@ def test_streaming_response_rerank(self, client: Mixedbread) -> None:
class TestAsyncClient:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_embed(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index 28f502e2..fa43c6ee 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -320,7 +320,9 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
class TestAsyncDataSources:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create_overload_1(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py
index 9aab6efd..f962e880 100644
--- a/tests/api_resources/test_embeddings.py
+++ b/tests/api_resources/test_embeddings.py
@@ -65,7 +65,9 @@ def test_streaming_response_create(self, client: Mixedbread) -> None:
class TestAsyncEmbeddings:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py
index 3df12533..dd9440c4 100644
--- a/tests/api_resources/test_files.py
+++ b/tests/api_resources/test_files.py
@@ -266,7 +266,9 @@ def test_path_params_content(self, client: Mixedbread) -> None:
class TestAsyncFiles:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 538f55dc..c6872f10 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -405,7 +405,9 @@ def test_streaming_response_search(self, client: Mixedbread) -> None:
class TestAsyncVectorStores:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 6a4128de..8a80638e 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -318,7 +318,9 @@ def test_streaming_response_search(self, client: Mixedbread) -> None:
class TestAsyncFiles:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
diff --git a/tests/conftest.py b/tests/conftest.py
index 61ded35a..9b35601c 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -6,10 +6,12 @@
import logging
from typing import TYPE_CHECKING, Iterator, AsyncIterator
+import httpx
import pytest
from pytest_asyncio import is_async_test
-from mixedbread import Mixedbread, AsyncMixedbread
+from mixedbread import Mixedbread, AsyncMixedbread, DefaultAioHttpClient
+from mixedbread._utils import is_dict
if TYPE_CHECKING:
from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]
@@ -27,6 +29,19 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None:
for async_test in pytest_asyncio_tests:
async_test.add_marker(session_scope_marker, append=False)
+ # We skip tests that use both the aiohttp client and respx_mock as respx_mock
+ # doesn't support custom transports.
+ for item in items:
+ if "async_client" not in item.fixturenames or "respx_mock" not in item.fixturenames:
+ continue
+
+ if not hasattr(item, "callspec"):
+ continue
+
+ async_client_param = item.callspec.params.get("async_client")
+ if is_dict(async_client_param) and async_client_param.get("http_client") == "aiohttp":
+ item.add_marker(pytest.mark.skip(reason="aiohttp client is not compatible with respx_mock"))
+
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -45,9 +60,25 @@ def client(request: FixtureRequest) -> Iterator[Mixedbread]:
@pytest.fixture(scope="session")
async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncMixedbread]:
- strict = getattr(request, "param", True)
- if not isinstance(strict, bool):
- raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}")
-
- async with AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client:
+ param = getattr(request, "param", True)
+
+ # defaults
+ strict = True
+ http_client: None | httpx.AsyncClient = None
+
+ if isinstance(param, bool):
+ strict = param
+ elif is_dict(param):
+ strict = param.get("strict", True)
+ assert isinstance(strict, bool)
+
+ http_client_type = param.get("http_client", "httpx")
+ if http_client_type == "aiohttp":
+ http_client = DefaultAioHttpClient()
+ else:
+ raise TypeError(f"Unexpected fixture parameter type {type(param)}, expected bool or dict")
+
+ async with AsyncMixedbread(
+ base_url=base_url, api_key=api_key, _strict_response_validation=strict, http_client=http_client
+ ) as client:
yield client
From ee641b26ef6ee4c107fbbb1ec77588f219755ef6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 24 Jun 2025 04:53:48 +0000
Subject: [PATCH 176/375] chore(tests): skip some failing tests on the latest
python versions
---
tests/test_client.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/test_client.py b/tests/test_client.py
index 7c75ca18..8f60c0c0 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -191,6 +191,7 @@ def test_copy_signature(self) -> None:
copy_param = copy_signature.parameters.get(name)
assert copy_param is not None, f"copy() signature is missing the {name} param"
+ @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12")
def test_copy_build_request(self) -> None:
options = FinalRequestOptions(method="get", url="/foo")
@@ -1009,6 +1010,7 @@ def test_copy_signature(self) -> None:
copy_param = copy_signature.parameters.get(name)
assert copy_param is not None, f"copy() signature is missing the {name} param"
+ @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12")
def test_copy_build_request(self) -> None:
options = FinalRequestOptions(method="get", url="/foo")
From c6fef4e0e5c2acfaa692e83da8f37563d2b05a0d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 09:25:33 +0000
Subject: [PATCH 177/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/data_sources/data_source_connector.py | 4 ++--
src/mixedbread/types/scored_audio_url_input_chunk.py | 5 ++++-
src/mixedbread/types/scored_image_url_input_chunk.py | 5 ++++-
src/mixedbread/types/scored_text_input_chunk.py | 5 ++++-
src/mixedbread/types/scored_video_url_input_chunk.py | 5 ++++-
6 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 8b1b4e11..f54fc2cc 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-258cd9419639d2d3d821e9c63a336fb7fecc362f376a7f606868445bcef995cd.yml
-openapi_spec_hash: e2c4cf1543194f94f3b0baad6a5735ba
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e3a6c9f052ee6bdfe6eb3db18628fd95c5c9bf18a656089f5f0add0490b90763.yml
+openapi_spec_hash: d3c1aa7b05aa7395dc80a2a72cbbbd84
config_hash: ca0dfb431a44ea42464c42b224addf36
diff --git a/src/mixedbread/types/data_sources/data_source_connector.py b/src/mixedbread/types/data_sources/data_source_connector.py
index d4276970..bda39237 100644
--- a/src/mixedbread/types/data_sources/data_source_connector.py
+++ b/src/mixedbread/types/data_sources/data_source_connector.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
@@ -46,7 +46,7 @@ class DataSourceConnector(BaseModel):
status: Literal["idle", "pending", "in_progress", "cancelled", "completed", "failed"]
"""The sync status of the connector"""
- error: Optional[str] = None
+ error: Optional[Dict[str, object]] = None
"""The sync error of the connector"""
object: Optional[Literal["data_source.connector"]] = None
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index b514f1bd..8f11be23 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.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 typing_extensions import Literal
from .._models import BaseModel
@@ -20,6 +20,9 @@ class ScoredAudioURLInputChunk(BaseModel):
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"""
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index f160a46d..8be62ae0 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.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 typing_extensions import Literal
from .._models import BaseModel
@@ -23,6 +23,9 @@ class ScoredImageURLInputChunk(BaseModel):
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"""
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index 42870062..398a8a7c 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.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 typing_extensions import Literal
from .._models import BaseModel
@@ -15,6 +15,9 @@ class ScoredTextInputChunk(BaseModel):
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"""
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index 14836909..bd0bea16 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.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 typing_extensions import Literal
from .._models import BaseModel
@@ -20,6 +20,9 @@ class ScoredVideoURLInputChunk(BaseModel):
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"""
From 302c389f14f93dc85fdbe50c9c50dbd77a667c18 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 09:26:20 +0000
Subject: [PATCH 178/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 2b28d6ec..6d78745c 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.8.1"
+ ".": "0.9.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 8078cb72..15422725 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.8.1"
+version = "0.9.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 cebff629..9205ddcd 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.8.1" # x-release-please-version
+__version__ = "0.9.0" # x-release-please-version
From 7f386308506a63888bb7d97f7a03d070927d1846 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 13:03:00 +0000
Subject: [PATCH 179/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
README.md | 65 -------------------
api.md | 23 ++++---
.../resources/data_sources/connectors.py | 42 +++++++-----
.../resources/data_sources/data_sources.py | 42 +++++++-----
src/mixedbread/resources/files.py | 44 +++++++------
src/mixedbread/resources/parsing/jobs.py | 41 +++++++-----
.../resources/vector_stores/files.py | 51 ++++++++++-----
.../resources/vector_stores/vector_stores.py | 42 +++++++-----
src/mixedbread/types/__init__.py | 3 +
.../types/data_source_list_params.py | 8 ++-
.../types/data_source_list_response.py | 37 +++++++++++
src/mixedbread/types/data_sources/__init__.py | 1 +
.../data_sources/connector_list_params.py | 8 ++-
.../data_sources/connector_list_response.py | 37 +++++++++++
src/mixedbread/types/file_list_params.py | 8 ++-
src/mixedbread/types/file_list_response.py | 37 +++++++++++
.../types/parsing/job_list_params.py | 8 ++-
.../types/parsing/job_list_response.py | 34 +++++++++-
.../types/vector_store_list_params.py | 7 +-
.../types/vector_store_list_response.py | 37 +++++++++++
.../types/vector_stores/__init__.py | 1 +
.../types/vector_stores/file_list_params.py | 13 +++-
.../types/vector_stores/file_list_response.py | 37 +++++++++++
.../data_sources/test_connectors.py | 24 +++----
tests/api_resources/parsing/test_jobs.py | 23 +++----
tests/api_resources/test_data_sources.py | 24 +++----
tests/api_resources/test_files.py | 29 +++++----
tests/api_resources/test_vector_stores.py | 24 +++----
.../api_resources/vector_stores/test_files.py | 26 ++++----
30 files changed, 514 insertions(+), 266 deletions(-)
create mode 100644 src/mixedbread/types/data_source_list_response.py
create mode 100644 src/mixedbread/types/data_sources/connector_list_response.py
create mode 100644 src/mixedbread/types/file_list_response.py
create mode 100644 src/mixedbread/types/vector_store_list_response.py
create mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
diff --git a/.stats.yml b/.stats.yml
index f54fc2cc..aea82ac0 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-e3a6c9f052ee6bdfe6eb3db18628fd95c5c9bf18a656089f5f0add0490b90763.yml
-openapi_spec_hash: d3c1aa7b05aa7395dc80a2a72cbbbd84
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-fd1562786a889e981d7d9b30d7f4b29d3d2ea11a8c30e19b919fae07ea355ccd.yml
+openapi_spec_hash: bed820af5a3ec78f236f707f63293d47
config_hash: ca0dfb431a44ea42464c42b224addf36
diff --git a/README.md b/README.md
index 901b0d7d..8bfd5cf1 100644
--- a/README.md
+++ b/README.md
@@ -109,71 +109,6 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
-## Pagination
-
-List methods in the Mixedbread API are paginated.
-
-This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
-
-```python
-from mixedbread import Mixedbread
-
-client = Mixedbread()
-
-all_vector_stores = []
-# Automatically fetches more pages as needed.
-for vector_store in client.vector_stores.list():
- # Do something with vector_store here
- all_vector_stores.append(vector_store)
-print(all_vector_stores)
-```
-
-Or, asynchronously:
-
-```python
-import asyncio
-from mixedbread import AsyncMixedbread
-
-client = AsyncMixedbread()
-
-
-async def main() -> None:
- all_vector_stores = []
- # Iterate through items across all pages, issuing requests as needed.
- async for vector_store in client.vector_stores.list():
- all_vector_stores.append(vector_store)
- print(all_vector_stores)
-
-
-asyncio.run(main())
-```
-
-Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
-
-```python
-first_page = await client.vector_stores.list()
-if first_page.has_next_page():
- print(f"will fetch next page using these details: {first_page.next_page_info()}")
- next_page = await first_page.get_next_page()
- print(f"number of items we just fetched: {len(next_page.data)}")
-
-# Remove `await` for non-async usage.
-```
-
-Or just work directly with the returned data:
-
-```python
-first_page = await client.vector_stores.list()
-
-print(
- f"the current start offset for this page: {first_page.pagination.offset}"
-) # => "the current start offset for this page: 1"
-for vector_store in first_page.data:
- print(vector_store.id)
-
-# Remove `await` for non-async usage.
-```
-
## Nested params
Nested parameters are dictionaries, typed using `TypedDict`, for example:
diff --git a/api.md b/api.md
index 20463369..71c47d0b 100644
--- a/api.md
+++ b/api.md
@@ -37,6 +37,7 @@ from mixedbread.types import (
ScoredVideoURLInputChunk,
VectorStore,
VectorStoreChunkSearchOptions,
+ VectorStoreListResponse,
VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
@@ -48,7 +49,7 @@ Methods:
- client.vector_stores.create(\*\*params) -> VectorStore
- client.vector_stores.retrieve(vector_store_identifier) -> VectorStore
- client.vector_stores.update(vector_store_identifier, \*\*params) -> VectorStore
-- client.vector_stores.list(\*\*params) -> SyncLimitOffset[VectorStore]
+- client.vector_stores.list(\*\*params) -> VectorStoreListResponse
- client.vector_stores.delete(vector_store_identifier) -> VectorStoreDeleteResponse
- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
@@ -63,6 +64,7 @@ from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -72,7 +74,7 @@ Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> SyncLimitOffset[VectorStoreFile]
+- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
@@ -98,7 +100,7 @@ Methods:
- client.parsing.jobs.create(\*\*params) -> ParsingJob
- client.parsing.jobs.retrieve(job_id) -> ParsingJob
-- client.parsing.jobs.list(\*\*params) -> SyncLimitOffset[JobListResponse]
+- client.parsing.jobs.list(\*\*params) -> JobListResponse
- client.parsing.jobs.delete(job_id) -> JobDeleteResponse
- client.parsing.jobs.cancel(job_id) -> ParsingJob
@@ -107,7 +109,7 @@ Methods:
Types:
```python
-from mixedbread.types import FileObject, PaginationWithTotal, FileDeleteResponse
+from mixedbread.types import FileObject, PaginationWithTotal, FileListResponse, FileDeleteResponse
```
Methods:
@@ -115,7 +117,7 @@ Methods:
- client.files.create(\*\*params) -> FileObject
- client.files.retrieve(file_id) -> FileObject
- client.files.update(file_id, \*\*params) -> FileObject
-- client.files.list(\*\*params) -> SyncLimitOffset[FileObject]
+- client.files.list(\*\*params) -> FileListResponse
- client.files.delete(file_id) -> FileDeleteResponse
- client.files.content(file_id) -> BinaryAPIResponse
@@ -184,6 +186,7 @@ from mixedbread.types import (
LinearDataSource,
NotionDataSource,
Oauth2Params,
+ DataSourceListResponse,
DataSourceDeleteResponse,
)
```
@@ -193,7 +196,7 @@ Methods:
- client.data_sources.create(\*\*params) -> DataSource
- client.data_sources.retrieve(data_source_id) -> DataSource
- client.data_sources.update(data_source_id, \*\*params) -> DataSource
-- client.data_sources.list(\*\*params) -> SyncLimitOffset[DataSource]
+- client.data_sources.list(\*\*params) -> DataSourceListResponse
- client.data_sources.delete(data_source_id) -> DataSourceDeleteResponse
## Connectors
@@ -201,7 +204,11 @@ Methods:
Types:
```python
-from mixedbread.types.data_sources import DataSourceConnector, ConnectorDeleteResponse
+from mixedbread.types.data_sources import (
+ DataSourceConnector,
+ ConnectorListResponse,
+ ConnectorDeleteResponse,
+)
```
Methods:
@@ -209,7 +216,7 @@ Methods:
- client.data_sources.connectors.create(data_source_id, \*\*params) -> DataSourceConnector
- client.data_sources.connectors.retrieve(connector_id, \*, data_source_id) -> DataSourceConnector
- client.data_sources.connectors.update(connector_id, \*, data_source_id, \*\*params) -> DataSourceConnector
-- client.data_sources.connectors.list(data_source_id, \*\*params) -> SyncLimitOffset[DataSourceConnector]
+- client.data_sources.connectors.list(data_source_id, \*\*params) -> ConnectorListResponse
- client.data_sources.connectors.delete(connector_id, \*, data_source_id) -> ConnectorDeleteResponse
# APIKeys
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index c9ab8400..fd110748 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -16,10 +16,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncLimitOffset, AsyncLimitOffset
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.data_sources import connector_list_params, connector_create_params, connector_update_params
from ...types.data_sources.data_source_connector import DataSourceConnector
+from ...types.data_sources.connector_list_response import ConnectorListResponse
from ...types.data_sources.connector_delete_response import ConnectorDeleteResponse
__all__ = ["ConnectorsResource", "AsyncConnectorsResource"]
@@ -237,14 +237,15 @@ def list(
data_source_id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[DataSourceConnector]:
+ ) -> ConnectorListResponse:
"""
Get all connectors for a data source.
@@ -258,7 +259,9 @@ def list(
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -270,9 +273,8 @@ def list(
"""
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
- return self._get_api_list(
+ return self._get(
f"/v1/data_sources/{data_source_id}/connectors",
- page=SyncLimitOffset[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -281,12 +283,13 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
},
connector_list_params.ConnectorListParams,
),
),
- model=DataSourceConnector,
+ cast_to=ConnectorListResponse,
)
def delete(
@@ -542,19 +545,20 @@ async def update(
cast_to=DataSourceConnector,
)
- def list(
+ async def list(
self,
data_source_id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[DataSourceConnector, AsyncLimitOffset[DataSourceConnector]]:
+ ) -> ConnectorListResponse:
"""
Get all connectors for a data source.
@@ -568,7 +572,9 @@ def list(
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -580,23 +586,23 @@ def list(
"""
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
- return self._get_api_list(
+ return await self._get(
f"/v1/data_sources/{data_source_id}/connectors",
- page=AsyncLimitOffset[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
},
connector_list_params.ConnectorListParams,
),
),
- model=DataSourceConnector,
+ cast_to=ConnectorListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index d1fcf526..d82939db 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -32,11 +32,11 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncLimitOffset, AsyncLimitOffset
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.data_source import DataSource
from ...types.oauth2_params import Oauth2Params
from ...types.data_source_type import DataSourceType
+from ...types.data_source_list_response import DataSourceListResponse
from ...types.data_source_delete_response import DataSourceDeleteResponse
__all__ = ["DataSourcesResource", "AsyncDataSourcesResource"]
@@ -356,14 +356,15 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[DataSource]:
+ ) -> DataSourceListResponse:
"""
Get all data sources.
@@ -372,7 +373,9 @@ def list(
Args:
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -382,9 +385,8 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return self._get(
"/v1/data_sources/",
- page=SyncLimitOffset[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -393,12 +395,13 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
},
data_source_list_params.DataSourceListParams,
),
),
- model=DataSource,
+ cast_to=DataSourceListResponse,
)
def delete(
@@ -749,18 +752,19 @@ async def update(
cast_to=DataSource,
)
- def list(
+ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[DataSource, AsyncLimitOffset[DataSource]]:
+ ) -> DataSourceListResponse:
"""
Get all data sources.
@@ -769,7 +773,9 @@ def list(
Args:
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -779,23 +785,23 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return await self._get(
"/v1/data_sources/",
- page=AsyncLimitOffset[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
},
data_source_list_params.DataSourceListParams,
),
),
- model=DataSource,
+ cast_to=DataSourceListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py
index 43cafa7d..207336ac 100644
--- a/src/mixedbread/resources/files.py
+++ b/src/mixedbread/resources/files.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import Mapping, cast
+from typing import Mapping, Optional, cast
import httpx
@@ -25,9 +25,9 @@
async_to_custom_raw_response_wrapper,
async_to_custom_streamed_response_wrapper,
)
-from ..pagination import SyncLimitOffset, AsyncLimitOffset
-from .._base_client import AsyncPaginator, make_request_options
+from .._base_client import make_request_options
from ..types.file_object import FileObject
+from ..types.file_list_response import FileListResponse
from ..types.file_delete_response import FileDeleteResponse
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -191,14 +191,15 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[FileObject]:
+ ) -> FileListResponse:
"""
List all files for the authenticated user.
@@ -209,7 +210,9 @@ def list(
Args:
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -219,9 +222,8 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return self._get(
"/v1/files",
- page=SyncLimitOffset[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -230,12 +232,13 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
},
file_list_params.FileListParams,
),
),
- model=FileObject,
+ cast_to=FileListResponse,
)
def delete(
@@ -472,18 +475,19 @@ async def update(
cast_to=FileObject,
)
- def list(
+ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[FileObject, AsyncLimitOffset[FileObject]]:
+ ) -> FileListResponse:
"""
List all files for the authenticated user.
@@ -494,7 +498,9 @@ def list(
Args:
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -504,23 +510,23 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return await self._get(
"/v1/files",
- page=AsyncLimitOffset[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
},
file_list_params.FileListParams,
),
),
- model=FileObject,
+ cast_to=FileListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 2b31acd1..939e97ec 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -17,8 +17,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncLimitOffset, AsyncLimitOffset
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.parsing import ReturnFormat, ChunkingStrategy, job_list_params, job_create_params
from ...types.parsing.parsing_job import ParsingJob
from ...types.parsing.element_type import ElementType
@@ -152,14 +151,15 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[JobListResponse]:
+ ) -> JobListResponse:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -171,7 +171,9 @@ def list(
Args:
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -181,9 +183,8 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return self._get(
"/v1/parsing/jobs",
- page=SyncLimitOffset[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -192,12 +193,13 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
},
job_list_params.JobListParams,
),
),
- model=JobListResponse,
+ cast_to=JobListResponse,
)
def delete(
@@ -397,18 +399,19 @@ async def retrieve(
cast_to=ParsingJob,
)
- def list(
+ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[JobListResponse, AsyncLimitOffset[JobListResponse]]:
+ ) -> JobListResponse:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -420,7 +423,9 @@ def list(
Args:
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -430,23 +435,23 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return await self._get(
"/v1/parsing/jobs",
- page=AsyncLimitOffset[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
},
job_list_params.JobListParams,
),
),
- model=JobListResponse,
+ cast_to=JobListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 59d9167a..16085822 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -16,12 +16,13 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncLimitOffset, AsyncLimitOffset
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.vector_stores import file_list_params, file_create_params, file_search_params
from ...types.vector_stores.vector_store_file import VectorStoreFile
+from ...types.vector_stores.file_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
+from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -157,14 +158,16 @@ def list(
vector_store_identifier: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[VectorStoreFileStatus]] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[VectorStoreFile]:
+ ) -> FileListResponse:
"""
List files indexed in a vector store with pagination.
@@ -178,7 +181,11 @@ def list(
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
+
+ statuses: Status to filter by
extra_headers: Send extra headers
@@ -192,9 +199,8 @@ def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return self._get_api_list(
+ return self._get(
f"/v1/vector_stores/{vector_store_identifier}/files",
- page=SyncLimitOffset[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -203,12 +209,14 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
+ "statuses": statuses,
},
file_list_params.FileListParams,
),
),
- model=VectorStoreFile,
+ cast_to=FileListResponse,
)
def delete(
@@ -461,19 +469,21 @@ async def retrieve(
cast_to=VectorStoreFile,
)
- def list(
+ async def list(
self,
vector_store_identifier: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[VectorStoreFileStatus]] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[VectorStoreFile, AsyncLimitOffset[VectorStoreFile]]:
+ ) -> FileListResponse:
"""
List files indexed in a vector store with pagination.
@@ -487,7 +497,11 @@ def list(
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
+
+ statuses: Status to filter by
extra_headers: Send extra headers
@@ -501,23 +515,24 @@ def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return self._get_api_list(
+ return await self._get(
f"/v1/vector_stores/{vector_store_identifier}/files",
- page=AsyncLimitOffset[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
+ "statuses": statuses,
},
file_list_params.FileListParams,
),
),
- model=VectorStoreFile,
+ cast_to=FileListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 8c125cfb..21f559df 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -31,10 +31,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncLimitOffset, AsyncLimitOffset
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.vector_store import VectorStore
from ...types.expires_after_param import ExpiresAfterParam
+from ...types.vector_store_list_response import VectorStoreListResponse
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
@@ -244,7 +244,8 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: bool | NotGiven = NOT_GIVEN,
q: Optional[str] | 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.
@@ -252,7 +253,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncLimitOffset[VectorStore]:
+ ) -> VectorStoreListResponse:
"""
List all vector stores with optional search.
@@ -264,7 +265,9 @@ def list(
Args:
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
q: Search query for fuzzy matching over name and description fields
@@ -276,9 +279,8 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return self._get(
"/v1/vector_stores",
- page=SyncLimitOffset[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -287,13 +289,14 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
"q": q,
},
vector_store_list_params.VectorStoreListParams,
),
),
- model=VectorStore,
+ cast_to=VectorStoreListResponse,
)
def delete(
@@ -683,11 +686,12 @@ async def update(
cast_to=VectorStore,
)
- def list(
+ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: bool | NotGiven = NOT_GIVEN,
q: Optional[str] | 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.
@@ -695,7 +699,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[VectorStore, AsyncLimitOffset[VectorStore]]:
+ ) -> VectorStoreListResponse:
"""
List all vector stores with optional search.
@@ -707,7 +711,9 @@ def list(
Args:
limit: Maximum number of items to return per page
- offset: Offset of the first item to return
+ cursor: Cursor for pagination (base64 encoded cursor)
+
+ include_total: Whether to include the total number of items
q: Search query for fuzzy matching over name and description fields
@@ -719,24 +725,24 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return await self._get(
"/v1/vector_stores",
- page=AsyncLimitOffset[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "offset": offset,
+ "cursor": cursor,
+ "include_total": include_total,
"q": q,
},
vector_store_list_params.VectorStoreListParams,
),
),
- model=VectorStore,
+ cast_to=VectorStoreListResponse,
)
async def delete(
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 5fead10f..a726eb8f 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -18,6 +18,7 @@
from .data_source_type import DataSourceType as DataSourceType
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
+from .file_list_response import FileListResponse as FileListResponse
from .file_update_params import FileUpdateParams as FileUpdateParams
from .api_key_list_params import APIKeyListParams as APIKeyListParams
from .client_embed_params import ClientEmbedParams as ClientEmbedParams
@@ -35,10 +36,12 @@
from .notion_data_source_param import NotionDataSourceParam as NotionDataSourceParam
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
from .data_source_create_params import DataSourceCreateParams as DataSourceCreateParams
+from .data_source_list_response import DataSourceListResponse as DataSourceListResponse
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 .vector_store_create_params import VectorStoreCreateParams as VectorStoreCreateParams
+from .vector_store_list_response import VectorStoreListResponse as VectorStoreListResponse
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
diff --git a/src/mixedbread/types/data_source_list_params.py b/src/mixedbread/types/data_source_list_params.py
index d6026d5d..86e27bce 100644
--- a/src/mixedbread/types/data_source_list_params.py
+++ b/src/mixedbread/types/data_source_list_params.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Optional
from typing_extensions import TypedDict
__all__ = ["DataSourceListParams"]
@@ -11,5 +12,8 @@ class DataSourceListParams(TypedDict, total=False):
limit: int
"""Maximum number of items to return per page"""
- offset: int
- """Offset of the first item to return"""
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
+
+ include_total: bool
+ """Whether to include the total number of items"""
diff --git a/src/mixedbread/types/data_source_list_response.py b/src/mixedbread/types/data_source_list_response.py
new file mode 100644
index 00000000..4c95ef7a
--- /dev/null
+++ b/src/mixedbread/types/data_source_list_response.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .data_source import DataSource
+
+__all__ = ["DataSourceListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
+
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
+
+ has_more: bool
+ """Whether there are more items available"""
+
+ has_prev: bool
+ """Whether there are previous items available"""
+
+ total: Optional[int] = None
+ """Total number of items available"""
+
+
+class DataSourceListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination."""
+
+ data: List[DataSource]
+ """The list of data sources"""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
diff --git a/src/mixedbread/types/data_sources/__init__.py b/src/mixedbread/types/data_sources/__init__.py
index c35b6f2e..c925bcc7 100644
--- a/src/mixedbread/types/data_sources/__init__.py
+++ b/src/mixedbread/types/data_sources/__init__.py
@@ -5,5 +5,6 @@
from .connector_list_params import ConnectorListParams as ConnectorListParams
from .data_source_connector import DataSourceConnector as DataSourceConnector
from .connector_create_params import ConnectorCreateParams as ConnectorCreateParams
+from .connector_list_response import ConnectorListResponse as ConnectorListResponse
from .connector_update_params import ConnectorUpdateParams as ConnectorUpdateParams
from .connector_delete_response import ConnectorDeleteResponse as ConnectorDeleteResponse
diff --git a/src/mixedbread/types/data_sources/connector_list_params.py b/src/mixedbread/types/data_sources/connector_list_params.py
index deda9f22..09a46fd0 100644
--- a/src/mixedbread/types/data_sources/connector_list_params.py
+++ b/src/mixedbread/types/data_sources/connector_list_params.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Optional
from typing_extensions import TypedDict
__all__ = ["ConnectorListParams"]
@@ -11,5 +12,8 @@ class ConnectorListParams(TypedDict, total=False):
limit: int
"""Maximum number of items to return per page"""
- offset: int
- """Offset of the first item to return"""
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
+
+ include_total: bool
+ """Whether to include the total number of items"""
diff --git a/src/mixedbread/types/data_sources/connector_list_response.py b/src/mixedbread/types/data_sources/connector_list_response.py
new file mode 100644
index 00000000..e63cf824
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_list_response.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+from .data_source_connector import DataSourceConnector
+
+__all__ = ["ConnectorListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
+
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
+
+ has_more: bool
+ """Whether there are more items available"""
+
+ has_prev: bool
+ """Whether there are previous items available"""
+
+ total: Optional[int] = None
+ """Total number of items available"""
+
+
+class ConnectorListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination."""
+
+ data: List[DataSourceConnector]
+ """The list of connectors"""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
diff --git a/src/mixedbread/types/file_list_params.py b/src/mixedbread/types/file_list_params.py
index 7ecfdf54..e7b9d891 100644
--- a/src/mixedbread/types/file_list_params.py
+++ b/src/mixedbread/types/file_list_params.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Optional
from typing_extensions import TypedDict
__all__ = ["FileListParams"]
@@ -11,5 +12,8 @@ class FileListParams(TypedDict, total=False):
limit: int
"""Maximum number of items to return per page"""
- offset: int
- """Offset of the first item to return"""
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
+
+ include_total: bool
+ """Whether to include the total number of items"""
diff --git a/src/mixedbread/types/file_list_response.py b/src/mixedbread/types/file_list_response.py
new file mode 100644
index 00000000..b66a56ad
--- /dev/null
+++ b/src/mixedbread/types/file_list_response.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .file_object import FileObject
+
+__all__ = ["FileListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
+
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
+
+ has_more: bool
+ """Whether there are more items available"""
+
+ has_prev: bool
+ """Whether there are previous items available"""
+
+ total: Optional[int] = None
+ """Total number of items available"""
+
+
+class FileListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination."""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[FileObject]
+ """The list of files"""
diff --git a/src/mixedbread/types/parsing/job_list_params.py b/src/mixedbread/types/parsing/job_list_params.py
index f8e7c7b0..92a016a9 100644
--- a/src/mixedbread/types/parsing/job_list_params.py
+++ b/src/mixedbread/types/parsing/job_list_params.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Optional
from typing_extensions import TypedDict
__all__ = ["JobListParams"]
@@ -11,5 +12,8 @@ class JobListParams(TypedDict, total=False):
limit: int
"""Maximum number of items to return per page"""
- offset: int
- """Offset of the first item to return"""
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
+
+ include_total: bool
+ """Whether to include the total number of items"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index 509d1620..b0aea3f0 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -1,16 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
+from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal
from ..._models import BaseModel
from .parsing_job_status import ParsingJobStatus
-__all__ = ["JobListResponse"]
+__all__ = ["JobListResponse", "Pagination", "Data"]
-class JobListResponse(BaseModel):
+class Pagination(BaseModel):
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
+
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
+
+ has_more: bool
+ """Whether there are more items available"""
+
+ has_prev: bool
+ """Whether there are previous items available"""
+
+ total: Optional[int] = None
+ """Total number of items available"""
+
+
+class Data(BaseModel):
id: str
"""The ID of the job"""
@@ -34,3 +51,14 @@ class JobListResponse(BaseModel):
object: Optional[Literal["parsing_job"]] = None
"""The type of the object"""
+
+
+class JobListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination."""
+
+ data: List[Data]
+ """The list of parsing jobs"""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
diff --git a/src/mixedbread/types/vector_store_list_params.py b/src/mixedbread/types/vector_store_list_params.py
index 4f649424..d42f0b1f 100644
--- a/src/mixedbread/types/vector_store_list_params.py
+++ b/src/mixedbread/types/vector_store_list_params.py
@@ -12,8 +12,11 @@ class VectorStoreListParams(TypedDict, total=False):
limit: int
"""Maximum number of items to return per page"""
- offset: int
- """Offset of the first item to return"""
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
+
+ include_total: bool
+ """Whether to include the total number of items"""
q: Optional[str]
"""Search query for fuzzy matching over name and description fields"""
diff --git a/src/mixedbread/types/vector_store_list_response.py b/src/mixedbread/types/vector_store_list_response.py
new file mode 100644
index 00000000..54664f1a
--- /dev/null
+++ b/src/mixedbread/types/vector_store_list_response.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .vector_store import VectorStore
+
+__all__ = ["VectorStoreListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
+
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
+
+ has_more: bool
+ """Whether there are more items available"""
+
+ has_prev: bool
+ """Whether there are previous items available"""
+
+ total: Optional[int] = None
+ """Total number of items available"""
+
+
+class VectorStoreListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination."""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[VectorStore]
+ """The list of vector stores"""
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index 6ce1aafe..f0cee6f2 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -5,6 +5,7 @@
from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
+from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
index 7ecfdf54..105ebeff 100644
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -2,8 +2,11 @@
from __future__ import annotations
+from typing import List, Optional
from typing_extensions import TypedDict
+from .vector_store_file_status import VectorStoreFileStatus
+
__all__ = ["FileListParams"]
@@ -11,5 +14,11 @@ class FileListParams(TypedDict, total=False):
limit: int
"""Maximum number of items to return per page"""
- offset: int
- """Offset of the first item to return"""
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
+
+ include_total: bool
+ """Whether to include the total number of items"""
+
+ statuses: Optional[List[VectorStoreFileStatus]]
+ """Status to filter by"""
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
new file mode 100644
index 00000000..e566de6b
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_list_response.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+from .vector_store_file import VectorStoreFile
+
+__all__ = ["FileListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
+
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
+
+ has_more: bool
+ """Whether there are more items available"""
+
+ has_prev: bool
+ """Whether there are previous items available"""
+
+ total: Optional[int] = None
+ """Total number of items available"""
+
+
+class FileListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination."""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[VectorStoreFile]
+ """The list of vector store files"""
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index 5520ee52..f32aeafb 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -9,9 +9,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
from mixedbread.types.data_sources import (
DataSourceConnector,
+ ConnectorListResponse,
ConnectorDeleteResponse,
)
@@ -188,16 +188,17 @@ def test_method_list(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(SyncLimitOffset[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
)
- assert_matches_type(SyncLimitOffset[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -208,7 +209,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(SyncLimitOffset[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -219,7 +220,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(SyncLimitOffset[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -451,16 +452,17 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(AsyncLimitOffset[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
)
- assert_matches_type(AsyncLimitOffset[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -471,7 +473,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(AsyncLimitOffset[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -482,7 +484,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(AsyncLimitOffset[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 64e12e9c..7b22a611 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -9,7 +9,6 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
from mixedbread.types.parsing import (
ParsingJob,
JobListResponse,
@@ -105,15 +104,16 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list()
- assert_matches_type(SyncLimitOffset[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list(
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
)
- assert_matches_type(SyncLimitOffset[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -122,7 +122,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(SyncLimitOffset[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -131,7 +131,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(SyncLimitOffset[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -300,15 +300,16 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list()
- assert_matches_type(AsyncLimitOffset[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list(
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
)
- assert_matches_type(AsyncLimitOffset[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -317,7 +318,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(AsyncLimitOffset[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -326,7 +327,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(AsyncLimitOffset[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index fa43c6ee..94ad5653 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -11,9 +11,9 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
DataSource,
+ DataSourceListResponse,
DataSourceDeleteResponse,
)
-from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -250,15 +250,16 @@ def test_path_params_update_overload_2(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
data_source = client.data_sources.list()
- assert_matches_type(SyncLimitOffset[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
data_source = client.data_sources.list(
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
)
- assert_matches_type(SyncLimitOffset[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -267,7 +268,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(SyncLimitOffset[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -276,7 +277,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(SyncLimitOffset[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -553,15 +554,16 @@ async def test_path_params_update_overload_2(self, async_client: AsyncMixedbread
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.list()
- assert_matches_type(AsyncLimitOffset[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.list(
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
)
- assert_matches_type(AsyncLimitOffset[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -570,7 +572,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(AsyncLimitOffset[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -579,7 +581,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(AsyncLimitOffset[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py
index dd9440c4..9fdc535d 100644
--- a/tests/api_resources/test_files.py
+++ b/tests/api_resources/test_files.py
@@ -11,14 +11,17 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import FileObject, FileDeleteResponse
+from mixedbread.types import (
+ FileObject,
+ FileListResponse,
+ FileDeleteResponse,
+)
from mixedbread._response import (
BinaryAPIResponse,
AsyncBinaryAPIResponse,
StreamedBinaryAPIResponse,
AsyncStreamedBinaryAPIResponse,
)
-from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -140,15 +143,16 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
file = client.files.list()
- assert_matches_type(SyncLimitOffset[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.files.list(
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
)
- assert_matches_type(SyncLimitOffset[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -157,7 +161,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncLimitOffset[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -166,7 +170,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncLimitOffset[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -384,15 +388,16 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list()
- assert_matches_type(AsyncLimitOffset[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list(
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
)
- assert_matches_type(AsyncLimitOffset[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -401,7 +406,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncLimitOffset[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -410,7 +415,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncLimitOffset[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index c6872f10..4be0efcc 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -11,11 +11,11 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
VectorStore,
+ VectorStoreListResponse,
VectorStoreDeleteResponse,
VectorStoreSearchResponse,
VectorStoreQuestionAnsweringResponse,
)
-from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -161,16 +161,17 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list()
- assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list(
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
q="x",
)
- assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -179,7 +180,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -188,7 +189,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -547,16 +548,17 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list()
- assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list(
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
q="x",
)
- assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -565,7 +567,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -574,7 +576,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 8a80638e..3d125ccd 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -9,9 +9,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.pagination import SyncLimitOffset, AsyncLimitOffset
from mixedbread.types.vector_stores import (
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -134,16 +134,18 @@ def test_method_list(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
+ statuses=["pending"],
)
- assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -154,7 +156,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -165,7 +167,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncLimitOffset[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -434,16 +436,18 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
limit=1000,
- offset=0,
+ cursor="cursor",
+ include_total=True,
+ statuses=["pending"],
)
- assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -454,7 +458,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -465,7 +469,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncLimitOffset[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
From 053ec23719f9912652c4ffe9636c225b7f22c895 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 13:04:24 +0000
Subject: [PATCH 180/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index aea82ac0..5cdcb68a 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-fd1562786a889e981d7d9b30d7f4b29d3d2ea11a8c30e19b919fae07ea355ccd.yml
-openapi_spec_hash: bed820af5a3ec78f236f707f63293d47
+openapi_spec_hash: 1d83645e7d7bc1b6ccfc1ecc7cca656a
config_hash: ca0dfb431a44ea42464c42b224addf36
From 2ec5ce745e3294497ccb203a6356590953411849 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 13:05:06 +0000
Subject: [PATCH 181/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 6d78745c..091cfb12 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.9.0"
+ ".": "0.10.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 15422725..d4a54e06 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.9.0"
+version = "0.10.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 9205ddcd..10f2a576 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.9.0" # x-release-please-version
+__version__ = "0.10.0" # x-release-please-version
From d1317944ee1fe2b81ac0f37edfa7a3d26c6f3f22 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 13:28:23 +0000
Subject: [PATCH 182/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
README.md | 63 +++++++++++++++++
api.md | 23 +++----
src/mixedbread/pagination.py | 67 ++++++++++++++++++-
.../resources/data_sources/connectors.py | 22 +++---
.../resources/data_sources/data_sources.py | 22 +++---
src/mixedbread/resources/files.py | 22 +++---
src/mixedbread/resources/parsing/jobs.py | 21 +++---
.../resources/vector_stores/files.py | 22 +++---
.../resources/vector_stores/vector_stores.py | 22 +++---
src/mixedbread/types/__init__.py | 3 -
.../types/data_source_list_response.py | 37 ----------
src/mixedbread/types/data_sources/__init__.py | 1 -
.../data_sources/connector_list_response.py | 37 ----------
src/mixedbread/types/file_list_response.py | 37 ----------
.../types/parsing/job_list_response.py | 34 +---------
.../types/vector_store_list_response.py | 37 ----------
.../types/vector_stores/__init__.py | 1 -
.../types/vector_stores/file_list_response.py | 37 ----------
.../data_sources/test_connectors.py | 18 ++---
tests/api_resources/parsing/test_jobs.py | 17 ++---
tests/api_resources/test_data_sources.py | 18 ++---
tests/api_resources/test_files.py | 23 +++----
tests/api_resources/test_vector_stores.py | 18 ++---
.../api_resources/vector_stores/test_files.py | 18 ++---
25 files changed, 268 insertions(+), 354 deletions(-)
delete mode 100644 src/mixedbread/types/data_source_list_response.py
delete mode 100644 src/mixedbread/types/data_sources/connector_list_response.py
delete mode 100644 src/mixedbread/types/file_list_response.py
delete mode 100644 src/mixedbread/types/vector_store_list_response.py
delete mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
diff --git a/.stats.yml b/.stats.yml
index 5cdcb68a..8c28e2d6 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-fd1562786a889e981d7d9b30d7f4b29d3d2ea11a8c30e19b919fae07ea355ccd.yml
openapi_spec_hash: 1d83645e7d7bc1b6ccfc1ecc7cca656a
-config_hash: ca0dfb431a44ea42464c42b224addf36
+config_hash: a36f4234467ae4cd0bea12552fcaaa4e
diff --git a/README.md b/README.md
index 8bfd5cf1..d4ec35ba 100644
--- a/README.md
+++ b/README.md
@@ -109,6 +109,69 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
+## Pagination
+
+List methods in the Mixedbread API are paginated.
+
+This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
+
+```python
+from mixedbread import Mixedbread
+
+client = Mixedbread()
+
+all_vector_stores = []
+# Automatically fetches more pages as needed.
+for vector_store in client.vector_stores.list():
+ # Do something with vector_store here
+ all_vector_stores.append(vector_store)
+print(all_vector_stores)
+```
+
+Or, asynchronously:
+
+```python
+import asyncio
+from mixedbread import AsyncMixedbread
+
+client = AsyncMixedbread()
+
+
+async def main() -> None:
+ all_vector_stores = []
+ # Iterate through items across all pages, issuing requests as needed.
+ async for vector_store in client.vector_stores.list():
+ all_vector_stores.append(vector_store)
+ print(all_vector_stores)
+
+
+asyncio.run(main())
+```
+
+Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
+
+```python
+first_page = await client.vector_stores.list()
+if first_page.has_next_page():
+ print(f"will fetch next page using these details: {first_page.next_page_info()}")
+ next_page = await first_page.get_next_page()
+ print(f"number of items we just fetched: {len(next_page.data)}")
+
+# Remove `await` for non-async usage.
+```
+
+Or just work directly with the returned data:
+
+```python
+first_page = await client.vector_stores.list()
+
+print(f"next page cursor: {first_page.pagination.next_cursor}") # => "next page cursor: ..."
+for vector_store in first_page.data:
+ print(vector_store.id)
+
+# Remove `await` for non-async usage.
+```
+
## Nested params
Nested parameters are dictionaries, typed using `TypedDict`, for example:
diff --git a/api.md b/api.md
index 71c47d0b..a9f5376f 100644
--- a/api.md
+++ b/api.md
@@ -37,7 +37,6 @@ from mixedbread.types import (
ScoredVideoURLInputChunk,
VectorStore,
VectorStoreChunkSearchOptions,
- VectorStoreListResponse,
VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
@@ -49,7 +48,7 @@ Methods:
- client.vector_stores.create(\*\*params) -> VectorStore
- client.vector_stores.retrieve(vector_store_identifier) -> VectorStore
- client.vector_stores.update(vector_store_identifier, \*\*params) -> VectorStore
-- client.vector_stores.list(\*\*params) -> VectorStoreListResponse
+- client.vector_stores.list(\*\*params) -> SyncCursor[VectorStore]
- client.vector_stores.delete(vector_store_identifier) -> VectorStoreDeleteResponse
- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
@@ -64,7 +63,6 @@ from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
- FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -74,7 +72,7 @@ Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
+- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> SyncCursor[VectorStoreFile]
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
@@ -100,7 +98,7 @@ Methods:
- client.parsing.jobs.create(\*\*params) -> ParsingJob
- client.parsing.jobs.retrieve(job_id) -> ParsingJob
-- client.parsing.jobs.list(\*\*params) -> JobListResponse
+- client.parsing.jobs.list(\*\*params) -> SyncCursor[JobListResponse]
- client.parsing.jobs.delete(job_id) -> JobDeleteResponse
- client.parsing.jobs.cancel(job_id) -> ParsingJob
@@ -109,7 +107,7 @@ Methods:
Types:
```python
-from mixedbread.types import FileObject, PaginationWithTotal, FileListResponse, FileDeleteResponse
+from mixedbread.types import FileObject, PaginationWithTotal, FileDeleteResponse
```
Methods:
@@ -117,7 +115,7 @@ Methods:
- client.files.create(\*\*params) -> FileObject
- client.files.retrieve(file_id) -> FileObject
- client.files.update(file_id, \*\*params) -> FileObject
-- client.files.list(\*\*params) -> FileListResponse
+- client.files.list(\*\*params) -> SyncCursor[FileObject]
- client.files.delete(file_id) -> FileDeleteResponse
- client.files.content(file_id) -> BinaryAPIResponse
@@ -186,7 +184,6 @@ from mixedbread.types import (
LinearDataSource,
NotionDataSource,
Oauth2Params,
- DataSourceListResponse,
DataSourceDeleteResponse,
)
```
@@ -196,7 +193,7 @@ Methods:
- client.data_sources.create(\*\*params) -> DataSource
- client.data_sources.retrieve(data_source_id) -> DataSource
- client.data_sources.update(data_source_id, \*\*params) -> DataSource
-- client.data_sources.list(\*\*params) -> DataSourceListResponse
+- client.data_sources.list(\*\*params) -> SyncCursor[DataSource]
- client.data_sources.delete(data_source_id) -> DataSourceDeleteResponse
## Connectors
@@ -204,11 +201,7 @@ Methods:
Types:
```python
-from mixedbread.types.data_sources import (
- DataSourceConnector,
- ConnectorListResponse,
- ConnectorDeleteResponse,
-)
+from mixedbread.types.data_sources import DataSourceConnector, ConnectorDeleteResponse
```
Methods:
@@ -216,7 +209,7 @@ Methods:
- client.data_sources.connectors.create(data_source_id, \*\*params) -> DataSourceConnector
- client.data_sources.connectors.retrieve(connector_id, \*, data_source_id) -> DataSourceConnector
- client.data_sources.connectors.update(connector_id, \*, data_source_id, \*\*params) -> DataSourceConnector
-- client.data_sources.connectors.list(data_source_id, \*\*params) -> ConnectorListResponse
+- client.data_sources.connectors.list(data_source_id, \*\*params) -> SyncCursor[DataSourceConnector]
- client.data_sources.connectors.delete(connector_id, \*, data_source_id) -> ConnectorDeleteResponse
# APIKeys
diff --git a/src/mixedbread/pagination.py b/src/mixedbread/pagination.py
index c2f1ea59..581f4f65 100644
--- a/src/mixedbread/pagination.py
+++ b/src/mixedbread/pagination.py
@@ -6,7 +6,14 @@
from ._models import BaseModel
from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage
-__all__ = ["LimitOffsetPagination", "SyncLimitOffset", "AsyncLimitOffset"]
+__all__ = [
+ "LimitOffsetPagination",
+ "SyncLimitOffset",
+ "AsyncLimitOffset",
+ "CursorPagination",
+ "SyncCursor",
+ "AsyncCursor",
+]
_T = TypeVar("_T")
@@ -87,3 +94,61 @@ def next_page_info(self) -> Optional[PageInfo]:
return PageInfo(params={"offset": current_count})
return None
+
+
+class CursorPagination(BaseModel):
+ next_cursor: Optional[str] = None
+
+ prev_cursor: Optional[str] = None
+
+ has_more: Optional[object] = None
+
+ has_prev: Optional[bool] = None
+
+ total: Optional[int] = None
+
+
+class SyncCursor(BaseSyncPage[_T], BasePage[_T], Generic[_T]):
+ data: List[_T]
+ pagination: Optional[CursorPagination] = None
+
+ @override
+ def _get_page_items(self) -> List[_T]:
+ data = self.data
+ if not data:
+ return []
+ return data
+
+ @override
+ def next_page_info(self) -> Optional[PageInfo]:
+ next_cursor = None
+ if self.pagination is not None:
+ if self.pagination.next_cursor is not None:
+ next_cursor = self.pagination.next_cursor
+ if not next_cursor:
+ return None
+
+ return PageInfo(params={"cursor": next_cursor})
+
+
+class AsyncCursor(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
+ data: List[_T]
+ pagination: Optional[CursorPagination] = None
+
+ @override
+ def _get_page_items(self) -> List[_T]:
+ data = self.data
+ if not data:
+ return []
+ return data
+
+ @override
+ def next_page_info(self) -> Optional[PageInfo]:
+ next_cursor = None
+ if self.pagination is not None:
+ if self.pagination.next_cursor is not None:
+ next_cursor = self.pagination.next_cursor
+ if not next_cursor:
+ return None
+
+ return PageInfo(params={"cursor": next_cursor})
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index fd110748..dbc11701 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -16,10 +16,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncCursor, AsyncCursor
+from ..._base_client import AsyncPaginator, make_request_options
from ...types.data_sources import connector_list_params, connector_create_params, connector_update_params
from ...types.data_sources.data_source_connector import DataSourceConnector
-from ...types.data_sources.connector_list_response import ConnectorListResponse
from ...types.data_sources.connector_delete_response import ConnectorDeleteResponse
__all__ = ["ConnectorsResource", "AsyncConnectorsResource"]
@@ -245,7 +245,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorListResponse:
+ ) -> SyncCursor[DataSourceConnector]:
"""
Get all connectors for a data source.
@@ -273,8 +273,9 @@ def list(
"""
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
- return self._get(
+ return self._get_api_list(
f"/v1/data_sources/{data_source_id}/connectors",
+ page=SyncCursor[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -289,7 +290,7 @@ def list(
connector_list_params.ConnectorListParams,
),
),
- cast_to=ConnectorListResponse,
+ model=DataSourceConnector,
)
def delete(
@@ -545,7 +546,7 @@ async def update(
cast_to=DataSourceConnector,
)
- async def list(
+ def list(
self,
data_source_id: str,
*,
@@ -558,7 +559,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorListResponse:
+ ) -> AsyncPaginator[DataSourceConnector, AsyncCursor[DataSourceConnector]]:
"""
Get all connectors for a data source.
@@ -586,14 +587,15 @@ async def list(
"""
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
- return await self._get(
+ return self._get_api_list(
f"/v1/data_sources/{data_source_id}/connectors",
+ page=AsyncCursor[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"cursor": cursor,
@@ -602,7 +604,7 @@ async def list(
connector_list_params.ConnectorListParams,
),
),
- cast_to=ConnectorListResponse,
+ model=DataSourceConnector,
)
async def delete(
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index d82939db..d9e4920f 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -32,11 +32,11 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncCursor, AsyncCursor
+from ..._base_client import AsyncPaginator, make_request_options
from ...types.data_source import DataSource
from ...types.oauth2_params import Oauth2Params
from ...types.data_source_type import DataSourceType
-from ...types.data_source_list_response import DataSourceListResponse
from ...types.data_source_delete_response import DataSourceDeleteResponse
__all__ = ["DataSourcesResource", "AsyncDataSourcesResource"]
@@ -364,7 +364,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceListResponse:
+ ) -> SyncCursor[DataSource]:
"""
Get all data sources.
@@ -385,8 +385,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/data_sources/",
+ page=SyncCursor[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -401,7 +402,7 @@ def list(
data_source_list_params.DataSourceListParams,
),
),
- cast_to=DataSourceListResponse,
+ model=DataSource,
)
def delete(
@@ -752,7 +753,7 @@ async def update(
cast_to=DataSource,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -764,7 +765,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceListResponse:
+ ) -> AsyncPaginator[DataSource, AsyncCursor[DataSource]]:
"""
Get all data sources.
@@ -785,14 +786,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/data_sources/",
+ page=AsyncCursor[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"cursor": cursor,
@@ -801,7 +803,7 @@ async def list(
data_source_list_params.DataSourceListParams,
),
),
- cast_to=DataSourceListResponse,
+ model=DataSource,
)
async def delete(
diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py
index 207336ac..f02646cb 100644
--- a/src/mixedbread/resources/files.py
+++ b/src/mixedbread/resources/files.py
@@ -25,9 +25,9 @@
async_to_custom_raw_response_wrapper,
async_to_custom_streamed_response_wrapper,
)
-from .._base_client import make_request_options
+from ..pagination import SyncCursor, AsyncCursor
+from .._base_client import AsyncPaginator, make_request_options
from ..types.file_object import FileObject
-from ..types.file_list_response import FileListResponse
from ..types.file_delete_response import FileDeleteResponse
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -199,7 +199,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> SyncCursor[FileObject]:
"""
List all files for the authenticated user.
@@ -222,8 +222,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/files",
+ page=SyncCursor[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -238,7 +239,7 @@ def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=FileObject,
)
def delete(
@@ -475,7 +476,7 @@ async def update(
cast_to=FileObject,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -487,7 +488,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> AsyncPaginator[FileObject, AsyncCursor[FileObject]]:
"""
List all files for the authenticated user.
@@ -510,14 +511,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/files",
+ page=AsyncCursor[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"cursor": cursor,
@@ -526,7 +528,7 @@ async def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=FileObject,
)
async def delete(
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 939e97ec..3810ab9e 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -17,7 +17,8 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncCursor, AsyncCursor
+from ..._base_client import AsyncPaginator, make_request_options
from ...types.parsing import ReturnFormat, ChunkingStrategy, job_list_params, job_create_params
from ...types.parsing.parsing_job import ParsingJob
from ...types.parsing.element_type import ElementType
@@ -159,7 +160,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> JobListResponse:
+ ) -> SyncCursor[JobListResponse]:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -183,8 +184,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/parsing/jobs",
+ page=SyncCursor[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -199,7 +201,7 @@ def list(
job_list_params.JobListParams,
),
),
- cast_to=JobListResponse,
+ model=JobListResponse,
)
def delete(
@@ -399,7 +401,7 @@ async def retrieve(
cast_to=ParsingJob,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -411,7 +413,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> JobListResponse:
+ ) -> AsyncPaginator[JobListResponse, AsyncCursor[JobListResponse]]:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -435,14 +437,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/parsing/jobs",
+ page=AsyncCursor[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"cursor": cursor,
@@ -451,7 +454,7 @@ async def list(
job_list_params.JobListParams,
),
),
- cast_to=JobListResponse,
+ model=JobListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 16085822..99f8d514 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -16,10 +16,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+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.vector_store_file import VectorStoreFile
-from ...types.vector_stores.file_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
@@ -167,7 +167,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> SyncCursor[VectorStoreFile]:
"""
List files indexed in a vector store with pagination.
@@ -199,8 +199,9 @@ def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return self._get(
+ return self._get_api_list(
f"/v1/vector_stores/{vector_store_identifier}/files",
+ page=SyncCursor[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -216,7 +217,7 @@ def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=VectorStoreFile,
)
def delete(
@@ -469,7 +470,7 @@ async def retrieve(
cast_to=VectorStoreFile,
)
- async def list(
+ def list(
self,
vector_store_identifier: str,
*,
@@ -483,7 +484,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> AsyncPaginator[VectorStoreFile, AsyncCursor[VectorStoreFile]]:
"""
List files indexed in a vector store with pagination.
@@ -515,14 +516,15 @@ async def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return await self._get(
+ return self._get_api_list(
f"/v1/vector_stores/{vector_store_identifier}/files",
+ page=AsyncCursor[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"cursor": cursor,
@@ -532,7 +534,7 @@ async def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=VectorStoreFile,
)
async def delete(
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 21f559df..768923bf 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -31,10 +31,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncCursor, AsyncCursor
+from ..._base_client import AsyncPaginator, make_request_options
from ...types.vector_store import VectorStore
from ...types.expires_after_param import ExpiresAfterParam
-from ...types.vector_store_list_response import VectorStoreListResponse
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
@@ -253,7 +253,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreListResponse:
+ ) -> SyncCursor[VectorStore]:
"""
List all vector stores with optional search.
@@ -279,8 +279,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/vector_stores",
+ page=SyncCursor[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -296,7 +297,7 @@ def list(
vector_store_list_params.VectorStoreListParams,
),
),
- cast_to=VectorStoreListResponse,
+ model=VectorStore,
)
def delete(
@@ -686,7 +687,7 @@ async def update(
cast_to=VectorStore,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -699,7 +700,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreListResponse:
+ ) -> AsyncPaginator[VectorStore, AsyncCursor[VectorStore]]:
"""
List all vector stores with optional search.
@@ -725,14 +726,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/vector_stores",
+ page=AsyncCursor[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"cursor": cursor,
@@ -742,7 +744,7 @@ async def list(
vector_store_list_params.VectorStoreListParams,
),
),
- cast_to=VectorStoreListResponse,
+ model=VectorStore,
)
async def delete(
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index a726eb8f..5fead10f 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -18,7 +18,6 @@
from .data_source_type import DataSourceType as DataSourceType
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
-from .file_list_response import FileListResponse as FileListResponse
from .file_update_params import FileUpdateParams as FileUpdateParams
from .api_key_list_params import APIKeyListParams as APIKeyListParams
from .client_embed_params import ClientEmbedParams as ClientEmbedParams
@@ -36,12 +35,10 @@
from .notion_data_source_param import NotionDataSourceParam as NotionDataSourceParam
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
from .data_source_create_params import DataSourceCreateParams as DataSourceCreateParams
-from .data_source_list_response import DataSourceListResponse as DataSourceListResponse
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 .vector_store_create_params import VectorStoreCreateParams as VectorStoreCreateParams
-from .vector_store_list_response import VectorStoreListResponse as VectorStoreListResponse
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
diff --git a/src/mixedbread/types/data_source_list_response.py b/src/mixedbread/types/data_source_list_response.py
deleted file mode 100644
index 4c95ef7a..00000000
--- a/src/mixedbread/types/data_source_list_response.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .data_source import DataSource
-
-__all__ = ["DataSourceListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
-
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
-
- has_more: bool
- """Whether there are more items available"""
-
- has_prev: bool
- """Whether there are previous items available"""
-
- total: Optional[int] = None
- """Total number of items available"""
-
-
-class DataSourceListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination."""
-
- data: List[DataSource]
- """The list of data sources"""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/data_sources/__init__.py b/src/mixedbread/types/data_sources/__init__.py
index c925bcc7..c35b6f2e 100644
--- a/src/mixedbread/types/data_sources/__init__.py
+++ b/src/mixedbread/types/data_sources/__init__.py
@@ -5,6 +5,5 @@
from .connector_list_params import ConnectorListParams as ConnectorListParams
from .data_source_connector import DataSourceConnector as DataSourceConnector
from .connector_create_params import ConnectorCreateParams as ConnectorCreateParams
-from .connector_list_response import ConnectorListResponse as ConnectorListResponse
from .connector_update_params import ConnectorUpdateParams as ConnectorUpdateParams
from .connector_delete_response import ConnectorDeleteResponse as ConnectorDeleteResponse
diff --git a/src/mixedbread/types/data_sources/connector_list_response.py b/src/mixedbread/types/data_sources/connector_list_response.py
deleted file mode 100644
index e63cf824..00000000
--- a/src/mixedbread/types/data_sources/connector_list_response.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .data_source_connector import DataSourceConnector
-
-__all__ = ["ConnectorListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
-
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
-
- has_more: bool
- """Whether there are more items available"""
-
- has_prev: bool
- """Whether there are previous items available"""
-
- total: Optional[int] = None
- """Total number of items available"""
-
-
-class ConnectorListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination."""
-
- data: List[DataSourceConnector]
- """The list of connectors"""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/file_list_response.py b/src/mixedbread/types/file_list_response.py
deleted file mode 100644
index b66a56ad..00000000
--- a/src/mixedbread/types/file_list_response.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .file_object import FileObject
-
-__all__ = ["FileListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
-
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
-
- has_more: bool
- """Whether there are more items available"""
-
- has_prev: bool
- """Whether there are previous items available"""
-
- total: Optional[int] = None
- """Total number of items available"""
-
-
-class FileListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination."""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[FileObject]
- """The list of files"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index b0aea3f0..509d1620 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -1,33 +1,16 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Optional
+from typing import Optional
from datetime import datetime
from typing_extensions import Literal
from ..._models import BaseModel
from .parsing_job_status import ParsingJobStatus
-__all__ = ["JobListResponse", "Pagination", "Data"]
+__all__ = ["JobListResponse"]
-class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
-
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
-
- has_more: bool
- """Whether there are more items available"""
-
- has_prev: bool
- """Whether there are previous items available"""
-
- total: Optional[int] = None
- """Total number of items available"""
-
-
-class Data(BaseModel):
+class JobListResponse(BaseModel):
id: str
"""The ID of the job"""
@@ -51,14 +34,3 @@ class Data(BaseModel):
object: Optional[Literal["parsing_job"]] = None
"""The type of the object"""
-
-
-class JobListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination."""
-
- data: List[Data]
- """The list of parsing jobs"""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/vector_store_list_response.py b/src/mixedbread/types/vector_store_list_response.py
deleted file mode 100644
index 54664f1a..00000000
--- a/src/mixedbread/types/vector_store_list_response.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .vector_store import VectorStore
-
-__all__ = ["VectorStoreListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
-
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
-
- has_more: bool
- """Whether there are more items available"""
-
- has_prev: bool
- """Whether there are previous items available"""
-
- total: Optional[int] = None
- """Total number of items available"""
-
-
-class VectorStoreListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination."""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[VectorStore]
- """The list of vector stores"""
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index f0cee6f2..6ce1aafe 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -5,7 +5,6 @@
from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
-from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
deleted file mode 100644
index e566de6b..00000000
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .vector_store_file import VectorStoreFile
-
-__all__ = ["FileListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
-
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
-
- has_more: bool
- """Whether there are more items available"""
-
- has_prev: bool
- """Whether there are previous items available"""
-
- total: Optional[int] = None
- """Total number of items available"""
-
-
-class FileListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination."""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[VectorStoreFile]
- """The list of vector store files"""
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index f32aeafb..352fed19 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -9,9 +9,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
+from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.data_sources import (
DataSourceConnector,
- ConnectorListResponse,
ConnectorDeleteResponse,
)
@@ -188,7 +188,7 @@ def test_method_list(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -198,7 +198,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
cursor="cursor",
include_total=True,
)
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -209,7 +209,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -220,7 +220,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -452,7 +452,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -462,7 +462,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
cursor="cursor",
include_total=True,
)
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -473,7 +473,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -484,7 +484,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 7b22a611..49f25077 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -9,6 +9,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
+from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.parsing import (
ParsingJob,
JobListResponse,
@@ -104,7 +105,7 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -113,7 +114,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
cursor="cursor",
include_total=True,
)
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -122,7 +123,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -131,7 +132,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -300,7 +301,7 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -309,7 +310,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
cursor="cursor",
include_total=True,
)
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -318,7 +319,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -327,7 +328,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index 94ad5653..8c6cc68b 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -11,9 +11,9 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
DataSource,
- DataSourceListResponse,
DataSourceDeleteResponse,
)
+from mixedbread.pagination import SyncCursor, AsyncCursor
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -250,7 +250,7 @@ def test_path_params_update_overload_2(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
data_source = client.data_sources.list()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -259,7 +259,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
cursor="cursor",
include_total=True,
)
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -268,7 +268,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -277,7 +277,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -554,7 +554,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncMixedbread
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.list()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -563,7 +563,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
cursor="cursor",
include_total=True,
)
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -572,7 +572,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -581,7 +581,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py
index 9fdc535d..51deafef 100644
--- a/tests/api_resources/test_files.py
+++ b/tests/api_resources/test_files.py
@@ -11,17 +11,14 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import (
- FileObject,
- FileListResponse,
- FileDeleteResponse,
-)
+from mixedbread.types import FileObject, FileDeleteResponse
from mixedbread._response import (
BinaryAPIResponse,
AsyncBinaryAPIResponse,
StreamedBinaryAPIResponse,
AsyncStreamedBinaryAPIResponse,
)
+from mixedbread.pagination import SyncCursor, AsyncCursor
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -143,7 +140,7 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
file = client.files.list()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[FileObject], file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -152,7 +149,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
cursor="cursor",
include_total=True,
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[FileObject], file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -161,7 +158,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[FileObject], file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -170,7 +167,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[FileObject], file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -388,7 +385,7 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -397,7 +394,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
cursor="cursor",
include_total=True,
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -406,7 +403,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -415,7 +412,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 4be0efcc..2fe4ab9f 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -11,11 +11,11 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
VectorStore,
- VectorStoreListResponse,
VectorStoreDeleteResponse,
VectorStoreSearchResponse,
VectorStoreQuestionAnsweringResponse,
)
+from mixedbread.pagination import SyncCursor, AsyncCursor
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -161,7 +161,7 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -171,7 +171,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
include_total=True,
q="x",
)
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -180,7 +180,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -189,7 +189,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -548,7 +548,7 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -558,7 +558,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
include_total=True,
q="x",
)
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -567,7 +567,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -576,7 +576,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 3d125ccd..350624fe 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -9,9 +9,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
+from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.vector_stores import (
VectorStoreFile,
- FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -134,7 +134,7 @@ def test_method_list(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -145,7 +145,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
include_total=True,
statuses=["pending"],
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -156,7 +156,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -167,7 +167,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -436,7 +436,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -447,7 +447,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
include_total=True,
statuses=["pending"],
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -458,7 +458,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -469,7 +469,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
assert cast(Any, response.is_closed) is True
From c1807ed8015e4f089e92c036aa5cfeb47d5ba9b6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 13:32:23 +0000
Subject: [PATCH 183/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 8c28e2d6..70831519 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-fd1562786a889e981d7d9b30d7f4b29d3d2ea11a8c30e19b919fae07ea355ccd.yml
openapi_spec_hash: 1d83645e7d7bc1b6ccfc1ecc7cca656a
-config_hash: a36f4234467ae4cd0bea12552fcaaa4e
+config_hash: cc68e7e1e58a14763975c9396c8600ae
From b444a2eec3a62cbdfa7b0bd84589652f4c094e91 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 13:33:07 +0000
Subject: [PATCH 184/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 091cfb12..f7014c35 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.10.0"
+ ".": "0.11.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index d4a54e06..59f0d0fe 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.10.0"
+version = "0.11.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 10f2a576..0341bb70 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.10.0" # x-release-please-version
+__version__ = "0.11.0" # x-release-please-version
From 85849b46144dbcf7795ab6ba9b9b2f8f6d30dbf3 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 13:33:51 +0000
Subject: [PATCH 185/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
src/mixedbread/pagination.py | 24 +++++++++++++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 70831519..3a696724 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-fd1562786a889e981d7d9b30d7f4b29d3d2ea11a8c30e19b919fae07ea355ccd.yml
openapi_spec_hash: 1d83645e7d7bc1b6ccfc1ecc7cca656a
-config_hash: cc68e7e1e58a14763975c9396c8600ae
+config_hash: 9957eb067ae655fc584c6a1fbe82540c
diff --git a/src/mixedbread/pagination.py b/src/mixedbread/pagination.py
index 581f4f65..59f96e24 100644
--- a/src/mixedbread/pagination.py
+++ b/src/mixedbread/pagination.py
@@ -101,7 +101,7 @@ class CursorPagination(BaseModel):
prev_cursor: Optional[str] = None
- has_more: Optional[object] = None
+ has_more: Optional[bool] = None
has_prev: Optional[bool] = None
@@ -119,6 +119,17 @@ def _get_page_items(self) -> List[_T]:
return []
return data
+ @override
+ def has_next_page(self) -> bool:
+ has_more = None
+ if self.pagination is not None:
+ if self.pagination.has_more is not None:
+ has_more = self.pagination.has_more
+ if has_more is not None and has_more is False:
+ return False
+
+ return super().has_next_page()
+
@override
def next_page_info(self) -> Optional[PageInfo]:
next_cursor = None
@@ -142,6 +153,17 @@ def _get_page_items(self) -> List[_T]:
return []
return data
+ @override
+ def has_next_page(self) -> bool:
+ has_more = None
+ if self.pagination is not None:
+ if self.pagination.has_more is not None:
+ has_more = self.pagination.has_more
+ if has_more is not None and has_more is False:
+ return False
+
+ return super().has_next_page()
+
@override
def next_page_info(self) -> Optional[PageInfo]:
next_cursor = None
From 86aa4d6c8c97f3b7ab8129ce09f37b2a2c6ae132 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 13:53:46 +0000
Subject: [PATCH 186/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index f7014c35..a7130553 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.11.0"
+ ".": "0.12.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 59f0d0fe..f1573a4e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.11.0"
+version = "0.12.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 0341bb70..8a6b49a1 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.11.0" # x-release-please-version
+__version__ = "0.12.0" # x-release-please-version
From 8ecbccfe14a8d7769231070c5be1b0c5fd884cf5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 14:16:43 +0000
Subject: [PATCH 187/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
src/mixedbread/_client.py | 4 ++--
tests/api_resources/vector_stores/test_files.py | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 3a696724..77fe4eff 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-fd1562786a889e981d7d9b30d7f4b29d3d2ea11a8c30e19b919fae07ea355ccd.yml
openapi_spec_hash: 1d83645e7d7bc1b6ccfc1ecc7cca656a
-config_hash: 9957eb067ae655fc584c6a1fbe82540c
+config_hash: 95ffbc5d87b528d727a944596d7cf051
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index bd402d87..0eca020d 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -176,7 +176,7 @@ def __init__(
@property
@override
def qs(self) -> Querystring:
- return Querystring(array_format="comma")
+ return Querystring(array_format="repeat")
@property
@override
@@ -539,7 +539,7 @@ def __init__(
@property
@override
def qs(self) -> Querystring:
- return Querystring(array_format="comma")
+ return Querystring(array_format="repeat")
@property
@override
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 350624fe..62eea508 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -143,7 +143,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
limit=1000,
cursor="cursor",
include_total=True,
- statuses=["pending"],
+ statuses=["pending", "in_progress"],
)
assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
@@ -445,7 +445,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
limit=1000,
cursor="cursor",
include_total=True,
- statuses=["pending"],
+ statuses=["pending", "in_progress"],
)
assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
From cd51ff077f65d9f3cedd8a78781962411b7c27a5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Jun 2025 14:20:33 +0000
Subject: [PATCH 188/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index a7130553..d52d2b97 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.12.0"
+ ".": "0.13.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index f1573a4e..5e49cf21 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.12.0"
+version = "0.13.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 8a6b49a1..b4a71847 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.12.0" # x-release-please-version
+__version__ = "0.13.0" # x-release-please-version
From 3ec1ae7a280bdf4238c35fe9c4703d4beeb86316 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 26 Jun 2025 13:25:39 +0000
Subject: [PATCH 189/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 77fe4eff..2f3b13a9 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-fd1562786a889e981d7d9b30d7f4b29d3d2ea11a8c30e19b919fae07ea355ccd.yml
-openapi_spec_hash: 1d83645e7d7bc1b6ccfc1ecc7cca656a
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-5c5de9998c6edfa2acd898ff8f26dee5f653f4d85a217654c9b3d41439f33910.yml
+openapi_spec_hash: d98327832bbd7f0b1178a15c15005bfa
config_hash: 95ffbc5d87b528d727a944596d7cf051
From 4f04d3d073085db87131cdf64e5937ba372acc38 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 26 Jun 2025 15:26:00 +0000
Subject: [PATCH 190/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 2f3b13a9..26f6a536 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-5c5de9998c6edfa2acd898ff8f26dee5f653f4d85a217654c9b3d41439f33910.yml
-openapi_spec_hash: d98327832bbd7f0b1178a15c15005bfa
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7361ed078e7c394c7cb1da4a3e2f3417d4498de5eea648cf9d3caaa0ddf85f78.yml
+openapi_spec_hash: 4ae67ffa9040c2d5a87026df79c1feaf
config_hash: 95ffbc5d87b528d727a944596d7cf051
From 1777a50d425e0f5da422d3aa717a68cc7b679656 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 27 Jun 2025 02:40:53 +0000
Subject: [PATCH 191/375] =?UTF-8?q?fix(ci):=20release-doctor=20=E2=80=94?=
=?UTF-8?q?=20report=20correct=20token=20name?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
bin/check-release-environment | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/check-release-environment b/bin/check-release-environment
index fa95a3ba..b845b0f4 100644
--- a/bin/check-release-environment
+++ b/bin/check-release-environment
@@ -3,7 +3,7 @@
errors=()
if [ -z "${PYPI_TOKEN}" ]; then
- errors+=("The MIXEDBREAD_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
+ errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi
lenErrors=${#errors[@]}
From f036d770f0d7018764f68fff2bbd31b48b21e495 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 28 Jun 2025 02:19:47 +0000
Subject: [PATCH 192/375] chore(internal): codegen related update
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index d52d2b97..3b07edf5 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.13.0"
+ ".": "0.13.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 5e49cf21..ba2411a3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.13.0"
+version = "0.13.1"
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 b4a71847..aa389075 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.13.0" # x-release-please-version
+__version__ = "0.13.1" # x-release-please-version
From 2bcb3a164bf1e03fbb6a35e1e655381ae42bcd59 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 28 Jun 2025 08:57:51 +0000
Subject: [PATCH 193/375] chore(ci): only run for pushes and fork pull requests
---
.github/workflows/ci.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 546cbbef..0aa80eff 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -17,6 +17,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
@@ -42,6 +43,7 @@ jobs:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
@@ -62,6 +64,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
From dfb5f96c12a52a76dc764f917ce36e17da2f91a6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 30 Jun 2025 02:35:11 +0000
Subject: [PATCH 194/375] fix(ci): correct conditional
---
.github/workflows/ci.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0aa80eff..2c0ecf6a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -36,14 +36,13 @@ jobs:
run: ./scripts/lint
upload:
- if: github.repository == 'stainless-sdks/mixedbread-python'
+ if: github.repository == 'stainless-sdks/mixedbread-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
- if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
From a333e05c66190467419aaf17efc6d2fc7cbe407e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 30 Jun 2025 02:53:29 +0000
Subject: [PATCH 195/375] chore(internal): codegen related update
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3b07edf5..f80776a4 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.13.1"
+ ".": "0.13.2"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index ba2411a3..41a2114a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.13.1"
+version = "0.13.2"
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 aa389075..405a4a61 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.13.1" # x-release-please-version
+__version__ = "0.13.2" # x-release-please-version
From 5c5d178c12f2088ad0ec57979652e3957eff2bad Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 30 Jun 2025 10:17:54 +0000
Subject: [PATCH 196/375] feat(api): api update
---
.stats.yml | 4 +-
README.md | 63 -----------------
api.md | 23 ++++---
.../resources/data_sources/connectors.py | 54 +++++++++------
.../resources/data_sources/data_sources.py | 54 +++++++++------
src/mixedbread/resources/files.py | 62 +++++++++++------
src/mixedbread/resources/parsing/jobs.py | 62 +++++++++++------
.../resources/vector_stores/files.py | 54 +++++++++------
.../resources/vector_stores/vector_stores.py | 54 +++++++++------
src/mixedbread/types/__init__.py | 3 +
.../types/data_source_list_params.py | 17 +++--
.../types/data_source_list_response.py | 69 +++++++++++++++++++
src/mixedbread/types/data_sources/__init__.py | 1 +
.../data_sources/connector_list_params.py | 17 +++--
.../data_sources/connector_list_response.py | 69 +++++++++++++++++++
src/mixedbread/types/file_list_params.py | 20 ++++--
src/mixedbread/types/file_list_response.py | 69 +++++++++++++++++++
.../types/parsing/job_list_params.py | 24 +++++--
.../types/parsing/job_list_response.py | 66 +++++++++++++++++-
.../types/vector_store_list_params.py | 17 +++--
.../types/vector_store_list_response.py | 69 +++++++++++++++++++
.../types/vector_stores/__init__.py | 1 +
.../types/vector_stores/file_list_params.py | 17 +++--
.../types/vector_stores/file_list_response.py | 69 +++++++++++++++++++
.../data_sources/test_connectors.py | 32 +++++----
tests/api_resources/parsing/test_jobs.py | 33 +++++----
tests/api_resources/test_data_sources.py | 32 +++++----
tests/api_resources/test_files.py | 39 ++++++-----
tests/api_resources/test_vector_stores.py | 32 +++++----
.../api_resources/vector_stores/test_files.py | 32 +++++----
30 files changed, 834 insertions(+), 324 deletions(-)
create mode 100644 src/mixedbread/types/data_source_list_response.py
create mode 100644 src/mixedbread/types/data_sources/connector_list_response.py
create mode 100644 src/mixedbread/types/file_list_response.py
create mode 100644 src/mixedbread/types/vector_store_list_response.py
create mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
diff --git a/.stats.yml b/.stats.yml
index 26f6a536..f49ee495 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-7361ed078e7c394c7cb1da4a3e2f3417d4498de5eea648cf9d3caaa0ddf85f78.yml
-openapi_spec_hash: 4ae67ffa9040c2d5a87026df79c1feaf
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-fe968780e87b8a5ff65ea009ade00fb0e27e951f7ce16d39a2ae0957740add45.yml
+openapi_spec_hash: 9a29ae1bb05df2061e321b0d1adef675
config_hash: 95ffbc5d87b528d727a944596d7cf051
diff --git a/README.md b/README.md
index d4ec35ba..8bfd5cf1 100644
--- a/README.md
+++ b/README.md
@@ -109,69 +109,6 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
-## Pagination
-
-List methods in the Mixedbread API are paginated.
-
-This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
-
-```python
-from mixedbread import Mixedbread
-
-client = Mixedbread()
-
-all_vector_stores = []
-# Automatically fetches more pages as needed.
-for vector_store in client.vector_stores.list():
- # Do something with vector_store here
- all_vector_stores.append(vector_store)
-print(all_vector_stores)
-```
-
-Or, asynchronously:
-
-```python
-import asyncio
-from mixedbread import AsyncMixedbread
-
-client = AsyncMixedbread()
-
-
-async def main() -> None:
- all_vector_stores = []
- # Iterate through items across all pages, issuing requests as needed.
- async for vector_store in client.vector_stores.list():
- all_vector_stores.append(vector_store)
- print(all_vector_stores)
-
-
-asyncio.run(main())
-```
-
-Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
-
-```python
-first_page = await client.vector_stores.list()
-if first_page.has_next_page():
- print(f"will fetch next page using these details: {first_page.next_page_info()}")
- next_page = await first_page.get_next_page()
- print(f"number of items we just fetched: {len(next_page.data)}")
-
-# Remove `await` for non-async usage.
-```
-
-Or just work directly with the returned data:
-
-```python
-first_page = await client.vector_stores.list()
-
-print(f"next page cursor: {first_page.pagination.next_cursor}") # => "next page cursor: ..."
-for vector_store in first_page.data:
- print(vector_store.id)
-
-# Remove `await` for non-async usage.
-```
-
## Nested params
Nested parameters are dictionaries, typed using `TypedDict`, for example:
diff --git a/api.md b/api.md
index a9f5376f..71c47d0b 100644
--- a/api.md
+++ b/api.md
@@ -37,6 +37,7 @@ from mixedbread.types import (
ScoredVideoURLInputChunk,
VectorStore,
VectorStoreChunkSearchOptions,
+ VectorStoreListResponse,
VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
@@ -48,7 +49,7 @@ Methods:
- client.vector_stores.create(\*\*params) -> VectorStore
- client.vector_stores.retrieve(vector_store_identifier) -> VectorStore
- client.vector_stores.update(vector_store_identifier, \*\*params) -> VectorStore
-- client.vector_stores.list(\*\*params) -> SyncCursor[VectorStore]
+- client.vector_stores.list(\*\*params) -> VectorStoreListResponse
- client.vector_stores.delete(vector_store_identifier) -> VectorStoreDeleteResponse
- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
@@ -63,6 +64,7 @@ from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -72,7 +74,7 @@ Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> SyncCursor[VectorStoreFile]
+- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
@@ -98,7 +100,7 @@ Methods:
- client.parsing.jobs.create(\*\*params) -> ParsingJob
- client.parsing.jobs.retrieve(job_id) -> ParsingJob
-- client.parsing.jobs.list(\*\*params) -> SyncCursor[JobListResponse]
+- client.parsing.jobs.list(\*\*params) -> JobListResponse
- client.parsing.jobs.delete(job_id) -> JobDeleteResponse
- client.parsing.jobs.cancel(job_id) -> ParsingJob
@@ -107,7 +109,7 @@ Methods:
Types:
```python
-from mixedbread.types import FileObject, PaginationWithTotal, FileDeleteResponse
+from mixedbread.types import FileObject, PaginationWithTotal, FileListResponse, FileDeleteResponse
```
Methods:
@@ -115,7 +117,7 @@ Methods:
- client.files.create(\*\*params) -> FileObject
- client.files.retrieve(file_id) -> FileObject
- client.files.update(file_id, \*\*params) -> FileObject
-- client.files.list(\*\*params) -> SyncCursor[FileObject]
+- client.files.list(\*\*params) -> FileListResponse
- client.files.delete(file_id) -> FileDeleteResponse
- client.files.content(file_id) -> BinaryAPIResponse
@@ -184,6 +186,7 @@ from mixedbread.types import (
LinearDataSource,
NotionDataSource,
Oauth2Params,
+ DataSourceListResponse,
DataSourceDeleteResponse,
)
```
@@ -193,7 +196,7 @@ Methods:
- client.data_sources.create(\*\*params) -> DataSource
- client.data_sources.retrieve(data_source_id) -> DataSource
- client.data_sources.update(data_source_id, \*\*params) -> DataSource
-- client.data_sources.list(\*\*params) -> SyncCursor[DataSource]
+- client.data_sources.list(\*\*params) -> DataSourceListResponse
- client.data_sources.delete(data_source_id) -> DataSourceDeleteResponse
## Connectors
@@ -201,7 +204,11 @@ Methods:
Types:
```python
-from mixedbread.types.data_sources import DataSourceConnector, ConnectorDeleteResponse
+from mixedbread.types.data_sources import (
+ DataSourceConnector,
+ ConnectorListResponse,
+ ConnectorDeleteResponse,
+)
```
Methods:
@@ -209,7 +216,7 @@ Methods:
- client.data_sources.connectors.create(data_source_id, \*\*params) -> DataSourceConnector
- client.data_sources.connectors.retrieve(connector_id, \*, data_source_id) -> DataSourceConnector
- client.data_sources.connectors.update(connector_id, \*, data_source_id, \*\*params) -> DataSourceConnector
-- client.data_sources.connectors.list(data_source_id, \*\*params) -> SyncCursor[DataSourceConnector]
+- client.data_sources.connectors.list(data_source_id, \*\*params) -> ConnectorListResponse
- client.data_sources.connectors.delete(connector_id, \*, data_source_id) -> ConnectorDeleteResponse
# APIKeys
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index dbc11701..f333b4e9 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -16,10 +16,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncCursor, AsyncCursor
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.data_sources import connector_list_params, connector_create_params, connector_update_params
from ...types.data_sources.data_source_connector import DataSourceConnector
+from ...types.data_sources.connector_list_response import ConnectorListResponse
from ...types.data_sources.connector_delete_response import ConnectorDeleteResponse
__all__ = ["ConnectorsResource", "AsyncConnectorsResource"]
@@ -237,7 +237,8 @@ def list(
data_source_id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -245,7 +246,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncCursor[DataSourceConnector]:
+ ) -> ConnectorListResponse:
"""
Get all connectors for a data source.
@@ -257,11 +258,15 @@ def list(
Args:
data_source_id: The ID of the data source to get connectors for
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
extra_headers: Send extra headers
@@ -273,9 +278,8 @@ def list(
"""
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
- return self._get_api_list(
+ return self._get(
f"/v1/data_sources/{data_source_id}/connectors",
- page=SyncCursor[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -284,13 +288,14 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
},
connector_list_params.ConnectorListParams,
),
),
- model=DataSourceConnector,
+ cast_to=ConnectorListResponse,
)
def delete(
@@ -546,12 +551,13 @@ async def update(
cast_to=DataSourceConnector,
)
- def list(
+ async def list(
self,
data_source_id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -559,7 +565,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[DataSourceConnector, AsyncCursor[DataSourceConnector]]:
+ ) -> ConnectorListResponse:
"""
Get all connectors for a data source.
@@ -571,11 +577,15 @@ def list(
Args:
data_source_id: The ID of the data source to get connectors for
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
extra_headers: Send extra headers
@@ -587,24 +597,24 @@ def list(
"""
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
- return self._get_api_list(
+ return await self._get(
f"/v1/data_sources/{data_source_id}/connectors",
- page=AsyncCursor[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
},
connector_list_params.ConnectorListParams,
),
),
- model=DataSourceConnector,
+ cast_to=ConnectorListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index d9e4920f..c8a83074 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -32,11 +32,11 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncCursor, AsyncCursor
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.data_source import DataSource
from ...types.oauth2_params import Oauth2Params
from ...types.data_source_type import DataSourceType
+from ...types.data_source_list_response import DataSourceListResponse
from ...types.data_source_delete_response import DataSourceDeleteResponse
__all__ = ["DataSourcesResource", "AsyncDataSourcesResource"]
@@ -356,7 +356,8 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -364,18 +365,22 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncCursor[DataSource]:
+ ) -> DataSourceListResponse:
"""
Get all data sources.
Returns: The list of data sources.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
extra_headers: Send extra headers
@@ -385,9 +390,8 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return self._get(
"/v1/data_sources/",
- page=SyncCursor[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -396,13 +400,14 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
},
data_source_list_params.DataSourceListParams,
),
),
- model=DataSource,
+ cast_to=DataSourceListResponse,
)
def delete(
@@ -753,11 +758,12 @@ async def update(
cast_to=DataSource,
)
- def list(
+ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -765,18 +771,22 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[DataSource, AsyncCursor[DataSource]]:
+ ) -> DataSourceListResponse:
"""
Get all data sources.
Returns: The list of data sources.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
extra_headers: Send extra headers
@@ -786,24 +796,24 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return await self._get(
"/v1/data_sources/",
- page=AsyncCursor[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
},
data_source_list_params.DataSourceListParams,
),
),
- model=DataSource,
+ cast_to=DataSourceListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py
index f02646cb..10f6a213 100644
--- a/src/mixedbread/resources/files.py
+++ b/src/mixedbread/resources/files.py
@@ -25,9 +25,9 @@
async_to_custom_raw_response_wrapper,
async_to_custom_streamed_response_wrapper,
)
-from ..pagination import SyncCursor, AsyncCursor
-from .._base_client import AsyncPaginator, make_request_options
+from .._base_client import make_request_options
from ..types.file_object import FileObject
+from ..types.file_list_response import FileListResponse
from ..types.file_delete_response import FileDeleteResponse
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -191,15 +191,17 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
+ q: Optional[str] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncCursor[FileObject]:
+ ) -> FileListResponse:
"""
List all files for the authenticated user.
@@ -208,11 +210,17 @@ def list(
Returns: A list of files belonging to the user.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ q: Search query for fuzzy matching over name and description fields
extra_headers: Send extra headers
@@ -222,9 +230,8 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return self._get(
"/v1/files",
- page=SyncCursor[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -233,13 +240,15 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
+ "q": q,
},
file_list_params.FileListParams,
),
),
- model=FileObject,
+ cast_to=FileListResponse,
)
def delete(
@@ -476,19 +485,21 @@ async def update(
cast_to=FileObject,
)
- def list(
+ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
+ q: Optional[str] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[FileObject, AsyncCursor[FileObject]]:
+ ) -> FileListResponse:
"""
List all files for the authenticated user.
@@ -497,11 +508,17 @@ def list(
Returns: A list of files belonging to the user.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ q: Search query for fuzzy matching over name and description fields
extra_headers: Send extra headers
@@ -511,24 +528,25 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return await self._get(
"/v1/files",
- page=AsyncCursor[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
+ "q": q,
},
file_list_params.FileListParams,
),
),
- model=FileObject,
+ cast_to=FileListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 3810ab9e..459fbe8e 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -17,14 +17,14 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncCursor, AsyncCursor
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.parsing import ReturnFormat, ChunkingStrategy, job_list_params, job_create_params
from ...types.parsing.parsing_job import ParsingJob
from ...types.parsing.element_type import ElementType
from ...types.parsing.return_format import ReturnFormat
from ...types.parsing.chunking_strategy import ChunkingStrategy
from ...types.parsing.job_list_response import JobListResponse
+from ...types.parsing.parsing_job_status import ParsingJobStatus
from ...types.parsing.job_delete_response import JobDeleteResponse
__all__ = ["JobsResource", "AsyncJobsResource"]
@@ -152,15 +152,17 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[ParsingJobStatus]] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncCursor[JobListResponse]:
+ ) -> JobListResponse:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -170,11 +172,17 @@ def list(
Returns: List of parsing jobs with pagination.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ statuses: Status to filter by
extra_headers: Send extra headers
@@ -184,9 +192,8 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return self._get(
"/v1/parsing/jobs",
- page=SyncCursor[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -195,13 +202,15 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
+ "statuses": statuses,
},
job_list_params.JobListParams,
),
),
- model=JobListResponse,
+ cast_to=JobListResponse,
)
def delete(
@@ -401,19 +410,21 @@ async def retrieve(
cast_to=ParsingJob,
)
- def list(
+ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[ParsingJobStatus]] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[JobListResponse, AsyncCursor[JobListResponse]]:
+ ) -> JobListResponse:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -423,11 +434,17 @@ def list(
Returns: List of parsing jobs with pagination.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ statuses: Status to filter by
extra_headers: Send extra headers
@@ -437,24 +454,25 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return await self._get(
"/v1/parsing/jobs",
- page=AsyncCursor[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
+ "statuses": statuses,
},
job_list_params.JobListParams,
),
),
- model=JobListResponse,
+ cast_to=JobListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 99f8d514..f25c6699 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -16,10 +16,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncCursor, AsyncCursor
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.vector_stores import file_list_params, file_create_params, file_search_params
from ...types.vector_stores.vector_store_file import VectorStoreFile
+from ...types.vector_stores.file_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
@@ -158,7 +158,8 @@ def list(
vector_store_identifier: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -167,7 +168,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncCursor[VectorStoreFile]:
+ ) -> FileListResponse:
"""
List files indexed in a vector store with pagination.
@@ -179,11 +180,15 @@ def list(
Args:
vector_store_identifier: The ID or name of the vector store
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
statuses: Status to filter by
@@ -199,9 +204,8 @@ def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return self._get_api_list(
+ return self._get(
f"/v1/vector_stores/{vector_store_identifier}/files",
- page=SyncCursor[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -210,14 +214,15 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
"statuses": statuses,
},
file_list_params.FileListParams,
),
),
- model=VectorStoreFile,
+ cast_to=FileListResponse,
)
def delete(
@@ -470,12 +475,13 @@ async def retrieve(
cast_to=VectorStoreFile,
)
- def list(
+ async def list(
self,
vector_store_identifier: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -484,7 +490,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[VectorStoreFile, AsyncCursor[VectorStoreFile]]:
+ ) -> FileListResponse:
"""
List files indexed in a vector store with pagination.
@@ -496,11 +502,15 @@ def list(
Args:
vector_store_identifier: The ID or name of the vector store
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
statuses: Status to filter by
@@ -516,25 +526,25 @@ def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return self._get_api_list(
+ return await self._get(
f"/v1/vector_stores/{vector_store_identifier}/files",
- page=AsyncCursor[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
"statuses": statuses,
},
file_list_params.FileListParams,
),
),
- model=VectorStoreFile,
+ cast_to=FileListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 768923bf..96bf67de 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -31,10 +31,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncCursor, AsyncCursor
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
from ...types.vector_store import VectorStore
from ...types.expires_after_param import ExpiresAfterParam
+from ...types.vector_store_list_response import VectorStoreListResponse
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
@@ -244,7 +244,8 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
q: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -253,7 +254,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncCursor[VectorStore]:
+ ) -> VectorStoreListResponse:
"""
List all vector stores with optional search.
@@ -263,11 +264,15 @@ def list(
Returns: VectorStoreListResponse: The list of vector stores.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
q: Search query for fuzzy matching over name and description fields
@@ -279,9 +284,8 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return self._get(
"/v1/vector_stores",
- page=SyncCursor[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -290,14 +294,15 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
"q": q,
},
vector_store_list_params.VectorStoreListParams,
),
),
- model=VectorStore,
+ cast_to=VectorStoreListResponse,
)
def delete(
@@ -687,11 +692,12 @@ async def update(
cast_to=VectorStore,
)
- def list(
+ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
q: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -700,7 +706,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[VectorStore, AsyncCursor[VectorStore]]:
+ ) -> VectorStoreListResponse:
"""
List all vector stores with optional search.
@@ -710,11 +716,15 @@ def list(
Returns: VectorStoreListResponse: The list of vector stores.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
q: Search query for fuzzy matching over name and description fields
@@ -726,25 +736,25 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get_api_list(
+ return await self._get(
"/v1/vector_stores",
- page=AsyncCursor[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform(
+ query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
"q": q,
},
vector_store_list_params.VectorStoreListParams,
),
),
- model=VectorStore,
+ cast_to=VectorStoreListResponse,
)
async def delete(
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 5fead10f..a726eb8f 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -18,6 +18,7 @@
from .data_source_type import DataSourceType as DataSourceType
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
+from .file_list_response import FileListResponse as FileListResponse
from .file_update_params import FileUpdateParams as FileUpdateParams
from .api_key_list_params import APIKeyListParams as APIKeyListParams
from .client_embed_params import ClientEmbedParams as ClientEmbedParams
@@ -35,10 +36,12 @@
from .notion_data_source_param import NotionDataSourceParam as NotionDataSourceParam
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
from .data_source_create_params import DataSourceCreateParams as DataSourceCreateParams
+from .data_source_list_response import DataSourceListResponse as DataSourceListResponse
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 .vector_store_create_params import VectorStoreCreateParams as VectorStoreCreateParams
+from .vector_store_list_response import VectorStoreListResponse as VectorStoreListResponse
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
diff --git a/src/mixedbread/types/data_source_list_params.py b/src/mixedbread/types/data_source_list_params.py
index 86e27bce..07eb80f4 100644
--- a/src/mixedbread/types/data_source_list_params.py
+++ b/src/mixedbread/types/data_source_list_params.py
@@ -10,10 +10,19 @@
class DataSourceListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
diff --git a/src/mixedbread/types/data_source_list_response.py b/src/mixedbread/types/data_source_list_response.py
new file mode 100644
index 00000000..0c7298f5
--- /dev/null
+++ b/src/mixedbread/types/data_source_list_response.py
@@ -0,0 +1,69 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .data_source import DataSource
+
+__all__ = ["DataSourceListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class DataSourceListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
+
+ data: List[DataSource]
+ """The list of data sources"""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
diff --git a/src/mixedbread/types/data_sources/__init__.py b/src/mixedbread/types/data_sources/__init__.py
index c35b6f2e..c925bcc7 100644
--- a/src/mixedbread/types/data_sources/__init__.py
+++ b/src/mixedbread/types/data_sources/__init__.py
@@ -5,5 +5,6 @@
from .connector_list_params import ConnectorListParams as ConnectorListParams
from .data_source_connector import DataSourceConnector as DataSourceConnector
from .connector_create_params import ConnectorCreateParams as ConnectorCreateParams
+from .connector_list_response import ConnectorListResponse as ConnectorListResponse
from .connector_update_params import ConnectorUpdateParams as ConnectorUpdateParams
from .connector_delete_response import ConnectorDeleteResponse as ConnectorDeleteResponse
diff --git a/src/mixedbread/types/data_sources/connector_list_params.py b/src/mixedbread/types/data_sources/connector_list_params.py
index 09a46fd0..cb3da959 100644
--- a/src/mixedbread/types/data_sources/connector_list_params.py
+++ b/src/mixedbread/types/data_sources/connector_list_params.py
@@ -10,10 +10,19 @@
class ConnectorListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
diff --git a/src/mixedbread/types/data_sources/connector_list_response.py b/src/mixedbread/types/data_sources/connector_list_response.py
new file mode 100644
index 00000000..c6f2f388
--- /dev/null
+++ b/src/mixedbread/types/data_sources/connector_list_response.py
@@ -0,0 +1,69 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+from .data_source_connector import DataSourceConnector
+
+__all__ = ["ConnectorListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class ConnectorListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
+
+ data: List[DataSourceConnector]
+ """The list of connectors"""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
diff --git a/src/mixedbread/types/file_list_params.py b/src/mixedbread/types/file_list_params.py
index e7b9d891..83207e3d 100644
--- a/src/mixedbread/types/file_list_params.py
+++ b/src/mixedbread/types/file_list_params.py
@@ -10,10 +10,22 @@
class FileListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
+
+ q: Optional[str]
+ """Search query for fuzzy matching over name and description fields"""
diff --git a/src/mixedbread/types/file_list_response.py b/src/mixedbread/types/file_list_response.py
new file mode 100644
index 00000000..c7322db2
--- /dev/null
+++ b/src/mixedbread/types/file_list_response.py
@@ -0,0 +1,69 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .file_object import FileObject
+
+__all__ = ["FileListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class FileListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[FileObject]
+ """The list of files"""
diff --git a/src/mixedbread/types/parsing/job_list_params.py b/src/mixedbread/types/parsing/job_list_params.py
index 92a016a9..979c53a3 100644
--- a/src/mixedbread/types/parsing/job_list_params.py
+++ b/src/mixedbread/types/parsing/job_list_params.py
@@ -2,18 +2,32 @@
from __future__ import annotations
-from typing import Optional
+from typing import List, Optional
from typing_extensions import TypedDict
+from .parsing_job_status import ParsingJobStatus
+
__all__ = ["JobListParams"]
class JobListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
+
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
+
+ statuses: Optional[List[ParsingJobStatus]]
+ """Status to filter by"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index 509d1620..3833e4f8 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -1,16 +1,44 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
+from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal
from ..._models import BaseModel
from .parsing_job_status import ParsingJobStatus
-__all__ = ["JobListResponse"]
+__all__ = ["JobListResponse", "Pagination", "Data"]
-class JobListResponse(BaseModel):
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class Data(BaseModel):
id: str
"""The ID of the job"""
@@ -34,3 +62,35 @@ class JobListResponse(BaseModel):
object: Optional[Literal["parsing_job"]] = None
"""The type of the object"""
+
+
+class JobListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
+
+ data: List[Data]
+ """The list of parsing jobs"""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
diff --git a/src/mixedbread/types/vector_store_list_params.py b/src/mixedbread/types/vector_store_list_params.py
index d42f0b1f..cdad6947 100644
--- a/src/mixedbread/types/vector_store_list_params.py
+++ b/src/mixedbread/types/vector_store_list_params.py
@@ -10,13 +10,22 @@
class VectorStoreListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
q: Optional[str]
"""Search query for fuzzy matching over name and description fields"""
diff --git a/src/mixedbread/types/vector_store_list_response.py b/src/mixedbread/types/vector_store_list_response.py
new file mode 100644
index 00000000..5ab4c798
--- /dev/null
+++ b/src/mixedbread/types/vector_store_list_response.py
@@ -0,0 +1,69 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .vector_store import VectorStore
+
+__all__ = ["VectorStoreListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class VectorStoreListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[VectorStore]
+ """The list of vector stores"""
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index 6ce1aafe..f0cee6f2 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -5,6 +5,7 @@
from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
+from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
index 105ebeff..49fe0c08 100644
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -12,13 +12,22 @@
class FileListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
statuses: Optional[List[VectorStoreFileStatus]]
"""Status to filter by"""
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
new file mode 100644
index 00000000..252d1c93
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_list_response.py
@@ -0,0 +1,69 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+from .vector_store_file import VectorStoreFile
+
+__all__ = ["FileListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class FileListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[VectorStoreFile]
+ """The list of vector store files"""
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index 352fed19..f0b2b2e3 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -9,9 +9,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.data_sources import (
DataSourceConnector,
+ ConnectorListResponse,
ConnectorDeleteResponse,
)
@@ -188,17 +188,18 @@ def test_method_list(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
)
- assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -209,7 +210,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -220,7 +221,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -452,17 +453,18 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
)
- assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -473,7 +475,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -484,7 +486,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
+ assert_matches_type(ConnectorListResponse, connector, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 49f25077..5586218b 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -9,7 +9,6 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.parsing import (
ParsingJob,
JobListResponse,
@@ -105,16 +104,18 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list()
- assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending", "in_progress"],
)
- assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -123,7 +124,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -132,7 +133,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -301,16 +302,18 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list()
- assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending", "in_progress"],
)
- assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -319,7 +322,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -328,7 +331,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
+ assert_matches_type(JobListResponse, job, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index 8c6cc68b..3e2075e0 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -11,9 +11,9 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
DataSource,
+ DataSourceListResponse,
DataSourceDeleteResponse,
)
-from mixedbread.pagination import SyncCursor, AsyncCursor
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -250,16 +250,17 @@ def test_path_params_update_overload_2(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
data_source = client.data_sources.list()
- assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
data_source = client.data_sources.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
)
- assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -268,7 +269,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -277,7 +278,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -554,16 +555,17 @@ async def test_path_params_update_overload_2(self, async_client: AsyncMixedbread
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.list()
- assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
)
- assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -572,7 +574,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -581,7 +583,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
+ assert_matches_type(DataSourceListResponse, data_source, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py
index 51deafef..5fb0941b 100644
--- a/tests/api_resources/test_files.py
+++ b/tests/api_resources/test_files.py
@@ -11,14 +11,17 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import FileObject, FileDeleteResponse
+from mixedbread.types import (
+ FileObject,
+ FileListResponse,
+ FileDeleteResponse,
+)
from mixedbread._response import (
BinaryAPIResponse,
AsyncBinaryAPIResponse,
StreamedBinaryAPIResponse,
AsyncStreamedBinaryAPIResponse,
)
-from mixedbread.pagination import SyncCursor, AsyncCursor
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -140,16 +143,18 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
file = client.files.list()
- assert_matches_type(SyncCursor[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.files.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ q="x",
)
- assert_matches_type(SyncCursor[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -158,7 +163,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncCursor[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -167,7 +172,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncCursor[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -385,16 +390,18 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list()
- assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ q="x",
)
- assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -403,7 +410,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -412,7 +419,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 2fe4ab9f..f8a62782 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -11,11 +11,11 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
VectorStore,
+ VectorStoreListResponse,
VectorStoreDeleteResponse,
VectorStoreSearchResponse,
VectorStoreQuestionAnsweringResponse,
)
-from mixedbread.pagination import SyncCursor, AsyncCursor
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -161,17 +161,18 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list()
- assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
q="x",
)
- assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -180,7 +181,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -189,7 +190,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -548,17 +549,18 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list()
- assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
q="x",
)
- assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -567,7 +569,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -576,7 +578,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
+ assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 62eea508..e3122544 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -9,9 +9,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.vector_stores import (
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -134,18 +134,19 @@ def test_method_list(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
statuses=["pending", "in_progress"],
)
- assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -156,7 +157,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -167,7 +168,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -436,18 +437,19 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
statuses=["pending", "in_progress"],
)
- assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -458,7 +460,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -469,7 +471,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
From 4b4c185b26c898b51b3698957c82db3791da07d1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 30 Jun 2025 10:25:28 +0000
Subject: [PATCH 197/375] feat(api): update via SDK Studio
---
.stats.yml | 6 +--
src/mixedbread/pagination.py | 46 +++++++++++-----
.../resources/data_sources/connectors.py | 32 ++++--------
.../resources/data_sources/data_sources.py | 32 ++++--------
src/mixedbread/resources/files.py | 40 ++++----------
src/mixedbread/resources/parsing/jobs.py | 41 ++++-----------
.../resources/vector_stores/files.py | 32 ++++--------
.../resources/vector_stores/vector_stores.py | 32 ++++--------
.../types/data_source_list_params.py | 17 ++----
.../types/data_source_list_response.py | 52 ++++---------------
.../data_sources/connector_list_params.py | 17 ++----
.../data_sources/connector_list_response.py | 52 ++++---------------
src/mixedbread/types/file_list_params.py | 20 ++-----
src/mixedbread/types/file_list_response.py | 52 ++++---------------
.../types/parsing/job_list_params.py | 24 ++-------
.../types/parsing/job_list_response.py | 52 ++++---------------
.../types/vector_store_list_params.py | 17 ++----
.../types/vector_store_list_response.py | 52 ++++---------------
.../types/vector_stores/file_list_params.py | 17 ++----
.../types/vector_stores/file_list_response.py | 52 ++++---------------
.../data_sources/test_connectors.py | 14 +++--
tests/api_resources/parsing/test_jobs.py | 16 +++---
tests/api_resources/test_data_sources.py | 14 +++--
tests/api_resources/test_files.py | 16 +++---
tests/api_resources/test_vector_stores.py | 14 +++--
.../api_resources/vector_stores/test_files.py | 14 +++--
26 files changed, 216 insertions(+), 557 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index f49ee495..0866595f 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-fe968780e87b8a5ff65ea009ade00fb0e27e951f7ce16d39a2ae0957740add45.yml
-openapi_spec_hash: 9a29ae1bb05df2061e321b0d1adef675
-config_hash: 95ffbc5d87b528d727a944596d7cf051
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7361ed078e7c394c7cb1da4a3e2f3417d4498de5eea648cf9d3caaa0ddf85f78.yml
+openapi_spec_hash: 4ae67ffa9040c2d5a87026df79c1feaf
+config_hash: 6098ac28bc4ec5be0c546035a5d81394
diff --git a/src/mixedbread/pagination.py b/src/mixedbread/pagination.py
index 59f96e24..a983df1e 100644
--- a/src/mixedbread/pagination.py
+++ b/src/mixedbread/pagination.py
@@ -97,14 +97,12 @@ def next_page_info(self) -> Optional[PageInfo]:
class CursorPagination(BaseModel):
- next_cursor: Optional[str] = None
+ first_cursor: Optional[str] = None
- prev_cursor: Optional[str] = None
+ last_cursor: Optional[str] = None
has_more: Optional[bool] = None
- has_prev: Optional[bool] = None
-
total: Optional[int] = None
@@ -132,14 +130,24 @@ def has_next_page(self) -> bool:
@override
def next_page_info(self) -> Optional[PageInfo]:
- next_cursor = None
+ if self._options.params.get("before"):
+ first_cursor = None
+ if self.pagination is not None:
+ if self.pagination.first_cursor is not None:
+ first_cursor = self.pagination.first_cursor
+ if not first_cursor:
+ return None
+
+ return PageInfo(params={"before": first_cursor})
+
+ last_cursor = None
if self.pagination is not None:
- if self.pagination.next_cursor is not None:
- next_cursor = self.pagination.next_cursor
- if not next_cursor:
+ if self.pagination.last_cursor is not None:
+ last_cursor = self.pagination.last_cursor
+ if not last_cursor:
return None
- return PageInfo(params={"cursor": next_cursor})
+ return PageInfo(params={"after": last_cursor})
class AsyncCursor(BaseAsyncPage[_T], BasePage[_T], Generic[_T]):
@@ -166,11 +174,21 @@ def has_next_page(self) -> bool:
@override
def next_page_info(self) -> Optional[PageInfo]:
- next_cursor = None
+ if self._options.params.get("before"):
+ first_cursor = None
+ if self.pagination is not None:
+ if self.pagination.first_cursor is not None:
+ first_cursor = self.pagination.first_cursor
+ if not first_cursor:
+ return None
+
+ return PageInfo(params={"before": first_cursor})
+
+ last_cursor = None
if self.pagination is not None:
- if self.pagination.next_cursor is not None:
- next_cursor = self.pagination.next_cursor
- if not next_cursor:
+ if self.pagination.last_cursor is not None:
+ last_cursor = self.pagination.last_cursor
+ if not last_cursor:
return None
- return PageInfo(params={"cursor": next_cursor})
+ return PageInfo(params={"after": last_cursor})
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index f333b4e9..fd110748 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -237,8 +237,7 @@ def list(
data_source_id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -258,15 +257,11 @@ def list(
Args:
data_source_id: The ID of the data source to get connectors for
- limit: Maximum number of items to return per page (1-100)
+ limit: Maximum number of items to return per page
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -288,8 +283,7 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
},
connector_list_params.ConnectorListParams,
@@ -556,8 +550,7 @@ async def list(
data_source_id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -577,15 +570,11 @@ async def list(
Args:
data_source_id: The ID of the data source to get connectors for
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ limit: Maximum number of items to return per page
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- include_total: Whether to include total count in response (expensive operation)
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -607,8 +596,7 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
},
connector_list_params.ConnectorListParams,
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index c8a83074..d82939db 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -356,8 +356,7 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -372,15 +371,11 @@ def list(
Returns: The list of data sources.
Args:
- limit: Maximum number of items to return per page (1-100)
+ limit: Maximum number of items to return per page
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -400,8 +395,7 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
},
data_source_list_params.DataSourceListParams,
@@ -762,8 +756,7 @@ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -778,15 +771,11 @@ async def list(
Returns: The list of data sources.
Args:
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ limit: Maximum number of items to return per page
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- include_total: Whether to include total count in response (expensive operation)
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -806,8 +795,7 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
},
data_source_list_params.DataSourceListParams,
diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py
index 10f6a213..207336ac 100644
--- a/src/mixedbread/resources/files.py
+++ b/src/mixedbread/resources/files.py
@@ -191,10 +191,8 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
- q: Optional[str] | 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,
@@ -210,17 +208,11 @@ def list(
Returns: A list of files belonging to the user.
Args:
- limit: Maximum number of items to return per page (1-100)
+ limit: Maximum number of items to return per page
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- q: Search query for fuzzy matching over name and description fields
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -240,10 +232,8 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
- "q": q,
},
file_list_params.FileListParams,
),
@@ -489,10 +479,8 @@ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
- q: Optional[str] | 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,
@@ -508,17 +496,11 @@ async def list(
Returns: A list of files belonging to the user.
Args:
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
+ limit: Maximum number of items to return per page
- include_total: Whether to include total count in response (expensive operation)
+ cursor: Cursor for pagination (base64 encoded cursor)
- q: Search query for fuzzy matching over name and description fields
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -538,10 +520,8 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
- "q": q,
},
file_list_params.FileListParams,
),
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 459fbe8e..939e97ec 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -24,7 +24,6 @@
from ...types.parsing.return_format import ReturnFormat
from ...types.parsing.chunking_strategy import ChunkingStrategy
from ...types.parsing.job_list_response import JobListResponse
-from ...types.parsing.parsing_job_status import ParsingJobStatus
from ...types.parsing.job_delete_response import JobDeleteResponse
__all__ = ["JobsResource", "AsyncJobsResource"]
@@ -152,10 +151,8 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[ParsingJobStatus]] | 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,
@@ -172,17 +169,11 @@ def list(
Returns: List of parsing jobs with pagination.
Args:
- limit: Maximum number of items to return per page (1-100)
+ limit: Maximum number of items to return per page
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- statuses: Status to filter by
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -202,10 +193,8 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
- "statuses": statuses,
},
job_list_params.JobListParams,
),
@@ -414,10 +403,8 @@ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[ParsingJobStatus]] | 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,
@@ -434,17 +421,11 @@ async def list(
Returns: List of parsing jobs with pagination.
Args:
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
+ limit: Maximum number of items to return per page
- include_total: Whether to include total count in response (expensive operation)
+ cursor: Cursor for pagination (base64 encoded cursor)
- statuses: Status to filter by
+ include_total: Whether to include the total number of items
extra_headers: Send extra headers
@@ -464,10 +445,8 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
- "statuses": statuses,
},
job_list_params.JobListParams,
),
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index f25c6699..16085822 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -158,8 +158,7 @@ def list(
vector_store_identifier: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -180,15 +179,11 @@ def list(
Args:
vector_store_identifier: The ID or name of the vector store
- limit: Maximum number of items to return per page (1-100)
+ limit: Maximum number of items to return per page
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
+ include_total: Whether to include the total number of items
statuses: Status to filter by
@@ -214,8 +209,7 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
"statuses": statuses,
},
@@ -480,8 +474,7 @@ async def list(
vector_store_identifier: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -502,15 +495,11 @@ async def list(
Args:
vector_store_identifier: The ID or name of the vector store
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ limit: Maximum number of items to return per page
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- include_total: Whether to include total count in response (expensive operation)
+ include_total: Whether to include the total number of items
statuses: Status to filter by
@@ -536,8 +525,7 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
"statuses": statuses,
},
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 96bf67de..21f559df 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -244,8 +244,7 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
q: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -264,15 +263,11 @@ def list(
Returns: VectorStoreListResponse: The list of vector stores.
Args:
- limit: Maximum number of items to return per page (1-100)
+ limit: Maximum number of items to return per page
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
+ include_total: Whether to include the total number of items
q: Search query for fuzzy matching over name and description fields
@@ -294,8 +289,7 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
"q": q,
},
@@ -696,8 +690,7 @@ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
+ cursor: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
q: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -716,15 +709,11 @@ async def list(
Returns: VectorStoreListResponse: The list of vector stores.
Args:
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
+ limit: Maximum number of items to return per page
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
+ cursor: Cursor for pagination (base64 encoded cursor)
- include_total: Whether to include total count in response (expensive operation)
+ include_total: Whether to include the total number of items
q: Search query for fuzzy matching over name and description fields
@@ -746,8 +735,7 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "after": after,
- "before": before,
+ "cursor": cursor,
"include_total": include_total,
"q": q,
},
diff --git a/src/mixedbread/types/data_source_list_params.py b/src/mixedbread/types/data_source_list_params.py
index 07eb80f4..86e27bce 100644
--- a/src/mixedbread/types/data_source_list_params.py
+++ b/src/mixedbread/types/data_source_list_params.py
@@ -10,19 +10,10 @@
class DataSourceListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page (1-100)"""
+ """Maximum number of items to return per page"""
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
-
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
include_total: bool
- """Whether to include total count in response (expensive operation)"""
+ """Whether to include the total number of items"""
diff --git a/src/mixedbread/types/data_source_list_response.py b/src/mixedbread/types/data_source_list_response.py
index 0c7298f5..4c95ef7a 100644
--- a/src/mixedbread/types/data_source_list_response.py
+++ b/src/mixedbread/types/data_source_list_response.py
@@ -10,57 +10,25 @@
class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
- Use for backward pagination. None if page is empty.
- """
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
+ has_more: bool
+ """Whether there are more items available"""
- Use for forward pagination. None if page is empty.
- """
+ has_prev: bool
+ """Whether there are previous items available"""
total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
+ """Total number of items available"""
class DataSourceListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
+ """Response model for cursor-based pagination."""
data: List[DataSource]
"""The list of data sources"""
diff --git a/src/mixedbread/types/data_sources/connector_list_params.py b/src/mixedbread/types/data_sources/connector_list_params.py
index cb3da959..09a46fd0 100644
--- a/src/mixedbread/types/data_sources/connector_list_params.py
+++ b/src/mixedbread/types/data_sources/connector_list_params.py
@@ -10,19 +10,10 @@
class ConnectorListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page (1-100)"""
+ """Maximum number of items to return per page"""
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
-
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
include_total: bool
- """Whether to include total count in response (expensive operation)"""
+ """Whether to include the total number of items"""
diff --git a/src/mixedbread/types/data_sources/connector_list_response.py b/src/mixedbread/types/data_sources/connector_list_response.py
index c6f2f388..e63cf824 100644
--- a/src/mixedbread/types/data_sources/connector_list_response.py
+++ b/src/mixedbread/types/data_sources/connector_list_response.py
@@ -10,57 +10,25 @@
class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
- Use for backward pagination. None if page is empty.
- """
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
+ has_more: bool
+ """Whether there are more items available"""
- Use for forward pagination. None if page is empty.
- """
+ has_prev: bool
+ """Whether there are previous items available"""
total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
+ """Total number of items available"""
class ConnectorListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
+ """Response model for cursor-based pagination."""
data: List[DataSourceConnector]
"""The list of connectors"""
diff --git a/src/mixedbread/types/file_list_params.py b/src/mixedbread/types/file_list_params.py
index 83207e3d..e7b9d891 100644
--- a/src/mixedbread/types/file_list_params.py
+++ b/src/mixedbread/types/file_list_params.py
@@ -10,22 +10,10 @@
class FileListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page (1-100)"""
+ """Maximum number of items to return per page"""
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
-
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
include_total: bool
- """Whether to include total count in response (expensive operation)"""
-
- q: Optional[str]
- """Search query for fuzzy matching over name and description fields"""
+ """Whether to include the total number of items"""
diff --git a/src/mixedbread/types/file_list_response.py b/src/mixedbread/types/file_list_response.py
index c7322db2..b66a56ad 100644
--- a/src/mixedbread/types/file_list_response.py
+++ b/src/mixedbread/types/file_list_response.py
@@ -10,57 +10,25 @@
class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
- Use for backward pagination. None if page is empty.
- """
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
+ has_more: bool
+ """Whether there are more items available"""
- Use for forward pagination. None if page is empty.
- """
+ has_prev: bool
+ """Whether there are previous items available"""
total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
+ """Total number of items available"""
class FileListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
+ """Response model for cursor-based pagination."""
object: Optional[Literal["list"]] = None
"""The object type of the response"""
diff --git a/src/mixedbread/types/parsing/job_list_params.py b/src/mixedbread/types/parsing/job_list_params.py
index 979c53a3..92a016a9 100644
--- a/src/mixedbread/types/parsing/job_list_params.py
+++ b/src/mixedbread/types/parsing/job_list_params.py
@@ -2,32 +2,18 @@
from __future__ import annotations
-from typing import List, Optional
+from typing import Optional
from typing_extensions import TypedDict
-from .parsing_job_status import ParsingJobStatus
-
__all__ = ["JobListParams"]
class JobListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page (1-100)"""
-
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
+ """Maximum number of items to return per page"""
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
include_total: bool
- """Whether to include total count in response (expensive operation)"""
-
- statuses: Optional[List[ParsingJobStatus]]
- """Status to filter by"""
+ """Whether to include the total number of items"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index 3833e4f8..b0aea3f0 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -11,31 +11,20 @@
class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
- Use for backward pagination. None if page is empty.
- """
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
+ has_more: bool
+ """Whether there are more items available"""
- Use for forward pagination. None if page is empty.
- """
+ has_prev: bool
+ """Whether there are previous items available"""
total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
+ """Total number of items available"""
class Data(BaseModel):
@@ -66,28 +55,7 @@ class Data(BaseModel):
class JobListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
+ """Response model for cursor-based pagination."""
data: List[Data]
"""The list of parsing jobs"""
diff --git a/src/mixedbread/types/vector_store_list_params.py b/src/mixedbread/types/vector_store_list_params.py
index cdad6947..d42f0b1f 100644
--- a/src/mixedbread/types/vector_store_list_params.py
+++ b/src/mixedbread/types/vector_store_list_params.py
@@ -10,22 +10,13 @@
class VectorStoreListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page (1-100)"""
+ """Maximum number of items to return per page"""
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
-
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
include_total: bool
- """Whether to include total count in response (expensive operation)"""
+ """Whether to include the total number of items"""
q: Optional[str]
"""Search query for fuzzy matching over name and description fields"""
diff --git a/src/mixedbread/types/vector_store_list_response.py b/src/mixedbread/types/vector_store_list_response.py
index 5ab4c798..54664f1a 100644
--- a/src/mixedbread/types/vector_store_list_response.py
+++ b/src/mixedbread/types/vector_store_list_response.py
@@ -10,57 +10,25 @@
class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
- Use for backward pagination. None if page is empty.
- """
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
+ has_more: bool
+ """Whether there are more items available"""
- Use for forward pagination. None if page is empty.
- """
+ has_prev: bool
+ """Whether there are previous items available"""
total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
+ """Total number of items available"""
class VectorStoreListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
+ """Response model for cursor-based pagination."""
object: Optional[Literal["list"]] = None
"""The object type of the response"""
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
index 49fe0c08..105ebeff 100644
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -12,22 +12,13 @@
class FileListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page (1-100)"""
+ """Maximum number of items to return per page"""
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
-
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
+ cursor: Optional[str]
+ """Cursor for pagination (base64 encoded cursor)"""
include_total: bool
- """Whether to include total count in response (expensive operation)"""
+ """Whether to include the total number of items"""
statuses: Optional[List[VectorStoreFileStatus]]
"""Status to filter by"""
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
index 252d1c93..e566de6b 100644
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ b/src/mixedbread/types/vector_stores/file_list_response.py
@@ -10,57 +10,25 @@
class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
+ next_cursor: Optional[str] = None
+ """Cursor for the next page, null if no more pages"""
- Use for backward pagination. None if page is empty.
- """
+ prev_cursor: Optional[str] = None
+ """Cursor for the previous page, null if no previous pages"""
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
+ has_more: bool
+ """Whether there are more items available"""
- Use for forward pagination. None if page is empty.
- """
+ has_prev: bool
+ """Whether there are previous items available"""
total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
+ """Total number of items available"""
class FileListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
+ """Response model for cursor-based pagination."""
object: Optional[Literal["list"]] = None
"""The object type of the response"""
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index f0b2b2e3..f32aeafb 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -194,10 +194,9 @@ def test_method_list(self, client: Mixedbread) -> None:
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
)
assert_matches_type(ConnectorListResponse, connector, path=["response"])
@@ -459,10 +458,9 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
)
assert_matches_type(ConnectorListResponse, connector, path=["response"])
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 5586218b..7b22a611 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -109,11 +109,9 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending", "in_progress"],
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
)
assert_matches_type(JobListResponse, job, path=["response"])
@@ -307,11 +305,9 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending", "in_progress"],
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
)
assert_matches_type(JobListResponse, job, path=["response"])
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index 3e2075e0..94ad5653 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -255,10 +255,9 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
data_source = client.data_sources.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
)
assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@@ -560,10 +559,9 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
)
assert_matches_type(DataSourceListResponse, data_source, path=["response"])
diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py
index 5fb0941b..9fdc535d 100644
--- a/tests/api_resources/test_files.py
+++ b/tests/api_resources/test_files.py
@@ -148,11 +148,9 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.files.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- q="x",
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
)
assert_matches_type(FileListResponse, file, path=["response"])
@@ -395,11 +393,9 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- q="x",
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
)
assert_matches_type(FileListResponse, file, path=["response"])
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index f8a62782..4be0efcc 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -166,10 +166,9 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
q="x",
)
assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@@ -554,10 +553,9 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
q="x",
)
assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index e3122544..3b56df7d 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -140,10 +140,9 @@ def test_method_list(self, client: Mixedbread) -> None:
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
statuses=["pending", "in_progress"],
)
assert_matches_type(FileListResponse, file, path=["response"])
@@ -443,10 +442,9 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
+ limit=1000,
+ cursor="cursor",
+ include_total=True,
statuses=["pending", "in_progress"],
)
assert_matches_type(FileListResponse, file, path=["response"])
From fd341b109ead4803a2de7795c56287aeb1a7198a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 30 Jun 2025 10:25:49 +0000
Subject: [PATCH 198/375] feat(api): api update
---
.stats.yml | 4 +-
.../resources/data_sources/connectors.py | 32 ++++++++----
.../resources/data_sources/data_sources.py | 32 ++++++++----
src/mixedbread/resources/files.py | 40 ++++++++++----
src/mixedbread/resources/parsing/jobs.py | 41 +++++++++++----
.../resources/vector_stores/files.py | 32 ++++++++----
.../resources/vector_stores/vector_stores.py | 32 ++++++++----
.../types/data_source_list_params.py | 17 ++++--
.../types/data_source_list_response.py | 52 +++++++++++++++----
.../data_sources/connector_list_params.py | 17 ++++--
.../data_sources/connector_list_response.py | 52 +++++++++++++++----
src/mixedbread/types/file_list_params.py | 20 +++++--
src/mixedbread/types/file_list_response.py | 52 +++++++++++++++----
.../types/parsing/job_list_params.py | 24 +++++++--
.../types/parsing/job_list_response.py | 52 +++++++++++++++----
.../types/vector_store_list_params.py | 17 ++++--
.../types/vector_store_list_response.py | 52 +++++++++++++++----
.../types/vector_stores/file_list_params.py | 17 ++++--
.../types/vector_stores/file_list_response.py | 52 +++++++++++++++----
.../data_sources/test_connectors.py | 14 ++---
tests/api_resources/parsing/test_jobs.py | 16 +++---
tests/api_resources/test_data_sources.py | 14 ++---
tests/api_resources/test_files.py | 16 +++---
tests/api_resources/test_vector_stores.py | 14 ++---
.../api_resources/vector_stores/test_files.py | 14 ++---
25 files changed, 542 insertions(+), 183 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 0866595f..d42a86a1 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-7361ed078e7c394c7cb1da4a3e2f3417d4498de5eea648cf9d3caaa0ddf85f78.yml
-openapi_spec_hash: 4ae67ffa9040c2d5a87026df79c1feaf
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-fe968780e87b8a5ff65ea009ade00fb0e27e951f7ce16d39a2ae0957740add45.yml
+openapi_spec_hash: 9a29ae1bb05df2061e321b0d1adef675
config_hash: 6098ac28bc4ec5be0c546035a5d81394
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index fd110748..f333b4e9 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -237,7 +237,8 @@ def list(
data_source_id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -257,11 +258,15 @@ def list(
Args:
data_source_id: The ID of the data source to get connectors for
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
extra_headers: Send extra headers
@@ -283,7 +288,8 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
},
connector_list_params.ConnectorListParams,
@@ -550,7 +556,8 @@ async def list(
data_source_id: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -570,11 +577,15 @@ async def list(
Args:
data_source_id: The ID of the data source to get connectors for
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- cursor: Cursor for pagination (base64 encoded cursor)
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
- include_total: Whether to include the total number of items
+ include_total: Whether to include total count in response (expensive operation)
extra_headers: Send extra headers
@@ -596,7 +607,8 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
},
connector_list_params.ConnectorListParams,
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index d82939db..c8a83074 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -356,7 +356,8 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -371,11 +372,15 @@ def list(
Returns: The list of data sources.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
extra_headers: Send extra headers
@@ -395,7 +400,8 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
},
data_source_list_params.DataSourceListParams,
@@ -756,7 +762,8 @@ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: 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.
@@ -771,11 +778,15 @@ async def list(
Returns: The list of data sources.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- cursor: Cursor for pagination (base64 encoded cursor)
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
- include_total: Whether to include the total number of items
+ include_total: Whether to include total count in response (expensive operation)
extra_headers: Send extra headers
@@ -795,7 +806,8 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
},
data_source_list_params.DataSourceListParams,
diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py
index 207336ac..10f6a213 100644
--- a/src/mixedbread/resources/files.py
+++ b/src/mixedbread/resources/files.py
@@ -191,8 +191,10 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
+ q: Optional[str] | 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,
@@ -208,11 +210,17 @@ def list(
Returns: A list of files belonging to the user.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ q: Search query for fuzzy matching over name and description fields
extra_headers: Send extra headers
@@ -232,8 +240,10 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
+ "q": q,
},
file_list_params.FileListParams,
),
@@ -479,8 +489,10 @@ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
+ q: Optional[str] | 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,
@@ -496,11 +508,17 @@ async def list(
Returns: A list of files belonging to the user.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
- cursor: Cursor for pagination (base64 encoded cursor)
+ include_total: Whether to include total count in response (expensive operation)
- include_total: Whether to include the total number of items
+ q: Search query for fuzzy matching over name and description fields
extra_headers: Send extra headers
@@ -520,8 +538,10 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
+ "q": q,
},
file_list_params.FileListParams,
),
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 939e97ec..459fbe8e 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -24,6 +24,7 @@
from ...types.parsing.return_format import ReturnFormat
from ...types.parsing.chunking_strategy import ChunkingStrategy
from ...types.parsing.job_list_response import JobListResponse
+from ...types.parsing.parsing_job_status import ParsingJobStatus
from ...types.parsing.job_delete_response import JobDeleteResponse
__all__ = ["JobsResource", "AsyncJobsResource"]
@@ -151,8 +152,10 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[ParsingJobStatus]] | 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,
@@ -169,11 +172,17 @@ def list(
Returns: List of parsing jobs with pagination.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ statuses: Status to filter by
extra_headers: Send extra headers
@@ -193,8 +202,10 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
+ "statuses": statuses,
},
job_list_params.JobListParams,
),
@@ -403,8 +414,10 @@ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[ParsingJobStatus]] | 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,
@@ -421,11 +434,17 @@ async def list(
Returns: List of parsing jobs with pagination.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
- cursor: Cursor for pagination (base64 encoded cursor)
+ include_total: Whether to include total count in response (expensive operation)
- include_total: Whether to include the total number of items
+ statuses: Status to filter by
extra_headers: Send extra headers
@@ -445,8 +464,10 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
+ "statuses": statuses,
},
job_list_params.JobListParams,
),
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 16085822..f25c6699 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -158,7 +158,8 @@ def list(
vector_store_identifier: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -179,11 +180,15 @@ def list(
Args:
vector_store_identifier: The ID or name of the vector store
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
statuses: Status to filter by
@@ -209,7 +214,8 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
"statuses": statuses,
},
@@ -474,7 +480,8 @@ async def list(
vector_store_identifier: str,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -495,11 +502,15 @@ async def list(
Args:
vector_store_identifier: The ID or name of the vector store
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- cursor: Cursor for pagination (base64 encoded cursor)
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
- include_total: Whether to include the total number of items
+ include_total: Whether to include total count in response (expensive operation)
statuses: Status to filter by
@@ -525,7 +536,8 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
"statuses": statuses,
},
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 21f559df..96bf67de 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -244,7 +244,8 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
q: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -263,11 +264,15 @@ def list(
Returns: VectorStoreListResponse: The list of vector stores.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
- cursor: Cursor for pagination (base64 encoded cursor)
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- include_total: Whether to include the total number of items
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
q: Search query for fuzzy matching over name and description fields
@@ -289,7 +294,8 @@ def list(
query=maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
"q": q,
},
@@ -690,7 +696,8 @@ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
- cursor: Optional[str] | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
q: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -709,11 +716,15 @@ async def list(
Returns: VectorStoreListResponse: The list of vector stores.
Args:
- limit: Maximum number of items to return per page
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
- cursor: Cursor for pagination (base64 encoded cursor)
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
- include_total: Whether to include the total number of items
+ include_total: Whether to include total count in response (expensive operation)
q: Search query for fuzzy matching over name and description fields
@@ -735,7 +746,8 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
- "cursor": cursor,
+ "after": after,
+ "before": before,
"include_total": include_total,
"q": q,
},
diff --git a/src/mixedbread/types/data_source_list_params.py b/src/mixedbread/types/data_source_list_params.py
index 86e27bce..07eb80f4 100644
--- a/src/mixedbread/types/data_source_list_params.py
+++ b/src/mixedbread/types/data_source_list_params.py
@@ -10,10 +10,19 @@
class DataSourceListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
diff --git a/src/mixedbread/types/data_source_list_response.py b/src/mixedbread/types/data_source_list_response.py
index 4c95ef7a..0c7298f5 100644
--- a/src/mixedbread/types/data_source_list_response.py
+++ b/src/mixedbread/types/data_source_list_response.py
@@ -10,25 +10,57 @@
class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
- has_more: bool
- """Whether there are more items available"""
+ Use for backward pagination. None if page is empty.
+ """
- has_prev: bool
- """Whether there are previous items available"""
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
total: Optional[int] = None
- """Total number of items available"""
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
class DataSourceListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination."""
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
data: List[DataSource]
"""The list of data sources"""
diff --git a/src/mixedbread/types/data_sources/connector_list_params.py b/src/mixedbread/types/data_sources/connector_list_params.py
index 09a46fd0..cb3da959 100644
--- a/src/mixedbread/types/data_sources/connector_list_params.py
+++ b/src/mixedbread/types/data_sources/connector_list_params.py
@@ -10,10 +10,19 @@
class ConnectorListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
diff --git a/src/mixedbread/types/data_sources/connector_list_response.py b/src/mixedbread/types/data_sources/connector_list_response.py
index e63cf824..c6f2f388 100644
--- a/src/mixedbread/types/data_sources/connector_list_response.py
+++ b/src/mixedbread/types/data_sources/connector_list_response.py
@@ -10,25 +10,57 @@
class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
- has_more: bool
- """Whether there are more items available"""
+ Use for backward pagination. None if page is empty.
+ """
- has_prev: bool
- """Whether there are previous items available"""
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
total: Optional[int] = None
- """Total number of items available"""
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
class ConnectorListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination."""
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
data: List[DataSourceConnector]
"""The list of connectors"""
diff --git a/src/mixedbread/types/file_list_params.py b/src/mixedbread/types/file_list_params.py
index e7b9d891..83207e3d 100644
--- a/src/mixedbread/types/file_list_params.py
+++ b/src/mixedbread/types/file_list_params.py
@@ -10,10 +10,22 @@
class FileListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
+
+ q: Optional[str]
+ """Search query for fuzzy matching over name and description fields"""
diff --git a/src/mixedbread/types/file_list_response.py b/src/mixedbread/types/file_list_response.py
index b66a56ad..c7322db2 100644
--- a/src/mixedbread/types/file_list_response.py
+++ b/src/mixedbread/types/file_list_response.py
@@ -10,25 +10,57 @@
class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
- has_more: bool
- """Whether there are more items available"""
+ Use for backward pagination. None if page is empty.
+ """
- has_prev: bool
- """Whether there are previous items available"""
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
total: Optional[int] = None
- """Total number of items available"""
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
class FileListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination."""
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
object: Optional[Literal["list"]] = None
"""The object type of the response"""
diff --git a/src/mixedbread/types/parsing/job_list_params.py b/src/mixedbread/types/parsing/job_list_params.py
index 92a016a9..979c53a3 100644
--- a/src/mixedbread/types/parsing/job_list_params.py
+++ b/src/mixedbread/types/parsing/job_list_params.py
@@ -2,18 +2,32 @@
from __future__ import annotations
-from typing import Optional
+from typing import List, Optional
from typing_extensions import TypedDict
+from .parsing_job_status import ParsingJobStatus
+
__all__ = ["JobListParams"]
class JobListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
+
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
+
+ statuses: Optional[List[ParsingJobStatus]]
+ """Status to filter by"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index b0aea3f0..3833e4f8 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -11,20 +11,31 @@
class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
- has_more: bool
- """Whether there are more items available"""
+ Use for backward pagination. None if page is empty.
+ """
- has_prev: bool
- """Whether there are previous items available"""
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
total: Optional[int] = None
- """Total number of items available"""
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
class Data(BaseModel):
@@ -55,7 +66,28 @@ class Data(BaseModel):
class JobListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination."""
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
data: List[Data]
"""The list of parsing jobs"""
diff --git a/src/mixedbread/types/vector_store_list_params.py b/src/mixedbread/types/vector_store_list_params.py
index d42f0b1f..cdad6947 100644
--- a/src/mixedbread/types/vector_store_list_params.py
+++ b/src/mixedbread/types/vector_store_list_params.py
@@ -10,13 +10,22 @@
class VectorStoreListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
q: Optional[str]
"""Search query for fuzzy matching over name and description fields"""
diff --git a/src/mixedbread/types/vector_store_list_response.py b/src/mixedbread/types/vector_store_list_response.py
index 54664f1a..5ab4c798 100644
--- a/src/mixedbread/types/vector_store_list_response.py
+++ b/src/mixedbread/types/vector_store_list_response.py
@@ -10,25 +10,57 @@
class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
- has_more: bool
- """Whether there are more items available"""
+ Use for backward pagination. None if page is empty.
+ """
- has_prev: bool
- """Whether there are previous items available"""
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
total: Optional[int] = None
- """Total number of items available"""
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
class VectorStoreListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination."""
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
object: Optional[Literal["list"]] = None
"""The object type of the response"""
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
index 105ebeff..49fe0c08 100644
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -12,13 +12,22 @@
class FileListParams(TypedDict, total=False):
limit: int
- """Maximum number of items to return per page"""
+ """Maximum number of items to return per page (1-100)"""
- cursor: Optional[str]
- """Cursor for pagination (base64 encoded cursor)"""
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
include_total: bool
- """Whether to include the total number of items"""
+ """Whether to include total count in response (expensive operation)"""
statuses: Optional[List[VectorStoreFileStatus]]
"""Status to filter by"""
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
index e566de6b..252d1c93 100644
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ b/src/mixedbread/types/vector_stores/file_list_response.py
@@ -10,25 +10,57 @@
class Pagination(BaseModel):
- next_cursor: Optional[str] = None
- """Cursor for the next page, null if no more pages"""
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
- prev_cursor: Optional[str] = None
- """Cursor for the previous page, null if no previous pages"""
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
- has_more: bool
- """Whether there are more items available"""
+ Use for backward pagination. None if page is empty.
+ """
- has_prev: bool
- """Whether there are previous items available"""
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
total: Optional[int] = None
- """Total number of items available"""
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
class FileListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination."""
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
object: Optional[Literal["list"]] = None
"""The object type of the response"""
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index f32aeafb..f0b2b2e3 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -194,9 +194,10 @@ def test_method_list(self, client: Mixedbread) -> None:
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
)
assert_matches_type(ConnectorListResponse, connector, path=["response"])
@@ -458,9 +459,10 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
)
assert_matches_type(ConnectorListResponse, connector, path=["response"])
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 7b22a611..5586218b 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -109,9 +109,11 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending", "in_progress"],
)
assert_matches_type(JobListResponse, job, path=["response"])
@@ -305,9 +307,11 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending", "in_progress"],
)
assert_matches_type(JobListResponse, job, path=["response"])
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index 94ad5653..3e2075e0 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -255,9 +255,10 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
data_source = client.data_sources.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
)
assert_matches_type(DataSourceListResponse, data_source, path=["response"])
@@ -559,9 +560,10 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
)
assert_matches_type(DataSourceListResponse, data_source, path=["response"])
diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py
index 9fdc535d..5fb0941b 100644
--- a/tests/api_resources/test_files.py
+++ b/tests/api_resources/test_files.py
@@ -148,9 +148,11 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.files.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ q="x",
)
assert_matches_type(FileListResponse, file, path=["response"])
@@ -393,9 +395,11 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ q="x",
)
assert_matches_type(FileListResponse, file, path=["response"])
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 4be0efcc..f8a62782 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -166,9 +166,10 @@ def test_method_list(self, client: Mixedbread) -> None:
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
q="x",
)
assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
@@ -553,9 +554,10 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list(
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
q="x",
)
assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 3b56df7d..e3122544 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -140,9 +140,10 @@ def test_method_list(self, client: Mixedbread) -> None:
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
statuses=["pending", "in_progress"],
)
assert_matches_type(FileListResponse, file, path=["response"])
@@ -442,9 +443,10 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
- limit=1000,
- cursor="cursor",
- include_total=True,
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
statuses=["pending", "in_progress"],
)
assert_matches_type(FileListResponse, file, path=["response"])
From 79cdf7d6f5424f6f5724d0eab4e7c6958ee9dcf4 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 30 Jun 2025 10:26:12 +0000
Subject: [PATCH 199/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index f80776a4..a26ebfc1 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.13.2"
+ ".": "0.14.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 41a2114a..ecd51575 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.13.2"
+version = "0.14.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 405a4a61..0b58cc93 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.13.2" # x-release-please-version
+__version__ = "0.14.0" # x-release-please-version
From 862871bdb802fdc5c3748b4e091299ee5482d503 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 30 Jun 2025 10:34:39 +0000
Subject: [PATCH 200/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index d42a86a1..970eac21 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-fe968780e87b8a5ff65ea009ade00fb0e27e951f7ce16d39a2ae0957740add45.yml
openapi_spec_hash: 9a29ae1bb05df2061e321b0d1adef675
-config_hash: 6098ac28bc4ec5be0c546035a5d81394
+config_hash: e4d40031e9232e8e6c16e73430b7f535
From ead9285b864febca3ea7fd19a3e95fe5d638749f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 30 Jun 2025 10:35:21 +0000
Subject: [PATCH 201/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index a26ebfc1..8f3e0a49 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.14.0"
+ ".": "0.15.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index ecd51575..c5f6a0cd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.14.0"
+version = "0.15.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 0b58cc93..fe278751 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.14.0" # x-release-please-version
+__version__ = "0.15.0" # x-release-please-version
From 96cad85587200957629b637b8b27e5fa45b9a657 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 2 Jul 2025 05:11:12 +0000
Subject: [PATCH 202/375] chore(ci): change upload type
---
.github/workflows/ci.yml | 18 ++++++++++++++++--
scripts/utils/upload-artifact.sh | 12 +++++++-----
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2c0ecf6a..508f13bb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -35,10 +35,10 @@ jobs:
- name: Run lints
run: ./scripts/lint
- upload:
+ build:
if: github.repository == 'stainless-sdks/mixedbread-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
- name: upload
+ name: build
permissions:
contents: read
id-token: write
@@ -46,6 +46,20 @@ jobs:
steps:
- uses: actions/checkout@v4
+ - name: Install Rye
+ run: |
+ curl -sSf https://rye.astral.sh/get | bash
+ echo "$HOME/.rye/shims" >> $GITHUB_PATH
+ env:
+ RYE_VERSION: '0.44.0'
+ RYE_INSTALL_OPTION: '--yes'
+
+ - name: Install dependencies
+ run: rye sync --all-features
+
+ - name: Run build
+ run: rye build
+
- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh
index e9b57e7c..5af44df7 100755
--- a/scripts/utils/upload-artifact.sh
+++ b/scripts/utils/upload-artifact.sh
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
set -exuo pipefail
-RESPONSE=$(curl -X POST "$URL" \
+FILENAME=$(basename dist/*.whl)
+
+RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \
-H "Authorization: Bearer $AUTH" \
-H "Content-Type: application/json")
@@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi
-UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
- -H "Content-Type: application/gzip" \
- --data-binary @- "$SIGNED_URL" 2>&1)
+UPLOAD_RESPONSE=$(curl -v -X PUT \
+ -H "Content-Type: binary/octet-stream" \
+ --data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1)
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
- echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/mixedbread-python/$SHA'\033[0m"
+ echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/mixedbread-python/$SHA/$FILENAME'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
From 960e619e709fb200dcef0bef19c6b98312cda737 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 2 Jul 2025 09:26:02 +0000
Subject: [PATCH 203/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/parsing/jobs.py | 8 ++++++++
src/mixedbread/types/parsing/job_list_params.py | 3 +++
src/mixedbread/types/parsing/job_list_response.py | 3 +++
src/mixedbread/types/parsing/parsing_job.py | 3 +++
tests/api_resources/parsing/test_jobs.py | 2 ++
6 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 970eac21..8071ffce 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-fe968780e87b8a5ff65ea009ade00fb0e27e951f7ce16d39a2ae0957740add45.yml
-openapi_spec_hash: 9a29ae1bb05df2061e321b0d1adef675
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-315b0ef2cbe106abc1299563d329b70c233e3bcbe5233db006fa09fbeafb7b62.yml
+openapi_spec_hash: 56fa40291a1ee5d7bfcde5654540cba8
config_hash: e4d40031e9232e8e6c16e73430b7f535
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 459fbe8e..409247c0 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -156,6 +156,7 @@ def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[ParsingJobStatus]] | NotGiven = NOT_GIVEN,
+ q: Optional[str] | 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,
@@ -184,6 +185,8 @@ def list(
statuses: Status to filter by
+ q: Search query to filter by
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -206,6 +209,7 @@ def list(
"before": before,
"include_total": include_total,
"statuses": statuses,
+ "q": q,
},
job_list_params.JobListParams,
),
@@ -418,6 +422,7 @@ async def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[ParsingJobStatus]] | NotGiven = NOT_GIVEN,
+ q: Optional[str] | 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,
@@ -446,6 +451,8 @@ async def list(
statuses: Status to filter by
+ q: Search query to filter by
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -468,6 +475,7 @@ async def list(
"before": before,
"include_total": include_total,
"statuses": statuses,
+ "q": q,
},
job_list_params.JobListParams,
),
diff --git a/src/mixedbread/types/parsing/job_list_params.py b/src/mixedbread/types/parsing/job_list_params.py
index 979c53a3..c34f3c09 100644
--- a/src/mixedbread/types/parsing/job_list_params.py
+++ b/src/mixedbread/types/parsing/job_list_params.py
@@ -31,3 +31,6 @@ class JobListParams(TypedDict, total=False):
statuses: Optional[List[ParsingJobStatus]]
"""Status to filter by"""
+
+ q: Optional[str]
+ """Search query to filter by"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index 3833e4f8..4b24ab2c 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -45,6 +45,9 @@ class Data(BaseModel):
file_id: str
"""The ID of the file to parse"""
+ filename: Optional[str] = None
+ """The name of the file"""
+
status: ParsingJobStatus
"""The status of the job"""
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index 026f0d7d..c950c5a4 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -68,6 +68,9 @@ class ParsingJob(BaseModel):
file_id: str
"""The ID of the file to parse"""
+ filename: Optional[str] = None
+ """The name of the file"""
+
status: ParsingJobStatus
"""The status of the job"""
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 5586218b..5ce07165 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -114,6 +114,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
statuses=["pending", "in_progress"],
+ q="x",
)
assert_matches_type(JobListResponse, job, path=["response"])
@@ -312,6 +313,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
statuses=["pending", "in_progress"],
+ q="x",
)
assert_matches_type(JobListResponse, job, path=["response"])
From 0519270e89fdd90fe814b6f8ff0773b515189ab2 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 2 Jul 2025 09:26:51 +0000
Subject: [PATCH 204/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 8f3e0a49..b4e9013b 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.15.0"
+ ".": "0.16.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index c5f6a0cd..d4b82f8b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.15.0"
+version = "0.16.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 fe278751..1fc64f37 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.15.0" # x-release-please-version
+__version__ = "0.16.0" # x-release-please-version
From 7791de553bf8e8d6137ff7aa2ca14c883f7e9211 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 2 Jul 2025 16:20:48 +0000
Subject: [PATCH 205/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 8071ffce..a7519b60 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-315b0ef2cbe106abc1299563d329b70c233e3bcbe5233db006fa09fbeafb7b62.yml
openapi_spec_hash: 56fa40291a1ee5d7bfcde5654540cba8
-config_hash: e4d40031e9232e8e6c16e73430b7f535
+config_hash: ecd1ddc3fbd3072806e3a29c2f8910b9
From 6901ae9f4b62b241fdcb5b2d12e39c26fa30e8cb Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 2 Jul 2025 16:28:32 +0000
Subject: [PATCH 206/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index a7519b60..fcbd8614 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-315b0ef2cbe106abc1299563d329b70c233e3bcbe5233db006fa09fbeafb7b62.yml
openapi_spec_hash: 56fa40291a1ee5d7bfcde5654540cba8
-config_hash: ecd1ddc3fbd3072806e3a29c2f8910b9
+config_hash: 439b5981c2fb63306c76f2a17052d688
From d56391de19f603fe6b5ff20565cd08405b0799c9 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 2 Jul 2025 16:29:17 +0000
Subject: [PATCH 207/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
README.md | 63 +++++++++++++++++
api.md | 23 +++----
.../resources/data_sources/connectors.py | 22 +++---
.../resources/data_sources/data_sources.py | 22 +++---
src/mixedbread/resources/files.py | 22 +++---
src/mixedbread/resources/parsing/jobs.py | 21 +++---
.../resources/vector_stores/files.py | 22 +++---
.../resources/vector_stores/vector_stores.py | 22 +++---
src/mixedbread/types/__init__.py | 3 -
.../types/data_source_list_response.py | 69 -------------------
src/mixedbread/types/data_sources/__init__.py | 1 -
.../data_sources/connector_list_response.py | 69 -------------------
src/mixedbread/types/file_list_response.py | 69 -------------------
.../types/parsing/job_list_response.py | 66 +-----------------
.../types/vector_store_list_response.py | 69 -------------------
.../types/vector_stores/__init__.py | 1 -
.../types/vector_stores/file_list_response.py | 69 -------------------
.../data_sources/test_connectors.py | 18 ++---
tests/api_resources/parsing/test_jobs.py | 17 ++---
tests/api_resources/test_data_sources.py | 18 ++---
tests/api_resources/test_files.py | 23 +++----
tests/api_resources/test_vector_stores.py | 18 ++---
.../api_resources/vector_stores/test_files.py | 18 ++---
24 files changed, 202 insertions(+), 545 deletions(-)
delete mode 100644 src/mixedbread/types/data_source_list_response.py
delete mode 100644 src/mixedbread/types/data_sources/connector_list_response.py
delete mode 100644 src/mixedbread/types/file_list_response.py
delete mode 100644 src/mixedbread/types/vector_store_list_response.py
delete mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
diff --git a/.stats.yml b/.stats.yml
index fcbd8614..f195d2e8 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-315b0ef2cbe106abc1299563d329b70c233e3bcbe5233db006fa09fbeafb7b62.yml
openapi_spec_hash: 56fa40291a1ee5d7bfcde5654540cba8
-config_hash: 439b5981c2fb63306c76f2a17052d688
+config_hash: d2da42a6eb83a404ee93a107e3b5c0f2
diff --git a/README.md b/README.md
index 8bfd5cf1..ef53e23e 100644
--- a/README.md
+++ b/README.md
@@ -109,6 +109,69 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
+## Pagination
+
+List methods in the Mixedbread API are paginated.
+
+This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:
+
+```python
+from mixedbread import Mixedbread
+
+client = Mixedbread()
+
+all_vector_stores = []
+# Automatically fetches more pages as needed.
+for vector_store in client.vector_stores.list():
+ # Do something with vector_store here
+ all_vector_stores.append(vector_store)
+print(all_vector_stores)
+```
+
+Or, asynchronously:
+
+```python
+import asyncio
+from mixedbread import AsyncMixedbread
+
+client = AsyncMixedbread()
+
+
+async def main() -> None:
+ all_vector_stores = []
+ # Iterate through items across all pages, issuing requests as needed.
+ async for vector_store in client.vector_stores.list():
+ all_vector_stores.append(vector_store)
+ print(all_vector_stores)
+
+
+asyncio.run(main())
+```
+
+Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
+
+```python
+first_page = await client.vector_stores.list()
+if first_page.has_next_page():
+ print(f"will fetch next page using these details: {first_page.next_page_info()}")
+ next_page = await first_page.get_next_page()
+ print(f"number of items we just fetched: {len(next_page.data)}")
+
+# Remove `await` for non-async usage.
+```
+
+Or just work directly with the returned data:
+
+```python
+first_page = await client.vector_stores.list()
+
+print(f"next page cursor: {first_page.pagination.last_cursor}") # => "next page cursor: ..."
+for vector_store in first_page.data:
+ print(vector_store.id)
+
+# Remove `await` for non-async usage.
+```
+
## Nested params
Nested parameters are dictionaries, typed using `TypedDict`, for example:
diff --git a/api.md b/api.md
index 71c47d0b..a9f5376f 100644
--- a/api.md
+++ b/api.md
@@ -37,7 +37,6 @@ from mixedbread.types import (
ScoredVideoURLInputChunk,
VectorStore,
VectorStoreChunkSearchOptions,
- VectorStoreListResponse,
VectorStoreDeleteResponse,
VectorStoreQuestionAnsweringResponse,
VectorStoreSearchResponse,
@@ -49,7 +48,7 @@ Methods:
- client.vector_stores.create(\*\*params) -> VectorStore
- client.vector_stores.retrieve(vector_store_identifier) -> VectorStore
- client.vector_stores.update(vector_store_identifier, \*\*params) -> VectorStore
-- client.vector_stores.list(\*\*params) -> VectorStoreListResponse
+- client.vector_stores.list(\*\*params) -> SyncCursor[VectorStore]
- client.vector_stores.delete(vector_store_identifier) -> VectorStoreDeleteResponse
- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
@@ -64,7 +63,6 @@ from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
- FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -74,7 +72,7 @@ Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
+- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> SyncCursor[VectorStoreFile]
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
@@ -100,7 +98,7 @@ Methods:
- client.parsing.jobs.create(\*\*params) -> ParsingJob
- client.parsing.jobs.retrieve(job_id) -> ParsingJob
-- client.parsing.jobs.list(\*\*params) -> JobListResponse
+- client.parsing.jobs.list(\*\*params) -> SyncCursor[JobListResponse]
- client.parsing.jobs.delete(job_id) -> JobDeleteResponse
- client.parsing.jobs.cancel(job_id) -> ParsingJob
@@ -109,7 +107,7 @@ Methods:
Types:
```python
-from mixedbread.types import FileObject, PaginationWithTotal, FileListResponse, FileDeleteResponse
+from mixedbread.types import FileObject, PaginationWithTotal, FileDeleteResponse
```
Methods:
@@ -117,7 +115,7 @@ Methods:
- client.files.create(\*\*params) -> FileObject
- client.files.retrieve(file_id) -> FileObject
- client.files.update(file_id, \*\*params) -> FileObject
-- client.files.list(\*\*params) -> FileListResponse
+- client.files.list(\*\*params) -> SyncCursor[FileObject]
- client.files.delete(file_id) -> FileDeleteResponse
- client.files.content(file_id) -> BinaryAPIResponse
@@ -186,7 +184,6 @@ from mixedbread.types import (
LinearDataSource,
NotionDataSource,
Oauth2Params,
- DataSourceListResponse,
DataSourceDeleteResponse,
)
```
@@ -196,7 +193,7 @@ Methods:
- client.data_sources.create(\*\*params) -> DataSource
- client.data_sources.retrieve(data_source_id) -> DataSource
- client.data_sources.update(data_source_id, \*\*params) -> DataSource
-- client.data_sources.list(\*\*params) -> DataSourceListResponse
+- client.data_sources.list(\*\*params) -> SyncCursor[DataSource]
- client.data_sources.delete(data_source_id) -> DataSourceDeleteResponse
## Connectors
@@ -204,11 +201,7 @@ Methods:
Types:
```python
-from mixedbread.types.data_sources import (
- DataSourceConnector,
- ConnectorListResponse,
- ConnectorDeleteResponse,
-)
+from mixedbread.types.data_sources import DataSourceConnector, ConnectorDeleteResponse
```
Methods:
@@ -216,7 +209,7 @@ Methods:
- client.data_sources.connectors.create(data_source_id, \*\*params) -> DataSourceConnector
- client.data_sources.connectors.retrieve(connector_id, \*, data_source_id) -> DataSourceConnector
- client.data_sources.connectors.update(connector_id, \*, data_source_id, \*\*params) -> DataSourceConnector
-- client.data_sources.connectors.list(data_source_id, \*\*params) -> ConnectorListResponse
+- client.data_sources.connectors.list(data_source_id, \*\*params) -> SyncCursor[DataSourceConnector]
- client.data_sources.connectors.delete(connector_id, \*, data_source_id) -> ConnectorDeleteResponse
# APIKeys
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index f333b4e9..30c2ed30 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -16,10 +16,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncCursor, AsyncCursor
+from ..._base_client import AsyncPaginator, make_request_options
from ...types.data_sources import connector_list_params, connector_create_params, connector_update_params
from ...types.data_sources.data_source_connector import DataSourceConnector
-from ...types.data_sources.connector_list_response import ConnectorListResponse
from ...types.data_sources.connector_delete_response import ConnectorDeleteResponse
__all__ = ["ConnectorsResource", "AsyncConnectorsResource"]
@@ -246,7 +246,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorListResponse:
+ ) -> SyncCursor[DataSourceConnector]:
"""
Get all connectors for a data source.
@@ -278,8 +278,9 @@ def list(
"""
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
- return self._get(
+ return self._get_api_list(
f"/v1/data_sources/{data_source_id}/connectors",
+ page=SyncCursor[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -295,7 +296,7 @@ def list(
connector_list_params.ConnectorListParams,
),
),
- cast_to=ConnectorListResponse,
+ model=DataSourceConnector,
)
def delete(
@@ -551,7 +552,7 @@ async def update(
cast_to=DataSourceConnector,
)
- async def list(
+ def list(
self,
data_source_id: str,
*,
@@ -565,7 +566,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> ConnectorListResponse:
+ ) -> AsyncPaginator[DataSourceConnector, AsyncCursor[DataSourceConnector]]:
"""
Get all connectors for a data source.
@@ -597,14 +598,15 @@ async def list(
"""
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
- return await self._get(
+ return self._get_api_list(
f"/v1/data_sources/{data_source_id}/connectors",
+ page=AsyncCursor[DataSourceConnector],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"after": after,
@@ -614,7 +616,7 @@ async def list(
connector_list_params.ConnectorListParams,
),
),
- cast_to=ConnectorListResponse,
+ model=DataSourceConnector,
)
async def delete(
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index c8a83074..dd533886 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -32,11 +32,11 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncCursor, AsyncCursor
+from ..._base_client import AsyncPaginator, make_request_options
from ...types.data_source import DataSource
from ...types.oauth2_params import Oauth2Params
from ...types.data_source_type import DataSourceType
-from ...types.data_source_list_response import DataSourceListResponse
from ...types.data_source_delete_response import DataSourceDeleteResponse
__all__ = ["DataSourcesResource", "AsyncDataSourcesResource"]
@@ -365,7 +365,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceListResponse:
+ ) -> SyncCursor[DataSource]:
"""
Get all data sources.
@@ -390,8 +390,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/data_sources/",
+ page=SyncCursor[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -407,7 +408,7 @@ def list(
data_source_list_params.DataSourceListParams,
),
),
- cast_to=DataSourceListResponse,
+ model=DataSource,
)
def delete(
@@ -758,7 +759,7 @@ async def update(
cast_to=DataSource,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -771,7 +772,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> DataSourceListResponse:
+ ) -> AsyncPaginator[DataSource, AsyncCursor[DataSource]]:
"""
Get all data sources.
@@ -796,14 +797,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/data_sources/",
+ page=AsyncCursor[DataSource],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"after": after,
@@ -813,7 +815,7 @@ async def list(
data_source_list_params.DataSourceListParams,
),
),
- cast_to=DataSourceListResponse,
+ model=DataSource,
)
async def delete(
diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py
index 10f6a213..5d00457d 100644
--- a/src/mixedbread/resources/files.py
+++ b/src/mixedbread/resources/files.py
@@ -25,9 +25,9 @@
async_to_custom_raw_response_wrapper,
async_to_custom_streamed_response_wrapper,
)
-from .._base_client import make_request_options
+from ..pagination import SyncCursor, AsyncCursor
+from .._base_client import AsyncPaginator, make_request_options
from ..types.file_object import FileObject
-from ..types.file_list_response import FileListResponse
from ..types.file_delete_response import FileDeleteResponse
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -201,7 +201,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> SyncCursor[FileObject]:
"""
List all files for the authenticated user.
@@ -230,8 +230,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/files",
+ page=SyncCursor[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -248,7 +249,7 @@ def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=FileObject,
)
def delete(
@@ -485,7 +486,7 @@ async def update(
cast_to=FileObject,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -499,7 +500,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> AsyncPaginator[FileObject, AsyncCursor[FileObject]]:
"""
List all files for the authenticated user.
@@ -528,14 +529,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/files",
+ page=AsyncCursor[FileObject],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"after": after,
@@ -546,7 +548,7 @@ async def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=FileObject,
)
async def delete(
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 409247c0..57d8fac4 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -17,7 +17,8 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncCursor, AsyncCursor
+from ..._base_client import AsyncPaginator, make_request_options
from ...types.parsing import ReturnFormat, ChunkingStrategy, job_list_params, job_create_params
from ...types.parsing.parsing_job import ParsingJob
from ...types.parsing.element_type import ElementType
@@ -163,7 +164,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> JobListResponse:
+ ) -> SyncCursor[JobListResponse]:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -195,8 +196,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/parsing/jobs",
+ page=SyncCursor[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -214,7 +216,7 @@ def list(
job_list_params.JobListParams,
),
),
- cast_to=JobListResponse,
+ model=JobListResponse,
)
def delete(
@@ -414,7 +416,7 @@ async def retrieve(
cast_to=ParsingJob,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -429,7 +431,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> JobListResponse:
+ ) -> AsyncPaginator[JobListResponse, AsyncCursor[JobListResponse]]:
"""List parsing jobs with pagination.
Args: limit: The number of items to return.
@@ -461,14 +463,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/parsing/jobs",
+ page=AsyncCursor[JobListResponse],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"after": after,
@@ -480,7 +483,7 @@ async def list(
job_list_params.JobListParams,
),
),
- cast_to=JobListResponse,
+ model=JobListResponse,
)
async def delete(
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index f25c6699..a88b09cf 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -16,10 +16,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+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.vector_store_file import VectorStoreFile
-from ...types.vector_stores.file_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
@@ -168,7 +168,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> SyncCursor[VectorStoreFile]:
"""
List files indexed in a vector store with pagination.
@@ -204,8 +204,9 @@ def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return self._get(
+ return self._get_api_list(
f"/v1/vector_stores/{vector_store_identifier}/files",
+ page=SyncCursor[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -222,7 +223,7 @@ def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=VectorStoreFile,
)
def delete(
@@ -475,7 +476,7 @@ async def retrieve(
cast_to=VectorStoreFile,
)
- async def list(
+ def list(
self,
vector_store_identifier: str,
*,
@@ -490,7 +491,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
+ ) -> AsyncPaginator[VectorStoreFile, AsyncCursor[VectorStoreFile]]:
"""
List files indexed in a vector store with pagination.
@@ -526,14 +527,15 @@ async def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return await self._get(
+ return self._get_api_list(
f"/v1/vector_stores/{vector_store_identifier}/files",
+ page=AsyncCursor[VectorStoreFile],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"after": after,
@@ -544,7 +546,7 @@ async def list(
file_list_params.FileListParams,
),
),
- cast_to=FileListResponse,
+ model=VectorStoreFile,
)
async def delete(
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 96bf67de..7fb443de 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -31,10 +31,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ..._base_client import make_request_options
+from ...pagination import SyncCursor, AsyncCursor
+from ..._base_client import AsyncPaginator, make_request_options
from ...types.vector_store import VectorStore
from ...types.expires_after_param import ExpiresAfterParam
-from ...types.vector_store_list_response import VectorStoreListResponse
from ...types.vector_store_delete_response import VectorStoreDeleteResponse
from ...types.vector_store_search_response import VectorStoreSearchResponse
from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
@@ -254,7 +254,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreListResponse:
+ ) -> SyncCursor[VectorStore]:
"""
List all vector stores with optional search.
@@ -284,8 +284,9 @@ def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return self._get(
+ return self._get_api_list(
"/v1/vector_stores",
+ page=SyncCursor[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -302,7 +303,7 @@ def list(
vector_store_list_params.VectorStoreListParams,
),
),
- cast_to=VectorStoreListResponse,
+ model=VectorStore,
)
def delete(
@@ -692,7 +693,7 @@ async def update(
cast_to=VectorStore,
)
- async def list(
+ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
@@ -706,7 +707,7 @@ async def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> VectorStoreListResponse:
+ ) -> AsyncPaginator[VectorStore, AsyncCursor[VectorStore]]:
"""
List all vector stores with optional search.
@@ -736,14 +737,15 @@ async def list(
timeout: Override the client-level default timeout for this request, in seconds
"""
- return await self._get(
+ return self._get_api_list(
"/v1/vector_stores",
+ page=AsyncCursor[VectorStore],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
+ query=maybe_transform(
{
"limit": limit,
"after": after,
@@ -754,7 +756,7 @@ async def list(
vector_store_list_params.VectorStoreListParams,
),
),
- cast_to=VectorStoreListResponse,
+ model=VectorStore,
)
async def delete(
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index a726eb8f..5fead10f 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -18,7 +18,6 @@
from .data_source_type import DataSourceType as DataSourceType
from .file_list_params import FileListParams as FileListParams
from .file_create_params import FileCreateParams as FileCreateParams
-from .file_list_response import FileListResponse as FileListResponse
from .file_update_params import FileUpdateParams as FileUpdateParams
from .api_key_list_params import APIKeyListParams as APIKeyListParams
from .client_embed_params import ClientEmbedParams as ClientEmbedParams
@@ -36,12 +35,10 @@
from .notion_data_source_param import NotionDataSourceParam as NotionDataSourceParam
from .vector_store_list_params import VectorStoreListParams as VectorStoreListParams
from .data_source_create_params import DataSourceCreateParams as DataSourceCreateParams
-from .data_source_list_response import DataSourceListResponse as DataSourceListResponse
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 .vector_store_create_params import VectorStoreCreateParams as VectorStoreCreateParams
-from .vector_store_list_response import VectorStoreListResponse as VectorStoreListResponse
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
diff --git a/src/mixedbread/types/data_source_list_response.py b/src/mixedbread/types/data_source_list_response.py
deleted file mode 100644
index 0c7298f5..00000000
--- a/src/mixedbread/types/data_source_list_response.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .data_source import DataSource
-
-__all__ = ["DataSourceListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
-
- Use for backward pagination. None if page is empty.
- """
-
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
-
- Use for forward pagination. None if page is empty.
- """
-
- total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
-
-
-class DataSourceListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
-
- data: List[DataSource]
- """The list of data sources"""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/data_sources/__init__.py b/src/mixedbread/types/data_sources/__init__.py
index c925bcc7..c35b6f2e 100644
--- a/src/mixedbread/types/data_sources/__init__.py
+++ b/src/mixedbread/types/data_sources/__init__.py
@@ -5,6 +5,5 @@
from .connector_list_params import ConnectorListParams as ConnectorListParams
from .data_source_connector import DataSourceConnector as DataSourceConnector
from .connector_create_params import ConnectorCreateParams as ConnectorCreateParams
-from .connector_list_response import ConnectorListResponse as ConnectorListResponse
from .connector_update_params import ConnectorUpdateParams as ConnectorUpdateParams
from .connector_delete_response import ConnectorDeleteResponse as ConnectorDeleteResponse
diff --git a/src/mixedbread/types/data_sources/connector_list_response.py b/src/mixedbread/types/data_sources/connector_list_response.py
deleted file mode 100644
index c6f2f388..00000000
--- a/src/mixedbread/types/data_sources/connector_list_response.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .data_source_connector import DataSourceConnector
-
-__all__ = ["ConnectorListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
-
- Use for backward pagination. None if page is empty.
- """
-
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
-
- Use for forward pagination. None if page is empty.
- """
-
- total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
-
-
-class ConnectorListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
-
- data: List[DataSourceConnector]
- """The list of connectors"""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/file_list_response.py b/src/mixedbread/types/file_list_response.py
deleted file mode 100644
index c7322db2..00000000
--- a/src/mixedbread/types/file_list_response.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .file_object import FileObject
-
-__all__ = ["FileListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
-
- Use for backward pagination. None if page is empty.
- """
-
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
-
- Use for forward pagination. None if page is empty.
- """
-
- total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
-
-
-class FileListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[FileObject]
- """The list of files"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index 4b24ab2c..14b52eb4 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -1,44 +1,16 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Optional
+from typing import Optional
from datetime import datetime
from typing_extensions import Literal
from ..._models import BaseModel
from .parsing_job_status import ParsingJobStatus
-__all__ = ["JobListResponse", "Pagination", "Data"]
+__all__ = ["JobListResponse"]
-class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
-
- Use for backward pagination. None if page is empty.
- """
-
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
-
- Use for forward pagination. None if page is empty.
- """
-
- total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
-
-
-class Data(BaseModel):
+class JobListResponse(BaseModel):
id: str
"""The ID of the job"""
@@ -65,35 +37,3 @@ class Data(BaseModel):
object: Optional[Literal["parsing_job"]] = None
"""The type of the object"""
-
-
-class JobListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
-
- data: List[Data]
- """The list of parsing jobs"""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
diff --git a/src/mixedbread/types/vector_store_list_response.py b/src/mixedbread/types/vector_store_list_response.py
deleted file mode 100644
index 5ab4c798..00000000
--- a/src/mixedbread/types/vector_store_list_response.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .vector_store import VectorStore
-
-__all__ = ["VectorStoreListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
-
- Use for backward pagination. None if page is empty.
- """
-
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
-
- Use for forward pagination. None if page is empty.
- """
-
- total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
-
-
-class VectorStoreListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[VectorStore]
- """The list of vector stores"""
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index f0cee6f2..6ce1aafe 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -5,7 +5,6 @@
from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
-from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
deleted file mode 100644
index 252d1c93..00000000
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .vector_store_file import VectorStoreFile
-
-__all__ = ["FileListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
-
- Use for backward pagination. None if page is empty.
- """
-
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
-
- Use for forward pagination. None if page is empty.
- """
-
- total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
-
-
-class FileListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[VectorStoreFile]
- """The list of vector store files"""
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index f0b2b2e3..23c313d4 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -9,9 +9,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
+from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.data_sources import (
DataSourceConnector,
- ConnectorListResponse,
ConnectorDeleteResponse,
)
@@ -188,7 +188,7 @@ def test_method_list(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -199,7 +199,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
)
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -210,7 +210,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -221,7 +221,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = response.parse()
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(SyncCursor[DataSourceConnector], connector, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -453,7 +453,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.list(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -464,7 +464,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
)
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -475,7 +475,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -486,7 +486,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
connector = await response.parse()
- assert_matches_type(ConnectorListResponse, connector, path=["response"])
+ assert_matches_type(AsyncCursor[DataSourceConnector], connector, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 5ce07165..7ffccb59 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -9,6 +9,7 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
+from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.parsing import (
ParsingJob,
JobListResponse,
@@ -104,7 +105,7 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
job = client.parsing.jobs.list()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -116,7 +117,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
statuses=["pending", "in_progress"],
q="x",
)
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -125,7 +126,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -134,7 +135,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = response.parse()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(SyncCursor[JobListResponse], job, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -303,7 +304,7 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.list()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -315,7 +316,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
statuses=["pending", "in_progress"],
q="x",
)
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -324,7 +325,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -333,7 +334,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
job = await response.parse()
- assert_matches_type(JobListResponse, job, path=["response"])
+ assert_matches_type(AsyncCursor[JobListResponse], job, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index 3e2075e0..7ecf2ff1 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -11,9 +11,9 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
DataSource,
- DataSourceListResponse,
DataSourceDeleteResponse,
)
+from mixedbread.pagination import SyncCursor, AsyncCursor
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -250,7 +250,7 @@ def test_path_params_update_overload_2(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
data_source = client.data_sources.list()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -260,7 +260,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
)
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -269,7 +269,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -278,7 +278,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = response.parse()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(SyncCursor[DataSource], data_source, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -555,7 +555,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncMixedbread
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.list()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -565,7 +565,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
)
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -574,7 +574,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -583,7 +583,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
data_source = await response.parse()
- assert_matches_type(DataSourceListResponse, data_source, path=["response"])
+ assert_matches_type(AsyncCursor[DataSource], data_source, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py
index 5fb0941b..62adce9b 100644
--- a/tests/api_resources/test_files.py
+++ b/tests/api_resources/test_files.py
@@ -11,17 +11,14 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.types import (
- FileObject,
- FileListResponse,
- FileDeleteResponse,
-)
+from mixedbread.types import FileObject, FileDeleteResponse
from mixedbread._response import (
BinaryAPIResponse,
AsyncBinaryAPIResponse,
StreamedBinaryAPIResponse,
AsyncStreamedBinaryAPIResponse,
)
+from mixedbread.pagination import SyncCursor, AsyncCursor
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -143,7 +140,7 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
file = client.files.list()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[FileObject], file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -154,7 +151,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
include_total=False,
q="x",
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[FileObject], file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -163,7 +160,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[FileObject], file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -172,7 +169,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[FileObject], file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -390,7 +387,7 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.files.list()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -401,7 +398,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
include_total=False,
q="x",
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -410,7 +407,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -419,7 +416,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[FileObject], file, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index f8a62782..cc5891a9 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -11,11 +11,11 @@
from tests.utils import assert_matches_type
from mixedbread.types import (
VectorStore,
- VectorStoreListResponse,
VectorStoreDeleteResponse,
VectorStoreSearchResponse,
VectorStoreQuestionAnsweringResponse,
)
+from mixedbread.pagination import SyncCursor, AsyncCursor
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -161,7 +161,7 @@ def test_path_params_update(self, client: Mixedbread) -> None:
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.list()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -172,7 +172,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
include_total=False,
q="x",
)
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -181,7 +181,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -190,7 +190,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -549,7 +549,7 @@ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.list()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -560,7 +560,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
include_total=False,
q="x",
)
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -569,7 +569,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -578,7 +578,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
vector_store = await response.parse()
- assert_matches_type(VectorStoreListResponse, vector_store, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index e3122544..1208d103 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -9,9 +9,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
+from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.vector_stores import (
VectorStoreFile,
- FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -134,7 +134,7 @@ def test_method_list(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -146,7 +146,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
include_total=False,
statuses=["pending", "in_progress"],
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -157,7 +157,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -168,7 +168,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -437,7 +437,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -449,7 +449,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
include_total=False,
statuses=["pending", "in_progress"],
)
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -460,7 +460,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -471,7 +471,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
assert cast(Any, response.is_closed) is True
From 71cbdfea53c16b7270289898a6a1ac9e0d9f8ab6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 2 Jul 2025 21:26:15 +0000
Subject: [PATCH 208/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index f195d2e8..7c7d6d61 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-315b0ef2cbe106abc1299563d329b70c233e3bcbe5233db006fa09fbeafb7b62.yml
-openapi_spec_hash: 56fa40291a1ee5d7bfcde5654540cba8
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-1cb5e131887b451004a08be20efac2fa11c58a80dcee0176c38182b335499f05.yml
+openapi_spec_hash: 1476cba193e17ebfb4bbf20c74753b05
config_hash: d2da42a6eb83a404ee93a107e3b5c0f2
From 57c359a7322fafced78134465097266146ef6d82 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 4 Jul 2025 03:30:11 +0000
Subject: [PATCH 209/375] chore(internal): codegen related update
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index b4e9013b..6db19b95 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.16.0"
+ ".": "0.17.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index d4b82f8b..bc769ba0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.16.0"
+version = "0.17.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 1fc64f37..596ec9fb 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.16.0" # x-release-please-version
+__version__ = "0.17.0" # x-release-please-version
From c732daf6322193e030c3db45a0ebb51f9b2ef540 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 17 Jul 2025 18:24:52 +0000
Subject: [PATCH 210/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
requirements-dev.lock | 2 +-
requirements.lock | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 7c7d6d61..5ca021e4 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-1cb5e131887b451004a08be20efac2fa11c58a80dcee0176c38182b335499f05.yml
openapi_spec_hash: 1476cba193e17ebfb4bbf20c74753b05
-config_hash: d2da42a6eb83a404ee93a107e3b5c0f2
+config_hash: 810d9712d3d0d6a1f50d71a25511d8a7
diff --git a/requirements-dev.lock b/requirements-dev.lock
index ca2c5c9e..d37564b7 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -56,7 +56,7 @@ httpx==0.28.1
# via httpx-aiohttp
# via mixedbread
# via respx
-httpx-aiohttp==0.1.6
+httpx-aiohttp==0.1.8
# via mixedbread
idna==3.4
# via anyio
diff --git a/requirements.lock b/requirements.lock
index 2b940d36..e7c74727 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -43,7 +43,7 @@ httpcore==1.0.2
httpx==0.28.1
# via httpx-aiohttp
# via mixedbread
-httpx-aiohttp==0.1.6
+httpx-aiohttp==0.1.8
# via mixedbread
idna==3.4
# via anyio
From 2e80bfe311bc38fdcb71d36f6392a4dbb8c3072b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 17 Jul 2025 18:25:42 +0000
Subject: [PATCH 211/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 6db19b95..4ad3fef3 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.17.0"
+ ".": "0.18.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index bc769ba0..0e3a091e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.17.0"
+version = "0.18.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 596ec9fb..f16b39b9 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.17.0" # x-release-please-version
+__version__ = "0.18.0" # x-release-please-version
From 7a6d48aecf78dca472ec89fe22b574d574e13ef3 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 17 Jul 2025 18:26:24 +0000
Subject: [PATCH 212/375] feat(api): api update
---
.stats.yml | 4 +-
api.md | 2 +-
.../resources/vector_stores/files.py | 22 +++-
src/mixedbread/types/object_type.py | 1 +
.../types/scored_audio_url_input_chunk.py | 6 +-
.../types/scored_image_url_input_chunk.py | 6 +-
.../types/scored_text_input_chunk.py | 3 +
.../types/scored_video_url_input_chunk.py | 6 +-
.../types/vector_stores/__init__.py | 1 +
.../vector_stores/file_retrieve_params.py | 15 +++
.../vector_stores/scored_vector_store_file.py | 6 +-
.../types/vector_stores/vector_store_file.py | 115 +++++++++++++++++-
.../api_resources/vector_stores/test_files.py | 18 +++
13 files changed, 184 insertions(+), 21 deletions(-)
create mode 100644 src/mixedbread/types/vector_stores/file_retrieve_params.py
diff --git a/.stats.yml b/.stats.yml
index 5ca021e4..c6bec7fc 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-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
diff --git a/api.md b/api.md
index a9f5376f..257f5d28 100644
--- a/api.md
+++ b/api.md
@@ -71,7 +71,7 @@ from mixedbread.types.vector_stores import (
Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
-- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier) -> VectorStoreFile
+- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> SyncCursor[VectorStoreFile]
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index a88b09cf..3623c1f5 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -18,7 +18,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
@@ -111,6 +111,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,
@@ -131,6 +132,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
@@ -148,7 +151,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,
)
@@ -434,6 +441,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,
@@ -454,6 +462,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
@@ -471,7 +481,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,
)
diff --git a/src/mixedbread/types/object_type.py b/src/mixedbread/types/object_type.py
index aecff986..fe19bc12 100644
--- a/src/mixedbread/types/object_type.py
+++ b/src/mixedbread/types/object_type.py
@@ -17,4 +17,5 @@
"api_key",
"data_source",
"data_source.connector",
+ "vector_store.histogram",
]
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 8f11be23..8a9d43e8 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -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."""
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index 8be62ae0..9bd0deb2 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -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."""
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index 398a8a7c..35f20c06 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -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"""
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index bd0bea16..78d77359 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -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."""
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index 6ce1aafe..6919f613 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -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
diff --git a/src/mixedbread/types/vector_stores/file_retrieve_params.py b/src/mixedbread/types/vector_stores/file_retrieve_params.py
new file mode 100644
index 00000000..0bbdedfc
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_retrieve_params.py
@@ -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"""
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 225806b2..ca72a30f 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -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"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 642c066f..96171171 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -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):
@@ -40,3 +146,6 @@ class VectorStoreFile(BaseModel):
object: Optional[Literal["vector_store.file"]] = None
"""Type of the object"""
+
+ chunks: Optional[List[Chunk]] = None
+ """chunks"""
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 1208d103..e0abab0e 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -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(
@@ -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(
From 49d345527e22893c75f009d27f2dfd7e667ccc0d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 17 Jul 2025 18:33:34 +0000
Subject: [PATCH 213/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 4ad3fef3..e7562934 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.18.0"
+ ".": "0.19.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 0e3a091e..5a7c87c0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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"
diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py
index f16b39b9..54e58eec 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.18.0" # x-release-please-version
+__version__ = "0.19.0" # x-release-please-version
From 7fac36c73bd9f70b04d20c31283250f25399a498 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 18 Jul 2025 02:19:41 +0000
Subject: [PATCH 214/375] chore(internal): codegen related update
---
README.md | 3 ++-
pyproject.toml | 3 ++-
requirements-dev.lock | 4 +--
requirements.lock | 4 +--
src/mixedbread/_base_client.py | 11 +++++++--
src/mixedbread/_models.py | 13 ++++++----
tests/test_client.py | 4 +--
tests/test_models.py | 45 ++++++++++++++++++++++++++++++++++
8 files changed, 72 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index ef53e23e..7e24a410 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
# Mixedbread API Python SDK API library
-[![PyPI version]()](https://pypi.org/project/mixedbread/)
+
+[)](https://pypi.org/project/mixedbread/)
The Mixedbread API Python SDK library provides convenient access to the Mixedbread REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
diff --git a/pyproject.toml b/pyproject.toml
index 5a7c87c0..cb4fee08 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
+ "Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
@@ -38,7 +39,7 @@ Homepage = "https://github.com/mixedbread-ai/mixedbread-python"
Repository = "https://github.com/mixedbread-ai/mixedbread-python"
[project.optional-dependencies]
-aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
+aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
[tool.rye]
managed = true
diff --git a/requirements-dev.lock b/requirements-dev.lock
index d37564b7..75170ccd 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -48,9 +48,9 @@ filelock==3.12.4
frozenlist==1.6.2
# via aiohttp
# via aiosignal
-h11==0.14.0
+h11==0.16.0
# via httpcore
-httpcore==1.0.2
+httpcore==1.0.9
# via httpx
httpx==0.28.1
# via httpx-aiohttp
diff --git a/requirements.lock b/requirements.lock
index e7c74727..93fffc81 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -36,9 +36,9 @@ exceptiongroup==1.2.2
frozenlist==1.6.2
# via aiohttp
# via aiosignal
-h11==0.14.0
+h11==0.16.0
# via httpcore
-httpcore==1.0.2
+httpcore==1.0.9
# via httpx
httpx==0.28.1
# via httpx-aiohttp
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 8ec40870..40ee1387 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -529,6 +529,15 @@ def _build_request(
# work around https://github.com/encode/httpx/discussions/2880
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
+ is_body_allowed = options.method.lower() != "get"
+
+ if is_body_allowed:
+ kwargs["json"] = json_data if is_given(json_data) else None
+ kwargs["files"] = files
+ else:
+ headers.pop("Content-Type", None)
+ kwargs.pop("data", None)
+
# TODO: report this error to httpx
return self._client.build_request( # pyright: ignore[reportUnknownMemberType]
headers=headers,
@@ -540,8 +549,6 @@ def _build_request(
# so that passing a `TypedDict` doesn't cause an error.
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
- json=json_data if is_given(json_data) else None,
- files=files,
**kwargs,
)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 4f214980..528d5680 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -2,9 +2,10 @@
import os
import inspect
-from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast
+from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
from datetime import date, datetime
from typing_extensions import (
+ List,
Unpack,
Literal,
ClassVar,
@@ -366,7 +367,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
if type_ is None:
raise RuntimeError(f"Unexpected field type is None for {key}")
- return construct_type(value=value, type_=type_)
+ return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None))
def is_basemodel(type_: type) -> bool:
@@ -420,7 +421,7 @@ def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T:
return cast(_T, construct_type(value=value, type_=type_))
-def construct_type(*, value: object, type_: object) -> object:
+def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]] = None) -> object:
"""Loose coercion to the expected type with construction of nested values.
If the given value does not match the expected type then it is returned as-is.
@@ -438,8 +439,10 @@ def construct_type(*, value: object, type_: object) -> object:
type_ = type_.__value__ # type: ignore[unreachable]
# unwrap `Annotated[T, ...]` -> `T`
- if is_annotated_type(type_):
- meta: tuple[Any, ...] = get_args(type_)[1:]
+ if metadata is not None:
+ meta: tuple[Any, ...] = tuple(metadata)
+ elif is_annotated_type(type_):
+ meta = get_args(type_)[1:]
type_ = extract_type_arg(type_, 0)
else:
meta = tuple()
diff --git a/tests/test_client.py b/tests/test_client.py
index 8f60c0c0..81aac0d0 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -464,7 +464,7 @@ def test_request_extra_query(self) -> None:
def test_multipart_repeating_array(self, client: Mixedbread) -> None:
request = client._build_request(
FinalRequestOptions.construct(
- method="get",
+ method="post",
url="/foo",
headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"},
json_data={"array": ["foo", "bar"]},
@@ -1283,7 +1283,7 @@ def test_request_extra_query(self) -> None:
def test_multipart_repeating_array(self, async_client: AsyncMixedbread) -> None:
request = async_client._build_request(
FinalRequestOptions.construct(
- method="get",
+ method="post",
url="/foo",
headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"},
json_data={"array": ["foo", "bar"]},
diff --git a/tests/test_models.py b/tests/test_models.py
index 7f19dc8b..27250fa2 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -889,3 +889,48 @@ class ModelB(BaseModel):
)
assert isinstance(m, ModelB)
+
+
+def test_nested_discriminated_union() -> None:
+ class InnerType1(BaseModel):
+ type: Literal["type_1"]
+
+ class InnerModel(BaseModel):
+ inner_value: str
+
+ class InnerType2(BaseModel):
+ type: Literal["type_2"]
+ some_inner_model: InnerModel
+
+ class Type1(BaseModel):
+ base_type: Literal["base_type_1"]
+ value: Annotated[
+ Union[
+ InnerType1,
+ InnerType2,
+ ],
+ PropertyInfo(discriminator="type"),
+ ]
+
+ class Type2(BaseModel):
+ base_type: Literal["base_type_2"]
+
+ T = Annotated[
+ Union[
+ Type1,
+ Type2,
+ ],
+ PropertyInfo(discriminator="base_type"),
+ ]
+
+ model = construct_type(
+ type_=T,
+ value={
+ "base_type": "base_type_1",
+ "value": {
+ "type": "type_2",
+ },
+ },
+ )
+ assert isinstance(model, Type1)
+ assert isinstance(model.value, InnerType2)
From ea10302ce23771c3a4420501e7bc3be4617d73bf Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 18 Jul 2025 04:14:00 +0000
Subject: [PATCH 215/375] feat: clean up environment call outs
---
README.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 7e24a410..6b66d10d 100644
--- a/README.md
+++ b/README.md
@@ -83,7 +83,6 @@ pip install mixedbread[aiohttp]
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
```python
-import os
import asyncio
from mixedbread import DefaultAioHttpClient
from mixedbread import AsyncMixedbread
@@ -91,7 +90,7 @@ from mixedbread import AsyncMixedbread
async def main() -> None:
async with AsyncMixedbread(
- api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
+ api_key="My API Key",
http_client=DefaultAioHttpClient(),
) as client:
vector_store = await client.vector_stores.create()
From 4e3cfc54dd0148c691613d07a6ee0f34b5798f7c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 21 Jul 2025 15:26:30 +0000
Subject: [PATCH 216/375] feat(api): api update
---
.stats.yml | 4 +--
.../resources/data_sources/data_sources.py | 35 ++++++++-----------
.../types/data_source_create_params.py | 5 ++-
.../types/data_source_update_params.py | 5 ++-
.../types/linear_data_source_param.py | 5 ++-
.../types/notion_data_source_param.py | 3 +-
tests/api_resources/test_data_sources.py | 8 ++---
7 files changed, 27 insertions(+), 38 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index c6bec7fc..392f60c3 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-d45a3a3119fa9a3db2a6cae3c6d376f99fb874ed359c369d9b9531fdea55dcec.yml
-openapi_spec_hash: aedb38c67ac4c4b9ee79d130ddeb583a
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e8f008047e9aa7f8824bbf5c8b3f338ce1f79b4c81f2637a5e4be1530ff45c9f.yml
+openapi_spec_hash: 27f45c14fedc15710f730e037f0694cf
config_hash: 810d9712d3d0d6a1f50d71a25511d8a7
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index dd533886..3579b305 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -3,17 +3,11 @@
from __future__ import annotations
from typing import Optional
-from typing_extensions import overload
+from typing_extensions import Literal, overload
import httpx
-from ...types import (
- Oauth2Params,
- DataSourceType,
- data_source_list_params,
- data_source_create_params,
- data_source_update_params,
-)
+from ...types import Oauth2Params, data_source_list_params, data_source_create_params, data_source_update_params
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import required_args, maybe_transform, async_maybe_transform
from ..._compat import cached_property
@@ -36,7 +30,6 @@
from ..._base_client import AsyncPaginator, make_request_options
from ...types.data_source import DataSource
from ...types.oauth2_params import Oauth2Params
-from ...types.data_source_type import DataSourceType
from ...types.data_source_delete_response import DataSourceDeleteResponse
__all__ = ["DataSourcesResource", "AsyncDataSourcesResource"]
@@ -70,7 +63,7 @@ def with_streaming_response(self) -> DataSourcesResourceWithStreamingResponse:
def create(
self,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN,
@@ -112,7 +105,7 @@ def create(
def create(
self,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["linear"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN,
@@ -153,7 +146,7 @@ def create(
def create(
self,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams]
@@ -227,7 +220,7 @@ def update(
self,
data_source_id: str,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN,
@@ -274,7 +267,7 @@ def update(
self,
data_source_id: str,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["linear"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN,
@@ -320,7 +313,7 @@ def update(
self,
data_source_id: str,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams]
@@ -477,7 +470,7 @@ def with_streaming_response(self) -> AsyncDataSourcesResourceWithStreamingRespon
async def create(
self,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN,
@@ -519,7 +512,7 @@ async def create(
async def create(
self,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["linear"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN,
@@ -560,7 +553,7 @@ async def create(
async def create(
self,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams]
@@ -634,7 +627,7 @@ async def update(
self,
data_source_id: str,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN,
@@ -681,7 +674,7 @@ async def update(
self,
data_source_id: str,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["linear"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN,
@@ -727,7 +720,7 @@ async def update(
self,
data_source_id: str,
*,
- type: DataSourceType | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN,
name: str,
metadata: object | NotGiven = NOT_GIVEN,
auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams]
diff --git a/src/mixedbread/types/data_source_create_params.py b/src/mixedbread/types/data_source_create_params.py
index caa23d67..9cc9738a 100644
--- a/src/mixedbread/types/data_source_create_params.py
+++ b/src/mixedbread/types/data_source_create_params.py
@@ -6,7 +6,6 @@
from typing_extensions import Literal, Required, TypeAlias, TypedDict
from .oauth2_params import Oauth2Params
-from .data_source_type import DataSourceType
__all__ = [
"DataSourceCreateParams",
@@ -18,7 +17,7 @@
class NotionDataSource(TypedDict, total=False):
- type: DataSourceType
+ type: Literal["notion"]
"""The type of data source to create"""
name: Required[str]
@@ -45,7 +44,7 @@ class NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=Fals
class LinearDataSource(TypedDict, total=False):
- type: DataSourceType
+ type: Literal["linear"]
"""The type of data source to create"""
name: Required[str]
diff --git a/src/mixedbread/types/data_source_update_params.py b/src/mixedbread/types/data_source_update_params.py
index 6c283f81..9aa8872b 100644
--- a/src/mixedbread/types/data_source_update_params.py
+++ b/src/mixedbread/types/data_source_update_params.py
@@ -6,7 +6,6 @@
from typing_extensions import Literal, Required, TypeAlias, TypedDict
from .oauth2_params import Oauth2Params
-from .data_source_type import DataSourceType
__all__ = [
"DataSourceUpdateParams",
@@ -18,7 +17,7 @@
class NotionDataSource(TypedDict, total=False):
- type: DataSourceType
+ type: Literal["notion"]
"""The type of data source to create"""
name: Required[str]
@@ -45,7 +44,7 @@ class NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=Fals
class LinearDataSource(TypedDict, total=False):
- type: DataSourceType
+ type: Literal["linear"]
"""The type of data source to create"""
name: Required[str]
diff --git a/src/mixedbread/types/linear_data_source_param.py b/src/mixedbread/types/linear_data_source_param.py
index 9dbe8904..8956d2e3 100644
--- a/src/mixedbread/types/linear_data_source_param.py
+++ b/src/mixedbread/types/linear_data_source_param.py
@@ -3,16 +3,15 @@
from __future__ import annotations
from typing import Optional
-from typing_extensions import Required, TypedDict
+from typing_extensions import Literal, Required, TypedDict
from .oauth2_params import Oauth2Params
-from .data_source_type import DataSourceType
__all__ = ["LinearDataSourceParam"]
class LinearDataSourceParam(TypedDict, total=False):
- type: DataSourceType
+ type: Literal["linear"]
"""The type of data source to create"""
name: Required[str]
diff --git a/src/mixedbread/types/notion_data_source_param.py b/src/mixedbread/types/notion_data_source_param.py
index 914c502f..65d12b2e 100644
--- a/src/mixedbread/types/notion_data_source_param.py
+++ b/src/mixedbread/types/notion_data_source_param.py
@@ -6,7 +6,6 @@
from typing_extensions import Literal, Required, TypeAlias, TypedDict
from .oauth2_params import Oauth2Params
-from .data_source_type import DataSourceType
__all__ = ["NotionDataSourceParam", "AuthParams", "AuthParamsAPIKeyCreateOrUpdateParams"]
@@ -22,7 +21,7 @@ class AuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
class NotionDataSourceParam(TypedDict, total=False):
- type: DataSourceType
+ type: Literal["notion"]
"""The type of data source to create"""
name: Required[str]
diff --git a/tests/api_resources/test_data_sources.py b/tests/api_resources/test_data_sources.py
index 7ecf2ff1..5cb9991e 100644
--- a/tests/api_resources/test_data_sources.py
+++ b/tests/api_resources/test_data_sources.py
@@ -72,7 +72,7 @@ def test_method_create_overload_2(self, client: Mixedbread) -> None:
@parametrize
def test_method_create_with_all_params_overload_2(self, client: Mixedbread) -> None:
data_source = client.data_sources.create(
- type="notion",
+ type="linear",
name="name",
metadata={},
auth_params={"type": "oauth2"},
@@ -206,7 +206,7 @@ def test_method_update_overload_2(self, client: Mixedbread) -> None:
def test_method_update_with_all_params_overload_2(self, client: Mixedbread) -> None:
data_source = client.data_sources.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- type="notion",
+ type="linear",
name="name",
metadata={},
auth_params={"type": "oauth2"},
@@ -377,7 +377,7 @@ async def test_method_create_overload_2(self, async_client: AsyncMixedbread) ->
@parametrize
async def test_method_create_with_all_params_overload_2(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.create(
- type="notion",
+ type="linear",
name="name",
metadata={},
auth_params={"type": "oauth2"},
@@ -511,7 +511,7 @@ async def test_method_update_overload_2(self, async_client: AsyncMixedbread) ->
async def test_method_update_with_all_params_overload_2(self, async_client: AsyncMixedbread) -> None:
data_source = await async_client.data_sources.update(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- type="notion",
+ type="linear",
name="name",
metadata={},
auth_params={"type": "oauth2"},
From 71353dc5e4b56b2a376acb55cec0254b5430e275 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 22 Jul 2025 02:21:22 +0000
Subject: [PATCH 217/375] fix(parsing): ignore empty metadata
---
src/mixedbread/_models.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 528d5680..ffcbf67b 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -439,7 +439,7 @@ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]
type_ = type_.__value__ # type: ignore[unreachable]
# unwrap `Annotated[T, ...]` -> `T`
- if metadata is not None:
+ if metadata is not None and len(metadata) > 0:
meta: tuple[Any, ...] = tuple(metadata)
elif is_annotated_type(type_):
meta = get_args(type_)[1:]
From 6fd5ef3df9068caf9cf99dfbe35e17dd9eaa3e60 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 22 Jul 2025 03:23:50 +0000
Subject: [PATCH 218/375] chore(types): rebuild Pydantic models after all types
are defined
---
src/mixedbread/types/__init__.py | 11 +++++++++++
src/mixedbread/types/shared/search_filter.py | 6 ------
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 5fead10f..aca3e061 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,6 +2,8 @@
from __future__ import annotations
+from . import shared
+from .. import _compat
from .shared import Usage as Usage, SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
from .api_key import APIKey as APIKey
from .embedding import Embedding as Embedding
@@ -56,3 +58,12 @@
from .vector_store_question_answering_response import (
VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
)
+
+# Rebuild cyclical models only after all modules are imported.
+# This ensures that, when building the deferred (due to cyclical references) model schema,
+# Pydantic can resolve the necessary references.
+# See: https://github.com/pydantic/pydantic/issues/11250 for more context.
+if _compat.PYDANTIC_V2:
+ shared.search_filter.SearchFilter.model_rebuild(_parent_namespace_depth=0)
+else:
+ shared.search_filter.SearchFilter.update_forward_refs() # type: ignore
diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py
index 4835d18d..579ae162 100644
--- a/src/mixedbread/types/shared/search_filter.py
+++ b/src/mixedbread/types/shared/search_filter.py
@@ -36,9 +36,3 @@ class SearchFilter(BaseModel):
none: Optional[List[NoneType]] = None
"""List of conditions or filters to be NOTed"""
-
-
-if PYDANTIC_V2:
- SearchFilter.model_rebuild()
-else:
- SearchFilter.update_forward_refs() # type: ignore
From 1b6c3f3a0387e9651519d2f725bf23a28170ce7c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 22 Jul 2025 03:44:53 +0000
Subject: [PATCH 219/375] chore(internal): codegen related update
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index e7562934..0c2ecec6 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.19.0"
+ ".": "0.20.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index cb4fee08..0ef339ff 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.19.0"
+version = "0.20.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 54e58eec..0c912dc1 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.19.0" # x-release-please-version
+__version__ = "0.20.0" # x-release-please-version
From d1211f76e655ae96339c5d1cc4b1f1007e4fc1f8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 23 Jul 2025 02:24:19 +0000
Subject: [PATCH 220/375] fix(parsing): parse extra field types
---
src/mixedbread/_models.py | 25 +++++++++++++++++++++++--
tests/test_models.py | 29 ++++++++++++++++++++++++++++-
2 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index ffcbf67b..b8387ce9 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -208,14 +208,18 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride]
else:
fields_values[name] = field_get_default(field)
+ extra_field_type = _get_extra_fields_type(__cls)
+
_extra = {}
for key, value in values.items():
if key not in model_fields:
+ parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value
+
if PYDANTIC_V2:
- _extra[key] = value
+ _extra[key] = parsed
else:
_fields_set.add(key)
- fields_values[key] = value
+ fields_values[key] = parsed
object.__setattr__(m, "__dict__", fields_values)
@@ -370,6 +374,23 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None))
+def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None:
+ if not PYDANTIC_V2:
+ # TODO
+ return None
+
+ schema = cls.__pydantic_core_schema__
+ if schema["type"] == "model":
+ fields = schema["schema"]
+ if fields["type"] == "model-fields":
+ extras = fields.get("extras_schema")
+ if extras and "cls" in extras:
+ # mypy can't narrow the type
+ return extras["cls"] # type: ignore[no-any-return]
+
+ return None
+
+
def is_basemodel(type_: type) -> bool:
"""Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`"""
if is_union(type_):
diff --git a/tests/test_models.py b/tests/test_models.py
index 27250fa2..a6a2821e 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -1,5 +1,5 @@
import json
-from typing import Any, Dict, List, Union, Optional, cast
+from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast
from datetime import datetime, timezone
from typing_extensions import Literal, Annotated, TypeAliasType
@@ -934,3 +934,30 @@ class Type2(BaseModel):
)
assert isinstance(model, Type1)
assert isinstance(model.value, InnerType2)
+
+
+@pytest.mark.skipif(not PYDANTIC_V2, reason="this is only supported in pydantic v2 for now")
+def test_extra_properties() -> None:
+ class Item(BaseModel):
+ prop: int
+
+ class Model(BaseModel):
+ __pydantic_extra__: Dict[str, Item] = Field(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
+
+ other: str
+
+ if TYPE_CHECKING:
+
+ def __getattr__(self, attr: str) -> Item: ...
+
+ model = construct_type(
+ type_=Model,
+ value={
+ "a": {"prop": 1},
+ "other": "foo",
+ },
+ )
+ assert isinstance(model, Model)
+ assert model.a.prop == 1
+ assert isinstance(model.a, Item)
+ assert model.other == "foo"
From 088d22a3d806d664af843eebd99ad06a83cd2d29 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 23 Jul 2025 04:00:42 +0000
Subject: [PATCH 221/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 0c2ecec6..461342f9 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.20.0"
+ ".": "0.20.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 0ef339ff..a117e167 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.20.0"
+version = "0.20.1"
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 0c912dc1..5feb757f 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.20.0" # x-release-please-version
+__version__ = "0.20.1" # x-release-please-version
From 05aac731e67af677b1831f6c8b2b2d8a70c9c59b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 23 Jul 2025 14:26:44 +0000
Subject: [PATCH 222/375] feat(api): api update
---
.stats.yml | 4 ++--
.../types/vector_store_chunk_search_options_param.py | 3 +++
src/mixedbread/types/vector_stores/file_search_params.py | 3 +++
tests/api_resources/test_vector_stores.py | 4 ++++
tests/api_resources/vector_stores/test_files.py | 2 ++
5 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 392f60c3..6c0eef6a 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-e8f008047e9aa7f8824bbf5c8b3f338ce1f79b4c81f2637a5e4be1530ff45c9f.yml
-openapi_spec_hash: 27f45c14fedc15710f730e037f0694cf
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-1d55ef57d17d780e3863936f62874ea7f378ed78a30edc0eb4119d9cb3009dc6.yml
+openapi_spec_hash: 1c5f41ebd04ef8a89bc257e11d7cb122
config_hash: 810d9712d3d0d6a1f50d71a25511d8a7
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 eed57858..f6ed0aad 100644
--- a/src/mixedbread/types/vector_store_chunk_search_options_param.py
+++ b/src/mixedbread/types/vector_store_chunk_search_options_param.py
@@ -24,3 +24,6 @@ class VectorStoreChunkSearchOptionsParam(TypedDict, total=False):
return_metadata: bool
"""Whether to return file metadata"""
+
+ apply_search_rules: bool
+ """Whether to apply search rules"""
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 17886660..3c289bc1 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -59,5 +59,8 @@ class SearchOptions(TypedDict, total=False):
chunks_per_file: int
"""Number of chunks to return for each file"""
+ apply_search_rules: bool
+ """Whether to apply search rules"""
+
from ..shared_params.search_filter import SearchFilter
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index cc5891a9..88ab340d 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -290,6 +290,7 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
"rewrite_query": True,
"rerank": True,
"return_metadata": True,
+ "apply_search_rules": True,
},
stream=True,
qa_options={
@@ -377,6 +378,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
"rewrite_query": True,
"rerank": True,
"return_metadata": True,
+ "apply_search_rules": True,
},
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@@ -678,6 +680,7 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
"rewrite_query": True,
"rerank": True,
"return_metadata": True,
+ "apply_search_rules": True,
},
stream=True,
qa_options={
@@ -765,6 +768,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
"rewrite_query": True,
"rerank": True,
"return_metadata": True,
+ "apply_search_rules": True,
},
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index e0abab0e..6e3bf27e 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:
"return_metadata": True,
"return_chunks": True,
"chunks_per_file": 0,
+ "apply_search_rules": True,
},
)
assert_matches_type(FileSearchResponse, file, path=["response"])
@@ -612,6 +613,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
"return_metadata": True,
"return_chunks": True,
"chunks_per_file": 0,
+ "apply_search_rules": True,
},
)
assert_matches_type(FileSearchResponse, file, path=["response"])
From 79def663a7cb0747e4f6583d30d8d35de467b3b1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 23 Jul 2025 14:28:52 +0000
Subject: [PATCH 223/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 461342f9..86b0e83d 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.20.1"
+ ".": "0.21.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index a117e167..1de0d3c4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.20.1"
+version = "0.21.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 5feb757f..16b3a101 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.20.1" # x-release-please-version
+__version__ = "0.21.0" # x-release-please-version
From c974da4daabbb226067858ee566fd1a7ee4f6386 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 24 Jul 2025 11:26:36 +0000
Subject: [PATCH 224/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 6c0eef6a..11af3564 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-1d55ef57d17d780e3863936f62874ea7f378ed78a30edc0eb4119d9cb3009dc6.yml
-openapi_spec_hash: 1c5f41ebd04ef8a89bc257e11d7cb122
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7540f6a4e50d3960b0ac9b1c6970ea361a55117d00564620aae9422ae036a4c6.yml
+openapi_spec_hash: aee381f66546ba66b89f3ad143dcf2d6
config_hash: 810d9712d3d0d6a1f50d71a25511d8a7
From a624f9238907f7bccef7dfe1f8c62f5680f54b0a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 25 Jul 2025 05:31:44 +0000
Subject: [PATCH 225/375] chore(project): add settings file for vscode
---
.gitignore | 1 -
.vscode/settings.json | 3 +++
2 files changed, 3 insertions(+), 1 deletion(-)
create mode 100644 .vscode/settings.json
diff --git a/.gitignore b/.gitignore
index 87797408..95ceb189 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
.prism.log
-.vscode
_dev
__pycache__
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..5b010307
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "python.analysis.importFormat": "relative",
+}
From e170547396b94bdc467c4e70581c0f8deae3ad58 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 31 Jul 2025 07:26:35 +0000
Subject: [PATCH 226/375] feat(client): support file upload requests
---
src/mixedbread/_base_client.py | 5 ++++-
src/mixedbread/_files.py | 8 ++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 40ee1387..d8edf54b 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -532,7 +532,10 @@ def _build_request(
is_body_allowed = options.method.lower() != "get"
if is_body_allowed:
- kwargs["json"] = json_data if is_given(json_data) else None
+ if isinstance(json_data, bytes):
+ kwargs["content"] = json_data
+ else:
+ kwargs["json"] = json_data if is_given(json_data) else None
kwargs["files"] = files
else:
headers.pop("Content-Type", None)
diff --git a/src/mixedbread/_files.py b/src/mixedbread/_files.py
index 3bef9c34..729ea489 100644
--- a/src/mixedbread/_files.py
+++ b/src/mixedbread/_files.py
@@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes:
return file
if is_tuple_t(file):
- return (file[0], _read_file_content(file[1]), *file[2:])
+ return (file[0], read_file_content(file[1]), *file[2:])
raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
-def _read_file_content(file: FileContent) -> HttpxFileContent:
+def read_file_content(file: FileContent) -> HttpxFileContent:
if isinstance(file, os.PathLike):
return pathlib.Path(file).read_bytes()
return file
@@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes:
return file
if is_tuple_t(file):
- return (file[0], await _async_read_file_content(file[1]), *file[2:])
+ return (file[0], await async_read_file_content(file[1]), *file[2:])
raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
-async def _async_read_file_content(file: FileContent) -> HttpxFileContent:
+async def async_read_file_content(file: FileContent) -> HttpxFileContent:
if isinstance(file, os.PathLike):
return await anyio.Path(file).read_bytes()
From 689451d2510cddd9a674e196db878e21e6a13281 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 1 Aug 2025 05:26:52 +0000
Subject: [PATCH 227/375] chore(internal): update examples
---
tests/api_resources/test_vector_stores.py | 156 ++----------------
.../api_resources/vector_stores/test_files.py | 78 +--------
2 files changed, 18 insertions(+), 216 deletions(-)
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 88ab340d..ab5f0c96 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -247,42 +247,9 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -335,42 +302,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -637,42 +571,9 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -725,42 +626,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 6e3bf27e..13922a78 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -255,42 +255,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -568,42 +535,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
From 8efd72a5cfecec8e5c9640175b3690dea4a9ecbe Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 6 Aug 2025 09:08:52 +0000
Subject: [PATCH 228/375] chore(internal): fix ruff target version
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 1de0d3c4..65ab6386 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -159,7 +159,7 @@ reportPrivateUsage = false
[tool.ruff]
line-length = 120
output-format = "grouped"
-target-version = "py37"
+target-version = "py38"
[tool.ruff.format]
docstring-code-format = true
From 55ec9b0236bfc819133faea33cfb65512a7f705d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 6 Aug 2025 12:27:16 +0000
Subject: [PATCH 229/375] feat(api): api update
---
.stats.yml | 4 +-
api.md | 2 +-
.../resources/vector_stores/files.py | 8 +
src/mixedbread/types/__init__.py | 13 +-
src/mixedbread/types/shared/__init__.py | 1 -
src/mixedbread/types/shared/search_filter.py | 38 -----
.../types/shared_params/__init__.py | 1 -
.../types/shared_params/search_filter.py | 37 -----
.../vector_store_question_answering_params.py | 62 ++++++-
.../types/vector_store_search_params.py | 58 ++++++-
.../types/vector_stores/file_list_params.py | 75 ++++++++-
.../types/vector_stores/file_search_params.py | 63 ++++++-
tests/api_resources/test_vector_stores.py | 156 ++++++++++++++++--
.../api_resources/vector_stores/test_files.py | 154 ++++++++++++++++-
14 files changed, 543 insertions(+), 129 deletions(-)
delete mode 100644 src/mixedbread/types/shared/search_filter.py
delete mode 100644 src/mixedbread/types/shared_params/search_filter.py
diff --git a/.stats.yml b/.stats.yml
index 11af3564..5b9fef09 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-7540f6a4e50d3960b0ac9b1c6970ea361a55117d00564620aae9422ae036a4c6.yml
-openapi_spec_hash: aee381f66546ba66b89f3ad143dcf2d6
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7f00f72937a82d3184ef21bc91c848984d4c3bacf910a671ac2c5736025d862c.yml
+openapi_spec_hash: 5c59e45eebcbb99551e308b194ec6243
config_hash: 810d9712d3d0d6a1f50d71a25511d8a7
diff --git a/api.md b/api.md
index 257f5d28..39630d7d 100644
--- a/api.md
+++ b/api.md
@@ -1,7 +1,7 @@
# Shared Types
```python
-from mixedbread.types import SearchFilter, SearchFilterCondition, Usage
+from mixedbread.types import SearchFilterCondition, Usage
```
# Mixedbread
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 3623c1f5..3c07213b 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -169,6 +169,7 @@ def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
@@ -199,6 +200,8 @@ def list(
statuses: Status to filter by
+ metadata_filter: Metadata filter to apply to the query
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -226,6 +229,7 @@ def list(
"before": before,
"include_total": include_total,
"statuses": statuses,
+ "metadata_filter": metadata_filter,
},
file_list_params.FileListParams,
),
@@ -501,6 +505,7 @@ def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
@@ -531,6 +536,8 @@ def list(
statuses: Status to filter by
+ metadata_filter: Metadata filter to apply to the query
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -558,6 +565,7 @@ def list(
"before": before,
"include_total": include_total,
"statuses": statuses,
+ "metadata_filter": metadata_filter,
},
file_list_params.FileListParams,
),
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index aca3e061..f548be8f 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,9 +2,7 @@
from __future__ import annotations
-from . import shared
-from .. import _compat
-from .shared import Usage as Usage, SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
+from .shared import Usage as Usage, SearchFilterCondition as SearchFilterCondition
from .api_key import APIKey as APIKey
from .embedding import Embedding as Embedding
from .data_source import DataSource as DataSource
@@ -58,12 +56,3 @@
from .vector_store_question_answering_response import (
VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
)
-
-# Rebuild cyclical models only after all modules are imported.
-# This ensures that, when building the deferred (due to cyclical references) model schema,
-# Pydantic can resolve the necessary references.
-# See: https://github.com/pydantic/pydantic/issues/11250 for more context.
-if _compat.PYDANTIC_V2:
- shared.search_filter.SearchFilter.model_rebuild(_parent_namespace_depth=0)
-else:
- shared.search_filter.SearchFilter.update_forward_refs() # type: ignore
diff --git a/src/mixedbread/types/shared/__init__.py b/src/mixedbread/types/shared/__init__.py
index 66d5dcf9..bdd92589 100644
--- a/src/mixedbread/types/shared/__init__.py
+++ b/src/mixedbread/types/shared/__init__.py
@@ -1,5 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .usage import Usage as Usage
-from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py
deleted file mode 100644
index 579ae162..00000000
--- a/src/mixedbread/types/shared/search_filter.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import TYPE_CHECKING, List, Union, Optional
-from typing_extensions import TypeAlias, TypeAliasType
-
-from ..._compat import PYDANTIC_V2
-from ..._models import BaseModel
-from .search_filter_condition import SearchFilterCondition
-
-__all__ = ["SearchFilter", "All", "Any", "NoneType"]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
-else:
- All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
-else:
- Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
-else:
- NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-
-class SearchFilter(BaseModel):
- all: Optional[List[All]] = None
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[List[Any]] = None
- """List of conditions or filters to be ORed together"""
-
- none: Optional[List[NoneType]] = None
- """List of conditions or filters to be NOTed"""
diff --git a/src/mixedbread/types/shared_params/__init__.py b/src/mixedbread/types/shared_params/__init__.py
index c91e740d..69d169c2 100644
--- a/src/mixedbread/types/shared_params/__init__.py
+++ b/src/mixedbread/types/shared_params/__init__.py
@@ -1,4 +1,3 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared_params/search_filter.py b/src/mixedbread/types/shared_params/search_filter.py
deleted file mode 100644
index a952a27a..00000000
--- a/src/mixedbread/types/shared_params/search_filter.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import TYPE_CHECKING, Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict, TypeAliasType
-
-from ..._compat import PYDANTIC_V2
-from .search_filter_condition import SearchFilterCondition
-
-__all__ = ["SearchFilter", "All", "Any", "NoneType"]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
-else:
- All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
-else:
- Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
-else:
- NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-
-class SearchFilter(TypedDict, total=False):
- all: Optional[Iterable[All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[NoneType]]
- """List of conditions or filters to be NOTed"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index b34189b3..6a21ffca 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -8,7 +8,20 @@
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
+__all__ = [
+ "VectorStoreQuestionAnsweringParams",
+ "Filters",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "FiltersUnionMember2",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "QaOptions",
+]
class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
@@ -42,9 +55,49 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
"""Question answering configuration options"""
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2: TypeAlias = Union[
+ FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
+]
+
+Filters: TypeAlias = Union[
+ FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
+]
class QaOptions(TypedDict, total=False):
@@ -53,6 +106,3 @@ class QaOptions(TypedDict, total=False):
multimodal: bool
"""Whether to use multimodal context"""
-
-
-from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 48fc21e1..84eed57b 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -8,7 +8,19 @@
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
+__all__ = [
+ "VectorStoreSearchParams",
+ "Filters",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "FiltersUnionMember2",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+]
class VectorStoreSearchParams(TypedDict, total=False):
@@ -33,8 +45,46 @@ class VectorStoreSearchParams(TypedDict, total=False):
"""Search configuration options"""
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-from .shared_params.search_filter import SearchFilter
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2: TypeAlias = Union[
+ FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
+]
+
+Filters: TypeAlias = Union[
+ FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
+]
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
index 49fe0c08..3041af3a 100644
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -2,12 +2,25 @@
from __future__ import annotations
-from typing import List, Optional
-from typing_extensions import TypedDict
+from typing import List, Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict
from .vector_store_file_status import VectorStoreFileStatus
+from ..shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["FileListParams"]
+__all__ = [
+ "FileListParams",
+ "MetadataFilter",
+ "MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2",
+ "MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2All",
+ "MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2Any",
+ "MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2None",
+ "MetadataFilterUnionMember2",
+ "MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2",
+ "MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2All",
+ "MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2Any",
+ "MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2None",
+]
class FileListParams(TypedDict, total=False):
@@ -31,3 +44,59 @@ class FileListParams(TypedDict, total=False):
statuses: Optional[List[VectorStoreFileStatus]]
"""Status to filter by"""
+
+ metadata_filter: Optional[MetadataFilter]
+ """Metadata filter to apply to the query"""
+
+
+MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2All: TypeAlias = Union[SearchFilterCondition, object]
+
+MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2Any: TypeAlias = Union[SearchFilterCondition, object]
+
+MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2(TypedDict, total=False):
+ all: Optional[Iterable[MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2None]]
+ """List of conditions or filters to be NOTed"""
+
+
+MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2All: TypeAlias = Union[
+ SearchFilterCondition, object
+]
+
+MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2Any: TypeAlias = Union[
+ SearchFilterCondition, object
+]
+
+MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2None: TypeAlias = Union[
+ SearchFilterCondition, object
+]
+
+
+class MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2(TypedDict, total=False):
+ all: Optional[Iterable[MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2None]]
+ """List of conditions or filters to be NOTed"""
+
+
+MetadataFilterUnionMember2: TypeAlias = Union[
+ MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2, SearchFilterCondition
+]
+
+MetadataFilter: TypeAlias = Union[
+ MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2,
+ SearchFilterCondition,
+ Iterable[MetadataFilterUnionMember2],
+]
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 3c289bc1..8954e6e5 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -8,7 +8,21 @@
from .rerank_config_param import RerankConfigParam
from ..shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions", "SearchOptionsRerank"]
+__all__ = [
+ "FileSearchParams",
+ "Filters",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "FiltersUnionMember2",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "SearchOptions",
+ "SearchOptionsRerank",
+]
class FileSearchParams(TypedDict, total=False):
@@ -33,9 +47,49 @@ class FileSearchParams(TypedDict, total=False):
"""Search configuration options"""
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2: TypeAlias = Union[
+ FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
+]
+
+Filters: TypeAlias = Union[
+ FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
+]
SearchOptionsRerank: TypeAlias = Union[bool, RerankConfigParam]
@@ -61,6 +115,3 @@ class SearchOptions(TypedDict, total=False):
apply_search_rules: bool
"""Whether to apply search rules"""
-
-
-from ..shared_params.search_filter import SearchFilter
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index ab5f0c96..88ab340d 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -247,9 +247,42 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -302,9 +335,42 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -571,9 +637,42 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -626,9 +725,42 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 13922a78..17014537 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -154,6 +154,44 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
statuses=["pending", "in_progress"],
+ metadata_filter={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
)
assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
@@ -255,9 +293,42 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -434,6 +505,44 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
statuses=["pending", "in_progress"],
+ metadata_filter={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
)
assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
@@ -535,9 +644,42 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
From f651323cb8d3659a521b1f5c9d7e1a23eb1b0136 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 7 Aug 2025 03:29:46 +0000
Subject: [PATCH 230/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 86b0e83d..cb9d2541 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.21.0"
+ ".": "0.22.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 65ab6386..fc70b2dc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.21.0"
+version = "0.22.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 16b3a101..fc182220 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.21.0" # x-release-please-version
+__version__ = "0.22.0" # x-release-please-version
From cf4cafab7cdf97b33a79eafe6e3e5093736facf5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 9 Aug 2025 05:19:38 +0000
Subject: [PATCH 231/375] chore: update @stainless-api/prism-cli to v5.15.0
---
scripts/mock | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/mock b/scripts/mock
index d2814ae6..0b28f6ea 100755
--- a/scripts/mock
+++ b/scripts/mock
@@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}"
# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
- npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log &
+ npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
# Wait for server to come online
echo -n "Waiting for server"
@@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then
echo
else
- npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL"
+ npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
fi
From 83ae11793390753eb8b26172494eb313a0e849e4 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 9 Aug 2025 05:26:00 +0000
Subject: [PATCH 232/375] chore(internal): update comment in script
---
scripts/test | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/test b/scripts/test
index 2b878456..dbeda2d2 100755
--- a/scripts/test
+++ b/scripts/test
@@ -43,7 +43,7 @@ elif ! prism_is_running ; then
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
- echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}"
+ echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo
exit 1
From 2b0e91b0981a6f6f3c413de109c45ead10cc4a74 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 9 Aug 2025 18:27:20 +0000
Subject: [PATCH 233/375] feat(api): api update
---
.stats.yml | 4 +-
api.md | 2 +-
.../resources/vector_stores/files.py | 8 -
src/mixedbread/types/__init__.py | 13 +-
src/mixedbread/types/shared/__init__.py | 1 +
src/mixedbread/types/shared/search_filter.py | 38 +++++
.../types/shared_params/__init__.py | 1 +
.../types/shared_params/search_filter.py | 37 +++++
.../vector_store_question_answering_params.py | 62 +------
.../types/vector_store_search_params.py | 58 +------
.../types/vector_stores/file_list_params.py | 75 +--------
.../types/vector_stores/file_search_params.py | 63 +------
tests/api_resources/test_vector_stores.py | 156 ++----------------
.../api_resources/vector_stores/test_files.py | 154 +----------------
14 files changed, 129 insertions(+), 543 deletions(-)
create mode 100644 src/mixedbread/types/shared/search_filter.py
create mode 100644 src/mixedbread/types/shared_params/search_filter.py
diff --git a/.stats.yml b/.stats.yml
index 5b9fef09..c7586392 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-7f00f72937a82d3184ef21bc91c848984d4c3bacf910a671ac2c5736025d862c.yml
-openapi_spec_hash: 5c59e45eebcbb99551e308b194ec6243
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-4983c57f5143aaeadfbb4af35595570e613035ae500ff1597fdf600cc2a48959.yml
+openapi_spec_hash: ecc0a6cfe61c3c959d034d094f36befe
config_hash: 810d9712d3d0d6a1f50d71a25511d8a7
diff --git a/api.md b/api.md
index 39630d7d..257f5d28 100644
--- a/api.md
+++ b/api.md
@@ -1,7 +1,7 @@
# Shared Types
```python
-from mixedbread.types import SearchFilterCondition, Usage
+from mixedbread.types import SearchFilter, SearchFilterCondition, Usage
```
# Mixedbread
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 3c07213b..3623c1f5 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -169,7 +169,6 @@ def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
- metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
@@ -200,8 +199,6 @@ def list(
statuses: Status to filter by
- metadata_filter: Metadata filter to apply to the query
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -229,7 +226,6 @@ def list(
"before": before,
"include_total": include_total,
"statuses": statuses,
- "metadata_filter": metadata_filter,
},
file_list_params.FileListParams,
),
@@ -505,7 +501,6 @@ def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
- metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
@@ -536,8 +531,6 @@ def list(
statuses: Status to filter by
- metadata_filter: Metadata filter to apply to the query
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -565,7 +558,6 @@ def list(
"before": before,
"include_total": include_total,
"statuses": statuses,
- "metadata_filter": metadata_filter,
},
file_list_params.FileListParams,
),
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index f548be8f..aca3e061 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,7 +2,9 @@
from __future__ import annotations
-from .shared import Usage as Usage, SearchFilterCondition as SearchFilterCondition
+from . import shared
+from .. import _compat
+from .shared import Usage as Usage, SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
from .api_key import APIKey as APIKey
from .embedding import Embedding as Embedding
from .data_source import DataSource as DataSource
@@ -56,3 +58,12 @@
from .vector_store_question_answering_response import (
VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
)
+
+# Rebuild cyclical models only after all modules are imported.
+# This ensures that, when building the deferred (due to cyclical references) model schema,
+# Pydantic can resolve the necessary references.
+# See: https://github.com/pydantic/pydantic/issues/11250 for more context.
+if _compat.PYDANTIC_V2:
+ shared.search_filter.SearchFilter.model_rebuild(_parent_namespace_depth=0)
+else:
+ shared.search_filter.SearchFilter.update_forward_refs() # type: ignore
diff --git a/src/mixedbread/types/shared/__init__.py b/src/mixedbread/types/shared/__init__.py
index bdd92589..66d5dcf9 100644
--- a/src/mixedbread/types/shared/__init__.py
+++ b/src/mixedbread/types/shared/__init__.py
@@ -1,4 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .usage import Usage as Usage
+from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py
new file mode 100644
index 00000000..579ae162
--- /dev/null
+++ b/src/mixedbread/types/shared/search_filter.py
@@ -0,0 +1,38 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, List, Union, Optional
+from typing_extensions import TypeAlias, TypeAliasType
+
+from ..._compat import PYDANTIC_V2
+from ..._models import BaseModel
+from .search_filter_condition import SearchFilterCondition
+
+__all__ = ["SearchFilter", "All", "Any", "NoneType"]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
+else:
+ All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
+else:
+ Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
+else:
+ NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+
+class SearchFilter(BaseModel):
+ all: Optional[List[All]] = None
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[List[Any]] = None
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[List[NoneType]] = None
+ """List of conditions or filters to be NOTed"""
diff --git a/src/mixedbread/types/shared_params/__init__.py b/src/mixedbread/types/shared_params/__init__.py
index 69d169c2..c91e740d 100644
--- a/src/mixedbread/types/shared_params/__init__.py
+++ b/src/mixedbread/types/shared_params/__init__.py
@@ -1,3 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared_params/search_filter.py b/src/mixedbread/types/shared_params/search_filter.py
new file mode 100644
index 00000000..a952a27a
--- /dev/null
+++ b/src/mixedbread/types/shared_params/search_filter.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict, TypeAliasType
+
+from ..._compat import PYDANTIC_V2
+from .search_filter_condition import SearchFilterCondition
+
+__all__ = ["SearchFilter", "All", "Any", "NoneType"]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
+else:
+ All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
+else:
+ Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
+else:
+ NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+
+class SearchFilter(TypedDict, total=False):
+ all: Optional[Iterable[All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[NoneType]]
+ """List of conditions or filters to be NOTed"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index 6a21ffca..b34189b3 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -8,20 +8,7 @@
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = [
- "VectorStoreQuestionAnsweringParams",
- "Filters",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "FiltersUnionMember2",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "QaOptions",
-]
+__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
@@ -55,49 +42,9 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
"""Question answering configuration options"""
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2: TypeAlias = Union[
- FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
-]
-
-Filters: TypeAlias = Union[
- FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
-]
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
class QaOptions(TypedDict, total=False):
@@ -106,3 +53,6 @@ class QaOptions(TypedDict, total=False):
multimodal: bool
"""Whether to use multimodal context"""
+
+
+from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 84eed57b..48fc21e1 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -8,19 +8,7 @@
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = [
- "VectorStoreSearchParams",
- "Filters",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "FiltersUnionMember2",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
-]
+__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
class VectorStoreSearchParams(TypedDict, total=False):
@@ -45,46 +33,8 @@ class VectorStoreSearchParams(TypedDict, total=False):
"""Search configuration options"""
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2: TypeAlias = Union[
- FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
-]
-
-Filters: TypeAlias = Union[
- FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
-]
+from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
index 3041af3a..49fe0c08 100644
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -2,25 +2,12 @@
from __future__ import annotations
-from typing import List, Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict
+from typing import List, Optional
+from typing_extensions import TypedDict
from .vector_store_file_status import VectorStoreFileStatus
-from ..shared_params.search_filter_condition import SearchFilterCondition
-__all__ = [
- "FileListParams",
- "MetadataFilter",
- "MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2",
- "MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2All",
- "MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2Any",
- "MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2None",
- "MetadataFilterUnionMember2",
- "MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2",
- "MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2All",
- "MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2Any",
- "MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2None",
-]
+__all__ = ["FileListParams"]
class FileListParams(TypedDict, total=False):
@@ -44,59 +31,3 @@ class FileListParams(TypedDict, total=False):
statuses: Optional[List[VectorStoreFileStatus]]
"""Status to filter by"""
-
- metadata_filter: Optional[MetadataFilter]
- """Metadata filter to apply to the query"""
-
-
-MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2All: TypeAlias = Union[SearchFilterCondition, object]
-
-MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2Any: TypeAlias = Union[SearchFilterCondition, object]
-
-MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2(TypedDict, total=False):
- all: Optional[Iterable[MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2None]]
- """List of conditions or filters to be NOTed"""
-
-
-MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2All: TypeAlias = Union[
- SearchFilterCondition, object
-]
-
-MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2Any: TypeAlias = Union[
- SearchFilterCondition, object
-]
-
-MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2None: TypeAlias = Union[
- SearchFilterCondition, object
-]
-
-
-class MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2(TypedDict, total=False):
- all: Optional[Iterable[MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2None]]
- """List of conditions or filters to be NOTed"""
-
-
-MetadataFilterUnionMember2: TypeAlias = Union[
- MetadataFilterUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter2, SearchFilterCondition
-]
-
-MetadataFilter: TypeAlias = Union[
- MetadataFilterMxbaiOmniCoreVectorStoreModelsSearchFilter2,
- SearchFilterCondition,
- Iterable[MetadataFilterUnionMember2],
-]
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 8954e6e5..3c289bc1 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -8,21 +8,7 @@
from .rerank_config_param import RerankConfigParam
from ..shared_params.search_filter_condition import SearchFilterCondition
-__all__ = [
- "FileSearchParams",
- "Filters",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "FiltersUnionMember2",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "SearchOptions",
- "SearchOptionsRerank",
-]
+__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions", "SearchOptionsRerank"]
class FileSearchParams(TypedDict, total=False):
@@ -47,49 +33,9 @@ class FileSearchParams(TypedDict, total=False):
"""Search configuration options"""
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2: TypeAlias = Union[
- FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
-]
-
-Filters: TypeAlias = Union[
- FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
-]
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
SearchOptionsRerank: TypeAlias = Union[bool, RerankConfigParam]
@@ -115,3 +61,6 @@ class SearchOptions(TypedDict, total=False):
apply_search_rules: bool
"""Whether to apply search rules"""
+
+
+from ..shared_params.search_filter import SearchFilter
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 88ab340d..ab5f0c96 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -247,42 +247,9 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -335,42 +302,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -637,42 +571,9 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -725,42 +626,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 17014537..13922a78 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -154,44 +154,6 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
statuses=["pending", "in_progress"],
- metadata_filter={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
)
assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
@@ -293,42 +255,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -505,44 +434,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
statuses=["pending", "in_progress"],
- metadata_filter={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
)
assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
@@ -644,42 +535,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
From b3f318742bf64fca49d89f09c78467b3c014a324 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 9 Aug 2025 18:29:08 +0000
Subject: [PATCH 234/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index cb9d2541..3f63a672 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.22.0"
+ ".": "0.22.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index fc70b2dc..14fac4d6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.22.0"
+version = "0.22.1"
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 fc182220..fc0f2056 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.22.0" # x-release-please-version
+__version__ = "0.22.1" # x-release-please-version
From 2a04d06b9c0af4d30797fd8b5fdf72fbd3bd9a0f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 07:35:05 +0000
Subject: [PATCH 235/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
api.md | 3 +-
.../resources/vector_stores/files.py | 90 +++++++++----------
.../types/vector_stores/__init__.py | 1 +
.../types/vector_stores/file_list_params.py | 17 +++-
.../types/vector_stores/file_list_response.py | 69 ++++++++++++++
.../api_resources/vector_stores/test_files.py | 32 ++++---
7 files changed, 153 insertions(+), 61 deletions(-)
create mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
diff --git a/.stats.yml b/.stats.yml
index c7586392..33d7691d 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-4983c57f5143aaeadfbb4af35595570e613035ae500ff1597fdf600cc2a48959.yml
openapi_spec_hash: ecc0a6cfe61c3c959d034d094f36befe
-config_hash: 810d9712d3d0d6a1f50d71a25511d8a7
+config_hash: ac27678c24558b71ee39b3db54fa12da
diff --git a/api.md b/api.md
index 257f5d28..f251791d 100644
--- a/api.md
+++ b/api.md
@@ -63,6 +63,7 @@ from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -72,7 +73,7 @@ Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier, \*\*params) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> SyncCursor[VectorStoreFile]
+- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 3623c1f5..af08e042 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -16,10 +16,10 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...pagination import SyncCursor, AsyncCursor
-from ..._base_client import AsyncPaginator, make_request_options
+from ..._base_client import make_request_options
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_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
@@ -169,18 +169,19 @@ def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> SyncCursor[VectorStoreFile]:
+ ) -> FileListResponse:
"""
- List files indexed in a vector store with pagination.
+ List files indexed in a vector store with pagination and metadata filter.
Args: vector_store_identifier: The ID or name of the vector store pagination:
- Pagination parameters
+ Pagination parameters and metadata filter
Returns: VectorStoreFileListResponse: Paginated list of vector store files
@@ -199,6 +200,8 @@ def list(
statuses: Status to filter by
+ metadata_filter: Metadata filter to apply to the query
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -211,26 +214,23 @@ def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return self._get_api_list(
- f"/v1/vector_stores/{vector_store_identifier}/files",
- page=SyncCursor[VectorStoreFile],
+ return self._post(
+ f"/v1/vector_stores/{vector_store_identifier}/files/list",
+ body=maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "statuses": statuses,
+ "metadata_filter": metadata_filter,
+ },
+ file_list_params.FileListParams,
+ ),
options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "statuses": statuses,
- },
- file_list_params.FileListParams,
- ),
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- model=VectorStoreFile,
+ cast_to=FileListResponse,
)
def delete(
@@ -492,7 +492,7 @@ async def retrieve(
cast_to=VectorStoreFile,
)
- def list(
+ async def list(
self,
vector_store_identifier: str,
*,
@@ -501,18 +501,19 @@ def list(
before: Optional[str] | NotGiven = NOT_GIVEN,
include_total: bool | NotGiven = NOT_GIVEN,
statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> AsyncPaginator[VectorStoreFile, AsyncCursor[VectorStoreFile]]:
+ ) -> FileListResponse:
"""
- List files indexed in a vector store with pagination.
+ List files indexed in a vector store with pagination and metadata filter.
Args: vector_store_identifier: The ID or name of the vector store pagination:
- Pagination parameters
+ Pagination parameters and metadata filter
Returns: VectorStoreFileListResponse: Paginated list of vector store files
@@ -531,6 +532,8 @@ def list(
statuses: Status to filter by
+ metadata_filter: Metadata filter to apply to the query
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -543,26 +546,23 @@ def list(
raise ValueError(
f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
)
- return self._get_api_list(
- f"/v1/vector_stores/{vector_store_identifier}/files",
- page=AsyncCursor[VectorStoreFile],
+ return await self._post(
+ f"/v1/vector_stores/{vector_store_identifier}/files/list",
+ body=await async_maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "statuses": statuses,
+ "metadata_filter": metadata_filter,
+ },
+ file_list_params.FileListParams,
+ ),
options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "statuses": statuses,
- },
- file_list_params.FileListParams,
- ),
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- model=VectorStoreFile,
+ cast_to=FileListResponse,
)
async def delete(
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index 6919f613..dcfaa05b 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -5,6 +5,7 @@
from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
+from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
index 49fe0c08..a4ac03c8 100644
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -2,12 +2,13 @@
from __future__ import annotations
-from typing import List, Optional
-from typing_extensions import TypedDict
+from typing import List, Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict
from .vector_store_file_status import VectorStoreFileStatus
+from ..shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["FileListParams"]
+__all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"]
class FileListParams(TypedDict, total=False):
@@ -31,3 +32,13 @@ class FileListParams(TypedDict, total=False):
statuses: Optional[List[VectorStoreFileStatus]]
"""Status to filter by"""
+
+ metadata_filter: Optional[MetadataFilter]
+ """Metadata filter to apply to the query"""
+
+
+MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+MetadataFilter: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[MetadataFilterUnionMember2]]
+
+from ..shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
new file mode 100644
index 00000000..252d1c93
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_list_response.py
@@ -0,0 +1,69 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+from .vector_store_file import VectorStoreFile
+
+__all__ = ["FileListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class FileListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[VectorStoreFile]
+ """The list of vector store files"""
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 13922a78..15a1c34b 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -9,9 +9,9 @@
from mixedbread import Mixedbread, AsyncMixedbread
from tests.utils import assert_matches_type
-from mixedbread.pagination import SyncCursor, AsyncCursor
from mixedbread.types.vector_stores import (
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -143,7 +143,7 @@ def test_method_list(self, client: Mixedbread) -> None:
file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
@@ -153,9 +153,14 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
- statuses=["pending", "in_progress"],
+ statuses=["pending"],
+ metadata_filter={
+ "all": [],
+ "any": [],
+ "none": [],
+ },
)
- assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
@@ -166,7 +171,7 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
@@ -177,7 +182,7 @@ def test_streaming_response_list(self, client: Mixedbread) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = response.parse()
- assert_matches_type(SyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -423,7 +428,7 @@ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
@@ -433,9 +438,14 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
include_total=False,
- statuses=["pending", "in_progress"],
+ statuses=["pending"],
+ metadata_filter={
+ "all": [],
+ "any": [],
+ "none": [],
+ },
)
- assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -446,7 +456,7 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
@@ -457,7 +467,7 @@ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
file = await response.parse()
- assert_matches_type(AsyncCursor[VectorStoreFile], file, path=["response"])
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
From 0db6fdbeca43e71f0c7659d4ffbc4bd69988057d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 07:36:59 +0000
Subject: [PATCH 236/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3f63a672..7f3f5c84 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.22.1"
+ ".": "0.23.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 14fac4d6..a3533921 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.22.1"
+version = "0.23.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 fc0f2056..4927e510 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.22.1" # x-release-please-version
+__version__ = "0.23.0" # x-release-please-version
From e31b7935bf3095a3d48b7a9d5a9a6d286a565695 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 10:27:24 +0000
Subject: [PATCH 237/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 33d7691d..73df6b78 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-4983c57f5143aaeadfbb4af35595570e613035ae500ff1597fdf600cc2a48959.yml
-openapi_spec_hash: ecc0a6cfe61c3c959d034d094f36befe
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-4129a5f260b36ed95efdc244d3fbe3d9378bad5fedea27db5cf8f5b082e80f41.yml
+openapi_spec_hash: 7265c7ce896e64900cdce5c1a093d506
config_hash: ac27678c24558b71ee39b3db54fa12da
From 01a63a4b1e416241946720c26dbd84768f24f8f8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 13:27:26 +0000
Subject: [PATCH 238/375] feat(api): api update
---
.stats.yml | 6 +-
api.md | 4 +-
.../resources/vector_stores/files.py | 162 +--------------
src/mixedbread/types/__init__.py | 13 +-
src/mixedbread/types/shared/__init__.py | 1 -
src/mixedbread/types/shared/search_filter.py | 38 ----
.../types/shared_params/__init__.py | 1 -
.../types/shared_params/search_filter.py | 37 ----
.../vector_store_question_answering_params.py | 62 +++++-
.../types/vector_store_search_params.py | 58 +++++-
.../types/vector_stores/__init__.py | 2 -
.../types/vector_stores/file_list_params.py | 44 ----
.../types/vector_stores/file_list_response.py | 69 -------
.../types/vector_stores/file_search_params.py | 63 +++++-
tests/api_resources/test_vector_stores.py | 156 ++++++++++++--
.../api_resources/vector_stores/test_files.py | 193 +++++++-----------
16 files changed, 389 insertions(+), 520 deletions(-)
delete mode 100644 src/mixedbread/types/shared/search_filter.py
delete mode 100644 src/mixedbread/types/shared_params/search_filter.py
delete mode 100644 src/mixedbread/types/vector_stores/file_list_params.py
delete mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
diff --git a/.stats.yml b/.stats.yml
index 73df6b78..b9d7aea4 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-4129a5f260b36ed95efdc244d3fbe3d9378bad5fedea27db5cf8f5b082e80f41.yml
-openapi_spec_hash: 7265c7ce896e64900cdce5c1a093d506
+configured_endpoints: 48
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7f00f72937a82d3184ef21bc91c848984d4c3bacf910a671ac2c5736025d862c.yml
+openapi_spec_hash: 5c59e45eebcbb99551e308b194ec6243
config_hash: ac27678c24558b71ee39b3db54fa12da
diff --git a/api.md b/api.md
index f251791d..0507d2b5 100644
--- a/api.md
+++ b/api.md
@@ -1,7 +1,7 @@
# Shared Types
```python
-from mixedbread.types import SearchFilter, SearchFilterCondition, Usage
+from mixedbread.types import SearchFilterCondition, Usage
```
# Mixedbread
@@ -63,7 +63,6 @@ from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
- FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -73,7 +72,6 @@ Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier, \*\*params) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index af08e042..f23b1afc 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -17,12 +17,10 @@
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
-from ...types.vector_stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
+from ...types.vector_stores import file_create_params, file_search_params, file_retrieve_params
from ...types.vector_stores.vector_store_file import VectorStoreFile
-from ...types.vector_stores.file_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
-from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -160,79 +158,6 @@ def retrieve(
cast_to=VectorStoreFile,
)
- def list(
- self,
- vector_store_identifier: str,
- *,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
- metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
- """
- List files indexed in a vector store with pagination and metadata filter.
-
- Args: vector_store_identifier: The ID or name of the vector store pagination:
- Pagination parameters and metadata filter
-
- Returns: VectorStoreFileListResponse: Paginated list of vector store files
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- statuses: Status to filter by
-
- metadata_filter: Metadata filter to apply to the query
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return self._post(
- f"/v1/vector_stores/{vector_store_identifier}/files/list",
- body=maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "statuses": statuses,
- "metadata_filter": metadata_filter,
- },
- file_list_params.FileListParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileListResponse,
- )
-
def delete(
self,
file_id: str,
@@ -492,79 +417,6 @@ async def retrieve(
cast_to=VectorStoreFile,
)
- async def list(
- self,
- vector_store_identifier: str,
- *,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
- metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
- """
- List files indexed in a vector store with pagination and metadata filter.
-
- Args: vector_store_identifier: The ID or name of the vector store pagination:
- Pagination parameters and metadata filter
-
- Returns: VectorStoreFileListResponse: Paginated list of vector store files
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- statuses: Status to filter by
-
- metadata_filter: Metadata filter to apply to the query
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return await self._post(
- f"/v1/vector_stores/{vector_store_identifier}/files/list",
- body=await async_maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "statuses": statuses,
- "metadata_filter": metadata_filter,
- },
- file_list_params.FileListParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileListResponse,
- )
-
async def delete(
self,
file_id: str,
@@ -699,9 +551,6 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_raw_response_wrapper(
files.retrieve,
)
- self.list = to_raw_response_wrapper(
- files.list,
- )
self.delete = to_raw_response_wrapper(
files.delete,
)
@@ -720,9 +569,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_raw_response_wrapper(
files.retrieve,
)
- self.list = async_to_raw_response_wrapper(
- files.list,
- )
self.delete = async_to_raw_response_wrapper(
files.delete,
)
@@ -741,9 +587,6 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_streamed_response_wrapper(
files.retrieve,
)
- self.list = to_streamed_response_wrapper(
- files.list,
- )
self.delete = to_streamed_response_wrapper(
files.delete,
)
@@ -762,9 +605,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_streamed_response_wrapper(
files.retrieve,
)
- self.list = async_to_streamed_response_wrapper(
- files.list,
- )
self.delete = async_to_streamed_response_wrapper(
files.delete,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index aca3e061..f548be8f 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,9 +2,7 @@
from __future__ import annotations
-from . import shared
-from .. import _compat
-from .shared import Usage as Usage, SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
+from .shared import Usage as Usage, SearchFilterCondition as SearchFilterCondition
from .api_key import APIKey as APIKey
from .embedding import Embedding as Embedding
from .data_source import DataSource as DataSource
@@ -58,12 +56,3 @@
from .vector_store_question_answering_response import (
VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
)
-
-# Rebuild cyclical models only after all modules are imported.
-# This ensures that, when building the deferred (due to cyclical references) model schema,
-# Pydantic can resolve the necessary references.
-# See: https://github.com/pydantic/pydantic/issues/11250 for more context.
-if _compat.PYDANTIC_V2:
- shared.search_filter.SearchFilter.model_rebuild(_parent_namespace_depth=0)
-else:
- shared.search_filter.SearchFilter.update_forward_refs() # type: ignore
diff --git a/src/mixedbread/types/shared/__init__.py b/src/mixedbread/types/shared/__init__.py
index 66d5dcf9..bdd92589 100644
--- a/src/mixedbread/types/shared/__init__.py
+++ b/src/mixedbread/types/shared/__init__.py
@@ -1,5 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .usage import Usage as Usage
-from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py
deleted file mode 100644
index 579ae162..00000000
--- a/src/mixedbread/types/shared/search_filter.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import TYPE_CHECKING, List, Union, Optional
-from typing_extensions import TypeAlias, TypeAliasType
-
-from ..._compat import PYDANTIC_V2
-from ..._models import BaseModel
-from .search_filter_condition import SearchFilterCondition
-
-__all__ = ["SearchFilter", "All", "Any", "NoneType"]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
-else:
- All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
-else:
- Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
-else:
- NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-
-class SearchFilter(BaseModel):
- all: Optional[List[All]] = None
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[List[Any]] = None
- """List of conditions or filters to be ORed together"""
-
- none: Optional[List[NoneType]] = None
- """List of conditions or filters to be NOTed"""
diff --git a/src/mixedbread/types/shared_params/__init__.py b/src/mixedbread/types/shared_params/__init__.py
index c91e740d..69d169c2 100644
--- a/src/mixedbread/types/shared_params/__init__.py
+++ b/src/mixedbread/types/shared_params/__init__.py
@@ -1,4 +1,3 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared_params/search_filter.py b/src/mixedbread/types/shared_params/search_filter.py
deleted file mode 100644
index a952a27a..00000000
--- a/src/mixedbread/types/shared_params/search_filter.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import TYPE_CHECKING, Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict, TypeAliasType
-
-from ..._compat import PYDANTIC_V2
-from .search_filter_condition import SearchFilterCondition
-
-__all__ = ["SearchFilter", "All", "Any", "NoneType"]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
-else:
- All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
-else:
- Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-if TYPE_CHECKING or PYDANTIC_V2:
- NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
-else:
- NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-
-class SearchFilter(TypedDict, total=False):
- all: Optional[Iterable[All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[NoneType]]
- """List of conditions or filters to be NOTed"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index b34189b3..6a21ffca 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -8,7 +8,20 @@
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
+__all__ = [
+ "VectorStoreQuestionAnsweringParams",
+ "Filters",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "FiltersUnionMember2",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "QaOptions",
+]
class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
@@ -42,9 +55,49 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
"""Question answering configuration options"""
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2: TypeAlias = Union[
+ FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
+]
+
+Filters: TypeAlias = Union[
+ FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
+]
class QaOptions(TypedDict, total=False):
@@ -53,6 +106,3 @@ class QaOptions(TypedDict, total=False):
multimodal: bool
"""Whether to use multimodal context"""
-
-
-from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 48fc21e1..84eed57b 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -8,7 +8,19 @@
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
+__all__ = [
+ "VectorStoreSearchParams",
+ "Filters",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "FiltersUnionMember2",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+]
class VectorStoreSearchParams(TypedDict, total=False):
@@ -33,8 +45,46 @@ class VectorStoreSearchParams(TypedDict, total=False):
"""Search configuration options"""
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-from .shared_params.search_filter import SearchFilter
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2: TypeAlias = Union[
+ FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
+]
+
+Filters: TypeAlias = Union[
+ FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
+]
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index dcfaa05b..a75412b9 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -2,10 +2,8 @@
from __future__ import annotations
-from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
-from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
deleted file mode 100644
index a4ac03c8..00000000
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import List, Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict
-
-from .vector_store_file_status import VectorStoreFileStatus
-from ..shared_params.search_filter_condition import SearchFilterCondition
-
-__all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"]
-
-
-class FileListParams(TypedDict, total=False):
- limit: int
- """Maximum number of items to return per page (1-100)"""
-
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
-
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
-
- include_total: bool
- """Whether to include total count in response (expensive operation)"""
-
- statuses: Optional[List[VectorStoreFileStatus]]
- """Status to filter by"""
-
- metadata_filter: Optional[MetadataFilter]
- """Metadata filter to apply to the query"""
-
-
-MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-MetadataFilter: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[MetadataFilterUnionMember2]]
-
-from ..shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
deleted file mode 100644
index 252d1c93..00000000
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .vector_store_file import VectorStoreFile
-
-__all__ = ["FileListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
-
- Use for backward pagination. None if page is empty.
- """
-
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
-
- Use for forward pagination. None if page is empty.
- """
-
- total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
-
-
-class FileListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[VectorStoreFile]
- """The list of vector store files"""
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 3c289bc1..8954e6e5 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -8,7 +8,21 @@
from .rerank_config_param import RerankConfigParam
from ..shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions", "SearchOptionsRerank"]
+__all__ = [
+ "FileSearchParams",
+ "Filters",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "FiltersUnionMember2",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
+ "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
+ "SearchOptions",
+ "SearchOptionsRerank",
+]
class FileSearchParams(TypedDict, total=False):
@@ -33,9 +47,49 @@ class FileSearchParams(TypedDict, total=False):
"""Search configuration options"""
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+
+FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
+
+
+class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
+ all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
+ """List of conditions or filters to be NOTed"""
+
+
+FiltersUnionMember2: TypeAlias = Union[
+ FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
+]
+
+Filters: TypeAlias = Union[
+ FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
+]
SearchOptionsRerank: TypeAlias = Union[bool, RerankConfigParam]
@@ -61,6 +115,3 @@ class SearchOptions(TypedDict, total=False):
apply_search_rules: bool
"""Whether to apply search rules"""
-
-
-from ..shared_params.search_filter import SearchFilter
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index ab5f0c96..88ab340d 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -247,9 +247,42 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -302,9 +335,42 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -571,9 +637,42 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -626,9 +725,42 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 15a1c34b..b24c14c2 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -11,7 +11,6 @@
from tests.utils import assert_matches_type
from mixedbread.types.vector_stores import (
VectorStoreFile,
- FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -138,63 +137,6 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
vector_store_identifier="vector_store_identifier",
)
- @parametrize
- def test_method_list(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- )
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- def test_method_list_with_all_params(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending"],
- metadata_filter={
- "all": [],
- "any": [],
- "none": [],
- },
- )
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- def test_raw_response_list(self, client: Mixedbread) -> None:
- response = client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- def test_streaming_response_list(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.list(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_list(self, client: Mixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="",
- )
-
@parametrize
def test_method_delete(self, client: Mixedbread) -> None:
file = client.vector_stores.files.delete(
@@ -260,9 +202,42 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -423,63 +398,6 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
vector_store_identifier="vector_store_identifier",
)
- @parametrize
- async def test_method_list(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- )
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending"],
- metadata_filter={
- "all": [],
- "any": [],
- "none": [],
- },
- )
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.list(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="",
- )
-
@parametrize
async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.delete(
@@ -545,9 +463,42 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
From 91cb8bed75054048095d906c8ca73f967d36a028 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 13:29:23 +0000
Subject: [PATCH 239/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 7f3f5c84..d2d60a3d 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.23.0"
+ ".": "0.24.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index a3533921..02b76f19 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.23.0"
+version = "0.24.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 4927e510..d3703aed 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.23.0" # x-release-please-version
+__version__ = "0.24.0" # x-release-please-version
From bd80e8e77f734f0ec0742512eb1783385cfbba5a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 13:52:23 +0000
Subject: [PATCH 240/375] feat(api): api update
---
.stats.yml | 6 +-
api.md | 4 +-
.../resources/vector_stores/files.py | 162 ++++++++++++++-
src/mixedbread/types/__init__.py | 13 +-
src/mixedbread/types/shared/__init__.py | 1 +
src/mixedbread/types/shared/search_filter.py | 38 ++++
.../types/shared_params/__init__.py | 1 +
.../types/shared_params/search_filter.py | 37 ++++
.../vector_store_question_answering_params.py | 62 +-----
.../types/vector_store_search_params.py | 58 +-----
.../types/vector_stores/__init__.py | 2 +
.../types/vector_stores/file_list_params.py | 44 ++++
.../types/vector_stores/file_list_response.py | 69 +++++++
.../types/vector_stores/file_search_params.py | 63 +-----
tests/api_resources/test_vector_stores.py | 156 ++------------
.../api_resources/vector_stores/test_files.py | 193 +++++++++++-------
16 files changed, 520 insertions(+), 389 deletions(-)
create mode 100644 src/mixedbread/types/shared/search_filter.py
create mode 100644 src/mixedbread/types/shared_params/search_filter.py
create mode 100644 src/mixedbread/types/vector_stores/file_list_params.py
create mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
diff --git a/.stats.yml b/.stats.yml
index b9d7aea4..33d7691d 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 48
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7f00f72937a82d3184ef21bc91c848984d4c3bacf910a671ac2c5736025d862c.yml
-openapi_spec_hash: 5c59e45eebcbb99551e308b194ec6243
+configured_endpoints: 49
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-4983c57f5143aaeadfbb4af35595570e613035ae500ff1597fdf600cc2a48959.yml
+openapi_spec_hash: ecc0a6cfe61c3c959d034d094f36befe
config_hash: ac27678c24558b71ee39b3db54fa12da
diff --git a/api.md b/api.md
index 0507d2b5..f251791d 100644
--- a/api.md
+++ b/api.md
@@ -1,7 +1,7 @@
# Shared Types
```python
-from mixedbread.types import SearchFilterCondition, Usage
+from mixedbread.types import SearchFilter, SearchFilterCondition, Usage
```
# Mixedbread
@@ -63,6 +63,7 @@ from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -72,6 +73,7 @@ Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier, \*\*params) -> VectorStoreFile
+- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index f23b1afc..af08e042 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -17,10 +17,12 @@
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
-from ...types.vector_stores import file_create_params, file_search_params, file_retrieve_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_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
+from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -158,6 +160,79 @@ def retrieve(
cast_to=VectorStoreFile,
)
+ def list(
+ self,
+ vector_store_identifier: str,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> FileListResponse:
+ """
+ List files indexed in a vector store with pagination and metadata filter.
+
+ Args: vector_store_identifier: The ID or name of the vector store pagination:
+ Pagination parameters and metadata filter
+
+ Returns: VectorStoreFileListResponse: Paginated list of vector store files
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ statuses: Status to filter by
+
+ metadata_filter: Metadata filter to apply to the query
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return self._post(
+ f"/v1/vector_stores/{vector_store_identifier}/files/list",
+ body=maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "statuses": statuses,
+ "metadata_filter": metadata_filter,
+ },
+ file_list_params.FileListParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileListResponse,
+ )
+
def delete(
self,
file_id: str,
@@ -417,6 +492,79 @@ async def retrieve(
cast_to=VectorStoreFile,
)
+ async def list(
+ self,
+ vector_store_identifier: str,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> FileListResponse:
+ """
+ List files indexed in a vector store with pagination and metadata filter.
+
+ Args: vector_store_identifier: The ID or name of the vector store pagination:
+ Pagination parameters and metadata filter
+
+ Returns: VectorStoreFileListResponse: Paginated list of vector store files
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ statuses: Status to filter by
+
+ metadata_filter: Metadata filter to apply to the query
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return await self._post(
+ f"/v1/vector_stores/{vector_store_identifier}/files/list",
+ body=await async_maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "statuses": statuses,
+ "metadata_filter": metadata_filter,
+ },
+ file_list_params.FileListParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileListResponse,
+ )
+
async def delete(
self,
file_id: str,
@@ -551,6 +699,9 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_raw_response_wrapper(
files.retrieve,
)
+ self.list = to_raw_response_wrapper(
+ files.list,
+ )
self.delete = to_raw_response_wrapper(
files.delete,
)
@@ -569,6 +720,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_raw_response_wrapper(
files.retrieve,
)
+ self.list = async_to_raw_response_wrapper(
+ files.list,
+ )
self.delete = async_to_raw_response_wrapper(
files.delete,
)
@@ -587,6 +741,9 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_streamed_response_wrapper(
files.retrieve,
)
+ self.list = to_streamed_response_wrapper(
+ files.list,
+ )
self.delete = to_streamed_response_wrapper(
files.delete,
)
@@ -605,6 +762,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_streamed_response_wrapper(
files.retrieve,
)
+ self.list = async_to_streamed_response_wrapper(
+ files.list,
+ )
self.delete = async_to_streamed_response_wrapper(
files.delete,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index f548be8f..aca3e061 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -2,7 +2,9 @@
from __future__ import annotations
-from .shared import Usage as Usage, SearchFilterCondition as SearchFilterCondition
+from . import shared
+from .. import _compat
+from .shared import Usage as Usage, SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
from .api_key import APIKey as APIKey
from .embedding import Embedding as Embedding
from .data_source import DataSource as DataSource
@@ -56,3 +58,12 @@
from .vector_store_question_answering_response import (
VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
)
+
+# Rebuild cyclical models only after all modules are imported.
+# This ensures that, when building the deferred (due to cyclical references) model schema,
+# Pydantic can resolve the necessary references.
+# See: https://github.com/pydantic/pydantic/issues/11250 for more context.
+if _compat.PYDANTIC_V2:
+ shared.search_filter.SearchFilter.model_rebuild(_parent_namespace_depth=0)
+else:
+ shared.search_filter.SearchFilter.update_forward_refs() # type: ignore
diff --git a/src/mixedbread/types/shared/__init__.py b/src/mixedbread/types/shared/__init__.py
index bdd92589..66d5dcf9 100644
--- a/src/mixedbread/types/shared/__init__.py
+++ b/src/mixedbread/types/shared/__init__.py
@@ -1,4 +1,5 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .usage import Usage as Usage
+from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py
new file mode 100644
index 00000000..579ae162
--- /dev/null
+++ b/src/mixedbread/types/shared/search_filter.py
@@ -0,0 +1,38 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, List, Union, Optional
+from typing_extensions import TypeAlias, TypeAliasType
+
+from ..._compat import PYDANTIC_V2
+from ..._models import BaseModel
+from .search_filter_condition import SearchFilterCondition
+
+__all__ = ["SearchFilter", "All", "Any", "NoneType"]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
+else:
+ All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
+else:
+ Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
+else:
+ NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+
+class SearchFilter(BaseModel):
+ all: Optional[List[All]] = None
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[List[Any]] = None
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[List[NoneType]] = None
+ """List of conditions or filters to be NOTed"""
diff --git a/src/mixedbread/types/shared_params/__init__.py b/src/mixedbread/types/shared_params/__init__.py
index 69d169c2..c91e740d 100644
--- a/src/mixedbread/types/shared_params/__init__.py
+++ b/src/mixedbread/types/shared_params/__init__.py
@@ -1,3 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+from .search_filter import SearchFilter as SearchFilter
from .search_filter_condition import SearchFilterCondition as SearchFilterCondition
diff --git a/src/mixedbread/types/shared_params/search_filter.py b/src/mixedbread/types/shared_params/search_filter.py
new file mode 100644
index 00000000..a952a27a
--- /dev/null
+++ b/src/mixedbread/types/shared_params/search_filter.py
@@ -0,0 +1,37 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict, TypeAliasType
+
+from ..._compat import PYDANTIC_V2
+from .search_filter_condition import SearchFilterCondition
+
+__all__ = ["SearchFilter", "All", "Any", "NoneType"]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
+else:
+ All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
+else:
+ Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+if TYPE_CHECKING or PYDANTIC_V2:
+ NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
+else:
+ NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+
+class SearchFilter(TypedDict, total=False):
+ all: Optional[Iterable[All]]
+ """List of conditions or filters to be ANDed together"""
+
+ any: Optional[Iterable[Any]]
+ """List of conditions or filters to be ORed together"""
+
+ none: Optional[Iterable[NoneType]]
+ """List of conditions or filters to be NOTed"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index 6a21ffca..b34189b3 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -8,20 +8,7 @@
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = [
- "VectorStoreQuestionAnsweringParams",
- "Filters",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "FiltersUnionMember2",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "QaOptions",
-]
+__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
@@ -55,49 +42,9 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
"""Question answering configuration options"""
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2: TypeAlias = Union[
- FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
-]
-
-Filters: TypeAlias = Union[
- FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
-]
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
class QaOptions(TypedDict, total=False):
@@ -106,3 +53,6 @@ class QaOptions(TypedDict, total=False):
multimodal: bool
"""Whether to use multimodal context"""
+
+
+from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 84eed57b..48fc21e1 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -8,19 +8,7 @@
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-__all__ = [
- "VectorStoreSearchParams",
- "Filters",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "FiltersUnionMember2",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
-]
+__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
class VectorStoreSearchParams(TypedDict, total=False):
@@ -45,46 +33,8 @@ class VectorStoreSearchParams(TypedDict, total=False):
"""Search configuration options"""
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2: TypeAlias = Union[
- FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
-]
-
-Filters: TypeAlias = Union[
- FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
-]
+from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index a75412b9..dcfaa05b 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -2,8 +2,10 @@
from __future__ import annotations
+from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
+from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
new file mode 100644
index 00000000..a4ac03c8
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -0,0 +1,44 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict
+
+from .vector_store_file_status import VectorStoreFileStatus
+from ..shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"]
+
+
+class FileListParams(TypedDict, total=False):
+ limit: int
+ """Maximum number of items to return per page (1-100)"""
+
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
+
+ include_total: bool
+ """Whether to include total count in response (expensive operation)"""
+
+ statuses: Optional[List[VectorStoreFileStatus]]
+ """Status to filter by"""
+
+ metadata_filter: Optional[MetadataFilter]
+ """Metadata filter to apply to the query"""
+
+
+MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+MetadataFilter: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[MetadataFilterUnionMember2]]
+
+from ..shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
new file mode 100644
index 00000000..252d1c93
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_list_response.py
@@ -0,0 +1,69 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+from .vector_store_file import VectorStoreFile
+
+__all__ = ["FileListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class FileListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[VectorStoreFile]
+ """The list of vector store files"""
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 8954e6e5..3c289bc1 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -8,21 +8,7 @@
from .rerank_config_param import RerankConfigParam
from ..shared_params.search_filter_condition import SearchFilterCondition
-__all__ = [
- "FileSearchParams",
- "Filters",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "FiltersUnionMember2",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any",
- "FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None",
- "SearchOptions",
- "SearchOptionsRerank",
-]
+__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions", "SearchOptionsRerank"]
class FileSearchParams(TypedDict, total=False):
@@ -47,49 +33,9 @@ class FileSearchParams(TypedDict, total=False):
"""Search configuration options"""
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any: TypeAlias = Union[SearchFilterCondition, object]
-
-FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None: TypeAlias = Union[SearchFilterCondition, object]
-
-
-class FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1(TypedDict, total=False):
- all: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1All]]
- """List of conditions or filters to be ANDed together"""
-
- any: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1Any]]
- """List of conditions or filters to be ORed together"""
-
- none: Optional[Iterable[FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1None]]
- """List of conditions or filters to be NOTed"""
-
-
-FiltersUnionMember2: TypeAlias = Union[
- FiltersUnionMember2MxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition
-]
-
-Filters: TypeAlias = Union[
- FiltersMxbaiOmniCoreVectorStoreModelsSearchFilter1, SearchFilterCondition, Iterable[FiltersUnionMember2]
-]
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
SearchOptionsRerank: TypeAlias = Union[bool, RerankConfigParam]
@@ -115,3 +61,6 @@ class SearchOptions(TypedDict, total=False):
apply_search_rules: bool
"""Whether to apply search rules"""
+
+
+from ..shared_params.search_filter import SearchFilter
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 88ab340d..ab5f0c96 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -247,42 +247,9 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -335,42 +302,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -637,42 +571,9 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -725,42 +626,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index b24c14c2..15a1c34b 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -11,6 +11,7 @@
from tests.utils import assert_matches_type
from mixedbread.types.vector_stores import (
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -137,6 +138,63 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
vector_store_identifier="vector_store_identifier",
)
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending"],
+ metadata_filter={
+ "all": [],
+ "any": [],
+ "none": [],
+ },
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Mixedbread) -> None:
+ response = client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Mixedbread) -> None:
+ with client.vector_stores.files.with_streaming_response.list(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_list(self, client: Mixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="",
+ )
+
@parametrize
def test_method_delete(self, client: Mixedbread) -> None:
file = client.vector_stores.files.delete(
@@ -202,42 +260,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -398,6 +423,63 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
vector_store_identifier="vector_store_identifier",
)
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending"],
+ metadata_filter={
+ "all": [],
+ "any": [],
+ "none": [],
+ },
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.files.with_streaming_response.list(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="",
+ )
+
@parametrize
async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.delete(
@@ -463,42 +545,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_ids=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [],
+ "any": [],
+ "none": [],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
From 0911ac265dc769337dcd0633311fa721ccae7382 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 14:52:34 +0000
Subject: [PATCH 241/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 2 -
.../resources/vector_stores/files.py | 162 +-----------------
.../types/vector_stores/__init__.py | 2 -
.../types/vector_stores/file_list_params.py | 44 -----
.../types/vector_stores/file_list_response.py | 69 --------
.../api_resources/vector_stores/test_files.py | 115 -------------
7 files changed, 3 insertions(+), 395 deletions(-)
delete mode 100644 src/mixedbread/types/vector_stores/file_list_params.py
delete mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
diff --git a/.stats.yml b/.stats.yml
index 33d7691d..fe2990a2 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 49
+configured_endpoints: 48
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-4983c57f5143aaeadfbb4af35595570e613035ae500ff1597fdf600cc2a48959.yml
openapi_spec_hash: ecc0a6cfe61c3c959d034d094f36befe
-config_hash: ac27678c24558b71ee39b3db54fa12da
+config_hash: d98614cc5eec7ec8807fcc86c1799d62
diff --git a/api.md b/api.md
index f251791d..e2f621af 100644
--- a/api.md
+++ b/api.md
@@ -63,7 +63,6 @@ from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
- FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -73,7 +72,6 @@ Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier, \*\*params) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index af08e042..f23b1afc 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -17,12 +17,10 @@
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
-from ...types.vector_stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
+from ...types.vector_stores import file_create_params, file_search_params, file_retrieve_params
from ...types.vector_stores.vector_store_file import VectorStoreFile
-from ...types.vector_stores.file_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
-from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -160,79 +158,6 @@ def retrieve(
cast_to=VectorStoreFile,
)
- def list(
- self,
- vector_store_identifier: str,
- *,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
- metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
- """
- List files indexed in a vector store with pagination and metadata filter.
-
- Args: vector_store_identifier: The ID or name of the vector store pagination:
- Pagination parameters and metadata filter
-
- Returns: VectorStoreFileListResponse: Paginated list of vector store files
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- statuses: Status to filter by
-
- metadata_filter: Metadata filter to apply to the query
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return self._post(
- f"/v1/vector_stores/{vector_store_identifier}/files/list",
- body=maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "statuses": statuses,
- "metadata_filter": metadata_filter,
- },
- file_list_params.FileListParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileListResponse,
- )
-
def delete(
self,
file_id: str,
@@ -492,79 +417,6 @@ async def retrieve(
cast_to=VectorStoreFile,
)
- async def list(
- self,
- vector_store_identifier: str,
- *,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
- metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- ) -> FileListResponse:
- """
- List files indexed in a vector store with pagination and metadata filter.
-
- Args: vector_store_identifier: The ID or name of the vector store pagination:
- Pagination parameters and metadata filter
-
- Returns: VectorStoreFileListResponse: Paginated list of vector store files
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- statuses: Status to filter by
-
- metadata_filter: Metadata filter to apply to the query
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return await self._post(
- f"/v1/vector_stores/{vector_store_identifier}/files/list",
- body=await async_maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "statuses": statuses,
- "metadata_filter": metadata_filter,
- },
- file_list_params.FileListParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileListResponse,
- )
-
async def delete(
self,
file_id: str,
@@ -699,9 +551,6 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_raw_response_wrapper(
files.retrieve,
)
- self.list = to_raw_response_wrapper(
- files.list,
- )
self.delete = to_raw_response_wrapper(
files.delete,
)
@@ -720,9 +569,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_raw_response_wrapper(
files.retrieve,
)
- self.list = async_to_raw_response_wrapper(
- files.list,
- )
self.delete = async_to_raw_response_wrapper(
files.delete,
)
@@ -741,9 +587,6 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_streamed_response_wrapper(
files.retrieve,
)
- self.list = to_streamed_response_wrapper(
- files.list,
- )
self.delete = to_streamed_response_wrapper(
files.delete,
)
@@ -762,9 +605,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_streamed_response_wrapper(
files.retrieve,
)
- self.list = async_to_streamed_response_wrapper(
- files.list,
- )
self.delete = async_to_streamed_response_wrapper(
files.delete,
)
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index dcfaa05b..a75412b9 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -2,10 +2,8 @@
from __future__ import annotations
-from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
-from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
deleted file mode 100644
index a4ac03c8..00000000
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import List, Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict
-
-from .vector_store_file_status import VectorStoreFileStatus
-from ..shared_params.search_filter_condition import SearchFilterCondition
-
-__all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"]
-
-
-class FileListParams(TypedDict, total=False):
- limit: int
- """Maximum number of items to return per page (1-100)"""
-
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
-
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
-
- include_total: bool
- """Whether to include total count in response (expensive operation)"""
-
- statuses: Optional[List[VectorStoreFileStatus]]
- """Status to filter by"""
-
- metadata_filter: Optional[MetadataFilter]
- """Metadata filter to apply to the query"""
-
-
-MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-MetadataFilter: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[MetadataFilterUnionMember2]]
-
-from ..shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
deleted file mode 100644
index 252d1c93..00000000
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .vector_store_file import VectorStoreFile
-
-__all__ = ["FileListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
-
- Use for backward pagination. None if page is empty.
- """
-
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
-
- Use for forward pagination. None if page is empty.
- """
-
- total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
-
-
-class FileListResponse(BaseModel):
- pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[VectorStoreFile]
- """The list of vector store files"""
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 15a1c34b..2c837f92 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -11,7 +11,6 @@
from tests.utils import assert_matches_type
from mixedbread.types.vector_stores import (
VectorStoreFile,
- FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -138,63 +137,6 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
vector_store_identifier="vector_store_identifier",
)
- @parametrize
- def test_method_list(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- )
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- def test_method_list_with_all_params(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending"],
- metadata_filter={
- "all": [],
- "any": [],
- "none": [],
- },
- )
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- def test_raw_response_list(self, client: Mixedbread) -> None:
- response = client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- def test_streaming_response_list(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.list(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_list(self, client: Mixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="",
- )
-
@parametrize
def test_method_delete(self, client: Mixedbread) -> None:
file = client.vector_stores.files.delete(
@@ -423,63 +365,6 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
vector_store_identifier="vector_store_identifier",
)
- @parametrize
- async def test_method_list(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- )
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending"],
- metadata_filter={
- "all": [],
- "any": [],
- "none": [],
- },
- )
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.list(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="",
- )
-
@parametrize
async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.delete(
From eb58811b2879d15ca48c30478e31558a0be3f458 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 14:54:02 +0000
Subject: [PATCH 242/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 2 +
.../resources/vector_stores/files.py | 162 +++++++++++++++++-
.../types/vector_stores/__init__.py | 2 +
.../types/vector_stores/file_list_params.py | 44 +++++
.../types/vector_stores/file_list_response.py | 69 ++++++++
.../api_resources/vector_stores/test_files.py | 115 +++++++++++++
7 files changed, 395 insertions(+), 3 deletions(-)
create mode 100644 src/mixedbread/types/vector_stores/file_list_params.py
create mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
diff --git a/.stats.yml b/.stats.yml
index fe2990a2..33d7691d 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 48
+configured_endpoints: 49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-4983c57f5143aaeadfbb4af35595570e613035ae500ff1597fdf600cc2a48959.yml
openapi_spec_hash: ecc0a6cfe61c3c959d034d094f36befe
-config_hash: d98614cc5eec7ec8807fcc86c1799d62
+config_hash: ac27678c24558b71ee39b3db54fa12da
diff --git a/api.md b/api.md
index e2f621af..f251791d 100644
--- a/api.md
+++ b/api.md
@@ -63,6 +63,7 @@ from mixedbread.types.vector_stores import (
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -72,6 +73,7 @@ Methods:
- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier, \*\*params) -> VectorStoreFile
+- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index f23b1afc..af08e042 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -17,10 +17,12 @@
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
-from ...types.vector_stores import file_create_params, file_search_params, file_retrieve_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_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
+from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -158,6 +160,79 @@ def retrieve(
cast_to=VectorStoreFile,
)
+ def list(
+ self,
+ vector_store_identifier: str,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> FileListResponse:
+ """
+ List files indexed in a vector store with pagination and metadata filter.
+
+ Args: vector_store_identifier: The ID or name of the vector store pagination:
+ Pagination parameters and metadata filter
+
+ Returns: VectorStoreFileListResponse: Paginated list of vector store files
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ statuses: Status to filter by
+
+ metadata_filter: Metadata filter to apply to the query
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return self._post(
+ f"/v1/vector_stores/{vector_store_identifier}/files/list",
+ body=maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "statuses": statuses,
+ "metadata_filter": metadata_filter,
+ },
+ file_list_params.FileListParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileListResponse,
+ )
+
def delete(
self,
file_id: str,
@@ -417,6 +492,79 @@ async def retrieve(
cast_to=VectorStoreFile,
)
+ async def list(
+ self,
+ vector_store_identifier: str,
+ *,
+ limit: int | NotGiven = NOT_GIVEN,
+ after: Optional[str] | NotGiven = NOT_GIVEN,
+ before: Optional[str] | NotGiven = NOT_GIVEN,
+ include_total: bool | NotGiven = NOT_GIVEN,
+ statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> FileListResponse:
+ """
+ List files indexed in a vector store with pagination and metadata filter.
+
+ Args: vector_store_identifier: The ID or name of the vector store pagination:
+ Pagination parameters and metadata filter
+
+ Returns: VectorStoreFileListResponse: Paginated list of vector store files
+
+ Args:
+ vector_store_identifier: The ID or name of the vector store
+
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ statuses: Status to filter by
+
+ metadata_filter: Metadata filter to apply to the query
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not vector_store_identifier:
+ raise ValueError(
+ f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
+ )
+ return await self._post(
+ f"/v1/vector_stores/{vector_store_identifier}/files/list",
+ body=await async_maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "statuses": statuses,
+ "metadata_filter": metadata_filter,
+ },
+ file_list_params.FileListParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileListResponse,
+ )
+
async def delete(
self,
file_id: str,
@@ -551,6 +699,9 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_raw_response_wrapper(
files.retrieve,
)
+ self.list = to_raw_response_wrapper(
+ files.list,
+ )
self.delete = to_raw_response_wrapper(
files.delete,
)
@@ -569,6 +720,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_raw_response_wrapper(
files.retrieve,
)
+ self.list = async_to_raw_response_wrapper(
+ files.list,
+ )
self.delete = async_to_raw_response_wrapper(
files.delete,
)
@@ -587,6 +741,9 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_streamed_response_wrapper(
files.retrieve,
)
+ self.list = to_streamed_response_wrapper(
+ files.list,
+ )
self.delete = to_streamed_response_wrapper(
files.delete,
)
@@ -605,6 +762,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_streamed_response_wrapper(
files.retrieve,
)
+ self.list = async_to_streamed_response_wrapper(
+ files.list,
+ )
self.delete = async_to_streamed_response_wrapper(
files.delete,
)
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
index a75412b9..dcfaa05b 100644
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ b/src/mixedbread/types/vector_stores/__init__.py
@@ -2,8 +2,10 @@
from __future__ import annotations
+from .file_list_params import FileListParams as FileListParams
from .vector_store_file import VectorStoreFile as VectorStoreFile
from .file_create_params import FileCreateParams as FileCreateParams
+from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .rerank_config_param import RerankConfigParam as RerankConfigParam
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
new file mode 100644
index 00000000..a4ac03c8
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -0,0 +1,44 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict
+
+from .vector_store_file_status import VectorStoreFileStatus
+from ..shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"]
+
+
+class FileListParams(TypedDict, total=False):
+ limit: int
+ """Maximum number of items to return per page (1-100)"""
+
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
+
+ include_total: bool
+ """Whether to include total count in response (expensive operation)"""
+
+ statuses: Optional[List[VectorStoreFileStatus]]
+ """Status to filter by"""
+
+ metadata_filter: Optional[MetadataFilter]
+ """Metadata filter to apply to the query"""
+
+
+MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+MetadataFilter: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[MetadataFilterUnionMember2]]
+
+from ..shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
new file mode 100644
index 00000000..252d1c93
--- /dev/null
+++ b/src/mixedbread/types/vector_stores/file_list_response.py
@@ -0,0 +1,69 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+from .vector_store_file import VectorStoreFile
+
+__all__ = ["FileListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class FileListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination.
+
+ Examples: Forward pagination response: { "has_more": true, "first_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
+ "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
+
+ Final page response:
+ {
+ "has_more": false,
+ "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
+ "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
+ "total": 42
+ }
+
+ Empty results:
+ {
+ "has_more": false,
+ "first_cursor": null,
+ "last_cursor": null,
+ "total": 0
+ }
+ """
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[VectorStoreFile]
+ """The list of vector store files"""
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 2c837f92..15a1c34b 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -11,6 +11,7 @@
from tests.utils import assert_matches_type
from mixedbread.types.vector_stores import (
VectorStoreFile,
+ FileListResponse,
FileDeleteResponse,
FileSearchResponse,
)
@@ -137,6 +138,63 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
vector_store_identifier="vector_store_identifier",
)
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
+ file = client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending"],
+ metadata_filter={
+ "all": [],
+ "any": [],
+ "none": [],
+ },
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Mixedbread) -> None:
+ response = client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Mixedbread) -> None:
+ with client.vector_stores.files.with_streaming_response.list(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_list(self, client: Mixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="",
+ )
+
@parametrize
def test_method_delete(self, client: Mixedbread) -> None:
file = client.vector_stores.files.delete(
@@ -365,6 +423,63 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
vector_store_identifier="vector_store_identifier",
)
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending"],
+ metadata_filter={
+ "all": [],
+ "any": [],
+ "none": [],
+ },
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="vector_store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.vector_stores.files.with_streaming_response.list(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="",
+ )
+
@parametrize
async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.delete(
From e2a5f99a8bebcd1f1be9dd204718ad06cc4f7d20 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 14:54:36 +0000
Subject: [PATCH 243/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index d2d60a3d..a36746b8 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.24.0"
+ ".": "0.25.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 02b76f19..666c8a59 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.24.0"
+version = "0.25.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 d3703aed..8b346a75 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.24.0" # x-release-please-version
+__version__ = "0.25.0" # x-release-please-version
From 476dee20176d6b5f53ea27244dbbe0c075234ed1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 11 Aug 2025 14:56:22 +0000
Subject: [PATCH 244/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index a36746b8..caf5ca3f 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.25.0"
+ ".": "0.26.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 666c8a59..4e15d3ed 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.25.0"
+version = "0.26.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 8b346a75..f10c0174 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.25.0" # x-release-please-version
+__version__ = "0.26.0" # x-release-please-version
From 90013202d1c819e50c5b47239f252c071dbe4bca Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sun, 17 Aug 2025 04:52:36 +0000
Subject: [PATCH 245/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 33d7691d..32796da3 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-4983c57f5143aaeadfbb4af35595570e613035ae500ff1597fdf600cc2a48959.yml
openapi_spec_hash: ecc0a6cfe61c3c959d034d094f36befe
-config_hash: ac27678c24558b71ee39b3db54fa12da
+config_hash: f3518c1127f2bfd4c77912b5d42caeba
From 8d0f3e99c903d4577f66d90253586d5590c4b96f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sun, 17 Aug 2025 05:38:44 +0000
Subject: [PATCH 246/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
README.md | 8 ++++----
src/mixedbread/_client.py | 13 +++++++------
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 32796da3..aecb65ef 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-4983c57f5143aaeadfbb4af35595570e613035ae500ff1597fdf600cc2a48959.yml
openapi_spec_hash: ecc0a6cfe61c3c959d034d094f36befe
-config_hash: f3518c1127f2bfd4c77912b5d42caeba
+config_hash: 22524d9aa927566851636768f6a861cd
diff --git a/README.md b/README.md
index 6b66d10d..b9c96e63 100644
--- a/README.md
+++ b/README.md
@@ -30,8 +30,8 @@ from mixedbread import Mixedbread
client = Mixedbread(
api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
- # defaults to "production".
- environment="local",
+ # or 'production' | 'local'; defaults to "production".
+ environment="development",
)
vector_store = client.vector_stores.create()
@@ -54,8 +54,8 @@ from mixedbread import AsyncMixedbread
client = AsyncMixedbread(
api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
- # defaults to "production".
- environment="local",
+ # or 'production' | 'local'; defaults to "production".
+ environment="development",
)
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 0eca020d..22dc96ba 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -68,6 +68,7 @@
ENVIRONMENTS: Dict[str, str] = {
"production": "https://api.mixedbread.com",
+ "development": "https://api.dev.mixedbread.com",
"local": "http://127.0.0.1:8000",
}
@@ -87,13 +88,13 @@ class Mixedbread(SyncAPIClient):
# client options
api_key: str
- _environment: Literal["production", "local"] | NotGiven
+ _environment: Literal["production", "development", "local"] | NotGiven
def __init__(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "local"] | NotGiven = NOT_GIVEN,
+ environment: Literal["production", "development", "local"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -197,7 +198,7 @@ def copy(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "local"] | None = None,
+ environment: Literal["production", "development", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
http_client: httpx.Client | None = None,
@@ -450,13 +451,13 @@ class AsyncMixedbread(AsyncAPIClient):
# client options
api_key: str
- _environment: Literal["production", "local"] | NotGiven
+ _environment: Literal["production", "development", "local"] | NotGiven
def __init__(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "local"] | NotGiven = NOT_GIVEN,
+ environment: Literal["production", "development", "local"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -560,7 +561,7 @@ def copy(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "local"] | None = None,
+ environment: Literal["production", "development", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
http_client: httpx.AsyncClient | None = None,
From 73a03a9fd14ae9e4970c435e4cb102fde6bc4ac6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sun, 17 Aug 2025 05:40:47 +0000
Subject: [PATCH 247/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index caf5ca3f..59acac47 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.26.0"
+ ".": "0.27.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 4e15d3ed..aaae9579 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.26.0"
+version = "0.27.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 f10c0174..064f5087 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.26.0" # x-release-please-version
+__version__ = "0.27.0" # x-release-please-version
From ac02d4ce0eed738efac3e1019e0c3d19dfd19584 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 21 Aug 2025 11:27:29 +0000
Subject: [PATCH 248/375] feat(api): api update
---
.stats.yml | 4 +-
api.md | 2 +-
.../resources/vector_stores/files.py | 40 +++++++++----------
.../resources/vector_stores/vector_stores.py | 16 ++------
src/mixedbread/types/__init__.py | 1 -
.../types/embedding_create_response.py | 4 +-
src/mixedbread/types/object_type.py | 21 ----------
.../vector_store_question_answering_params.py | 6 +--
.../types/vector_store_search_params.py | 4 +-
.../types/vector_stores/file_create_params.py | 6 +--
.../types/vector_stores/file_list_response.py | 23 +----------
.../types/vector_stores/file_search_params.py | 4 +-
.../vector_stores/scored_vector_store_file.py | 2 +-
tests/api_resources/test_vector_stores.py | 34 +++++++++++-----
.../api_resources/vector_stores/test_files.py | 12 ++++--
15 files changed, 68 insertions(+), 111 deletions(-)
delete mode 100644 src/mixedbread/types/object_type.py
diff --git a/.stats.yml b/.stats.yml
index aecb65ef..1ac23eea 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-4983c57f5143aaeadfbb4af35595570e613035ae500ff1597fdf600cc2a48959.yml
-openapi_spec_hash: ecc0a6cfe61c3c959d034d094f36befe
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7c2a2a34f9dcbbc872b3b3a920ad90e64f2313cb45150bc54b66cf49da5c847f.yml
+openapi_spec_hash: 458f00057a397021bab7b374f0191f18
config_hash: 22524d9aa927566851636768f6a861cd
diff --git a/api.md b/api.md
index f251791d..2a054ea2 100644
--- a/api.md
+++ b/api.md
@@ -166,7 +166,7 @@ Methods:
Types:
```python
-from mixedbread.types import EncodingFormat, ObjectType
+from mixedbread.types import EncodingFormat
```
Methods:
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index af08e042..8e412360 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -51,9 +51,9 @@ def create(
self,
vector_store_identifier: str,
*,
- file_id: str,
metadata: object | NotGiven = NOT_GIVEN,
experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
+ file_id: str,
# 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,
@@ -62,22 +62,22 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> VectorStoreFile:
"""
- Upload a new file to a vector store for indexing.
+ Add an already uploaded file to a vector store.
- Args: vector_store_identifier: The ID or name of the vector store to upload to
- file: The file to upload and index
+ Args: vector_store_identifier: The ID or name of the vector store to add the
+ file to file: The file to add and index
- Returns: VectorStoreFile: Details of the uploaded and indexed file
+ Returns: VectorStoreFile: Details of the added and indexed file
Args:
vector_store_identifier: The ID or name of the vector store
- file_id: ID of the file to add
-
metadata: Optional metadata for the file
experimental: Strategy for adding the file
+ file_id: ID of the file to add
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -94,9 +94,9 @@ def create(
f"/v1/vector_stores/{vector_store_identifier}/files",
body=maybe_transform(
{
- "file_id": file_id,
"metadata": metadata,
"experimental": experimental,
+ "file_id": file_id,
},
file_create_params.FileCreateParams,
),
@@ -284,8 +284,7 @@ def search(
self,
*,
query: str,
- vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
- vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_identifiers: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
@@ -342,7 +341,6 @@ def search(
{
"query": query,
"vector_store_identifiers": vector_store_identifiers,
- "vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
"file_ids": file_ids,
@@ -381,9 +379,9 @@ async def create(
self,
vector_store_identifier: str,
*,
- file_id: str,
metadata: object | NotGiven = NOT_GIVEN,
experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
+ file_id: str,
# 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,
@@ -392,22 +390,22 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> VectorStoreFile:
"""
- Upload a new file to a vector store for indexing.
+ Add an already uploaded file to a vector store.
- Args: vector_store_identifier: The ID or name of the vector store to upload to
- file: The file to upload and index
+ Args: vector_store_identifier: The ID or name of the vector store to add the
+ file to file: The file to add and index
- Returns: VectorStoreFile: Details of the uploaded and indexed file
+ Returns: VectorStoreFile: Details of the added and indexed file
Args:
vector_store_identifier: The ID or name of the vector store
- file_id: ID of the file to add
-
metadata: Optional metadata for the file
experimental: Strategy for adding the file
+ file_id: ID of the file to add
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -424,9 +422,9 @@ async def create(
f"/v1/vector_stores/{vector_store_identifier}/files",
body=await async_maybe_transform(
{
- "file_id": file_id,
"metadata": metadata,
"experimental": experimental,
+ "file_id": file_id,
},
file_create_params.FileCreateParams,
),
@@ -616,8 +614,7 @@ async def search(
self,
*,
query: str,
- vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
- vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_identifiers: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
@@ -674,7 +671,6 @@ async def search(
{
"query": query,
"vector_store_identifiers": vector_store_identifiers,
- "vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
"file_ids": file_ids,
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 7fb443de..6ebf46c5 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -351,8 +351,7 @@ def question_answering(
self,
*,
query: str | NotGiven = NOT_GIVEN,
- vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
- vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_identifiers: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
@@ -402,7 +401,6 @@ def question_answering(
{
"query": query,
"vector_store_identifiers": vector_store_identifiers,
- "vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
"file_ids": file_ids,
@@ -422,8 +420,7 @@ def search(
self,
*,
query: str,
- vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
- vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_identifiers: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
@@ -481,7 +478,6 @@ def search(
{
"query": query,
"vector_store_identifiers": vector_store_identifiers,
- "vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
"file_ids": file_ids,
@@ -804,8 +800,7 @@ async def question_answering(
self,
*,
query: str | NotGiven = NOT_GIVEN,
- vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
- vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_identifiers: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
@@ -855,7 +850,6 @@ async def question_answering(
{
"query": query,
"vector_store_identifiers": vector_store_identifiers,
- "vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
"file_ids": file_ids,
@@ -875,8 +869,7 @@ async def search(
self,
*,
query: str,
- vector_store_identifiers: Optional[List[str]] | NotGiven = NOT_GIVEN,
- vector_store_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ vector_store_identifiers: List[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
@@ -934,7 +927,6 @@ async def search(
{
"query": query,
"vector_store_identifiers": vector_store_identifiers,
- "vector_store_ids": vector_store_ids,
"top_k": top_k,
"filters": filters,
"file_ids": file_ids,
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index aca3e061..da6af5f0 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -9,7 +9,6 @@
from .embedding import Embedding as Embedding
from .data_source import DataSource as DataSource
from .file_object import FileObject as FileObject
-from .object_type import ObjectType as ObjectType
from .vector_store import VectorStore as VectorStore
from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
diff --git a/src/mixedbread/types/embedding_create_response.py b/src/mixedbread/types/embedding_create_response.py
index d7389135..ba5adbf6 100644
--- a/src/mixedbread/types/embedding_create_response.py
+++ b/src/mixedbread/types/embedding_create_response.py
@@ -1,10 +1,10 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
+from typing_extensions import Literal
from .._models import BaseModel
from .embedding import Embedding
-from .object_type import ObjectType
from .shared.usage import Usage
from .encoding_format import EncodingFormat
from .multi_encoding_embedding import MultiEncodingEmbedding
@@ -22,7 +22,7 @@ class EmbeddingCreateResponse(BaseModel):
data: Union[List[Embedding], List[MultiEncodingEmbedding]]
"""The created embeddings."""
- object: Optional[ObjectType] = None
+ object: Optional[Literal["list"]] = None
"""The object type of the response"""
normalized: bool
diff --git a/src/mixedbread/types/object_type.py b/src/mixedbread/types/object_type.py
deleted file mode 100644
index fe19bc12..00000000
--- a/src/mixedbread/types/object_type.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing_extensions import Literal, TypeAlias
-
-__all__ = ["ObjectType"]
-
-ObjectType: TypeAlias = Literal[
- "list",
- "parsing_job",
- "extraction_job",
- "embedding",
- "embedding_dict",
- "rank_result",
- "file",
- "vector_store",
- "vector_store.file",
- "api_key",
- "data_source",
- "data_source.connector",
- "vector_store.histogram",
-]
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index b34189b3..80c56b44 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -3,7 +3,7 @@
from __future__ import annotations
from typing import List, Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict
+from typing_extensions import Required, TypeAlias, TypedDict
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
@@ -18,11 +18,9 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
If not provided, the question will be extracted from the passed messages.
"""
- vector_store_identifiers: Optional[List[str]]
+ vector_store_identifiers: Required[List[str]]
"""IDs or names of vector stores to search"""
- vector_store_ids: Optional[List[str]]
-
top_k: int
"""Number of results to return"""
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index 48fc21e1..fc08a5ae 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -15,11 +15,9 @@ class VectorStoreSearchParams(TypedDict, total=False):
query: Required[str]
"""Search query text"""
- vector_store_identifiers: Optional[List[str]]
+ vector_store_identifiers: Required[List[str]]
"""IDs or names of vector stores to search"""
- vector_store_ids: Optional[List[str]]
-
top_k: int
"""Number of results to return"""
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
index e94f5505..ce39cfd1 100644
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -8,15 +8,15 @@
class FileCreateParams(TypedDict, total=False):
- file_id: Required[str]
- """ID of the file to add"""
-
metadata: object
"""Optional metadata for the file"""
experimental: Experimental
"""Strategy for adding the file"""
+ file_id: Required[str]
+ """ID of the file to add"""
+
class Experimental(TypedDict, total=False):
parsing_strategy: Literal["fast", "high_quality"]
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
index 252d1c93..afdcc55d 100644
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ b/src/mixedbread/types/vector_stores/file_list_response.py
@@ -39,28 +39,7 @@ class Pagination(BaseModel):
class FileListResponse(BaseModel):
pagination: Pagination
- """Response model for cursor-based pagination.
-
- Examples: Forward pagination response: { "has_more": true, "first_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMSIsImlkIjoiYWJjMTIzIn0=", "last_cursor":
- "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMCIsImlkIjoieHl6Nzg5In0=", "total": null }
-
- Final page response:
- {
- "has_more": false,
- "first_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOSIsImlkIjoibGFzdDEyMyJ9",
- "last_cursor": "eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0yOCIsImlkIjoiZmluYWw0NTYifQ==",
- "total": 42
- }
-
- Empty results:
- {
- "has_more": false,
- "first_cursor": null,
- "last_cursor": null,
- "total": 0
- }
- """
+ """Response model for cursor-based pagination."""
object: Optional[Literal["list"]] = None
"""The object type of the response"""
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 3c289bc1..03805405 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -15,11 +15,9 @@ class FileSearchParams(TypedDict, total=False):
query: Required[str]
"""Search query text"""
- vector_store_identifiers: Optional[List[str]]
+ vector_store_identifiers: Required[List[str]]
"""IDs or names of vector stores to search"""
- vector_store_ids: Optional[List[str]]
-
top_k: int
"""Number of results to return"""
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 ca72a30f..12d8ddd0 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -52,7 +52,7 @@ class ScoredVectorStoreFile(BaseModel):
"""Type of the object"""
chunks: Optional[List[Chunk]] = None
- """chunks"""
+ """Array of scored file chunks"""
score: float
"""score of the file"""
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index ab5f0c96..fa109005 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -236,7 +236,9 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
@parametrize
def test_method_question_answering(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.question_answering()
+ vector_store = client.vector_stores.question_answering(
+ vector_store_identifiers=["string"],
+ )
assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
@@ -244,7 +246,6 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
vector_store = client.vector_stores.question_answering(
query="x",
vector_store_identifiers=["string"],
- vector_store_ids=["string"],
top_k=1,
filters={
"all": [],
@@ -269,7 +270,9 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
@parametrize
def test_raw_response_question_answering(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.question_answering()
+ response = client.vector_stores.with_raw_response.question_answering(
+ vector_store_identifiers=["string"],
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -278,7 +281,9 @@ def test_raw_response_question_answering(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_question_answering(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.question_answering() as response:
+ with client.vector_stores.with_streaming_response.question_answering(
+ vector_store_identifiers=["string"],
+ ) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -291,6 +296,7 @@ def test_streaming_response_question_answering(self, client: Mixedbread) -> None
def test_method_search(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@@ -299,7 +305,6 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store = client.vector_stores.search(
query="how to configure SSL",
vector_store_identifiers=["string"],
- vector_store_ids=["string"],
top_k=1,
filters={
"all": [],
@@ -321,6 +326,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
def test_raw_response_search(self, client: Mixedbread) -> None:
response = client.vector_stores.with_raw_response.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
)
assert response.is_closed is True
@@ -332,6 +338,7 @@ def test_raw_response_search(self, client: Mixedbread) -> None:
def test_streaming_response_search(self, client: Mixedbread) -> None:
with client.vector_stores.with_streaming_response.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -560,7 +567,9 @@ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.question_answering()
+ vector_store = await async_client.vector_stores.question_answering(
+ vector_store_identifiers=["string"],
+ )
assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
@@ -568,7 +577,6 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
vector_store = await async_client.vector_stores.question_answering(
query="x",
vector_store_identifiers=["string"],
- vector_store_ids=["string"],
top_k=1,
filters={
"all": [],
@@ -593,7 +601,9 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
@parametrize
async def test_raw_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.question_answering()
+ response = await async_client.vector_stores.with_raw_response.question_answering(
+ vector_store_identifiers=["string"],
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -602,7 +612,9 @@ async def test_raw_response_question_answering(self, async_client: AsyncMixedbre
@parametrize
async def test_streaming_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.question_answering() as response:
+ async with async_client.vector_stores.with_streaming_response.question_answering(
+ vector_store_identifiers=["string"],
+ ) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -615,6 +627,7 @@ async def test_streaming_response_question_answering(self, async_client: AsyncMi
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
vector_store = await async_client.vector_stores.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
)
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@@ -623,7 +636,6 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store = await async_client.vector_stores.search(
query="how to configure SSL",
vector_store_identifiers=["string"],
- vector_store_ids=["string"],
top_k=1,
filters={
"all": [],
@@ -645,6 +657,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
response = await async_client.vector_stores.with_raw_response.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
)
assert response.is_closed is True
@@ -656,6 +669,7 @@ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
async with async_client.vector_stores.with_streaming_response.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 15a1c34b..6d7726a2 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -34,12 +34,12 @@ def test_method_create(self, client: Mixedbread) -> None:
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.create(
vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
metadata={},
experimental={
"parsing_strategy": "fast",
"contextualization": True,
},
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -249,6 +249,7 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
def test_method_search(self, client: Mixedbread) -> None:
file = client.vector_stores.files.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
)
assert_matches_type(FileSearchResponse, file, path=["response"])
@@ -257,7 +258,6 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.search(
query="how to configure SSL",
vector_store_identifiers=["string"],
- vector_store_ids=["string"],
top_k=1,
filters={
"all": [],
@@ -281,6 +281,7 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
def test_raw_response_search(self, client: Mixedbread) -> None:
response = client.vector_stores.files.with_raw_response.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
)
assert response.is_closed is True
@@ -292,6 +293,7 @@ def test_raw_response_search(self, client: Mixedbread) -> None:
def test_streaming_response_search(self, client: Mixedbread) -> None:
with client.vector_stores.files.with_streaming_response.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -319,12 +321,12 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.create(
vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
metadata={},
experimental={
"parsing_strategy": "fast",
"contextualization": True,
},
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -534,6 +536,7 @@ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
file = await async_client.vector_stores.files.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
)
assert_matches_type(FileSearchResponse, file, path=["response"])
@@ -542,7 +545,6 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.vector_stores.files.search(
query="how to configure SSL",
vector_store_identifiers=["string"],
- vector_store_ids=["string"],
top_k=1,
filters={
"all": [],
@@ -566,6 +568,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
response = await async_client.vector_stores.files.with_raw_response.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
)
assert response.is_closed is True
@@ -577,6 +580,7 @@ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
async with async_client.vector_stores.files.with_streaming_response.search(
query="how to configure SSL",
+ vector_store_identifiers=["string"],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
From 9ad8c99c4d9f73eed6bdde2991d5c8386aabc8d6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 21 Aug 2025 11:29:33 +0000
Subject: [PATCH 249/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 59acac47..8935e932 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.27.0"
+ ".": "0.28.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index aaae9579..a60f88e7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.27.0"
+version = "0.28.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 064f5087..f6fccb29 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.27.0" # x-release-please-version
+__version__ = "0.28.0" # x-release-please-version
From 2a32d0a81a7dd94d7bb8aa67cc8f10ec7ae8b05d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 22 Aug 2025 05:27:28 +0000
Subject: [PATCH 250/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 1ac23eea..63c721ad 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-7c2a2a34f9dcbbc872b3b3a920ad90e64f2313cb45150bc54b66cf49da5c847f.yml
-openapi_spec_hash: 458f00057a397021bab7b374f0191f18
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-40639c878f8afb52cc3836e1ee0634572b1ab7ae38eec890029c761a469d8c6c.yml
+openapi_spec_hash: 7fb8b083a410ec343d80fc37384d65d9
config_hash: 22524d9aa927566851636768f6a861cd
From fb9d6d0b76808e6f600b49b12704f210c96ef8eb Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 22 Aug 2025 07:31:45 +0000
Subject: [PATCH 251/375] chore: update github action
---
.github/workflows/ci.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 508f13bb..3d5672b0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -36,7 +36,7 @@ jobs:
run: ./scripts/lint
build:
- if: github.repository == 'stainless-sdks/mixedbread-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
timeout-minutes: 10
name: build
permissions:
@@ -61,12 +61,14 @@ jobs:
run: rye build
- name: Get GitHub OIDC Token
+ if: github.repository == 'stainless-sdks/mixedbread-python'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());
- name: Upload tarball
+ if: github.repository == 'stainless-sdks/mixedbread-python'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
From 7fec6e1be96fa0625b6d22299142e1647c7ebf6f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 25 Aug 2025 11:27:25 +0000
Subject: [PATCH 252/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 63c721ad..252dd5ab 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-40639c878f8afb52cc3836e1ee0634572b1ab7ae38eec890029c761a469d8c6c.yml
-openapi_spec_hash: 7fb8b083a410ec343d80fc37384d65d9
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-c950bdc025566e8000354aef54c6f1c6c4ecbd92f9b6aca231701b8bebdf917e.yml
+openapi_spec_hash: d76b267c95385a291cdb9401a9bdb95e
config_hash: 22524d9aa927566851636768f6a861cd
From 6a240141fe7215fdd989f72846f4e6ef390ac00e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 26 Aug 2025 05:59:17 +0000
Subject: [PATCH 253/375] chore(internal): change ci workflow machines
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3d5672b0..592b71b4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -42,7 +42,7 @@ jobs:
permissions:
contents: read
id-token: write
- runs-on: depot-ubuntu-24.04
+ runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
From 68dade7095c78a9237ecdfbb1d5be2a82d37030d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 27 Aug 2025 08:29:22 +0000
Subject: [PATCH 254/375] fix: avoid newer type syntax
---
src/mixedbread/_models.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index b8387ce9..92f7c10b 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -304,7 +304,7 @@ def model_dump(
exclude_none=exclude_none,
)
- return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped
+ return cast("dict[str, Any]", json_safe(dumped)) if mode == "json" else dumped
@override
def model_dump_json(
From c2db0828b88e4b84050f9a1940601de1e3f7a158 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 27 Aug 2025 08:31:26 +0000
Subject: [PATCH 255/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 8935e932..a6fc929e 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.28.0"
+ ".": "0.28.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index a60f88e7..e8a36dfb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.28.0"
+version = "0.28.1"
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 f6fccb29..12cfe033 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.28.0" # x-release-please-version
+__version__ = "0.28.1" # x-release-please-version
From 2861950d5ceb152df9405643bbdca57ee39ef24f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 27 Aug 2025 08:41:34 +0000
Subject: [PATCH 256/375] chore(internal): update pyright exclude list
---
pyproject.toml | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyproject.toml b/pyproject.toml
index e8a36dfb..c0728888 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -148,6 +148,7 @@ exclude = [
"_dev",
".venv",
".nox",
+ ".git",
]
reportImplicitOverride = true
From 683b6b52baa3f62995616790406852551f8d2952 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 30 Aug 2025 04:28:43 +0000
Subject: [PATCH 257/375] chore(internal): add Sequence related utils
---
src/mixedbread/_types.py | 36 ++++++++++++++++++++++++++++++-
src/mixedbread/_utils/__init__.py | 1 +
src/mixedbread/_utils/_typing.py | 5 +++++
tests/utils.py | 10 ++++++++-
4 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_types.py b/src/mixedbread/_types.py
index 6fdd2f2b..baa4a78b 100644
--- a/src/mixedbread/_types.py
+++ b/src/mixedbread/_types.py
@@ -13,10 +13,21 @@
Mapping,
TypeVar,
Callable,
+ Iterator,
Optional,
Sequence,
)
-from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
+from typing_extensions import (
+ Set,
+ Literal,
+ Protocol,
+ TypeAlias,
+ TypedDict,
+ SupportsIndex,
+ overload,
+ override,
+ runtime_checkable,
+)
import httpx
import pydantic
@@ -217,3 +228,26 @@ class _GenericAlias(Protocol):
class HttpxSendArgs(TypedDict, total=False):
auth: httpx.Auth
follow_redirects: bool
+
+
+_T_co = TypeVar("_T_co", covariant=True)
+
+
+if TYPE_CHECKING:
+ # This works because str.__contains__ does not accept object (either in typeshed or at runtime)
+ # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
+ class SequenceNotStr(Protocol[_T_co]):
+ @overload
+ def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
+ @overload
+ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ...
+ def __contains__(self, value: object, /) -> bool: ...
+ def __len__(self) -> int: ...
+ def __iter__(self) -> Iterator[_T_co]: ...
+ def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
+ def count(self, value: Any, /) -> int: ...
+ def __reversed__(self) -> Iterator[_T_co]: ...
+else:
+ # just point this to a normal `Sequence` at runtime to avoid having to special case
+ # deserializing our custom sequence type
+ SequenceNotStr = Sequence
diff --git a/src/mixedbread/_utils/__init__.py b/src/mixedbread/_utils/__init__.py
index d4fda26f..ca547ce5 100644
--- a/src/mixedbread/_utils/__init__.py
+++ b/src/mixedbread/_utils/__init__.py
@@ -38,6 +38,7 @@
extract_type_arg as extract_type_arg,
is_iterable_type as is_iterable_type,
is_required_type as is_required_type,
+ is_sequence_type as is_sequence_type,
is_annotated_type as is_annotated_type,
is_type_alias_type as is_type_alias_type,
strip_annotated_type as strip_annotated_type,
diff --git a/src/mixedbread/_utils/_typing.py b/src/mixedbread/_utils/_typing.py
index 1bac9542..845cd6b2 100644
--- a/src/mixedbread/_utils/_typing.py
+++ b/src/mixedbread/_utils/_typing.py
@@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool:
return (get_origin(typ) or typ) == list
+def is_sequence_type(typ: type) -> bool:
+ origin = get_origin(typ) or typ
+ return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence
+
+
def is_iterable_type(typ: type) -> bool:
"""If the given type is `typing.Iterable[T]`"""
origin = get_origin(typ) or typ
diff --git a/tests/utils.py b/tests/utils.py
index bd4c1519..020c34e2 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -4,7 +4,7 @@
import inspect
import traceback
import contextlib
-from typing import Any, TypeVar, Iterator, cast
+from typing import Any, TypeVar, Iterator, Sequence, cast
from datetime import date, datetime
from typing_extensions import Literal, get_args, get_origin, assert_type
@@ -15,6 +15,7 @@
is_list_type,
is_union_type,
extract_type_arg,
+ is_sequence_type,
is_annotated_type,
is_type_alias_type,
)
@@ -71,6 +72,13 @@ def assert_matches_type(
if is_list_type(type_):
return _assert_list_type(type_, value)
+ if is_sequence_type(type_):
+ assert isinstance(value, Sequence)
+ inner_type = get_args(type_)[0]
+ for entry in value: # type: ignore
+ assert_type(inner_type, entry) # type: ignore
+ return
+
if origin == str:
assert isinstance(value, str)
elif origin == int:
From f70c836e8ad30530923896e9a90e1ba9ae9cfd0e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 1 Sep 2025 14:27:33 +0000
Subject: [PATCH 258/375] feat(api): api update
---
.stats.yml | 4 +-
.../types/vector_stores/vector_store_file.py | 44 ++++++++++++++++---
2 files changed, 39 insertions(+), 9 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 252dd5ab..e8f16265 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-c950bdc025566e8000354aef54c6f1c6c4ecbd92f9b6aca231701b8bebdf917e.yml
-openapi_spec_hash: d76b267c95385a291cdb9401a9bdb95e
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-a2720b37997685cf019808be37ab86f7071f55ac09c80916293489f6d3644160.yml
+openapi_spec_hash: 61c24c03f1df5276b03e7bcce5266c21
config_hash: 22524d9aa927566851636768f6a861cd
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 96171171..a5378318 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -12,9 +12,12 @@
"VectorStoreFile",
"Chunk",
"ChunkTextInputChunk",
- "ChunkImageURLInputChunkBase",
- "ChunkAudioURLInputChunkBase",
- "ChunkVideoURLInputChunkBase",
+ "ChunkImageURLInputChunk",
+ "ChunkImageURLInputChunkImageURL",
+ "ChunkAudioURLInputChunk",
+ "ChunkAudioURLInputChunkAudioURL",
+ "ChunkVideoURLInputChunk",
+ "ChunkVideoURLInputChunkVideoURL",
]
@@ -41,7 +44,15 @@ class ChunkTextInputChunk(BaseModel):
"""Text content to process"""
-class ChunkImageURLInputChunkBase(BaseModel):
+class ChunkImageURLInputChunkImageURL(BaseModel):
+ url: str
+ """The image URL. Can be either a URL or a Data URI."""
+
+ format: Optional[str] = None
+ """The image format/mimetype"""
+
+
+class ChunkImageURLInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -63,8 +74,16 @@ class ChunkImageURLInputChunkBase(BaseModel):
summary: Optional[str] = None
"""summary of the image"""
+ image_url: ChunkImageURLInputChunkImageURL
+ """The image input specification."""
+
+
+class ChunkAudioURLInputChunkAudioURL(BaseModel):
+ url: str
+ """The audio URL. Can be either a URL or a Data URI."""
-class ChunkAudioURLInputChunkBase(BaseModel):
+
+class ChunkAudioURLInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -86,8 +105,16 @@ class ChunkAudioURLInputChunkBase(BaseModel):
summary: Optional[str] = None
"""summary of the audio"""
+ audio_url: ChunkAudioURLInputChunkAudioURL
+ """The audio input specification."""
+
+
+class ChunkVideoURLInputChunkVideoURL(BaseModel):
+ url: str
+ """The video URL. Can be either a URL or a Data URI."""
-class ChunkVideoURLInputChunkBase(BaseModel):
+
+class ChunkVideoURLInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -109,9 +136,12 @@ class ChunkVideoURLInputChunkBase(BaseModel):
summary: Optional[str] = None
"""summary of the video"""
+ video_url: ChunkVideoURLInputChunkVideoURL
+ """The video input specification."""
+
Chunk: TypeAlias = Annotated[
- Union[ChunkTextInputChunk, ChunkImageURLInputChunkBase, ChunkAudioURLInputChunkBase, ChunkVideoURLInputChunkBase],
+ Union[ChunkTextInputChunk, ChunkImageURLInputChunk, ChunkAudioURLInputChunk, ChunkVideoURLInputChunk],
PropertyInfo(discriminator="type"),
]
From 98e3d5862125524f302ef4c0a22cb445bfa23797 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 1 Sep 2025 14:29:29 +0000
Subject: [PATCH 259/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index a6fc929e..b8dda9bf 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.28.1"
+ ".": "0.29.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index c0728888..38780c53 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.28.1"
+version = "0.29.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 12cfe033..95fda5ff 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.28.1" # x-release-please-version
+__version__ = "0.29.0" # x-release-please-version
From 2ea0d64f9846a41f1d8eee991c5b726950d71fef Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 3 Sep 2025 03:53:21 +0000
Subject: [PATCH 260/375] feat(types): replace List[str] with SequenceNotStr in
params
---
src/mixedbread/_client.py | 13 +++++-----
src/mixedbread/_utils/_transform.py | 6 +++++
src/mixedbread/resources/embeddings.py | 6 ++---
.../resources/extractions/content.py | 8 +++----
.../resources/vector_stores/files.py | 10 ++++----
.../resources/vector_stores/vector_stores.py | 24 +++++++++----------
src/mixedbread/types/client_embed_params.py | 3 ++-
src/mixedbread/types/client_rerank_params.py | 8 ++++---
.../types/embedding_create_params.py | 3 ++-
.../extractions/content_create_params.py | 5 ++--
.../types/vector_store_create_params.py | 5 ++--
.../vector_store_question_answering_params.py | 7 +++---
.../types/vector_store_search_params.py | 7 +++---
.../types/vector_stores/file_search_params.py | 7 +++---
.../vector_stores/rerank_config_param.py | 6 +++--
15 files changed, 68 insertions(+), 50 deletions(-)
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 22dc96ba..c4f54779 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -22,6 +22,7 @@
Transport,
ProxiesTypes,
RequestOptions,
+ SequenceNotStr,
)
from ._utils import (
is_given,
@@ -251,7 +252,7 @@ def embed(
self,
*,
model: str,
- input: Union[str, List[str]],
+ input: Union[str, SequenceNotStr[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
@@ -340,8 +341,8 @@ def rerank(
*,
model: str | NotGiven = NOT_GIVEN,
query: str,
- input: List[Union[str, Iterable[object], object]],
- rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ input: SequenceNotStr[Union[str, Iterable[object], object]],
+ rank_fields: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
return_input: bool | NotGiven = NOT_GIVEN,
rewrite_query: bool | NotGiven = NOT_GIVEN,
@@ -614,7 +615,7 @@ async def embed(
self,
*,
model: str,
- input: Union[str, List[str]],
+ input: Union[str, SequenceNotStr[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
@@ -703,8 +704,8 @@ async def rerank(
*,
model: str | NotGiven = NOT_GIVEN,
query: str,
- input: List[Union[str, Iterable[object], object]],
- rank_fields: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ input: SequenceNotStr[Union[str, Iterable[object], object]],
+ rank_fields: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
top_k: int | NotGiven = NOT_GIVEN,
return_input: bool | NotGiven = NOT_GIVEN,
rewrite_query: bool | NotGiven = NOT_GIVEN,
diff --git a/src/mixedbread/_utils/_transform.py b/src/mixedbread/_utils/_transform.py
index b0cc20a7..f0bcefd4 100644
--- a/src/mixedbread/_utils/_transform.py
+++ b/src/mixedbread/_utils/_transform.py
@@ -16,6 +16,7 @@
lru_cache,
is_mapping,
is_iterable,
+ is_sequence,
)
from .._files import is_base64_file_input
from ._typing import (
@@ -24,6 +25,7 @@
extract_type_arg,
is_iterable_type,
is_required_type,
+ is_sequence_type,
is_annotated_type,
strip_annotated_type,
)
@@ -184,6 +186,8 @@ def _transform_recursive(
(is_list_type(stripped_type) and is_list(data))
# Iterable[T]
or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
+ # Sequence[T]
+ or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str))
):
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
# intended as an iterable, so we don't transform it.
@@ -346,6 +350,8 @@ async def _async_transform_recursive(
(is_list_type(stripped_type) and is_list(data))
# Iterable[T]
or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str))
+ # Sequence[T]
+ or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str))
):
# dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually
# intended as an iterable, so we don't transform it.
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index 84d90cce..17bee234 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -7,7 +7,7 @@
import httpx
from ..types import embedding_create_params
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -48,7 +48,7 @@ def create(
self,
*,
model: str,
- input: Union[str, List[str]],
+ input: Union[str, SequenceNotStr[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
@@ -134,7 +134,7 @@ async def create(
self,
*,
model: str,
- input: Union[str, List[str]],
+ input: Union[str, SequenceNotStr[str]],
dimensions: Optional[int] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
normalized: bool | NotGiven = NOT_GIVEN,
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
index 9dd3c663..a74a9b13 100644
--- a/src/mixedbread/resources/extractions/content.py
+++ b/src/mixedbread/resources/extractions/content.py
@@ -2,11 +2,11 @@
from __future__ import annotations
-from typing import Dict, List, Union, Iterable, Optional
+from typing import Dict, Union, Iterable, Optional
import httpx
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -46,7 +46,7 @@ def with_streaming_response(self) -> ContentResourceWithStreamingResponse:
def create(
self,
*,
- content: Union[str, List[str], Iterable[content_create_params.ContentUnionMember2]],
+ content: Union[str, SequenceNotStr[str], Iterable[content_create_params.ContentUnionMember2]],
json_schema: Dict[str, object],
instructions: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -118,7 +118,7 @@ def with_streaming_response(self) -> AsyncContentResourceWithStreamingResponse:
async def create(
self,
*,
- content: Union[str, List[str], Iterable[content_create_params.ContentUnionMember2]],
+ content: Union[str, SequenceNotStr[str], Iterable[content_create_params.ContentUnionMember2]],
json_schema: Dict[str, object],
instructions: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 8e412360..216e2475 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -6,7 +6,7 @@
import httpx
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -284,10 +284,10 @@ def search(
self,
*,
query: str,
- vector_store_identifiers: List[str],
+ vector_store_identifiers: SequenceNotStr[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | 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.
@@ -614,10 +614,10 @@ async def search(
self,
*,
query: str,
- vector_store_identifiers: List[str],
+ vector_store_identifiers: SequenceNotStr[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | 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.
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 6ebf46c5..0dd32b0f 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import List, Union, Iterable, Optional
+from typing import Union, Iterable, Optional
import httpx
@@ -21,7 +21,7 @@
vector_store_update_params,
vector_store_question_answering_params,
)
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -75,7 +75,7 @@ def create(
is_public: bool | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ file_ids: Optional[SequenceNotStr[str]] | 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,
@@ -351,10 +351,10 @@ def question_answering(
self,
*,
query: str | NotGiven = NOT_GIVEN,
- vector_store_identifiers: List[str],
+ vector_store_identifiers: SequenceNotStr[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
@@ -420,10 +420,10 @@ def search(
self,
*,
query: str,
- vector_store_identifiers: List[str],
+ vector_store_identifiers: SequenceNotStr[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
search_options: VectorStoreChunkSearchOptionsParam | 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.
@@ -524,7 +524,7 @@ async def create(
is_public: bool | NotGiven = NOT_GIVEN,
expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
metadata: object | NotGiven = NOT_GIVEN,
- file_ids: Optional[List[str]] | NotGiven = NOT_GIVEN,
+ file_ids: Optional[SequenceNotStr[str]] | 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,
@@ -800,10 +800,10 @@ async def question_answering(
self,
*,
query: str | NotGiven = NOT_GIVEN,
- vector_store_identifiers: List[str],
+ vector_store_identifiers: SequenceNotStr[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
stream: bool | NotGiven = NOT_GIVEN,
qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
@@ -869,10 +869,10 @@ async def search(
self,
*,
query: str,
- vector_store_identifiers: List[str],
+ vector_store_identifiers: SequenceNotStr[str],
top_k: int | NotGiven = NOT_GIVEN,
filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], List[str], None] | NotGiven = NOT_GIVEN,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
search_options: VectorStoreChunkSearchOptionsParam | 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.
diff --git a/src/mixedbread/types/client_embed_params.py b/src/mixedbread/types/client_embed_params.py
index 9636bb6a..7a5080bc 100644
--- a/src/mixedbread/types/client_embed_params.py
+++ b/src/mixedbread/types/client_embed_params.py
@@ -5,6 +5,7 @@
from typing import List, Union, Optional
from typing_extensions import Required, TypedDict
+from .._types import SequenceNotStr
from .encoding_format import EncodingFormat
__all__ = ["ClientEmbedParams"]
@@ -14,7 +15,7 @@ class ClientEmbedParams(TypedDict, total=False):
model: Required[str]
"""The model to use for creating embeddings."""
- input: Required[Union[str, List[str]]]
+ input: Required[Union[str, SequenceNotStr[str]]]
"""The input to create embeddings for."""
dimensions: Optional[int]
diff --git a/src/mixedbread/types/client_rerank_params.py b/src/mixedbread/types/client_rerank_params.py
index 89548084..ee628e54 100644
--- a/src/mixedbread/types/client_rerank_params.py
+++ b/src/mixedbread/types/client_rerank_params.py
@@ -2,9 +2,11 @@
from __future__ import annotations
-from typing import List, Union, Iterable, Optional
+from typing import Union, Iterable, Optional
from typing_extensions import Required, TypedDict
+from .._types import SequenceNotStr
+
__all__ = ["ClientRerankParams"]
@@ -15,10 +17,10 @@ class ClientRerankParams(TypedDict, total=False):
query: Required[str]
"""The query to rerank the documents."""
- input: Required[List[Union[str, Iterable[object], object]]]
+ input: Required[SequenceNotStr[Union[str, Iterable[object], object]]]
"""The input documents to rerank."""
- rank_fields: Optional[List[str]]
+ rank_fields: Optional[SequenceNotStr[str]]
"""The fields of the documents to rank."""
top_k: int
diff --git a/src/mixedbread/types/embedding_create_params.py b/src/mixedbread/types/embedding_create_params.py
index e78f3b9a..ab848f77 100644
--- a/src/mixedbread/types/embedding_create_params.py
+++ b/src/mixedbread/types/embedding_create_params.py
@@ -5,6 +5,7 @@
from typing import List, Union, Optional
from typing_extensions import Required, TypedDict
+from .._types import SequenceNotStr
from .encoding_format import EncodingFormat
__all__ = ["EmbeddingCreateParams"]
@@ -14,7 +15,7 @@ class EmbeddingCreateParams(TypedDict, total=False):
model: Required[str]
"""The model to use for creating embeddings."""
- input: Required[Union[str, List[str]]]
+ input: Required[Union[str, SequenceNotStr[str]]]
"""The input to create embeddings for."""
dimensions: Optional[int]
diff --git a/src/mixedbread/types/extractions/content_create_params.py b/src/mixedbread/types/extractions/content_create_params.py
index 713deb65..54faba84 100644
--- a/src/mixedbread/types/extractions/content_create_params.py
+++ b/src/mixedbread/types/extractions/content_create_params.py
@@ -2,9 +2,10 @@
from __future__ import annotations
-from typing import Dict, List, Union, Iterable, Optional
+from typing import Dict, Union, Iterable, Optional
from typing_extensions import Required, TypeAlias, TypedDict
+from ..._types import SequenceNotStr
from .text_input_param import TextInputParam
from .image_url_input_param import ImageURLInputParam
@@ -12,7 +13,7 @@
class ContentCreateParams(TypedDict, total=False):
- content: Required[Union[str, List[str], Iterable[ContentUnionMember2]]]
+ content: Required[Union[str, SequenceNotStr[str], Iterable[ContentUnionMember2]]]
"""The content to extract from"""
json_schema: Required[Dict[str, object]]
diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py
index 39ee001b..f22e2673 100644
--- a/src/mixedbread/types/vector_store_create_params.py
+++ b/src/mixedbread/types/vector_store_create_params.py
@@ -2,9 +2,10 @@
from __future__ import annotations
-from typing import List, Optional
+from typing import Optional
from typing_extensions import TypedDict
+from .._types import SequenceNotStr
from .expires_after_param import ExpiresAfterParam
__all__ = ["VectorStoreCreateParams"]
@@ -26,5 +27,5 @@ class VectorStoreCreateParams(TypedDict, total=False):
metadata: object
"""Optional metadata key-value pairs"""
- file_ids: Optional[List[str]]
+ file_ids: Optional[SequenceNotStr[str]]
"""Optional list of file IDs"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index 80c56b44..f8c3bba3 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -2,9 +2,10 @@
from __future__ import annotations
-from typing import List, Union, Iterable, Optional
+from typing import Union, Iterable, Optional
from typing_extensions import Required, TypeAlias, TypedDict
+from .._types import SequenceNotStr
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
@@ -18,7 +19,7 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
If not provided, the question will be extracted from the passed messages.
"""
- vector_store_identifiers: Required[List[str]]
+ vector_store_identifiers: Required[SequenceNotStr[str]]
"""IDs or names of vector stores to search"""
top_k: int
@@ -27,7 +28,7 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- file_ids: Union[Iterable[object], List[str], None]
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None]
"""Optional list of file IDs to filter chunks by (inclusion filter)"""
search_options: VectorStoreChunkSearchOptionsParam
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
index fc08a5ae..f5258d95 100644
--- a/src/mixedbread/types/vector_store_search_params.py
+++ b/src/mixedbread/types/vector_store_search_params.py
@@ -2,9 +2,10 @@
from __future__ import annotations
-from typing import List, Union, Iterable, Optional
+from typing import Union, Iterable, Optional
from typing_extensions import Required, TypeAlias, TypedDict
+from .._types import SequenceNotStr
from .shared_params.search_filter_condition import SearchFilterCondition
from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
@@ -15,7 +16,7 @@ class VectorStoreSearchParams(TypedDict, total=False):
query: Required[str]
"""Search query text"""
- vector_store_identifiers: Required[List[str]]
+ vector_store_identifiers: Required[SequenceNotStr[str]]
"""IDs or names of vector stores to search"""
top_k: int
@@ -24,7 +25,7 @@ class VectorStoreSearchParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- file_ids: Union[Iterable[object], List[str], None]
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None]
"""Optional list of file IDs to filter chunks by (inclusion filter)"""
search_options: VectorStoreChunkSearchOptionsParam
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index 03805405..c29be236 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -2,9 +2,10 @@
from __future__ import annotations
-from typing import List, Union, Iterable, Optional
+from typing import Union, Iterable, Optional
from typing_extensions import Required, TypeAlias, TypedDict
+from ..._types import SequenceNotStr
from .rerank_config_param import RerankConfigParam
from ..shared_params.search_filter_condition import SearchFilterCondition
@@ -15,7 +16,7 @@ class FileSearchParams(TypedDict, total=False):
query: Required[str]
"""Search query text"""
- vector_store_identifiers: Required[List[str]]
+ vector_store_identifiers: Required[SequenceNotStr[str]]
"""IDs or names of vector stores to search"""
top_k: int
@@ -24,7 +25,7 @@ class FileSearchParams(TypedDict, total=False):
filters: Optional[Filters]
"""Optional filter conditions"""
- file_ids: Union[Iterable[object], List[str], None]
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None]
"""Optional list of file IDs to filter chunks by (inclusion filter)"""
search_options: SearchOptions
diff --git a/src/mixedbread/types/vector_stores/rerank_config_param.py b/src/mixedbread/types/vector_stores/rerank_config_param.py
index da1f0a33..9b13ef7b 100644
--- a/src/mixedbread/types/vector_stores/rerank_config_param.py
+++ b/src/mixedbread/types/vector_stores/rerank_config_param.py
@@ -2,9 +2,11 @@
from __future__ import annotations
-from typing import List, Union, Optional
+from typing import Union, Optional
from typing_extensions import TypedDict
+from ..._types import SequenceNotStr
+
__all__ = ["RerankConfigParam"]
@@ -12,7 +14,7 @@ class RerankConfigParam(TypedDict, total=False):
model: str
"""The name of the reranking model"""
- with_metadata: Union[bool, List[str]]
+ with_metadata: Union[bool, SequenceNotStr[str]]
"""Whether to include metadata in the reranked results"""
top_k: Optional[int]
From 900fc0b09cbd2c0b5dc770038253437c9edfac86 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 4 Sep 2025 04:12:38 +0000
Subject: [PATCH 261/375] feat: improve future compat with pydantic v3
---
src/mixedbread/_base_client.py | 6 +-
src/mixedbread/_compat.py | 96 ++++++-------
src/mixedbread/_models.py | 80 +++++------
src/mixedbread/_utils/__init__.py | 10 +-
src/mixedbread/_utils/_compat.py | 45 ++++++
src/mixedbread/_utils/_datetime_parse.py | 136 ++++++++++++++++++
src/mixedbread/_utils/_transform.py | 6 +-
src/mixedbread/_utils/_typing.py | 2 +-
src/mixedbread/_utils/_utils.py | 1 -
src/mixedbread/types/__init__.py | 6 +-
src/mixedbread/types/shared/search_filter.py | 8 +-
.../types/shared_params/search_filter.py | 8 +-
tests/test_models.py | 48 +++----
tests/test_transform.py | 16 +--
tests/test_utils/test_datetime_parse.py | 110 ++++++++++++++
tests/utils.py | 8 +-
16 files changed, 443 insertions(+), 143 deletions(-)
create mode 100644 src/mixedbread/_utils/_compat.py
create mode 100644 src/mixedbread/_utils/_datetime_parse.py
create mode 100644 tests/test_utils/test_datetime_parse.py
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index d8edf54b..60c1612a 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -59,7 +59,7 @@
ModelBuilderProtocol,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
-from ._compat import PYDANTIC_V2, model_copy, model_dump
+from ._compat import PYDANTIC_V1, model_copy, model_dump
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
from ._response import (
APIResponse,
@@ -232,7 +232,7 @@ def _set_private_attributes(
model: Type[_T],
options: FinalRequestOptions,
) -> None:
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}
self._model = model
@@ -320,7 +320,7 @@ def _set_private_attributes(
client: AsyncAPIClient,
options: FinalRequestOptions,
) -> None:
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}
self._model = model
diff --git a/src/mixedbread/_compat.py b/src/mixedbread/_compat.py
index 92d9ee61..bdef67f0 100644
--- a/src/mixedbread/_compat.py
+++ b/src/mixedbread/_compat.py
@@ -12,14 +12,13 @@
_T = TypeVar("_T")
_ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel)
-# --------------- Pydantic v2 compatibility ---------------
+# --------------- Pydantic v2, v3 compatibility ---------------
# Pyright incorrectly reports some of our functions as overriding a method when they don't
# pyright: reportIncompatibleMethodOverride=false
-PYDANTIC_V2 = pydantic.VERSION.startswith("2.")
+PYDANTIC_V1 = pydantic.VERSION.startswith("1.")
-# v1 re-exports
if TYPE_CHECKING:
def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001
@@ -44,90 +43,92 @@ def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001
...
else:
- if PYDANTIC_V2:
- from pydantic.v1.typing import (
+ # v1 re-exports
+ if PYDANTIC_V1:
+ from pydantic.typing import (
get_args as get_args,
is_union as is_union,
get_origin as get_origin,
is_typeddict as is_typeddict,
is_literal_type as is_literal_type,
)
- from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
+ from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
else:
- from pydantic.typing import (
+ from ._utils import (
get_args as get_args,
is_union as is_union,
get_origin as get_origin,
+ parse_date as parse_date,
is_typeddict as is_typeddict,
+ parse_datetime as parse_datetime,
is_literal_type as is_literal_type,
)
- from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
# refactored config
if TYPE_CHECKING:
from pydantic import ConfigDict as ConfigDict
else:
- if PYDANTIC_V2:
- from pydantic import ConfigDict
- else:
+ if PYDANTIC_V1:
# TODO: provide an error message here?
ConfigDict = None
+ else:
+ from pydantic import ConfigDict as ConfigDict
# renamed methods / properties
def parse_obj(model: type[_ModelT], value: object) -> _ModelT:
- if PYDANTIC_V2:
- return model.model_validate(value)
- else:
+ if PYDANTIC_V1:
return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
+ else:
+ return model.model_validate(value)
def field_is_required(field: FieldInfo) -> bool:
- if PYDANTIC_V2:
- return field.is_required()
- return field.required # type: ignore
+ if PYDANTIC_V1:
+ return field.required # type: ignore
+ return field.is_required()
def field_get_default(field: FieldInfo) -> Any:
value = field.get_default()
- if PYDANTIC_V2:
- from pydantic_core import PydanticUndefined
-
- if value == PydanticUndefined:
- return None
+ if PYDANTIC_V1:
return value
+ from pydantic_core import PydanticUndefined
+
+ if value == PydanticUndefined:
+ return None
return value
def field_outer_type(field: FieldInfo) -> Any:
- if PYDANTIC_V2:
- return field.annotation
- return field.outer_type_ # type: ignore
+ if PYDANTIC_V1:
+ return field.outer_type_ # type: ignore
+ return field.annotation
def get_model_config(model: type[pydantic.BaseModel]) -> Any:
- if PYDANTIC_V2:
- return model.model_config
- return model.__config__ # type: ignore
+ if PYDANTIC_V1:
+ return model.__config__ # type: ignore
+ return model.model_config
def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]:
- if PYDANTIC_V2:
- return model.model_fields
- return model.__fields__ # type: ignore
+ if PYDANTIC_V1:
+ return model.__fields__ # type: ignore
+ return model.model_fields
def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT:
- if PYDANTIC_V2:
- return model.model_copy(deep=deep)
- return model.copy(deep=deep) # type: ignore
+ if PYDANTIC_V1:
+ return model.copy(deep=deep) # type: ignore
+ return model.model_copy(deep=deep)
def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
- if PYDANTIC_V2:
- return model.model_dump_json(indent=indent)
- return model.json(indent=indent) # type: ignore
+ if PYDANTIC_V1:
+ return model.json(indent=indent) # type: ignore
+ return model.model_dump_json(indent=indent)
def model_dump(
@@ -139,14 +140,14 @@ def model_dump(
warnings: bool = True,
mode: Literal["json", "python"] = "python",
) -> dict[str, Any]:
- if PYDANTIC_V2 or hasattr(model, "model_dump"):
+ if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
return model.model_dump(
mode=mode,
exclude=exclude,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
- warnings=warnings if PYDANTIC_V2 else True,
+ warnings=True if PYDANTIC_V1 else warnings,
)
return cast(
"dict[str, Any]",
@@ -159,9 +160,9 @@ def model_dump(
def model_parse(model: type[_ModelT], data: Any) -> _ModelT:
- if PYDANTIC_V2:
- return model.model_validate(data)
- return model.parse_obj(data) # pyright: ignore[reportDeprecated]
+ if PYDANTIC_V1:
+ return model.parse_obj(data) # pyright: ignore[reportDeprecated]
+ return model.model_validate(data)
# generic models
@@ -170,17 +171,16 @@ def model_parse(model: type[_ModelT], data: Any) -> _ModelT:
class GenericModel(pydantic.BaseModel): ...
else:
- if PYDANTIC_V2:
+ if PYDANTIC_V1:
+ import pydantic.generics
+
+ class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
+ else:
# there no longer needs to be a distinction in v2 but
# we still have to create our own subclass to avoid
# inconsistent MRO ordering errors
class GenericModel(pydantic.BaseModel): ...
- else:
- import pydantic.generics
-
- class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
-
# cached properties
if TYPE_CHECKING:
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 92f7c10b..3a6017ef 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -50,7 +50,7 @@
strip_annotated_type,
)
from ._compat import (
- PYDANTIC_V2,
+ PYDANTIC_V1,
ConfigDict,
GenericModel as BaseGenericModel,
get_args,
@@ -81,11 +81,7 @@ class _ConfigProtocol(Protocol):
class BaseModel(pydantic.BaseModel):
- if PYDANTIC_V2:
- model_config: ClassVar[ConfigDict] = ConfigDict(
- extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true"))
- )
- else:
+ if PYDANTIC_V1:
@property
@override
@@ -95,6 +91,10 @@ def model_fields_set(self) -> set[str]:
class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated]
extra: Any = pydantic.Extra.allow # type: ignore
+ else:
+ model_config: ClassVar[ConfigDict] = ConfigDict(
+ extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true"))
+ )
def to_dict(
self,
@@ -215,25 +215,25 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride]
if key not in model_fields:
parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value
- if PYDANTIC_V2:
- _extra[key] = parsed
- else:
+ if PYDANTIC_V1:
_fields_set.add(key)
fields_values[key] = parsed
+ else:
+ _extra[key] = parsed
object.__setattr__(m, "__dict__", fields_values)
- if PYDANTIC_V2:
- # these properties are copied from Pydantic's `model_construct()` method
- object.__setattr__(m, "__pydantic_private__", None)
- object.__setattr__(m, "__pydantic_extra__", _extra)
- object.__setattr__(m, "__pydantic_fields_set__", _fields_set)
- else:
+ if PYDANTIC_V1:
# init_private_attributes() does not exist in v2
m._init_private_attributes() # type: ignore
# copied from Pydantic v1's `construct()` method
object.__setattr__(m, "__fields_set__", _fields_set)
+ else:
+ # these properties are copied from Pydantic's `model_construct()` method
+ object.__setattr__(m, "__pydantic_private__", None)
+ object.__setattr__(m, "__pydantic_extra__", _extra)
+ object.__setattr__(m, "__pydantic_fields_set__", _fields_set)
return m
@@ -243,7 +243,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride]
# although not in practice
model_construct = construct
- if not PYDANTIC_V2:
+ if PYDANTIC_V1:
# we define aliases for some of the new pydantic v2 methods so
# that we can just document these methods without having to specify
# a specific pydantic version as some users may not know which
@@ -363,10 +363,10 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
if value is None:
return field_get_default(field)
- if PYDANTIC_V2:
- type_ = field.annotation
- else:
+ if PYDANTIC_V1:
type_ = cast(type, field.outer_type_) # type: ignore
+ else:
+ type_ = field.annotation # type: ignore
if type_ is None:
raise RuntimeError(f"Unexpected field type is None for {key}")
@@ -375,7 +375,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None:
- if not PYDANTIC_V2:
+ if PYDANTIC_V1:
# TODO
return None
@@ -628,30 +628,30 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
for variant in get_args(union):
variant = strip_annotated_type(variant)
if is_basemodel_type(variant):
- if PYDANTIC_V2:
- field = _extract_field_schema_pv2(variant, discriminator_field_name)
- if not field:
+ if PYDANTIC_V1:
+ field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
+ if not field_info:
continue
# Note: if one variant defines an alias then they all should
- discriminator_alias = field.get("serialization_alias")
-
- field_schema = field["schema"]
+ discriminator_alias = field_info.alias
- if field_schema["type"] == "literal":
- for entry in cast("LiteralSchema", field_schema)["expected"]:
+ if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation):
+ for entry in get_args(annotation):
if isinstance(entry, str):
mapping[entry] = variant
else:
- field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
- if not field_info:
+ field = _extract_field_schema_pv2(variant, discriminator_field_name)
+ if not field:
continue
# Note: if one variant defines an alias then they all should
- discriminator_alias = field_info.alias
+ discriminator_alias = field.get("serialization_alias")
- if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation):
- for entry in get_args(annotation):
+ field_schema = field["schema"]
+
+ if field_schema["type"] == "literal":
+ for entry in cast("LiteralSchema", field_schema)["expected"]:
if isinstance(entry, str):
mapping[entry] = variant
@@ -714,7 +714,7 @@ class GenericModel(BaseGenericModel, BaseModel):
pass
-if PYDANTIC_V2:
+if not PYDANTIC_V1:
from pydantic import TypeAdapter as _TypeAdapter
_CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter))
@@ -782,12 +782,12 @@ class FinalRequestOptions(pydantic.BaseModel):
json_data: Union[Body, None] = None
extra_json: Union[AnyMapping, None] = None
- if PYDANTIC_V2:
- model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True)
- else:
+ if PYDANTIC_V1:
class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated]
arbitrary_types_allowed: bool = True
+ else:
+ model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True)
def get_max_retries(self, max_retries: int) -> int:
if isinstance(self.max_retries, NotGiven):
@@ -820,9 +820,9 @@ def construct( # type: ignore
key: strip_not_given(value)
for key, value in values.items()
}
- if PYDANTIC_V2:
- return super().model_construct(_fields_set, **kwargs)
- return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated]
+ if PYDANTIC_V1:
+ return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated]
+ return super().model_construct(_fields_set, **kwargs)
if not TYPE_CHECKING:
# type checkers incorrectly complain about this assignment
diff --git a/src/mixedbread/_utils/__init__.py b/src/mixedbread/_utils/__init__.py
index ca547ce5..dc64e29a 100644
--- a/src/mixedbread/_utils/__init__.py
+++ b/src/mixedbread/_utils/__init__.py
@@ -10,7 +10,6 @@
lru_cache as lru_cache,
is_mapping as is_mapping,
is_tuple_t as is_tuple_t,
- parse_date as parse_date,
is_iterable as is_iterable,
is_sequence as is_sequence,
coerce_float as coerce_float,
@@ -23,7 +22,6 @@
coerce_boolean as coerce_boolean,
coerce_integer as coerce_integer,
file_from_path as file_from_path,
- parse_datetime as parse_datetime,
strip_not_given as strip_not_given,
deepcopy_minimal as deepcopy_minimal,
get_async_library as get_async_library,
@@ -32,6 +30,13 @@
maybe_coerce_boolean as maybe_coerce_boolean,
maybe_coerce_integer as maybe_coerce_integer,
)
+from ._compat import (
+ get_args as get_args,
+ is_union as is_union,
+ get_origin as get_origin,
+ is_typeddict as is_typeddict,
+ is_literal_type as is_literal_type,
+)
from ._typing import (
is_list_type as is_list_type,
is_union_type as is_union_type,
@@ -56,3 +61,4 @@
function_has_argument as function_has_argument,
assert_signatures_in_sync as assert_signatures_in_sync,
)
+from ._datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
diff --git a/src/mixedbread/_utils/_compat.py b/src/mixedbread/_utils/_compat.py
new file mode 100644
index 00000000..dd703233
--- /dev/null
+++ b/src/mixedbread/_utils/_compat.py
@@ -0,0 +1,45 @@
+from __future__ import annotations
+
+import sys
+import typing_extensions
+from typing import Any, Type, Union, Literal, Optional
+from datetime import date, datetime
+from typing_extensions import get_args as _get_args, get_origin as _get_origin
+
+from .._types import StrBytesIntFloat
+from ._datetime_parse import parse_date as _parse_date, parse_datetime as _parse_datetime
+
+_LITERAL_TYPES = {Literal, typing_extensions.Literal}
+
+
+def get_args(tp: type[Any]) -> tuple[Any, ...]:
+ return _get_args(tp)
+
+
+def get_origin(tp: type[Any]) -> type[Any] | None:
+ return _get_origin(tp)
+
+
+def is_union(tp: Optional[Type[Any]]) -> bool:
+ if sys.version_info < (3, 10):
+ return tp is Union # type: ignore[comparison-overlap]
+ else:
+ import types
+
+ return tp is Union or tp is types.UnionType
+
+
+def is_typeddict(tp: Type[Any]) -> bool:
+ return typing_extensions.is_typeddict(tp)
+
+
+def is_literal_type(tp: Type[Any]) -> bool:
+ return get_origin(tp) in _LITERAL_TYPES
+
+
+def parse_date(value: Union[date, StrBytesIntFloat]) -> date:
+ return _parse_date(value)
+
+
+def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime:
+ return _parse_datetime(value)
diff --git a/src/mixedbread/_utils/_datetime_parse.py b/src/mixedbread/_utils/_datetime_parse.py
new file mode 100644
index 00000000..7cb9d9e6
--- /dev/null
+++ b/src/mixedbread/_utils/_datetime_parse.py
@@ -0,0 +1,136 @@
+"""
+This file contains code from https://github.com/pydantic/pydantic/blob/main/pydantic/v1/datetime_parse.py
+without the Pydantic v1 specific errors.
+"""
+
+from __future__ import annotations
+
+import re
+from typing import Dict, Union, Optional
+from datetime import date, datetime, timezone, timedelta
+
+from .._types import StrBytesIntFloat
+
+date_expr = r"(?P\d{4})-(?P\d{1,2})-(?P\d{1,2})"
+time_expr = (
+ r"(?P\d{1,2}):(?P\d{1,2})"
+ r"(?::(?P\d{1,2})(?:\.(?P\d{1,6})\d{0,6})?)?"
+ r"(?PZ|[+-]\d{2}(?::?\d{2})?)?$"
+)
+
+date_re = re.compile(f"{date_expr}$")
+datetime_re = re.compile(f"{date_expr}[T ]{time_expr}")
+
+
+EPOCH = datetime(1970, 1, 1)
+# if greater than this, the number is in ms, if less than or equal it's in seconds
+# (in seconds this is 11th October 2603, in ms it's 20th August 1970)
+MS_WATERSHED = int(2e10)
+# slightly more than datetime.max in ns - (datetime.max - EPOCH).total_seconds() * 1e9
+MAX_NUMBER = int(3e20)
+
+
+def _get_numeric(value: StrBytesIntFloat, native_expected_type: str) -> Union[None, int, float]:
+ if isinstance(value, (int, float)):
+ return value
+ try:
+ return float(value)
+ except ValueError:
+ return None
+ except TypeError:
+ raise TypeError(f"invalid type; expected {native_expected_type}, string, bytes, int or float") from None
+
+
+def _from_unix_seconds(seconds: Union[int, float]) -> datetime:
+ if seconds > MAX_NUMBER:
+ return datetime.max
+ elif seconds < -MAX_NUMBER:
+ return datetime.min
+
+ while abs(seconds) > MS_WATERSHED:
+ seconds /= 1000
+ dt = EPOCH + timedelta(seconds=seconds)
+ return dt.replace(tzinfo=timezone.utc)
+
+
+def _parse_timezone(value: Optional[str]) -> Union[None, int, timezone]:
+ if value == "Z":
+ return timezone.utc
+ elif value is not None:
+ offset_mins = int(value[-2:]) if len(value) > 3 else 0
+ offset = 60 * int(value[1:3]) + offset_mins
+ if value[0] == "-":
+ offset = -offset
+ return timezone(timedelta(minutes=offset))
+ else:
+ return None
+
+
+def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime:
+ """
+ Parse a datetime/int/float/string and return a datetime.datetime.
+
+ This function supports time zone offsets. When the input contains one,
+ the output uses a timezone with a fixed offset from UTC.
+
+ Raise ValueError if the input is well formatted but not a valid datetime.
+ Raise ValueError if the input isn't well formatted.
+ """
+ if isinstance(value, datetime):
+ return value
+
+ number = _get_numeric(value, "datetime")
+ if number is not None:
+ return _from_unix_seconds(number)
+
+ if isinstance(value, bytes):
+ value = value.decode()
+
+ assert not isinstance(value, (float, int))
+
+ match = datetime_re.match(value)
+ if match is None:
+ raise ValueError("invalid datetime format")
+
+ kw = match.groupdict()
+ if kw["microsecond"]:
+ kw["microsecond"] = kw["microsecond"].ljust(6, "0")
+
+ tzinfo = _parse_timezone(kw.pop("tzinfo"))
+ kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None}
+ kw_["tzinfo"] = tzinfo
+
+ return datetime(**kw_) # type: ignore
+
+
+def parse_date(value: Union[date, StrBytesIntFloat]) -> date:
+ """
+ Parse a date/int/float/string and return a datetime.date.
+
+ Raise ValueError if the input is well formatted but not a valid date.
+ Raise ValueError if the input isn't well formatted.
+ """
+ if isinstance(value, date):
+ if isinstance(value, datetime):
+ return value.date()
+ else:
+ return value
+
+ number = _get_numeric(value, "date")
+ if number is not None:
+ return _from_unix_seconds(number).date()
+
+ if isinstance(value, bytes):
+ value = value.decode()
+
+ assert not isinstance(value, (float, int))
+ match = date_re.match(value)
+ if match is None:
+ raise ValueError("invalid date format")
+
+ kw = {k: int(v) for k, v in match.groupdict().items()}
+
+ try:
+ return date(**kw)
+ except ValueError:
+ raise ValueError("invalid date format") from None
diff --git a/src/mixedbread/_utils/_transform.py b/src/mixedbread/_utils/_transform.py
index f0bcefd4..c19124f0 100644
--- a/src/mixedbread/_utils/_transform.py
+++ b/src/mixedbread/_utils/_transform.py
@@ -19,6 +19,7 @@
is_sequence,
)
from .._files import is_base64_file_input
+from ._compat import get_origin, is_typeddict
from ._typing import (
is_list_type,
is_union_type,
@@ -29,7 +30,6 @@
is_annotated_type,
strip_annotated_type,
)
-from .._compat import get_origin, model_dump, is_typeddict
_T = TypeVar("_T")
@@ -169,6 +169,8 @@ def _transform_recursive(
Defaults to the same value as the `annotation` argument.
"""
+ from .._compat import model_dump
+
if inner_type is None:
inner_type = annotation
@@ -333,6 +335,8 @@ async def _async_transform_recursive(
Defaults to the same value as the `annotation` argument.
"""
+ from .._compat import model_dump
+
if inner_type is None:
inner_type = annotation
diff --git a/src/mixedbread/_utils/_typing.py b/src/mixedbread/_utils/_typing.py
index 845cd6b2..193109f3 100644
--- a/src/mixedbread/_utils/_typing.py
+++ b/src/mixedbread/_utils/_typing.py
@@ -15,7 +15,7 @@
from ._utils import lru_cache
from .._types import InheritsGeneric
-from .._compat import is_union as _is_union
+from ._compat import is_union as _is_union
def is_annotated_type(typ: type) -> bool:
diff --git a/src/mixedbread/_utils/_utils.py b/src/mixedbread/_utils/_utils.py
index ea3cf3f2..f0818595 100644
--- a/src/mixedbread/_utils/_utils.py
+++ b/src/mixedbread/_utils/_utils.py
@@ -22,7 +22,6 @@
import sniffio
from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike
-from .._compat import parse_date as parse_date, parse_datetime as parse_datetime
_T = TypeVar("_T")
_TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index da6af5f0..651a8004 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -62,7 +62,7 @@
# This ensures that, when building the deferred (due to cyclical references) model schema,
# Pydantic can resolve the necessary references.
# See: https://github.com/pydantic/pydantic/issues/11250 for more context.
-if _compat.PYDANTIC_V2:
- shared.search_filter.SearchFilter.model_rebuild(_parent_namespace_depth=0)
-else:
+if _compat.PYDANTIC_V1:
shared.search_filter.SearchFilter.update_forward_refs() # type: ignore
+else:
+ shared.search_filter.SearchFilter.model_rebuild(_parent_namespace_depth=0)
diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py
index 579ae162..45e367a5 100644
--- a/src/mixedbread/types/shared/search_filter.py
+++ b/src/mixedbread/types/shared/search_filter.py
@@ -5,23 +5,23 @@
from typing import TYPE_CHECKING, List, Union, Optional
from typing_extensions import TypeAlias, TypeAliasType
-from ..._compat import PYDANTIC_V2
+from ..._compat import PYDANTIC_V1
from ..._models import BaseModel
from .search_filter_condition import SearchFilterCondition
__all__ = ["SearchFilter", "All", "Any", "NoneType"]
-if TYPE_CHECKING or PYDANTIC_V2:
+if TYPE_CHECKING or not PYDANTIC_V1:
All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
else:
All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-if TYPE_CHECKING or PYDANTIC_V2:
+if TYPE_CHECKING or not PYDANTIC_V1:
Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
else:
Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-if TYPE_CHECKING or PYDANTIC_V2:
+if TYPE_CHECKING or not PYDANTIC_V1:
NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
else:
NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
diff --git a/src/mixedbread/types/shared_params/search_filter.py b/src/mixedbread/types/shared_params/search_filter.py
index a952a27a..02870e0e 100644
--- a/src/mixedbread/types/shared_params/search_filter.py
+++ b/src/mixedbread/types/shared_params/search_filter.py
@@ -5,22 +5,22 @@
from typing import TYPE_CHECKING, Union, Iterable, Optional
from typing_extensions import TypeAlias, TypedDict, TypeAliasType
-from ..._compat import PYDANTIC_V2
+from ..._compat import PYDANTIC_V1
from .search_filter_condition import SearchFilterCondition
__all__ = ["SearchFilter", "All", "Any", "NoneType"]
-if TYPE_CHECKING or PYDANTIC_V2:
+if TYPE_CHECKING or not PYDANTIC_V1:
All = TypeAliasType("All", Union["SearchFilter", SearchFilterCondition])
else:
All: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-if TYPE_CHECKING or PYDANTIC_V2:
+if TYPE_CHECKING or not PYDANTIC_V1:
Any = TypeAliasType("Any", Union["SearchFilter", SearchFilterCondition])
else:
Any: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-if TYPE_CHECKING or PYDANTIC_V2:
+if TYPE_CHECKING or not PYDANTIC_V1:
NoneType = TypeAliasType("NoneType", Union["SearchFilter", SearchFilterCondition])
else:
NoneType: TypeAlias = Union["SearchFilter", SearchFilterCondition]
diff --git a/tests/test_models.py b/tests/test_models.py
index a6a2821e..4a12ab5d 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -8,7 +8,7 @@
from pydantic import Field
from mixedbread._utils import PropertyInfo
-from mixedbread._compat import PYDANTIC_V2, parse_obj, model_dump, model_json
+from mixedbread._compat import PYDANTIC_V1, parse_obj, model_dump, model_json
from mixedbread._models import BaseModel, construct_type
@@ -294,12 +294,12 @@ class Model(BaseModel):
assert cast(bool, m.foo) is True
m = Model.construct(foo={"name": 3})
- if PYDANTIC_V2:
- assert isinstance(m.foo, Submodel1)
- assert m.foo.name == 3 # type: ignore
- else:
+ if PYDANTIC_V1:
assert isinstance(m.foo, Submodel2)
assert m.foo.name == "3"
+ else:
+ assert isinstance(m.foo, Submodel1)
+ assert m.foo.name == 3 # type: ignore
def test_list_of_unions() -> None:
@@ -426,10 +426,10 @@ class Model(BaseModel):
expected = datetime(2019, 12, 27, 18, 11, 19, 117000, tzinfo=timezone.utc)
- if PYDANTIC_V2:
- expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}'
- else:
+ if PYDANTIC_V1:
expected_json = '{"created_at": "2019-12-27T18:11:19.117000+00:00"}'
+ else:
+ expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}'
model = Model.construct(created_at="2019-12-27T18:11:19.117Z")
assert model.created_at == expected
@@ -531,7 +531,7 @@ class Model2(BaseModel):
assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)}
assert m4.to_dict(mode="json") == {"created_at": time_str}
- if not PYDANTIC_V2:
+ if PYDANTIC_V1:
with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"):
m.to_dict(warnings=False)
@@ -556,7 +556,7 @@ class Model(BaseModel):
assert m3.model_dump() == {"foo": None}
assert m3.model_dump(exclude_none=True) == {}
- if not PYDANTIC_V2:
+ if PYDANTIC_V1:
with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"):
m.model_dump(round_trip=True)
@@ -580,10 +580,10 @@ class Model(BaseModel):
assert json.loads(m.to_json()) == {"FOO": "hello"}
assert json.loads(m.to_json(use_api_names=False)) == {"foo": "hello"}
- if PYDANTIC_V2:
- assert m.to_json(indent=None) == '{"FOO":"hello"}'
- else:
+ if PYDANTIC_V1:
assert m.to_json(indent=None) == '{"FOO": "hello"}'
+ else:
+ assert m.to_json(indent=None) == '{"FOO":"hello"}'
m2 = Model()
assert json.loads(m2.to_json()) == {}
@@ -595,7 +595,7 @@ class Model(BaseModel):
assert json.loads(m3.to_json()) == {"FOO": None}
assert json.loads(m3.to_json(exclude_none=True)) == {}
- if not PYDANTIC_V2:
+ if PYDANTIC_V1:
with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"):
m.to_json(warnings=False)
@@ -622,7 +622,7 @@ class Model(BaseModel):
assert json.loads(m3.model_dump_json()) == {"foo": None}
assert json.loads(m3.model_dump_json(exclude_none=True)) == {}
- if not PYDANTIC_V2:
+ if PYDANTIC_V1:
with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"):
m.model_dump_json(round_trip=True)
@@ -679,12 +679,12 @@ class B(BaseModel):
)
assert isinstance(m, A)
assert m.type == "a"
- if PYDANTIC_V2:
- assert m.data == 100 # type: ignore[comparison-overlap]
- else:
+ if PYDANTIC_V1:
# pydantic v1 automatically converts inputs to strings
# if the expected type is a str
assert m.data == "100"
+ else:
+ assert m.data == 100 # type: ignore[comparison-overlap]
def test_discriminated_unions_unknown_variant() -> None:
@@ -768,12 +768,12 @@ class B(BaseModel):
)
assert isinstance(m, A)
assert m.foo_type == "a"
- if PYDANTIC_V2:
- assert m.data == 100 # type: ignore[comparison-overlap]
- else:
+ if PYDANTIC_V1:
# pydantic v1 automatically converts inputs to strings
# if the expected type is a str
assert m.data == "100"
+ else:
+ assert m.data == 100 # type: ignore[comparison-overlap]
def test_discriminated_unions_overlapping_discriminators_invalid_data() -> None:
@@ -833,7 +833,7 @@ class B(BaseModel):
assert UnionType.__discriminator__ is discriminator
-@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1")
+@pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1")
def test_type_alias_type() -> None:
Alias = TypeAliasType("Alias", str) # pyright: ignore
@@ -849,7 +849,7 @@ class Model(BaseModel):
assert m.union == "bar"
-@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1")
+@pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1")
def test_field_named_cls() -> None:
class Model(BaseModel):
cls: str
@@ -936,7 +936,7 @@ class Type2(BaseModel):
assert isinstance(model.value, InnerType2)
-@pytest.mark.skipif(not PYDANTIC_V2, reason="this is only supported in pydantic v2 for now")
+@pytest.mark.skipif(PYDANTIC_V1, reason="this is only supported in pydantic v2 for now")
def test_extra_properties() -> None:
class Item(BaseModel):
prop: int
diff --git a/tests/test_transform.py b/tests/test_transform.py
index d3c69d8e..0bad8ee8 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -15,7 +15,7 @@
parse_datetime,
async_transform as _async_transform,
)
-from mixedbread._compat import PYDANTIC_V2
+from mixedbread._compat import PYDANTIC_V1
from mixedbread._models import BaseModel
_T = TypeVar("_T")
@@ -189,7 +189,7 @@ class DateModel(BaseModel):
@pytest.mark.asyncio
async def test_iso8601_format(use_async: bool) -> None:
dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00")
- tz = "Z" if PYDANTIC_V2 else "+00:00"
+ tz = "+00:00" if PYDANTIC_V1 else "Z"
assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap]
assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692" + tz} # type: ignore[comparison-overlap]
@@ -297,11 +297,11 @@ async def test_pydantic_unknown_field(use_async: bool) -> None:
@pytest.mark.asyncio
async def test_pydantic_mismatched_types(use_async: bool) -> None:
model = MyModel.construct(foo=True)
- if PYDANTIC_V2:
+ if PYDANTIC_V1:
+ params = await transform(model, Any, use_async)
+ else:
with pytest.warns(UserWarning):
params = await transform(model, Any, use_async)
- else:
- params = await transform(model, Any, use_async)
assert cast(Any, params) == {"foo": True}
@@ -309,11 +309,11 @@ async def test_pydantic_mismatched_types(use_async: bool) -> None:
@pytest.mark.asyncio
async def test_pydantic_mismatched_object_type(use_async: bool) -> None:
model = MyModel.construct(foo=MyModel.construct(hello="world"))
- if PYDANTIC_V2:
+ if PYDANTIC_V1:
+ params = await transform(model, Any, use_async)
+ else:
with pytest.warns(UserWarning):
params = await transform(model, Any, use_async)
- else:
- params = await transform(model, Any, use_async)
assert cast(Any, params) == {"foo": {"hello": "world"}}
diff --git a/tests/test_utils/test_datetime_parse.py b/tests/test_utils/test_datetime_parse.py
new file mode 100644
index 00000000..27b7a48d
--- /dev/null
+++ b/tests/test_utils/test_datetime_parse.py
@@ -0,0 +1,110 @@
+"""
+Copied from https://github.com/pydantic/pydantic/blob/v1.10.22/tests/test_datetime_parse.py
+with modifications so it works without pydantic v1 imports.
+"""
+
+from typing import Type, Union
+from datetime import date, datetime, timezone, timedelta
+
+import pytest
+
+from mixedbread._utils import parse_date, parse_datetime
+
+
+def create_tz(minutes: int) -> timezone:
+ return timezone(timedelta(minutes=minutes))
+
+
+@pytest.mark.parametrize(
+ "value,result",
+ [
+ # Valid inputs
+ ("1494012444.883309", date(2017, 5, 5)),
+ (b"1494012444.883309", date(2017, 5, 5)),
+ (1_494_012_444.883_309, date(2017, 5, 5)),
+ ("1494012444", date(2017, 5, 5)),
+ (1_494_012_444, date(2017, 5, 5)),
+ (0, date(1970, 1, 1)),
+ ("2012-04-23", date(2012, 4, 23)),
+ (b"2012-04-23", date(2012, 4, 23)),
+ ("2012-4-9", date(2012, 4, 9)),
+ (date(2012, 4, 9), date(2012, 4, 9)),
+ (datetime(2012, 4, 9, 12, 15), date(2012, 4, 9)),
+ # Invalid inputs
+ ("x20120423", ValueError),
+ ("2012-04-56", ValueError),
+ (19_999_999_999, date(2603, 10, 11)), # just before watershed
+ (20_000_000_001, date(1970, 8, 20)), # just after watershed
+ (1_549_316_052, date(2019, 2, 4)), # nowish in s
+ (1_549_316_052_104, date(2019, 2, 4)), # nowish in ms
+ (1_549_316_052_104_324, date(2019, 2, 4)), # nowish in μs
+ (1_549_316_052_104_324_096, date(2019, 2, 4)), # nowish in ns
+ ("infinity", date(9999, 12, 31)),
+ ("inf", date(9999, 12, 31)),
+ (float("inf"), date(9999, 12, 31)),
+ ("infinity ", date(9999, 12, 31)),
+ (int("1" + "0" * 100), date(9999, 12, 31)),
+ (1e1000, date(9999, 12, 31)),
+ ("-infinity", date(1, 1, 1)),
+ ("-inf", date(1, 1, 1)),
+ ("nan", ValueError),
+ ],
+)
+def test_date_parsing(value: Union[str, bytes, int, float], result: Union[date, Type[Exception]]) -> None:
+ if type(result) == type and issubclass(result, Exception): # pyright: ignore[reportUnnecessaryIsInstance]
+ with pytest.raises(result):
+ parse_date(value)
+ else:
+ assert parse_date(value) == result
+
+
+@pytest.mark.parametrize(
+ "value,result",
+ [
+ # Valid inputs
+ # values in seconds
+ ("1494012444.883309", datetime(2017, 5, 5, 19, 27, 24, 883_309, tzinfo=timezone.utc)),
+ (1_494_012_444.883_309, datetime(2017, 5, 5, 19, 27, 24, 883_309, tzinfo=timezone.utc)),
+ ("1494012444", datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)),
+ (b"1494012444", datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)),
+ (1_494_012_444, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)),
+ # values in ms
+ ("1494012444000.883309", datetime(2017, 5, 5, 19, 27, 24, 883, tzinfo=timezone.utc)),
+ ("-1494012444000.883309", datetime(1922, 8, 29, 4, 32, 35, 999117, tzinfo=timezone.utc)),
+ (1_494_012_444_000, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)),
+ ("2012-04-23T09:15:00", datetime(2012, 4, 23, 9, 15)),
+ ("2012-4-9 4:8:16", datetime(2012, 4, 9, 4, 8, 16)),
+ ("2012-04-23T09:15:00Z", datetime(2012, 4, 23, 9, 15, 0, 0, timezone.utc)),
+ ("2012-4-9 4:8:16-0320", datetime(2012, 4, 9, 4, 8, 16, 0, create_tz(-200))),
+ ("2012-04-23T10:20:30.400+02:30", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(150))),
+ ("2012-04-23T10:20:30.400+02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(120))),
+ ("2012-04-23T10:20:30.400-02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))),
+ (b"2012-04-23T10:20:30.400-02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))),
+ (datetime(2017, 5, 5), datetime(2017, 5, 5)),
+ (0, datetime(1970, 1, 1, 0, 0, 0, tzinfo=timezone.utc)),
+ # Invalid inputs
+ ("x20120423091500", ValueError),
+ ("2012-04-56T09:15:90", ValueError),
+ ("2012-04-23T11:05:00-25:00", ValueError),
+ (19_999_999_999, datetime(2603, 10, 11, 11, 33, 19, tzinfo=timezone.utc)), # just before watershed
+ (20_000_000_001, datetime(1970, 8, 20, 11, 33, 20, 1000, tzinfo=timezone.utc)), # just after watershed
+ (1_549_316_052, datetime(2019, 2, 4, 21, 34, 12, 0, tzinfo=timezone.utc)), # nowish in s
+ (1_549_316_052_104, datetime(2019, 2, 4, 21, 34, 12, 104_000, tzinfo=timezone.utc)), # nowish in ms
+ (1_549_316_052_104_324, datetime(2019, 2, 4, 21, 34, 12, 104_324, tzinfo=timezone.utc)), # nowish in μs
+ (1_549_316_052_104_324_096, datetime(2019, 2, 4, 21, 34, 12, 104_324, tzinfo=timezone.utc)), # nowish in ns
+ ("infinity", datetime(9999, 12, 31, 23, 59, 59, 999999)),
+ ("inf", datetime(9999, 12, 31, 23, 59, 59, 999999)),
+ ("inf ", datetime(9999, 12, 31, 23, 59, 59, 999999)),
+ (1e50, datetime(9999, 12, 31, 23, 59, 59, 999999)),
+ (float("inf"), datetime(9999, 12, 31, 23, 59, 59, 999999)),
+ ("-infinity", datetime(1, 1, 1, 0, 0)),
+ ("-inf", datetime(1, 1, 1, 0, 0)),
+ ("nan", ValueError),
+ ],
+)
+def test_datetime_parsing(value: Union[str, bytes, int, float], result: Union[datetime, Type[Exception]]) -> None:
+ if type(result) == type and issubclass(result, Exception): # pyright: ignore[reportUnnecessaryIsInstance]
+ with pytest.raises(result):
+ parse_datetime(value)
+ else:
+ assert parse_datetime(value) == result
diff --git a/tests/utils.py b/tests/utils.py
index 020c34e2..c9a2638f 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -19,7 +19,7 @@
is_annotated_type,
is_type_alias_type,
)
-from mixedbread._compat import PYDANTIC_V2, field_outer_type, get_model_fields
+from mixedbread._compat import PYDANTIC_V1, field_outer_type, get_model_fields
from mixedbread._models import BaseModel
BaseModelT = TypeVar("BaseModelT", bound=BaseModel)
@@ -28,12 +28,12 @@
def assert_matches_model(model: type[BaseModelT], value: BaseModelT, *, path: list[str]) -> bool:
for name, field in get_model_fields(model).items():
field_value = getattr(value, name)
- if PYDANTIC_V2:
- allow_none = False
- else:
+ if PYDANTIC_V1:
# in v1 nullability was structured differently
# https://docs.pydantic.dev/2.0/migration/#required-optional-and-nullable-fields
allow_none = getattr(field, "allow_none", False)
+ else:
+ allow_none = False
assert_matches_type(
field_outer_type(field),
From c11b270aede8c5d753effcb1d9541c6a737bb7cc Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 5 Sep 2025 04:33:37 +0000
Subject: [PATCH 262/375] chore(internal): move mypy configurations to
`pyproject.toml` file
---
mypy.ini | 50 ------------------------------------------------
pyproject.toml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 50 deletions(-)
delete mode 100644 mypy.ini
diff --git a/mypy.ini b/mypy.ini
deleted file mode 100644
index 5d8f89a9..00000000
--- a/mypy.ini
+++ /dev/null
@@ -1,50 +0,0 @@
-[mypy]
-pretty = True
-show_error_codes = True
-
-# Exclude _files.py because mypy isn't smart enough to apply
-# the correct type narrowing and as this is an internal module
-# it's fine to just use Pyright.
-#
-# We also exclude our `tests` as mypy doesn't always infer
-# types correctly and Pyright will still catch any type errors.
-exclude = ^(src/mixedbread/_files\.py|_dev/.*\.py|tests/.*)$
-
-strict_equality = True
-implicit_reexport = True
-check_untyped_defs = True
-no_implicit_optional = True
-
-warn_return_any = True
-warn_unreachable = True
-warn_unused_configs = True
-
-# Turn these options off as it could cause conflicts
-# with the Pyright options.
-warn_unused_ignores = False
-warn_redundant_casts = False
-
-disallow_any_generics = True
-disallow_untyped_defs = True
-disallow_untyped_calls = True
-disallow_subclassing_any = True
-disallow_incomplete_defs = True
-disallow_untyped_decorators = True
-cache_fine_grained = True
-
-# By default, mypy reports an error if you assign a value to the result
-# of a function call that doesn't return anything. We do this in our test
-# cases:
-# ```
-# result = ...
-# assert result is None
-# ```
-# Changing this codegen to make mypy happy would increase complexity
-# and would not be worth it.
-disable_error_code = func-returns-value,overload-cannot-match
-
-# https://github.com/python/mypy/issues/12162
-[mypy.overrides]
-module = "black.files.*"
-ignore_errors = true
-ignore_missing_imports = true
diff --git a/pyproject.toml b/pyproject.toml
index 38780c53..aad265cd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -157,6 +157,58 @@ reportOverlappingOverload = false
reportImportCycles = false
reportPrivateUsage = false
+[tool.mypy]
+pretty = true
+show_error_codes = true
+
+# Exclude _files.py because mypy isn't smart enough to apply
+# the correct type narrowing and as this is an internal module
+# it's fine to just use Pyright.
+#
+# We also exclude our `tests` as mypy doesn't always infer
+# types correctly and Pyright will still catch any type errors.
+exclude = ['src/mixedbread/_files.py', '_dev/.*.py', 'tests/.*']
+
+strict_equality = true
+implicit_reexport = true
+check_untyped_defs = true
+no_implicit_optional = true
+
+warn_return_any = true
+warn_unreachable = true
+warn_unused_configs = true
+
+# Turn these options off as it could cause conflicts
+# with the Pyright options.
+warn_unused_ignores = false
+warn_redundant_casts = false
+
+disallow_any_generics = true
+disallow_untyped_defs = true
+disallow_untyped_calls = true
+disallow_subclassing_any = true
+disallow_incomplete_defs = true
+disallow_untyped_decorators = true
+cache_fine_grained = true
+
+# By default, mypy reports an error if you assign a value to the result
+# of a function call that doesn't return anything. We do this in our test
+# cases:
+# ```
+# result = ...
+# assert result is None
+# ```
+# Changing this codegen to make mypy happy would increase complexity
+# and would not be worth it.
+disable_error_code = "func-returns-value,overload-cannot-match"
+
+# https://github.com/python/mypy/issues/12162
+[[tool.mypy.overrides]]
+module = "black.files.*"
+ignore_errors = true
+ignore_missing_imports = true
+
+
[tool.ruff]
line-length = 120
output-format = "grouped"
From 7ce9b638edf3303cf9af7ead6f11d9ac26186a7b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 6 Sep 2025 05:20:38 +0000
Subject: [PATCH 263/375] chore(tests): simplify `get_platform` test
`nest_asyncio` is archived and broken on some platforms so it's
not worth keeping in our test suite.
---
pyproject.toml | 1 -
requirements-dev.lock | 1 -
tests/test_client.py | 53 +++++--------------------------------------
3 files changed, 6 insertions(+), 49 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index aad265cd..c9c29a06 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -56,7 +56,6 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
- "nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]
diff --git a/requirements-dev.lock b/requirements-dev.lock
index 75170ccd..9c562dc9 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -75,7 +75,6 @@ multidict==6.4.4
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
-nest-asyncio==1.6.0
nodeenv==1.8.0
# via pyright
nox==2023.4.22
diff --git a/tests/test_client.py b/tests/test_client.py
index 81aac0d0..177f226f 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -6,13 +6,10 @@
import os
import sys
import json
-import time
import asyncio
import inspect
-import subprocess
import tracemalloc
from typing import Any, Union, cast
-from textwrap import dedent
from unittest import mock
from typing_extensions import Literal
@@ -23,14 +20,17 @@
from mixedbread import Mixedbread, AsyncMixedbread, APIResponseValidationError
from mixedbread._types import Omit
+from mixedbread._utils import asyncify
from mixedbread._models import BaseModel, FinalRequestOptions
from mixedbread._exceptions import APIStatusError, APITimeoutError, MixedbreadError, APIResponseValidationError
from mixedbread._base_client import (
DEFAULT_TIMEOUT,
HTTPX_DEFAULT_TIMEOUT,
BaseClient,
+ OtherPlatform,
DefaultHttpxClient,
DefaultAsyncHttpxClient,
+ get_platform,
make_request_options,
)
@@ -1659,50 +1659,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
- def test_get_platform(self) -> None:
- # A previous implementation of asyncify could leave threads unterminated when
- # used with nest_asyncio.
- #
- # Since nest_asyncio.apply() is global and cannot be un-applied, this
- # test is run in a separate process to avoid affecting other tests.
- test_code = dedent("""
- import asyncio
- import nest_asyncio
- import threading
-
- from mixedbread._utils import asyncify
- from mixedbread._base_client import get_platform
-
- async def test_main() -> None:
- result = await asyncify(get_platform)()
- print(result)
- for thread in threading.enumerate():
- print(thread.name)
-
- nest_asyncio.apply()
- asyncio.run(test_main())
- """)
- with subprocess.Popen(
- [sys.executable, "-c", test_code],
- text=True,
- ) as process:
- timeout = 10 # seconds
-
- start_time = time.monotonic()
- while True:
- return_code = process.poll()
- if return_code is not None:
- if return_code != 0:
- raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code")
-
- # success
- break
-
- if time.monotonic() - start_time > timeout:
- process.kill()
- raise AssertionError("calling get_platform using asyncify resulted in a hung process")
-
- time.sleep(0.1)
+ async def test_get_platform(self) -> None:
+ platform = await asyncify(get_platform)()
+ assert isinstance(platform, (str, OtherPlatform))
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
# Test that the proxy environment variables are set correctly
From 649244aca34276dfaf7fc79c4c1dcbaf3cb468c3 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 8 Sep 2025 19:27:34 +0000
Subject: [PATCH 264/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/scored_audio_url_input_chunk.py | 3 +++
src/mixedbread/types/vector_stores/vector_store_file.py | 3 +++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e8f16265..50632ba4 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-a2720b37997685cf019808be37ab86f7071f55ac09c80916293489f6d3644160.yml
-openapi_spec_hash: 61c24c03f1df5276b03e7bcce5266c21
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-922df6375506208e6003aa26bdf065a8221e5a99aac6d654b9d2a76175339828.yml
+openapi_spec_hash: 19b698680ff92d3c5dc7e3f6c4ec12b1
config_hash: 22524d9aa927566851636768f6a861cd
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 8a9d43e8..59d6423f 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -52,3 +52,6 @@ class ScoredAudioURLInputChunk(BaseModel):
audio_url: AudioURL
"""The audio input specification."""
+
+ sampling_rate: int
+ """The sampling rate of the audio."""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index a5378318..e9c535d4 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -108,6 +108,9 @@ class ChunkAudioURLInputChunk(BaseModel):
audio_url: ChunkAudioURLInputChunkAudioURL
"""The audio input specification."""
+ sampling_rate: int
+ """The sampling rate of the audio."""
+
class ChunkVideoURLInputChunkVideoURL(BaseModel):
url: str
From a403b60f7bf59b323f9075c1bf671922d5c93308 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 8 Sep 2025 19:32:26 +0000
Subject: [PATCH 265/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index b8dda9bf..554e34bb 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.29.0"
+ ".": "0.30.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index c9c29a06..897de283 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.29.0"
+version = "0.30.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 95fda5ff..341d4e2a 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.29.0" # x-release-please-version
+__version__ = "0.30.0" # x-release-please-version
From f3a1690994a8b6fcd19917be44d3b05fc0630ebc Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 8 Sep 2025 19:37:37 +0000
Subject: [PATCH 266/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 50632ba4..c9fd9032 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-922df6375506208e6003aa26bdf065a8221e5a99aac6d654b9d2a76175339828.yml
openapi_spec_hash: 19b698680ff92d3c5dc7e3f6c4ec12b1
-config_hash: 22524d9aa927566851636768f6a861cd
+config_hash: fef0ea78daf11093ff503919baae5ec0
From 84cec5d1f9a0fd9eb3a9344c15f4c0478f5f2500 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 17 Sep 2025 03:18:14 +0000
Subject: [PATCH 267/375] chore(internal): update pydantic dependency
---
requirements-dev.lock | 7 +++++--
requirements.lock | 7 +++++--
src/mixedbread/_models.py | 14 ++++++++++----
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/requirements-dev.lock b/requirements-dev.lock
index 9c562dc9..f24d36ed 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -88,9 +88,9 @@ pluggy==1.5.0
propcache==0.3.1
# via aiohttp
# via yarl
-pydantic==2.10.3
+pydantic==2.11.9
# via mixedbread
-pydantic-core==2.27.1
+pydantic-core==2.33.2
# via pydantic
pygments==2.18.0
# via rich
@@ -126,6 +126,9 @@ typing-extensions==4.12.2
# via pydantic
# via pydantic-core
# via pyright
+ # via typing-inspection
+typing-inspection==0.4.1
+ # via pydantic
virtualenv==20.24.5
# via nox
yarl==1.20.0
diff --git a/requirements.lock b/requirements.lock
index 93fffc81..57e00706 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -55,9 +55,9 @@ multidict==6.4.4
propcache==0.3.1
# via aiohttp
# via yarl
-pydantic==2.10.3
+pydantic==2.11.9
# via mixedbread
-pydantic-core==2.27.1
+pydantic-core==2.33.2
# via pydantic
sniffio==1.3.0
# via anyio
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
# via multidict
# via pydantic
# via pydantic-core
+ # via typing-inspection
+typing-inspection==0.4.1
+ # via pydantic
yarl==1.20.0
# via aiohttp
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 3a6017ef..6a3cd1d2 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -256,7 +256,7 @@ def model_dump(
mode: Literal["json", "python"] | str = "python",
include: IncEx | None = None,
exclude: IncEx | None = None,
- by_alias: bool = False,
+ by_alias: bool | None = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
@@ -264,6 +264,7 @@ def model_dump(
warnings: bool | Literal["none", "warn", "error"] = True,
context: dict[str, Any] | None = None,
serialize_as_any: bool = False,
+ fallback: Callable[[Any], Any] | None = None,
) -> dict[str, Any]:
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
@@ -295,10 +296,12 @@ def model_dump(
raise ValueError("context is only supported in Pydantic v2")
if serialize_as_any != False:
raise ValueError("serialize_as_any is only supported in Pydantic v2")
+ if fallback is not None:
+ raise ValueError("fallback is only supported in Pydantic v2")
dumped = super().dict( # pyright: ignore[reportDeprecated]
include=include,
exclude=exclude,
- by_alias=by_alias,
+ by_alias=by_alias if by_alias is not None else False,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
exclude_none=exclude_none,
@@ -313,13 +316,14 @@ def model_dump_json(
indent: int | None = None,
include: IncEx | None = None,
exclude: IncEx | None = None,
- by_alias: bool = False,
+ by_alias: bool | None = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
round_trip: bool = False,
warnings: bool | Literal["none", "warn", "error"] = True,
context: dict[str, Any] | None = None,
+ fallback: Callable[[Any], Any] | None = None,
serialize_as_any: bool = False,
) -> str:
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
@@ -348,11 +352,13 @@ def model_dump_json(
raise ValueError("context is only supported in Pydantic v2")
if serialize_as_any != False:
raise ValueError("serialize_as_any is only supported in Pydantic v2")
+ if fallback is not None:
+ raise ValueError("fallback is only supported in Pydantic v2")
return super().json( # type: ignore[reportDeprecated]
indent=indent,
include=include,
exclude=exclude,
- by_alias=by_alias,
+ by_alias=by_alias if by_alias is not None else False,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
exclude_none=exclude_none,
From 3e3cbbff3d214750e86a392e2d30105a2d651274 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 19 Sep 2025 03:41:14 +0000
Subject: [PATCH 268/375] chore(types): change optional parameter type from
NotGiven to Omit
---
src/mixedbread/__init__.py | 4 +-
src/mixedbread/_base_client.py | 18 +--
src/mixedbread/_client.py | 71 ++++-----
src/mixedbread/_qs.py | 14 +-
src/mixedbread/_types.py | 29 ++--
src/mixedbread/_utils/_transform.py | 4 +-
src/mixedbread/_utils/_utils.py | 8 +-
src/mixedbread/resources/api_keys.py | 42 +++---
src/mixedbread/resources/chat.py | 6 +-
.../resources/data_sources/connectors.py | 70 ++++-----
.../resources/data_sources/data_sources.py | 126 ++++++++--------
src/mixedbread/resources/embeddings.py | 22 +--
.../resources/extractions/content.py | 10 +-
src/mixedbread/resources/extractions/jobs.py | 10 +-
.../resources/extractions/schema.py | 14 +-
src/mixedbread/resources/files.py | 46 +++---
src/mixedbread/resources/parsing/jobs.py | 62 ++++----
.../resources/vector_stores/files.py | 74 +++++-----
.../resources/vector_stores/vector_stores.py | 138 +++++++++---------
tests/test_transform.py | 11 +-
20 files changed, 398 insertions(+), 381 deletions(-)
diff --git a/src/mixedbread/__init__.py b/src/mixedbread/__init__.py
index df2a2fb2..82ae8048 100644
--- a/src/mixedbread/__init__.py
+++ b/src/mixedbread/__init__.py
@@ -3,7 +3,7 @@
import typing as _t
from . import types
-from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
+from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
from ._utils import file_from_path
from ._client import (
ENVIRONMENTS,
@@ -49,7 +49,9 @@
"ProxiesTypes",
"NotGiven",
"NOT_GIVEN",
+ "not_given",
"Omit",
+ "omit",
"MixedbreadError",
"APIError",
"APIStatusError",
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 60c1612a..69fd970e 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -42,7 +42,6 @@
from ._qs import Querystring
from ._files import to_httpx_files, async_to_httpx_files
from ._types import (
- NOT_GIVEN,
Body,
Omit,
Query,
@@ -57,6 +56,7 @@
RequestOptions,
HttpxRequestFiles,
ModelBuilderProtocol,
+ not_given,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import PYDANTIC_V1, model_copy, model_dump
@@ -145,9 +145,9 @@ def __init__(
def __init__(
self,
*,
- url: URL | NotGiven = NOT_GIVEN,
- json: Body | NotGiven = NOT_GIVEN,
- params: Query | NotGiven = NOT_GIVEN,
+ url: URL | NotGiven = not_given,
+ json: Body | NotGiven = not_given,
+ params: Query | NotGiven = not_given,
) -> None:
self.url = url
self.json = json
@@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques
# we internally support defining a temporary header to override the
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
# see _response.py for implementation details
- override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
+ override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
if is_given(override_cast_to):
options.headers = headers
return cast(Type[ResponseT], override_cast_to)
@@ -825,7 +825,7 @@ def __init__(
version: str,
base_url: str | URL,
max_retries: int = DEFAULT_MAX_RETRIES,
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
@@ -1356,7 +1356,7 @@ def __init__(
base_url: str | URL,
_strict_response_validation: bool,
max_retries: int = DEFAULT_MAX_RETRIES,
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
@@ -1818,8 +1818,8 @@ def make_request_options(
extra_query: Query | None = None,
extra_body: Body | None = None,
idempotency_key: str | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
- post_parser: PostParser | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ post_parser: PostParser | NotGiven = not_given,
) -> RequestOptions:
"""Create a dict of type RequestOptions without keys of NotGiven values."""
options: RequestOptions = {}
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index c4f54779..31462225 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -12,7 +12,6 @@
from ._qs import Querystring
from .types import client_embed_params, client_rerank_params
from ._types import (
- NOT_GIVEN,
Body,
Omit,
Query,
@@ -23,6 +22,8 @@
ProxiesTypes,
RequestOptions,
SequenceNotStr,
+ omit,
+ not_given,
)
from ._utils import (
is_given,
@@ -95,9 +96,9 @@ def __init__(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "development", "local"] | NotGiven = NOT_GIVEN,
- base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
- timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
+ environment: Literal["production", "development", "local"] | NotGiven = not_given,
+ base_url: str | httpx.URL | None | NotGiven = not_given,
+ timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
@@ -201,9 +202,9 @@ def copy(
api_key: str | None = None,
environment: Literal["production", "development", "local"] | None = None,
base_url: str | httpx.URL | None = None,
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
- max_retries: int | NotGiven = NOT_GIVEN,
+ max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
@@ -253,16 +254,16 @@ def embed(
*,
model: str,
input: Union[str, SequenceNotStr[str]],
- dimensions: Optional[int] | NotGiven = NOT_GIVEN,
- prompt: Optional[str] | NotGiven = NOT_GIVEN,
- normalized: bool | NotGiven = NOT_GIVEN,
- encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN,
+ dimensions: Optional[int] | Omit = omit,
+ prompt: Optional[str] | Omit = omit,
+ normalized: bool | Omit = omit,
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
@@ -321,7 +322,7 @@ def info(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InfoResponse:
"""
Returns service information, including name and version.
@@ -339,19 +340,19 @@ def info(
def rerank(
self,
*,
- model: str | NotGiven = NOT_GIVEN,
+ model: str | Omit = omit,
query: str,
input: SequenceNotStr[Union[str, Iterable[object], object]],
- rank_fields: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
- top_k: int | NotGiven = NOT_GIVEN,
- return_input: bool | NotGiven = NOT_GIVEN,
- rewrite_query: bool | NotGiven = NOT_GIVEN,
+ rank_fields: Optional[SequenceNotStr[str]] | Omit = omit,
+ top_k: int | Omit = omit,
+ return_input: bool | Omit = omit,
+ rewrite_query: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> RerankResponse:
"""
Rerank different kind of documents for a given query.
@@ -458,9 +459,9 @@ def __init__(
self,
*,
api_key: str | None = None,
- environment: Literal["production", "development", "local"] | NotGiven = NOT_GIVEN,
- base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
- timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
+ environment: Literal["production", "development", "local"] | NotGiven = not_given,
+ base_url: str | httpx.URL | None | NotGiven = not_given,
+ timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
@@ -564,9 +565,9 @@ def copy(
api_key: str | None = None,
environment: Literal["production", "development", "local"] | None = None,
base_url: str | httpx.URL | None = None,
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
- max_retries: int | NotGiven = NOT_GIVEN,
+ max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
@@ -616,16 +617,16 @@ async def embed(
*,
model: str,
input: Union[str, SequenceNotStr[str]],
- dimensions: Optional[int] | NotGiven = NOT_GIVEN,
- prompt: Optional[str] | NotGiven = NOT_GIVEN,
- normalized: bool | NotGiven = NOT_GIVEN,
- encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN,
+ dimensions: Optional[int] | Omit = omit,
+ prompt: Optional[str] | Omit = omit,
+ normalized: bool | Omit = omit,
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
@@ -684,7 +685,7 @@ async def info(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InfoResponse:
"""
Returns service information, including name and version.
@@ -702,19 +703,19 @@ async def info(
async def rerank(
self,
*,
- model: str | NotGiven = NOT_GIVEN,
+ model: str | Omit = omit,
query: str,
input: SequenceNotStr[Union[str, Iterable[object], object]],
- rank_fields: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
- top_k: int | NotGiven = NOT_GIVEN,
- return_input: bool | NotGiven = NOT_GIVEN,
- rewrite_query: bool | NotGiven = NOT_GIVEN,
+ rank_fields: Optional[SequenceNotStr[str]] | Omit = omit,
+ top_k: int | Omit = omit,
+ return_input: bool | Omit = omit,
+ rewrite_query: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> RerankResponse:
"""
Rerank different kind of documents for a given query.
diff --git a/src/mixedbread/_qs.py b/src/mixedbread/_qs.py
index 274320ca..ada6fd3f 100644
--- a/src/mixedbread/_qs.py
+++ b/src/mixedbread/_qs.py
@@ -4,7 +4,7 @@
from urllib.parse import parse_qs, urlencode
from typing_extensions import Literal, get_args
-from ._types import NOT_GIVEN, NotGiven, NotGivenOr
+from ._types import NotGiven, not_given
from ._utils import flatten
_T = TypeVar("_T")
@@ -41,8 +41,8 @@ def stringify(
self,
params: Params,
*,
- array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
- nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
+ array_format: ArrayFormat | NotGiven = not_given,
+ nested_format: NestedFormat | NotGiven = not_given,
) -> str:
return urlencode(
self.stringify_items(
@@ -56,8 +56,8 @@ def stringify_items(
self,
params: Params,
*,
- array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
- nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
+ array_format: ArrayFormat | NotGiven = not_given,
+ nested_format: NestedFormat | NotGiven = not_given,
) -> list[tuple[str, str]]:
opts = Options(
qs=self,
@@ -143,8 +143,8 @@ def __init__(
self,
qs: Querystring = _qs,
*,
- array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
- nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
+ array_format: ArrayFormat | NotGiven = not_given,
+ nested_format: NestedFormat | NotGiven = not_given,
) -> None:
self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format
self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format
diff --git a/src/mixedbread/_types.py b/src/mixedbread/_types.py
index baa4a78b..97471b6c 100644
--- a/src/mixedbread/_types.py
+++ b/src/mixedbread/_types.py
@@ -117,18 +117,21 @@ class RequestOptions(TypedDict, total=False):
# Sentinel class used until PEP 0661 is accepted
class NotGiven:
"""
- A sentinel singleton class used to distinguish omitted keyword arguments
- from those passed in with the value None (which may have different behavior).
+ For parameters with a meaningful None value, we need to distinguish between
+ the user explicitly passing None, and the user not passing the parameter at
+ all.
+
+ User code shouldn't need to use not_given directly.
For example:
```py
- def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ...
+ def create(timeout: Timeout | None | NotGiven = not_given): ...
- get(timeout=1) # 1s timeout
- get(timeout=None) # No timeout
- get() # Default timeout behavior, which may not be statically known at the method definition.
+ create(timeout=1) # 1s timeout
+ create(timeout=None) # No timeout
+ create() # Default timeout behavior
```
"""
@@ -140,13 +143,14 @@ def __repr__(self) -> str:
return "NOT_GIVEN"
-NotGivenOr = Union[_T, NotGiven]
+not_given = NotGiven()
+# for backwards compatibility:
NOT_GIVEN = NotGiven()
class Omit:
- """In certain situations you need to be able to represent a case where a default value has
- to be explicitly removed and `None` is not an appropriate substitute, for example:
+ """
+ To explicitly omit something from being sent in a request, use `omit`.
```py
# as the default `Content-Type` header is `application/json` that will be sent
@@ -156,8 +160,8 @@ class Omit:
# to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983'
client.post(..., headers={"Content-Type": "multipart/form-data"})
- # instead you can remove the default `application/json` header by passing Omit
- client.post(..., headers={"Content-Type": Omit()})
+ # instead you can remove the default `application/json` header by passing omit
+ client.post(..., headers={"Content-Type": omit})
```
"""
@@ -165,6 +169,9 @@ def __bool__(self) -> Literal[False]:
return False
+omit = Omit()
+
+
@runtime_checkable
class ModelBuilderProtocol(Protocol):
@classmethod
diff --git a/src/mixedbread/_utils/_transform.py b/src/mixedbread/_utils/_transform.py
index c19124f0..52075492 100644
--- a/src/mixedbread/_utils/_transform.py
+++ b/src/mixedbread/_utils/_transform.py
@@ -268,7 +268,7 @@ def _transform_typeddict(
annotations = get_type_hints(expected_type, include_extras=True)
for key, value in data.items():
if not is_given(value):
- # we don't need to include `NotGiven` values here as they'll
+ # we don't need to include omitted values here as they'll
# be stripped out before the request is sent anyway
continue
@@ -434,7 +434,7 @@ async def _async_transform_typeddict(
annotations = get_type_hints(expected_type, include_extras=True)
for key, value in data.items():
if not is_given(value):
- # we don't need to include `NotGiven` values here as they'll
+ # we don't need to include omitted values here as they'll
# be stripped out before the request is sent anyway
continue
diff --git a/src/mixedbread/_utils/_utils.py b/src/mixedbread/_utils/_utils.py
index f0818595..50d59269 100644
--- a/src/mixedbread/_utils/_utils.py
+++ b/src/mixedbread/_utils/_utils.py
@@ -21,7 +21,7 @@
import sniffio
-from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike
+from .._types import Omit, NotGiven, FileTypes, HeadersLike
_T = TypeVar("_T")
_TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
@@ -63,7 +63,7 @@ def _extract_items(
try:
key = path[index]
except IndexError:
- if isinstance(obj, NotGiven):
+ if not is_given(obj):
# no value was provided - we can safely ignore
return []
@@ -126,8 +126,8 @@ def _extract_items(
return []
-def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]:
- return not isinstance(obj, NotGiven)
+def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
+ return not isinstance(obj, NotGiven) and not isinstance(obj, Omit)
# Type safe methods for narrowing types with TypeVars.
diff --git a/src/mixedbread/resources/api_keys.py b/src/mixedbread/resources/api_keys.py
index 9de4c7fe..f304929e 100644
--- a/src/mixedbread/resources/api_keys.py
+++ b/src/mixedbread/resources/api_keys.py
@@ -8,7 +8,7 @@
import httpx
from ..types import api_key_list_params, api_key_create_params
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -50,14 +50,14 @@ def with_streaming_response(self) -> APIKeysResourceWithStreamingResponse:
def create(
self,
*,
- name: str | NotGiven = NOT_GIVEN,
- expires_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
+ name: str | Omit = omit,
+ expires_at: Union[str, datetime, None] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKeyCreated:
"""
Create a new API key.
@@ -104,7 +104,7 @@ def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKey:
"""
Retrieve details of a specific API key by its ID.
@@ -137,14 +137,14 @@ def retrieve(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ offset: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncLimitOffset[APIKey]:
"""
List all API keys for the authenticated user.
@@ -194,7 +194,7 @@ def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKeyDeleteResponse:
"""
Delete a specific API key by its ID.
@@ -234,7 +234,7 @@ def reroll(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKeyCreated:
"""
Reroll the secret for a specific API key by its ID.
@@ -276,7 +276,7 @@ def revoke(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKey:
"""
Revoke a specific API key by its ID.
@@ -330,14 +330,14 @@ def with_streaming_response(self) -> AsyncAPIKeysResourceWithStreamingResponse:
async def create(
self,
*,
- name: str | NotGiven = NOT_GIVEN,
- expires_at: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
+ name: str | Omit = omit,
+ expires_at: Union[str, datetime, None] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKeyCreated:
"""
Create a new API key.
@@ -384,7 +384,7 @@ async def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKey:
"""
Retrieve details of a specific API key by its ID.
@@ -417,14 +417,14 @@ async def retrieve(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- offset: int | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ offset: int | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[APIKey, AsyncLimitOffset[APIKey]]:
"""
List all API keys for the authenticated user.
@@ -474,7 +474,7 @@ async def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKeyDeleteResponse:
"""
Delete a specific API key by its ID.
@@ -514,7 +514,7 @@ async def reroll(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKeyCreated:
"""
Reroll the secret for a specific API key by its ID.
@@ -556,7 +556,7 @@ async def revoke(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> APIKey:
"""
Revoke a specific API key by its ID.
diff --git a/src/mixedbread/resources/chat.py b/src/mixedbread/resources/chat.py
index f9b1b0ce..a5788f8f 100644
--- a/src/mixedbread/resources/chat.py
+++ b/src/mixedbread/resources/chat.py
@@ -4,7 +4,7 @@
import httpx
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -46,7 +46,7 @@ def create_completion(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create a chat completion using the provided parameters.
@@ -101,7 +101,7 @@ async def create_completion(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create a chat completion using the provided parameters.
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index 30c2ed30..9ab5bee1 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -6,7 +6,7 @@
import httpx
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -50,16 +50,16 @@ def create(
data_source_id: str,
*,
vector_store_id: str,
- name: str | NotGiven = NOT_GIVEN,
- trigger_sync: bool | NotGiven = NOT_GIVEN,
- metadata: object | NotGiven = NOT_GIVEN,
- polling_interval: Union[int, str, None] | NotGiven = NOT_GIVEN,
+ name: str | Omit = omit,
+ trigger_sync: bool | Omit = omit,
+ metadata: object | Omit = omit,
+ polling_interval: Union[int, str, None] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSourceConnector:
"""
Create a new connector.
@@ -125,7 +125,7 @@ def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSourceConnector:
"""
Get a connector by ID.
@@ -165,16 +165,16 @@ def update(
connector_id: str,
*,
data_source_id: str,
- name: Optional[str] | NotGiven = NOT_GIVEN,
- metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
- trigger_sync: Optional[bool] | NotGiven = NOT_GIVEN,
- polling_interval: Union[int, str, None] | NotGiven = NOT_GIVEN,
+ name: Optional[str] | Omit = omit,
+ metadata: Optional[Dict[str, object]] | Omit = omit,
+ trigger_sync: Optional[bool] | Omit = omit,
+ polling_interval: Union[int, str, None] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSourceConnector:
"""
Update a connector.
@@ -236,16 +236,16 @@ def list(
self,
data_source_id: str,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncCursor[DataSourceConnector]:
"""
Get all connectors for a data source.
@@ -309,7 +309,7 @@ def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ConnectorDeleteResponse:
"""
Delete a connector.
@@ -370,16 +370,16 @@ async def create(
data_source_id: str,
*,
vector_store_id: str,
- name: str | NotGiven = NOT_GIVEN,
- trigger_sync: bool | NotGiven = NOT_GIVEN,
- metadata: object | NotGiven = NOT_GIVEN,
- polling_interval: Union[int, str, None] | NotGiven = NOT_GIVEN,
+ name: str | Omit = omit,
+ trigger_sync: bool | Omit = omit,
+ metadata: object | Omit = omit,
+ polling_interval: Union[int, str, None] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSourceConnector:
"""
Create a new connector.
@@ -445,7 +445,7 @@ async def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSourceConnector:
"""
Get a connector by ID.
@@ -485,16 +485,16 @@ async def update(
connector_id: str,
*,
data_source_id: str,
- name: Optional[str] | NotGiven = NOT_GIVEN,
- metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
- trigger_sync: Optional[bool] | NotGiven = NOT_GIVEN,
- polling_interval: Union[int, str, None] | NotGiven = NOT_GIVEN,
+ name: Optional[str] | Omit = omit,
+ metadata: Optional[Dict[str, object]] | Omit = omit,
+ trigger_sync: Optional[bool] | Omit = omit,
+ polling_interval: Union[int, str, None] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSourceConnector:
"""
Update a connector.
@@ -556,16 +556,16 @@ def list(
self,
data_source_id: str,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[DataSourceConnector, AsyncCursor[DataSourceConnector]]:
"""
Get all connectors for a data source.
@@ -629,7 +629,7 @@ async def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ConnectorDeleteResponse:
"""
Delete a connector.
diff --git a/src/mixedbread/resources/data_sources/data_sources.py b/src/mixedbread/resources/data_sources/data_sources.py
index 3579b305..185eaedb 100644
--- a/src/mixedbread/resources/data_sources/data_sources.py
+++ b/src/mixedbread/resources/data_sources/data_sources.py
@@ -8,7 +8,7 @@
import httpx
from ...types import Oauth2Params, data_source_list_params, data_source_create_params, data_source_update_params
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import required_args, maybe_transform, async_maybe_transform
from ..._compat import cached_property
from .connectors import (
@@ -63,16 +63,16 @@ def with_streaming_response(self) -> DataSourcesResourceWithStreamingResponse:
def create(
self,
*,
- type: Literal["notion"] | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""
Create a new data source.
@@ -105,16 +105,16 @@ def create(
def create(
self,
*,
- type: Literal["linear"] | NotGiven = NOT_GIVEN,
+ type: Literal["linear"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ auth_params: Optional[Oauth2Params] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""
Create a new data source.
@@ -146,18 +146,18 @@ def create(
def create(
self,
*,
- type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Literal["linear"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams]
| Optional[Oauth2Params]
- | NotGiven = NOT_GIVEN,
+ | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
return self._post(
"/v1/data_sources/",
@@ -185,7 +185,7 @@ def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""
Get a data source by ID.
@@ -220,16 +220,16 @@ def update(
self,
data_source_id: str,
*,
- type: Literal["notion"] | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""Update a data source.
@@ -267,16 +267,16 @@ def update(
self,
data_source_id: str,
*,
- type: Literal["linear"] | NotGiven = NOT_GIVEN,
+ type: Literal["linear"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ auth_params: Optional[Oauth2Params] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""Update a data source.
@@ -313,18 +313,18 @@ def update(
self,
data_source_id: str,
*,
- type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Literal["linear"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams]
| Optional[Oauth2Params]
- | NotGiven = NOT_GIVEN,
+ | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
@@ -348,16 +348,16 @@ def update(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncCursor[DataSource]:
"""
Get all data sources.
@@ -413,7 +413,7 @@ def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSourceDeleteResponse:
"""
Delete a data source.
@@ -470,16 +470,16 @@ def with_streaming_response(self) -> AsyncDataSourcesResourceWithStreamingRespon
async def create(
self,
*,
- type: Literal["notion"] | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""
Create a new data source.
@@ -512,16 +512,16 @@ async def create(
async def create(
self,
*,
- type: Literal["linear"] | NotGiven = NOT_GIVEN,
+ type: Literal["linear"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ auth_params: Optional[Oauth2Params] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""
Create a new data source.
@@ -553,18 +553,18 @@ async def create(
async def create(
self,
*,
- type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Literal["linear"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
auth_params: Optional[data_source_create_params.NotionDataSourceAuthParams]
| Optional[Oauth2Params]
- | NotGiven = NOT_GIVEN,
+ | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
return await self._post(
"/v1/data_sources/",
@@ -592,7 +592,7 @@ async def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""
Get a data source by ID.
@@ -627,16 +627,16 @@ async def update(
self,
data_source_id: str,
*,
- type: Literal["notion"] | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""Update a data source.
@@ -674,16 +674,16 @@ async def update(
self,
data_source_id: str,
*,
- type: Literal["linear"] | NotGiven = NOT_GIVEN,
+ type: Literal["linear"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
- auth_params: Optional[Oauth2Params] | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ auth_params: Optional[Oauth2Params] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
"""Update a data source.
@@ -720,18 +720,18 @@ async def update(
self,
data_source_id: str,
*,
- type: Literal["notion"] | Literal["linear"] | NotGiven = NOT_GIVEN,
+ type: Literal["notion"] | Literal["linear"] | Omit = omit,
name: str,
- metadata: object | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
auth_params: Optional[data_source_update_params.NotionDataSourceAuthParams]
| Optional[Oauth2Params]
- | NotGiven = NOT_GIVEN,
+ | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSource:
if not data_source_id:
raise ValueError(f"Expected a non-empty value for `data_source_id` but received {data_source_id!r}")
@@ -755,16 +755,16 @@ async def update(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[DataSource, AsyncCursor[DataSource]]:
"""
Get all data sources.
@@ -820,7 +820,7 @@ async def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> DataSourceDeleteResponse:
"""
Delete a data source.
diff --git a/src/mixedbread/resources/embeddings.py b/src/mixedbread/resources/embeddings.py
index 17bee234..d2c74634 100644
--- a/src/mixedbread/resources/embeddings.py
+++ b/src/mixedbread/resources/embeddings.py
@@ -7,7 +7,7 @@
import httpx
from ..types import embedding_create_params
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
+from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -49,16 +49,16 @@ def create(
*,
model: str,
input: Union[str, SequenceNotStr[str]],
- dimensions: Optional[int] | NotGiven = NOT_GIVEN,
- prompt: Optional[str] | NotGiven = NOT_GIVEN,
- normalized: bool | NotGiven = NOT_GIVEN,
- encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN,
+ dimensions: Optional[int] | Omit = omit,
+ prompt: Optional[str] | Omit = omit,
+ normalized: bool | Omit = omit,
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
@@ -135,16 +135,16 @@ async def create(
*,
model: str,
input: Union[str, SequenceNotStr[str]],
- dimensions: Optional[int] | NotGiven = NOT_GIVEN,
- prompt: Optional[str] | NotGiven = NOT_GIVEN,
- normalized: bool | NotGiven = NOT_GIVEN,
- encoding_format: Union[EncodingFormat, List[EncodingFormat]] | NotGiven = NOT_GIVEN,
+ dimensions: Optional[int] | Omit = omit,
+ prompt: Optional[str] | Omit = omit,
+ normalized: bool | Omit = omit,
+ encoding_format: Union[EncodingFormat, List[EncodingFormat]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EmbeddingCreateResponse:
"""
Create embeddings for text or images using the specified model, encoding format,
diff --git a/src/mixedbread/resources/extractions/content.py b/src/mixedbread/resources/extractions/content.py
index a74a9b13..b2111bb3 100644
--- a/src/mixedbread/resources/extractions/content.py
+++ b/src/mixedbread/resources/extractions/content.py
@@ -6,7 +6,7 @@
import httpx
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
+from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -48,13 +48,13 @@ def create(
*,
content: Union[str, SequenceNotStr[str], Iterable[content_create_params.ContentUnionMember2]],
json_schema: Dict[str, object],
- instructions: Optional[str] | NotGiven = NOT_GIVEN,
+ instructions: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ExtractionResult:
"""
Extract content from a string using the provided schema.
@@ -120,13 +120,13 @@ async def create(
*,
content: Union[str, SequenceNotStr[str], Iterable[content_create_params.ContentUnionMember2]],
json_schema: Dict[str, object],
- instructions: Optional[str] | NotGiven = NOT_GIVEN,
+ instructions: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ExtractionResult:
"""
Extract content from a string using the provided schema.
diff --git a/src/mixedbread/resources/extractions/jobs.py b/src/mixedbread/resources/extractions/jobs.py
index 29b77911..ae48bbf3 100644
--- a/src/mixedbread/resources/extractions/jobs.py
+++ b/src/mixedbread/resources/extractions/jobs.py
@@ -6,7 +6,7 @@
import httpx
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -53,7 +53,7 @@ def create(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ExtractionJob:
"""
Start an extraction job for the provided file and schema.
@@ -99,7 +99,7 @@ def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ExtractionJob:
"""
Get detailed information about a specific extraction job.
@@ -160,7 +160,7 @@ async def create(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ExtractionJob:
"""
Start an extraction job for the provided file and schema.
@@ -206,7 +206,7 @@ async def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ExtractionJob:
"""
Get detailed information about a specific extraction job.
diff --git a/src/mixedbread/resources/extractions/schema.py b/src/mixedbread/resources/extractions/schema.py
index 651723f6..6eabe54e 100644
--- a/src/mixedbread/resources/extractions/schema.py
+++ b/src/mixedbread/resources/extractions/schema.py
@@ -6,7 +6,7 @@
import httpx
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -54,7 +54,7 @@ def create(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CreatedJsonSchema:
"""
Create a schema with the provided parameters.
@@ -92,7 +92,7 @@ def enhance(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EnhancedJsonSchema:
"""
Enhance a schema by enriching the descriptions to aid extraction.
@@ -130,7 +130,7 @@ def validate(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ValidatedJsonSchema:
"""
Validate a schema.
@@ -189,7 +189,7 @@ async def create(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CreatedJsonSchema:
"""
Create a schema with the provided parameters.
@@ -227,7 +227,7 @@ async def enhance(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> EnhancedJsonSchema:
"""
Enhance a schema by enriching the descriptions to aid extraction.
@@ -265,7 +265,7 @@ async def validate(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ValidatedJsonSchema:
"""
Validate a schema.
diff --git a/src/mixedbread/resources/files.py b/src/mixedbread/resources/files.py
index 5d00457d..d1e74a27 100644
--- a/src/mixedbread/resources/files.py
+++ b/src/mixedbread/resources/files.py
@@ -7,7 +7,7 @@
import httpx
from ..types import file_list_params, file_create_params, file_update_params
-from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
+from .._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given
from .._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -62,7 +62,7 @@ def create(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileObject:
"""
Upload a new file.
@@ -107,7 +107,7 @@ def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileObject:
"""
Retrieve details of a specific file by its ID.
@@ -147,7 +147,7 @@ def update(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileObject:
"""
Update the details of a specific file.
@@ -190,17 +190,17 @@ def update(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- q: Optional[str] | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ q: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncCursor[FileObject]:
"""
List all files for the authenticated user.
@@ -261,7 +261,7 @@ def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileDeleteResponse:
"""
Delete a specific file by its ID.
@@ -300,7 +300,7 @@ def content(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> BinaryAPIResponse:
"""
Download a specific file by its ID.
@@ -361,7 +361,7 @@ async def create(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileObject:
"""
Upload a new file.
@@ -406,7 +406,7 @@ async def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileObject:
"""
Retrieve details of a specific file by its ID.
@@ -446,7 +446,7 @@ async def update(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileObject:
"""
Update the details of a specific file.
@@ -489,17 +489,17 @@ async def update(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- q: Optional[str] | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ q: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[FileObject, AsyncCursor[FileObject]]:
"""
List all files for the authenticated user.
@@ -560,7 +560,7 @@ async def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileDeleteResponse:
"""
Delete a specific file by its ID.
@@ -599,7 +599,7 @@ async def content(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncBinaryAPIResponse:
"""
Download a specific file by its ID.
diff --git a/src/mixedbread/resources/parsing/jobs.py b/src/mixedbread/resources/parsing/jobs.py
index 57d8fac4..97b70a8c 100644
--- a/src/mixedbread/resources/parsing/jobs.py
+++ b/src/mixedbread/resources/parsing/jobs.py
@@ -7,7 +7,7 @@
import httpx
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -55,16 +55,16 @@ def create(
self,
*,
file_id: str,
- element_types: Optional[List[ElementType]] | NotGiven = NOT_GIVEN,
- chunking_strategy: ChunkingStrategy | NotGiven = NOT_GIVEN,
- return_format: ReturnFormat | NotGiven = NOT_GIVEN,
- mode: Literal["fast", "high_quality"] | NotGiven = NOT_GIVEN,
+ element_types: Optional[List[ElementType]] | Omit = omit,
+ chunking_strategy: ChunkingStrategy | Omit = omit,
+ return_format: ReturnFormat | Omit = omit,
+ mode: Literal["fast", "high_quality"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ParsingJob:
"""
Start a parse job for the provided file.
@@ -119,7 +119,7 @@ def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ParsingJob:
"""
Get detailed information about a specific parse job.
@@ -152,18 +152,18 @@ def retrieve(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[ParsingJobStatus]] | NotGiven = NOT_GIVEN,
- q: Optional[str] | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ statuses: Optional[List[ParsingJobStatus]] | Omit = omit,
+ q: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncCursor[JobListResponse]:
"""List parsing jobs with pagination.
@@ -228,7 +228,7 @@ def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobDeleteResponse:
"""
Delete a specific parse job.
@@ -267,7 +267,7 @@ def cancel(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ParsingJob:
"""
Cancel a specific parse job.
@@ -322,16 +322,16 @@ async def create(
self,
*,
file_id: str,
- element_types: Optional[List[ElementType]] | NotGiven = NOT_GIVEN,
- chunking_strategy: ChunkingStrategy | NotGiven = NOT_GIVEN,
- return_format: ReturnFormat | NotGiven = NOT_GIVEN,
- mode: Literal["fast", "high_quality"] | NotGiven = NOT_GIVEN,
+ element_types: Optional[List[ElementType]] | Omit = omit,
+ chunking_strategy: ChunkingStrategy | Omit = omit,
+ return_format: ReturnFormat | Omit = omit,
+ mode: Literal["fast", "high_quality"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ParsingJob:
"""
Start a parse job for the provided file.
@@ -386,7 +386,7 @@ async def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ParsingJob:
"""
Get detailed information about a specific parse job.
@@ -419,18 +419,18 @@ async def retrieve(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[ParsingJobStatus]] | NotGiven = NOT_GIVEN,
- q: Optional[str] | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ statuses: Optional[List[ParsingJobStatus]] | Omit = omit,
+ q: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[JobListResponse, AsyncCursor[JobListResponse]]:
"""List parsing jobs with pagination.
@@ -495,7 +495,7 @@ async def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> JobDeleteResponse:
"""
Delete a specific parse job.
@@ -534,7 +534,7 @@ async def cancel(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ParsingJob:
"""
Cancel a specific parse job.
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 216e2475..b5df5ffe 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -6,7 +6,7 @@
import httpx
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
+from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -51,15 +51,15 @@ def create(
self,
vector_store_identifier: str,
*,
- metadata: object | NotGiven = NOT_GIVEN,
- experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ experimental: file_create_params.Experimental | Omit = omit,
file_id: str,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreFile:
"""
Add an already uploaded file to a vector store.
@@ -111,13 +111,13 @@ def retrieve(
file_id: str,
*,
vector_store_identifier: str,
- return_chunks: bool | NotGiven = NOT_GIVEN,
+ return_chunks: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreFile:
"""
Get details of a specific file in a vector store.
@@ -164,18 +164,18 @@ def list(
self,
vector_store_identifier: str,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
- metadata_filter: Optional[file_list_params.MetadataFilter] | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ statuses: Optional[List[VectorStoreFileStatus]] | Omit = omit,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileListResponse:
"""
List files indexed in a vector store with pagination and metadata filter.
@@ -243,7 +243,7 @@ def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileDeleteResponse:
"""
Delete a file from a vector store.
@@ -285,16 +285,16 @@ def search(
*,
query: str,
vector_store_identifiers: SequenceNotStr[str],
- top_k: int | NotGiven = NOT_GIVEN,
- filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
- search_options: file_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ top_k: int | Omit = omit,
+ filters: Optional[file_search_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: file_search_params.SearchOptions | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileSearchResponse:
"""
Perform semantic search across complete vector store files.
@@ -379,15 +379,15 @@ async def create(
self,
vector_store_identifier: str,
*,
- metadata: object | NotGiven = NOT_GIVEN,
- experimental: file_create_params.Experimental | NotGiven = NOT_GIVEN,
+ metadata: object | Omit = omit,
+ experimental: file_create_params.Experimental | Omit = omit,
file_id: str,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreFile:
"""
Add an already uploaded file to a vector store.
@@ -439,13 +439,13 @@ async def retrieve(
file_id: str,
*,
vector_store_identifier: str,
- return_chunks: bool | NotGiven = NOT_GIVEN,
+ return_chunks: bool | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreFile:
"""
Get details of a specific file in a vector store.
@@ -494,18 +494,18 @@ async def list(
self,
vector_store_identifier: str,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- statuses: Optional[List[VectorStoreFileStatus]] | NotGiven = NOT_GIVEN,
- metadata_filter: Optional[file_list_params.MetadataFilter] | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ statuses: Optional[List[VectorStoreFileStatus]] | Omit = omit,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileListResponse:
"""
List files indexed in a vector store with pagination and metadata filter.
@@ -573,7 +573,7 @@ async def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileDeleteResponse:
"""
Delete a file from a vector store.
@@ -615,16 +615,16 @@ async def search(
*,
query: str,
vector_store_identifiers: SequenceNotStr[str],
- top_k: int | NotGiven = NOT_GIVEN,
- filters: Optional[file_search_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
- search_options: file_search_params.SearchOptions | NotGiven = NOT_GIVEN,
+ top_k: int | Omit = omit,
+ filters: Optional[file_search_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: file_search_params.SearchOptions | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileSearchResponse:
"""
Perform semantic search across complete vector store files.
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 0dd32b0f..75d11b1c 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -21,7 +21,7 @@
vector_store_update_params,
vector_store_question_answering_params,
)
-from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
+from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -70,18 +70,18 @@ def with_streaming_response(self) -> VectorStoresResourceWithStreamingResponse:
def create(
self,
*,
- name: Optional[str] | NotGiven = NOT_GIVEN,
- description: Optional[str] | NotGiven = NOT_GIVEN,
- is_public: bool | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
- metadata: object | NotGiven = NOT_GIVEN,
- file_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
+ name: Optional[str] | Omit = omit,
+ description: Optional[str] | Omit = omit,
+ is_public: bool | Omit = omit,
+ expires_after: Optional[ExpiresAfterParam] | Omit = omit,
+ metadata: object | Omit = omit,
+ file_ids: Optional[SequenceNotStr[str]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
Create a new vector store.
@@ -140,7 +140,7 @@ def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
Get a vector store by ID or name.
@@ -176,17 +176,17 @@ def update(
self,
vector_store_identifier: str,
*,
- name: Optional[str] | NotGiven = NOT_GIVEN,
- description: Optional[str] | NotGiven = NOT_GIVEN,
- is_public: Optional[bool] | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
- metadata: object | NotGiven = NOT_GIVEN,
+ name: Optional[str] | Omit = omit,
+ description: Optional[str] | Omit = omit,
+ is_public: Optional[bool] | Omit = omit,
+ expires_after: Optional[ExpiresAfterParam] | Omit = omit,
+ metadata: object | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
Update a vector store by ID or name.
@@ -243,17 +243,17 @@ def update(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- q: Optional[str] | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ q: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncCursor[VectorStore]:
"""
List all vector stores with optional search.
@@ -315,7 +315,7 @@ def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreDeleteResponse:
"""
Delete a vector store by ID or name.
@@ -350,20 +350,20 @@ def delete(
def question_answering(
self,
*,
- query: str | NotGiven = NOT_GIVEN,
+ query: str | Omit = omit,
vector_store_identifiers: SequenceNotStr[str],
- top_k: int | NotGiven = NOT_GIVEN,
- filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
- stream: bool | NotGiven = NOT_GIVEN,
- qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
+ top_k: int | Omit = omit,
+ filters: Optional[vector_store_question_answering_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: VectorStoreChunkSearchOptionsParam | Omit = omit,
+ stream: bool | Omit = omit,
+ qa_options: vector_store_question_answering_params.QaOptions | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreQuestionAnsweringResponse:
"""Question answering
@@ -421,16 +421,16 @@ def search(
*,
query: str,
vector_store_identifiers: SequenceNotStr[str],
- top_k: int | NotGiven = NOT_GIVEN,
- filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
+ top_k: int | Omit = omit,
+ filters: Optional[vector_store_search_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: VectorStoreChunkSearchOptionsParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreSearchResponse:
"""
Perform semantic search across vector store chunks.
@@ -519,18 +519,18 @@ def with_streaming_response(self) -> AsyncVectorStoresResourceWithStreamingRespo
async def create(
self,
*,
- name: Optional[str] | NotGiven = NOT_GIVEN,
- description: Optional[str] | NotGiven = NOT_GIVEN,
- is_public: bool | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
- metadata: object | NotGiven = NOT_GIVEN,
- file_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
+ name: Optional[str] | Omit = omit,
+ description: Optional[str] | Omit = omit,
+ is_public: bool | Omit = omit,
+ expires_after: Optional[ExpiresAfterParam] | Omit = omit,
+ metadata: object | Omit = omit,
+ file_ids: Optional[SequenceNotStr[str]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
Create a new vector store.
@@ -589,7 +589,7 @@ async def retrieve(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
Get a vector store by ID or name.
@@ -625,17 +625,17 @@ async def update(
self,
vector_store_identifier: str,
*,
- name: Optional[str] | NotGiven = NOT_GIVEN,
- description: Optional[str] | NotGiven = NOT_GIVEN,
- is_public: Optional[bool] | NotGiven = NOT_GIVEN,
- expires_after: Optional[ExpiresAfterParam] | NotGiven = NOT_GIVEN,
- metadata: object | NotGiven = NOT_GIVEN,
+ name: Optional[str] | Omit = omit,
+ description: Optional[str] | Omit = omit,
+ is_public: Optional[bool] | Omit = omit,
+ expires_after: Optional[ExpiresAfterParam] | Omit = omit,
+ metadata: object | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
Update a vector store by ID or name.
@@ -692,17 +692,17 @@ async def update(
def list(
self,
*,
- limit: int | NotGiven = NOT_GIVEN,
- after: Optional[str] | NotGiven = NOT_GIVEN,
- before: Optional[str] | NotGiven = NOT_GIVEN,
- include_total: bool | NotGiven = NOT_GIVEN,
- q: Optional[str] | NotGiven = NOT_GIVEN,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ q: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[VectorStore, AsyncCursor[VectorStore]]:
"""
List all vector stores with optional search.
@@ -764,7 +764,7 @@ async def delete(
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreDeleteResponse:
"""
Delete a vector store by ID or name.
@@ -799,20 +799,20 @@ async def delete(
async def question_answering(
self,
*,
- query: str | NotGiven = NOT_GIVEN,
+ query: str | Omit = omit,
vector_store_identifiers: SequenceNotStr[str],
- top_k: int | NotGiven = NOT_GIVEN,
- filters: Optional[vector_store_question_answering_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
- stream: bool | NotGiven = NOT_GIVEN,
- qa_options: vector_store_question_answering_params.QaOptions | NotGiven = NOT_GIVEN,
+ top_k: int | Omit = omit,
+ filters: Optional[vector_store_question_answering_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: VectorStoreChunkSearchOptionsParam | Omit = omit,
+ stream: bool | Omit = omit,
+ qa_options: vector_store_question_answering_params.QaOptions | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreQuestionAnsweringResponse:
"""Question answering
@@ -870,16 +870,16 @@ async def search(
*,
query: str,
vector_store_identifiers: SequenceNotStr[str],
- top_k: int | NotGiven = NOT_GIVEN,
- filters: Optional[vector_store_search_params.Filters] | NotGiven = NOT_GIVEN,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN,
- search_options: VectorStoreChunkSearchOptionsParam | NotGiven = NOT_GIVEN,
+ top_k: int | Omit = omit,
+ filters: Optional[vector_store_search_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: VectorStoreChunkSearchOptionsParam | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreSearchResponse:
"""
Perform semantic search across vector store chunks.
diff --git a/tests/test_transform.py b/tests/test_transform.py
index 0bad8ee8..1337f4f6 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -8,7 +8,7 @@
import pytest
-from mixedbread._types import NOT_GIVEN, Base64FileInput
+from mixedbread._types import Base64FileInput, omit, not_given
from mixedbread._utils import (
PropertyInfo,
transform as _transform,
@@ -450,4 +450,11 @@ async def test_transform_skipping(use_async: bool) -> None:
@pytest.mark.asyncio
async def test_strips_notgiven(use_async: bool) -> None:
assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"}
- assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {}
+ assert await transform({"foo_bar": not_given}, Foo1, use_async) == {}
+
+
+@parametrize
+@pytest.mark.asyncio
+async def test_strips_omit(use_async: bool) -> None:
+ assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"}
+ assert await transform({"foo_bar": omit}, Foo1, use_async) == {}
From 3a57380e592d20de242b82c78588c6d2a2e55d3d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 20 Sep 2025 03:46:19 +0000
Subject: [PATCH 269/375] chore: do not install brew dependencies in
./scripts/bootstrap by default
---
scripts/bootstrap | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/scripts/bootstrap b/scripts/bootstrap
index e84fe62c..b430fee3 100755
--- a/scripts/bootstrap
+++ b/scripts/bootstrap
@@ -4,10 +4,18 @@ set -e
cd "$(dirname "$0")/.."
-if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
+if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
- echo "==> Installing Homebrew dependencies…"
- brew bundle
+ echo -n "==> Install Homebrew dependencies? (y/N): "
+ read -r response
+ case "$response" in
+ [yY][eE][sS]|[yY])
+ brew bundle
+ ;;
+ *)
+ ;;
+ esac
+ echo
}
fi
From 6983cb3b5bddd44741a878648d90f239a419d315 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 23 Sep 2025 03:11:00 +0000
Subject: [PATCH 270/375] chore(internal): improve examples
---
tests/api_resources/test_vector_stores.py | 132 ++++++++++++++++--
.../api_resources/vector_stores/test_files.py | 132 ++++++++++++++++--
2 files changed, 240 insertions(+), 24 deletions(-)
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index fa109005..6157396e 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -248,9 +248,36 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ ],
+ "any": [
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
+ "none": [
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -307,9 +334,36 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ ],
+ "any": [
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
+ "none": [
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -579,9 +633,36 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ ],
+ "any": [
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
+ "none": [
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -638,9 +719,36 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ ],
+ "any": [
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
+ "none": [
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 6d7726a2..24ccbdc7 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -155,9 +155,36 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
include_total=False,
statuses=["pending"],
metadata_filter={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ ],
+ "any": [
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
+ "none": [
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
},
)
assert_matches_type(FileListResponse, file, path=["response"])
@@ -260,9 +287,36 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ ],
+ "any": [
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
+ "none": [
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -442,9 +496,36 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
include_total=False,
statuses=["pending"],
metadata_filter={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ ],
+ "any": [
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
+ "none": [
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
},
)
assert_matches_type(FileListResponse, file, path=["response"])
@@ -547,9 +628,36 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [],
- "any": [],
- "none": [],
+ "all": [
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ {
+ "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ },
+ ],
+ "any": [
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
+ "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
+ "none": [
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ {
+ "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ },
+ ],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
From 5b4161d4c40d5021fad940b9e3aac6adaf20ec99 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 24 Sep 2025 04:03:41 +0000
Subject: [PATCH 271/375] chore(internal): use some smaller example values
---
tests/api_resources/test_vector_stores.py | 120 +++++++++++-------
.../api_resources/vector_stores/test_files.py | 120 +++++++++++-------
2 files changed, 144 insertions(+), 96 deletions(-)
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 6157396e..61cbf6c2 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -250,32 +250,38 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
filters={
"all": [
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"any": [
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"none": [
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
},
@@ -336,32 +342,38 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
filters={
"all": [
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"any": [
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"none": [
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
},
@@ -635,32 +647,38 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
filters={
"all": [
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"any": [
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"none": [
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
},
@@ -721,32 +739,38 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
filters={
"all": [
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"any": [
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"none": [
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
},
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 24ccbdc7..eb15c4b6 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -157,32 +157,38 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
metadata_filter={
"all": [
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"any": [
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"none": [
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
},
@@ -289,32 +295,38 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
filters={
"all": [
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"any": [
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"none": [
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
},
@@ -498,32 +510,38 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
metadata_filter={
"all": [
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"any": [
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"none": [
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
},
@@ -630,32 +648,38 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
filters={
"all": [
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "any": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"any": [{}, {}]}, {"any": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"any": [
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"none": [{}, {}]}, {"none": [{}, {}]}],
- "none": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
"none": [
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
},
{
- "all": [{"any": [{}, {}]}, {"any": [{}, {}]}],
- "any": [{"all": [{}, {}]}, {"all": [{}, {}]}],
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
},
],
},
From 52180984015acf3d0141cc0ee2d1ee99c10212d4 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 26 Sep 2025 10:27:57 +0000
Subject: [PATCH 272/375] feat(api): api update
---
.stats.yml | 4 +-
.../resources/vector_stores/vector_stores.py | 12 +-
.../types/scored_audio_url_input_chunk.py | 173 ++++-
.../types/scored_image_url_input_chunk.py | 173 ++++-
.../types/scored_text_input_chunk.py | 172 ++++-
.../types/scored_video_url_input_chunk.py | 173 ++++-
.../types/vector_stores/vector_store_file.py | 664 +++++++++++++++++-
7 files changed, 1342 insertions(+), 29 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index c9fd9032..e9cacf73 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-922df6375506208e6003aa26bdf065a8221e5a99aac6d654b9d2a76175339828.yml
-openapi_spec_hash: 19b698680ff92d3c5dc7e3f6c4ec12b1
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-6eceba7c701064aa752ff55cf7539a15258dea54c151fec7e56a20c72bc2920a.yml
+openapi_spec_hash: 46b9ea8cf4a72ab36be2f5d8fb45de54
config_hash: fef0ea78daf11093ff503919baae5ec0
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 75d11b1c..fdc8c15a 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -258,10 +258,10 @@ def list(
"""
List all vector stores with optional search.
- Args: pagination: The pagination options. q: Optional search query to filter
- vector stores.
+ Args: options: The pagination options including limit, cursor, and optional
+ search query (q)
- Returns: VectorStoreListResponse: The list of vector stores.
+ Returns: VectorStoreListResponse: The list of vector stores
Args:
limit: Maximum number of items to return per page (1-100)
@@ -707,10 +707,10 @@ def list(
"""
List all vector stores with optional search.
- Args: pagination: The pagination options. q: Optional search query to filter
- vector stores.
+ Args: options: The pagination options including limit, cursor, and optional
+ search query (q)
- Returns: VectorStoreListResponse: The list of vector stores.
+ Returns: VectorStoreListResponse: The list of vector stores
Args:
limit: Maximum number of items to return per page (1-100)
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 59d6423f..8c59a3d1 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -1,11 +1,176 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, Optional
-from typing_extensions import Literal
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
+from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = ["ScoredAudioURLInputChunk", "AudioURL"]
+__all__ = [
+ "ScoredAudioURLInputChunk",
+ "GeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "GeneratedMetadataTextChunkGeneratedMetadata",
+ "GeneratedMetadataPdfChunkGeneratedMetadata",
+ "GeneratedMetadataCodeChunkGeneratedMetadata",
+ "GeneratedMetadataAudioChunkGeneratedMetadata",
+ "AudioURL",
+]
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
+
+ heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+GeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ GeneratedMetadataMarkdownChunkGeneratedMetadata,
+ GeneratedMetadataTextChunkGeneratedMetadata,
+ GeneratedMetadataPdfChunkGeneratedMetadata,
+ GeneratedMetadataCodeChunkGeneratedMetadata,
+ GeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
class AudioURL(BaseModel):
@@ -20,7 +185,7 @@ class ScoredAudioURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[GeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index 9bd0deb2..f3cd2fe8 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -1,11 +1,176 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, Optional
-from typing_extensions import Literal
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
+from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = ["ScoredImageURLInputChunk", "ImageURL"]
+__all__ = [
+ "ScoredImageURLInputChunk",
+ "GeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "GeneratedMetadataTextChunkGeneratedMetadata",
+ "GeneratedMetadataPdfChunkGeneratedMetadata",
+ "GeneratedMetadataCodeChunkGeneratedMetadata",
+ "GeneratedMetadataAudioChunkGeneratedMetadata",
+ "ImageURL",
+]
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
+
+ heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+GeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ GeneratedMetadataMarkdownChunkGeneratedMetadata,
+ GeneratedMetadataTextChunkGeneratedMetadata,
+ GeneratedMetadataPdfChunkGeneratedMetadata,
+ GeneratedMetadataCodeChunkGeneratedMetadata,
+ GeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
class ImageURL(BaseModel):
@@ -23,7 +188,7 @@ class ScoredImageURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[GeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index 35f20c06..b299e211 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -1,11 +1,175 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, Optional
-from typing_extensions import Literal
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
+from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = ["ScoredTextInputChunk"]
+__all__ = [
+ "ScoredTextInputChunk",
+ "GeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "GeneratedMetadataTextChunkGeneratedMetadata",
+ "GeneratedMetadataPdfChunkGeneratedMetadata",
+ "GeneratedMetadataCodeChunkGeneratedMetadata",
+ "GeneratedMetadataAudioChunkGeneratedMetadata",
+]
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
+
+ heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+GeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ GeneratedMetadataMarkdownChunkGeneratedMetadata,
+ GeneratedMetadataTextChunkGeneratedMetadata,
+ GeneratedMetadataPdfChunkGeneratedMetadata,
+ GeneratedMetadataCodeChunkGeneratedMetadata,
+ GeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
class ScoredTextInputChunk(BaseModel):
@@ -15,7 +179,7 @@ class ScoredTextInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[GeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index 78d77359..a6b9b316 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -1,11 +1,176 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, Optional
-from typing_extensions import Literal
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
+from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = ["ScoredVideoURLInputChunk", "VideoURL"]
+__all__ = [
+ "ScoredVideoURLInputChunk",
+ "GeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "GeneratedMetadataTextChunkGeneratedMetadata",
+ "GeneratedMetadataPdfChunkGeneratedMetadata",
+ "GeneratedMetadataCodeChunkGeneratedMetadata",
+ "GeneratedMetadataAudioChunkGeneratedMetadata",
+ "VideoURL",
+]
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
+
+ heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+GeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ GeneratedMetadataMarkdownChunkGeneratedMetadata,
+ GeneratedMetadataTextChunkGeneratedMetadata,
+ GeneratedMetadataPdfChunkGeneratedMetadata,
+ GeneratedMetadataCodeChunkGeneratedMetadata,
+ GeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
class VideoURL(BaseModel):
@@ -20,7 +185,7 @@ class ScoredVideoURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[GeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index e9c535d4..318fb208 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -1,9 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, List, Union, Optional
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
from ..._utils import PropertyInfo
from ..._models import BaseModel
from .vector_store_file_status import VectorStoreFileStatus
@@ -12,15 +14,202 @@
"VectorStoreFile",
"Chunk",
"ChunkTextInputChunk",
+ "ChunkTextInputChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkImageURLInputChunk",
+ "ChunkImageURLInputChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkImageURLInputChunkImageURL",
"ChunkAudioURLInputChunk",
+ "ChunkAudioURLInputChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkAudioURLInputChunkAudioURL",
"ChunkVideoURLInputChunk",
+ "ChunkVideoURLInputChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkVideoURLInputChunkVideoURL",
]
+class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = (
+ None
+ )
+
+ heading_context: Optional[
+ List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkTextInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -28,7 +217,7 @@ class ChunkTextInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkTextInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -44,6 +233,161 @@ class ChunkTextInputChunk(BaseModel):
"""Text content to process"""
+class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
+ ] = None
+
+ heading_context: Optional[
+ List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkImageURLInputChunkImageURL(BaseModel):
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -59,7 +403,7 @@ class ChunkImageURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkImageURLInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -78,6 +422,161 @@ class ChunkImageURLInputChunk(BaseModel):
"""The image input specification."""
+class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
+ ] = None
+
+ heading_context: Optional[
+ List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkAudioURLInputChunkAudioURL(BaseModel):
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -90,7 +589,7 @@ class ChunkAudioURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkAudioURLInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -112,6 +611,161 @@ class ChunkAudioURLInputChunk(BaseModel):
"""The sampling rate of the audio."""
+class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
+ ] = None
+
+ heading_context: Optional[
+ List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkVideoURLInputChunkVideoURL(BaseModel):
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -124,7 +778,7 @@ class ChunkVideoURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkVideoURLInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
From e0a3323388b31afb74359103b344e2bac4b84f30 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sun, 28 Sep 2025 11:27:56 +0000
Subject: [PATCH 273/375] feat(api): api update
---
.stats.yml | 4 +-
.../resources/vector_stores/vector_stores.py | 12 +-
.../types/scored_audio_url_input_chunk.py | 173 +----
.../types/scored_image_url_input_chunk.py | 173 +----
.../types/scored_text_input_chunk.py | 172 +----
.../types/scored_video_url_input_chunk.py | 173 +----
.../types/vector_stores/vector_store_file.py | 664 +-----------------
7 files changed, 29 insertions(+), 1342 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e9cacf73..fb5eaf61 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-6eceba7c701064aa752ff55cf7539a15258dea54c151fec7e56a20c72bc2920a.yml
-openapi_spec_hash: 46b9ea8cf4a72ab36be2f5d8fb45de54
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-7e1c9e69f48d60426e9495fa864cacb60b1df2462a89dd0dc6f8faa29b85537d.yml
+openapi_spec_hash: c6ac1b5e4ee5db8723cc223695d296f5
config_hash: fef0ea78daf11093ff503919baae5ec0
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index fdc8c15a..75d11b1c 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -258,10 +258,10 @@ def list(
"""
List all vector stores with optional search.
- Args: options: The pagination options including limit, cursor, and optional
- search query (q)
+ Args: pagination: The pagination options. q: Optional search query to filter
+ vector stores.
- Returns: VectorStoreListResponse: The list of vector stores
+ Returns: VectorStoreListResponse: The list of vector stores.
Args:
limit: Maximum number of items to return per page (1-100)
@@ -707,10 +707,10 @@ def list(
"""
List all vector stores with optional search.
- Args: options: The pagination options including limit, cursor, and optional
- search query (q)
+ Args: pagination: The pagination options. q: Optional search query to filter
+ vector stores.
- Returns: VectorStoreListResponse: The list of vector stores
+ Returns: VectorStoreListResponse: The list of vector stores.
Args:
limit: Maximum number of items to return per page (1-100)
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 8c59a3d1..59d6423f 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -1,176 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import TYPE_CHECKING, Dict, List, Union, Optional
-from typing_extensions import Literal, Annotated, TypeAlias
+from typing import Dict, Optional
+from typing_extensions import Literal
-from pydantic import Field as FieldInfo
-
-from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = [
- "ScoredAudioURLInputChunk",
- "GeneratedMetadata",
- "GeneratedMetadataMarkdownChunkGeneratedMetadata",
- "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "GeneratedMetadataTextChunkGeneratedMetadata",
- "GeneratedMetadataPdfChunkGeneratedMetadata",
- "GeneratedMetadataCodeChunkGeneratedMetadata",
- "GeneratedMetadataAudioChunkGeneratedMetadata",
- "AudioURL",
-]
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
-
- heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-GeneratedMetadata: TypeAlias = Annotated[
- Union[
- GeneratedMetadataMarkdownChunkGeneratedMetadata,
- GeneratedMetadataTextChunkGeneratedMetadata,
- GeneratedMetadataPdfChunkGeneratedMetadata,
- GeneratedMetadataCodeChunkGeneratedMetadata,
- GeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
+__all__ = ["ScoredAudioURLInputChunk", "AudioURL"]
class AudioURL(BaseModel):
@@ -185,7 +20,7 @@ class ScoredAudioURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[GeneratedMetadata] = None
+ generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index f3cd2fe8..9bd0deb2 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -1,176 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import TYPE_CHECKING, Dict, List, Union, Optional
-from typing_extensions import Literal, Annotated, TypeAlias
+from typing import Dict, Optional
+from typing_extensions import Literal
-from pydantic import Field as FieldInfo
-
-from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = [
- "ScoredImageURLInputChunk",
- "GeneratedMetadata",
- "GeneratedMetadataMarkdownChunkGeneratedMetadata",
- "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "GeneratedMetadataTextChunkGeneratedMetadata",
- "GeneratedMetadataPdfChunkGeneratedMetadata",
- "GeneratedMetadataCodeChunkGeneratedMetadata",
- "GeneratedMetadataAudioChunkGeneratedMetadata",
- "ImageURL",
-]
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
-
- heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-GeneratedMetadata: TypeAlias = Annotated[
- Union[
- GeneratedMetadataMarkdownChunkGeneratedMetadata,
- GeneratedMetadataTextChunkGeneratedMetadata,
- GeneratedMetadataPdfChunkGeneratedMetadata,
- GeneratedMetadataCodeChunkGeneratedMetadata,
- GeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
+__all__ = ["ScoredImageURLInputChunk", "ImageURL"]
class ImageURL(BaseModel):
@@ -188,7 +23,7 @@ class ScoredImageURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[GeneratedMetadata] = None
+ generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index b299e211..35f20c06 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -1,175 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import TYPE_CHECKING, Dict, List, Union, Optional
-from typing_extensions import Literal, Annotated, TypeAlias
+from typing import Dict, Optional
+from typing_extensions import Literal
-from pydantic import Field as FieldInfo
-
-from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = [
- "ScoredTextInputChunk",
- "GeneratedMetadata",
- "GeneratedMetadataMarkdownChunkGeneratedMetadata",
- "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "GeneratedMetadataTextChunkGeneratedMetadata",
- "GeneratedMetadataPdfChunkGeneratedMetadata",
- "GeneratedMetadataCodeChunkGeneratedMetadata",
- "GeneratedMetadataAudioChunkGeneratedMetadata",
-]
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
-
- heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-GeneratedMetadata: TypeAlias = Annotated[
- Union[
- GeneratedMetadataMarkdownChunkGeneratedMetadata,
- GeneratedMetadataTextChunkGeneratedMetadata,
- GeneratedMetadataPdfChunkGeneratedMetadata,
- GeneratedMetadataCodeChunkGeneratedMetadata,
- GeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
+__all__ = ["ScoredTextInputChunk"]
class ScoredTextInputChunk(BaseModel):
@@ -179,7 +15,7 @@ class ScoredTextInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[GeneratedMetadata] = None
+ generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index a6b9b316..78d77359 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -1,176 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import TYPE_CHECKING, Dict, List, Union, Optional
-from typing_extensions import Literal, Annotated, TypeAlias
+from typing import Dict, Optional
+from typing_extensions import Literal
-from pydantic import Field as FieldInfo
-
-from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = [
- "ScoredVideoURLInputChunk",
- "GeneratedMetadata",
- "GeneratedMetadataMarkdownChunkGeneratedMetadata",
- "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "GeneratedMetadataTextChunkGeneratedMetadata",
- "GeneratedMetadataPdfChunkGeneratedMetadata",
- "GeneratedMetadataCodeChunkGeneratedMetadata",
- "GeneratedMetadataAudioChunkGeneratedMetadata",
- "VideoURL",
-]
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
-
- heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-GeneratedMetadata: TypeAlias = Annotated[
- Union[
- GeneratedMetadataMarkdownChunkGeneratedMetadata,
- GeneratedMetadataTextChunkGeneratedMetadata,
- GeneratedMetadataPdfChunkGeneratedMetadata,
- GeneratedMetadataCodeChunkGeneratedMetadata,
- GeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
+__all__ = ["ScoredVideoURLInputChunk", "VideoURL"]
class VideoURL(BaseModel):
@@ -185,7 +20,7 @@ class ScoredVideoURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[GeneratedMetadata] = None
+ generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 318fb208..e9c535d4 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -1,11 +1,9 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing import Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, Annotated, TypeAlias
-from pydantic import Field as FieldInfo
-
from ..._utils import PropertyInfo
from ..._models import BaseModel
from .vector_store_file_status import VectorStoreFileStatus
@@ -14,202 +12,15 @@
"VectorStoreFile",
"Chunk",
"ChunkTextInputChunk",
- "ChunkTextInputChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkImageURLInputChunk",
- "ChunkImageURLInputChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkImageURLInputChunkImageURL",
"ChunkAudioURLInputChunk",
- "ChunkAudioURLInputChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkAudioURLInputChunkAudioURL",
"ChunkVideoURLInputChunk",
- "ChunkVideoURLInputChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkVideoURLInputChunkVideoURL",
]
-class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = (
- None
- )
-
- heading_context: Optional[
- List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
- ] = 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 ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
class ChunkTextInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -217,7 +28,7 @@ class ChunkTextInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[ChunkTextInputChunkGeneratedMetadata] = None
+ generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -233,161 +44,6 @@ class ChunkTextInputChunk(BaseModel):
"""Text content to process"""
-class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
- ] = None
-
- heading_context: Optional[
- List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
- ] = 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 ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
class ChunkImageURLInputChunkImageURL(BaseModel):
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -403,7 +59,7 @@ class ChunkImageURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[ChunkImageURLInputChunkGeneratedMetadata] = None
+ generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -422,161 +78,6 @@ class ChunkImageURLInputChunk(BaseModel):
"""The image input specification."""
-class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
- ] = None
-
- heading_context: Optional[
- List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
- ] = 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 ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
class ChunkAudioURLInputChunkAudioURL(BaseModel):
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -589,7 +90,7 @@ class ChunkAudioURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[ChunkAudioURLInputChunkGeneratedMetadata] = None
+ generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -611,161 +112,6 @@ class ChunkAudioURLInputChunk(BaseModel):
"""The sampling rate of the audio."""
-class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
- ] = None
-
- heading_context: Optional[
- List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
- ] = 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 ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- 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 ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
class ChunkVideoURLInputChunkVideoURL(BaseModel):
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -778,7 +124,7 @@ class ChunkVideoURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[ChunkVideoURLInputChunkGeneratedMetadata] = None
+ generated_metadata: Optional[Dict[str, object]] = None
"""metadata of the chunk"""
model: Optional[str] = None
From 157e5955f7f5c1099925dab6766217cbc86d8802 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 30 Sep 2025 17:28:03 +0000
Subject: [PATCH 274/375] feat(api): api update
---
.stats.yml | 4 +-
api.md | 4 -
.../resources/data_sources/connectors.py | 12 +-
.../resources/vector_stores/files.py | 235 ++--
.../resources/vector_stores/vector_stores.py | 313 +++--
src/mixedbread/types/__init__.py | 4 -
.../data_sources/connector_create_params.py | 4 +-
.../data_sources/data_source_connector.py | 4 +-
src/mixedbread/types/expires_after.py | 2 +-
src/mixedbread/types/expires_after_param.py | 2 +-
.../types/scored_audio_url_input_chunk.py | 57 -
.../types/scored_image_url_input_chunk.py | 57 -
.../types/scored_text_input_chunk.py | 46 -
.../types/scored_video_url_input_chunk.py | 54 -
src/mixedbread/types/vector_store.py | 2 +-
.../types/vector_store_create_params.py | 2 +-
...ector_store_question_answering_response.py | 210 +++-
.../types/vector_store_search_response.py | 208 +++-
.../types/vector_store_update_params.py | 4 +-
.../types/vector_stores/file_list_params.py | 5 +-
.../vector_stores/scored_vector_store_file.py | 215 +++-
.../types/vector_stores/vector_store_file.py | 7 +-
.../data_sources/test_connectors.py | 20 +-
tests/api_resources/test_vector_stores.py | 1030 +++++++++--------
.../api_resources/vector_stores/test_files.py | 980 ++++++++--------
25 files changed, 1979 insertions(+), 1502 deletions(-)
delete mode 100644 src/mixedbread/types/scored_audio_url_input_chunk.py
delete mode 100644 src/mixedbread/types/scored_image_url_input_chunk.py
delete mode 100644 src/mixedbread/types/scored_text_input_chunk.py
delete mode 100644 src/mixedbread/types/scored_video_url_input_chunk.py
diff --git a/.stats.yml b/.stats.yml
index fb5eaf61..bc469a36 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-7e1c9e69f48d60426e9495fa864cacb60b1df2462a89dd0dc6f8faa29b85537d.yml
-openapi_spec_hash: c6ac1b5e4ee5db8723cc223695d296f5
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-badb544207d1a5cbf542ecf662d4d4f085dd7d402c367620eeda31c2949c2f79.yml
+openapi_spec_hash: 27c151b834d6c5a5dc72e8f10c861840
config_hash: fef0ea78daf11093ff503919baae5ec0
diff --git a/api.md b/api.md
index 2a054ea2..1f6ce1dd 100644
--- a/api.md
+++ b/api.md
@@ -31,10 +31,6 @@ Types:
```python
from mixedbread.types import (
ExpiresAfter,
- ScoredAudioURLInputChunk,
- ScoredImageURLInputChunk,
- ScoredTextInputChunk,
- ScoredVideoURLInputChunk,
VectorStore,
VectorStoreChunkSearchOptions,
VectorStoreDeleteResponse,
diff --git a/src/mixedbread/resources/data_sources/connectors.py b/src/mixedbread/resources/data_sources/connectors.py
index 9ab5bee1..bd913e76 100644
--- a/src/mixedbread/resources/data_sources/connectors.py
+++ b/src/mixedbread/resources/data_sources/connectors.py
@@ -49,7 +49,7 @@ def create(
self,
data_source_id: str,
*,
- vector_store_id: str,
+ store_id: str,
name: str | Omit = omit,
trigger_sync: bool | Omit = omit,
metadata: object | Omit = omit,
@@ -72,7 +72,7 @@ def create(
Args:
data_source_id: The ID of the data source to create a connector for
- vector_store_id: The ID of the vector store
+ store_id: The ID of the store
name: The name of the connector
@@ -101,7 +101,7 @@ def create(
f"/v1/data_sources/{data_source_id}/connectors",
body=maybe_transform(
{
- "vector_store_id": vector_store_id,
+ "store_id": store_id,
"name": name,
"trigger_sync": trigger_sync,
"metadata": metadata,
@@ -369,7 +369,7 @@ async def create(
self,
data_source_id: str,
*,
- vector_store_id: str,
+ store_id: str,
name: str | Omit = omit,
trigger_sync: bool | Omit = omit,
metadata: object | Omit = omit,
@@ -392,7 +392,7 @@ async def create(
Args:
data_source_id: The ID of the data source to create a connector for
- vector_store_id: The ID of the vector store
+ store_id: The ID of the store
name: The name of the connector
@@ -421,7 +421,7 @@ async def create(
f"/v1/data_sources/{data_source_id}/connectors",
body=await async_maybe_transform(
{
- "vector_store_id": vector_store_id,
+ "store_id": store_id,
"name": name,
"trigger_sync": trigger_sync,
"metadata": metadata,
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index b5df5ffe..300f9d99 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -2,7 +2,9 @@
from __future__ import annotations
+import typing_extensions
from typing import List, Union, Iterable, Optional
+from typing_extensions import Literal
import httpx
@@ -22,7 +24,6 @@
from ...types.vector_stores.file_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
from ...types.vector_stores.file_search_response import FileSearchResponse
-from ...types.vector_stores.vector_store_file_status import VectorStoreFileStatus
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -47,6 +48,7 @@ def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
"""
return FilesResourceWithStreamingResponse(self)
+ @typing_extensions.deprecated("deprecated")
def create(
self,
vector_store_identifier: str,
@@ -62,12 +64,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreFile:
"""
- Add an already uploaded file to a vector store.
-
- Args: vector_store_identifier: The ID or name of the vector store to add the
- file to file: The file to add and index
-
- Returns: VectorStoreFile: Details of the added and indexed file
+ DEPRECATED: Use POST /stores/{store_identifier}/files instead
Args:
vector_store_identifier: The ID or name of the vector store
@@ -106,6 +103,7 @@ def create(
cast_to=VectorStoreFile,
)
+ @typing_extensions.deprecated("deprecated")
def retrieve(
self,
file_id: str,
@@ -120,17 +118,12 @@ def retrieve(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreFile:
"""
- Get details of a specific file in a vector store.
-
- Args: vector_store_identifier: The ID or name of the vector store file_id: The
- ID of the file
-
- Returns: VectorStoreFile: Details of the vector store file
+ DEPRECATED: Use GET /stores/{store_identifier}/files/{file_id} instead
Args:
vector_store_identifier: The ID or name of the vector store
- file_id: The ID of the file
+ file_id: The ID or name of the file
return_chunks: Whether to return the chunks for the file
@@ -160,6 +153,7 @@ def retrieve(
cast_to=VectorStoreFile,
)
+ @typing_extensions.deprecated("deprecated")
def list(
self,
vector_store_identifier: str,
@@ -168,7 +162,7 @@ def list(
after: Optional[str] | Omit = omit,
before: Optional[str] | Omit = omit,
include_total: bool | Omit = omit,
- statuses: Optional[List[VectorStoreFileStatus]] | Omit = omit,
+ statuses: Optional[List[Literal["pending", "in_progress", "cancelled", "completed", "failed"]]] | Omit = omit,
metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -178,12 +172,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileListResponse:
"""
- List files indexed in a vector store with pagination and metadata filter.
-
- Args: vector_store_identifier: The ID or name of the vector store pagination:
- Pagination parameters and metadata filter
-
- Returns: VectorStoreFileListResponse: Paginated list of vector store files
+ DEPRECATED: Use POST /stores/{store_identifier}/files/list instead
Args:
vector_store_identifier: The ID or name of the vector store
@@ -233,6 +222,7 @@ def list(
cast_to=FileListResponse,
)
+ @typing_extensions.deprecated("deprecated")
def delete(
self,
file_id: str,
@@ -246,17 +236,12 @@ def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileDeleteResponse:
"""
- Delete a file from a vector store.
-
- Args: vector_store_identifier: The ID or name of the vector store file_id: The
- ID of the file to delete
-
- Returns: VectorStoreFileDeleted: The deleted file
+ DEPRECATED: Use DELETE /stores/{store_identifier}/files/{file_id} instead
Args:
vector_store_identifier: The ID or name of the vector store
- file_id: The ID of the file to delete
+ file_id: The ID or name of the file to delete
extra_headers: Send extra headers
@@ -280,6 +265,7 @@ def delete(
cast_to=FileDeleteResponse,
)
+ @typing_extensions.deprecated("deprecated")
def search(
self,
*,
@@ -297,22 +283,7 @@ def search(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileSearchResponse:
"""
- Perform semantic search across complete vector store files.
-
- This endpoint searches through vector store files using semantic similarity
- matching. Unlike chunk search, it returns complete matching files rather than
- individual chunks. Supports complex search queries with filters and returns
- relevance-scored results.
-
- Args: search_params: Search configuration including: - query text or
- embeddings - metadata filters - pagination parameters - sorting preferences
- \\__state: API state dependency \\__ctx: Service context dependency
-
- Returns: VectorStoreSearchFileResponse containing: - List of matched files with
- relevance scores - Pagination details including total result count
-
- Raises: HTTPException (400): If search parameters are invalid HTTPException
- (404): If no vector stores are found to search
+ DEPRECATED: Use POST /stores/{store_identifier}/files/search instead
Args:
query: Search query text
@@ -375,6 +346,7 @@ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
"""
return AsyncFilesResourceWithStreamingResponse(self)
+ @typing_extensions.deprecated("deprecated")
async def create(
self,
vector_store_identifier: str,
@@ -390,12 +362,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreFile:
"""
- Add an already uploaded file to a vector store.
-
- Args: vector_store_identifier: The ID or name of the vector store to add the
- file to file: The file to add and index
-
- Returns: VectorStoreFile: Details of the added and indexed file
+ DEPRECATED: Use POST /stores/{store_identifier}/files instead
Args:
vector_store_identifier: The ID or name of the vector store
@@ -434,6 +401,7 @@ async def create(
cast_to=VectorStoreFile,
)
+ @typing_extensions.deprecated("deprecated")
async def retrieve(
self,
file_id: str,
@@ -448,17 +416,12 @@ async def retrieve(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreFile:
"""
- Get details of a specific file in a vector store.
-
- Args: vector_store_identifier: The ID or name of the vector store file_id: The
- ID of the file
-
- Returns: VectorStoreFile: Details of the vector store file
+ DEPRECATED: Use GET /stores/{store_identifier}/files/{file_id} instead
Args:
vector_store_identifier: The ID or name of the vector store
- file_id: The ID of the file
+ file_id: The ID or name of the file
return_chunks: Whether to return the chunks for the file
@@ -490,6 +453,7 @@ async def retrieve(
cast_to=VectorStoreFile,
)
+ @typing_extensions.deprecated("deprecated")
async def list(
self,
vector_store_identifier: str,
@@ -498,7 +462,7 @@ async def list(
after: Optional[str] | Omit = omit,
before: Optional[str] | Omit = omit,
include_total: bool | Omit = omit,
- statuses: Optional[List[VectorStoreFileStatus]] | Omit = omit,
+ statuses: Optional[List[Literal["pending", "in_progress", "cancelled", "completed", "failed"]]] | Omit = omit,
metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -508,12 +472,7 @@ async def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileListResponse:
"""
- List files indexed in a vector store with pagination and metadata filter.
-
- Args: vector_store_identifier: The ID or name of the vector store pagination:
- Pagination parameters and metadata filter
-
- Returns: VectorStoreFileListResponse: Paginated list of vector store files
+ DEPRECATED: Use POST /stores/{store_identifier}/files/list instead
Args:
vector_store_identifier: The ID or name of the vector store
@@ -563,6 +522,7 @@ async def list(
cast_to=FileListResponse,
)
+ @typing_extensions.deprecated("deprecated")
async def delete(
self,
file_id: str,
@@ -576,17 +536,12 @@ async def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileDeleteResponse:
"""
- Delete a file from a vector store.
-
- Args: vector_store_identifier: The ID or name of the vector store file_id: The
- ID of the file to delete
-
- Returns: VectorStoreFileDeleted: The deleted file
+ DEPRECATED: Use DELETE /stores/{store_identifier}/files/{file_id} instead
Args:
vector_store_identifier: The ID or name of the vector store
- file_id: The ID of the file to delete
+ file_id: The ID or name of the file to delete
extra_headers: Send extra headers
@@ -610,6 +565,7 @@ async def delete(
cast_to=FileDeleteResponse,
)
+ @typing_extensions.deprecated("deprecated")
async def search(
self,
*,
@@ -627,22 +583,7 @@ async def search(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> FileSearchResponse:
"""
- Perform semantic search across complete vector store files.
-
- This endpoint searches through vector store files using semantic similarity
- matching. Unlike chunk search, it returns complete matching files rather than
- individual chunks. Supports complex search queries with filters and returns
- relevance-scored results.
-
- Args: search_params: Search configuration including: - query text or
- embeddings - metadata filters - pagination parameters - sorting preferences
- \\__state: API state dependency \\__ctx: Service context dependency
-
- Returns: VectorStoreSearchFileResponse containing: - List of matched files with
- relevance scores - Pagination details including total result count
-
- Raises: HTTPException (400): If search parameters are invalid HTTPException
- (404): If no vector stores are found to search
+ DEPRECATED: Use POST /stores/{store_identifier}/files/search instead
Args:
query: Search query text
@@ -689,20 +630,30 @@ class FilesResourceWithRawResponse:
def __init__(self, files: FilesResource) -> None:
self._files = files
- self.create = to_raw_response_wrapper(
- files.create,
+ self.create = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ files.create, # pyright: ignore[reportDeprecated],
+ )
)
- self.retrieve = to_raw_response_wrapper(
- files.retrieve,
+ self.retrieve = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ files.retrieve, # pyright: ignore[reportDeprecated],
+ )
)
- self.list = to_raw_response_wrapper(
- files.list,
+ self.list = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ files.list, # pyright: ignore[reportDeprecated],
+ )
)
- self.delete = to_raw_response_wrapper(
- files.delete,
+ self.delete = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ files.delete, # pyright: ignore[reportDeprecated],
+ )
)
- self.search = to_raw_response_wrapper(
- files.search,
+ self.search = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ files.search, # pyright: ignore[reportDeprecated],
+ )
)
@@ -710,20 +661,30 @@ class AsyncFilesResourceWithRawResponse:
def __init__(self, files: AsyncFilesResource) -> None:
self._files = files
- self.create = async_to_raw_response_wrapper(
- files.create,
+ self.create = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ files.create, # pyright: ignore[reportDeprecated],
+ )
)
- self.retrieve = async_to_raw_response_wrapper(
- files.retrieve,
+ self.retrieve = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ files.retrieve, # pyright: ignore[reportDeprecated],
+ )
)
- self.list = async_to_raw_response_wrapper(
- files.list,
+ self.list = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ files.list, # pyright: ignore[reportDeprecated],
+ )
)
- self.delete = async_to_raw_response_wrapper(
- files.delete,
+ self.delete = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ files.delete, # pyright: ignore[reportDeprecated],
+ )
)
- self.search = async_to_raw_response_wrapper(
- files.search,
+ self.search = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ files.search, # pyright: ignore[reportDeprecated],
+ )
)
@@ -731,20 +692,30 @@ class FilesResourceWithStreamingResponse:
def __init__(self, files: FilesResource) -> None:
self._files = files
- self.create = to_streamed_response_wrapper(
- files.create,
+ self.create = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ files.create, # pyright: ignore[reportDeprecated],
+ )
)
- self.retrieve = to_streamed_response_wrapper(
- files.retrieve,
+ self.retrieve = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ files.retrieve, # pyright: ignore[reportDeprecated],
+ )
)
- self.list = to_streamed_response_wrapper(
- files.list,
+ self.list = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ files.list, # pyright: ignore[reportDeprecated],
+ )
)
- self.delete = to_streamed_response_wrapper(
- files.delete,
+ self.delete = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ files.delete, # pyright: ignore[reportDeprecated],
+ )
)
- self.search = to_streamed_response_wrapper(
- files.search,
+ self.search = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ files.search, # pyright: ignore[reportDeprecated],
+ )
)
@@ -752,18 +723,28 @@ class AsyncFilesResourceWithStreamingResponse:
def __init__(self, files: AsyncFilesResource) -> None:
self._files = files
- self.create = async_to_streamed_response_wrapper(
- files.create,
+ self.create = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ files.create, # pyright: ignore[reportDeprecated],
+ )
)
- self.retrieve = async_to_streamed_response_wrapper(
- files.retrieve,
+ self.retrieve = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ files.retrieve, # pyright: ignore[reportDeprecated],
+ )
)
- self.list = async_to_streamed_response_wrapper(
- files.list,
+ self.list = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ files.list, # pyright: ignore[reportDeprecated],
+ )
)
- self.delete = async_to_streamed_response_wrapper(
- files.delete,
+ self.delete = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ files.delete, # pyright: ignore[reportDeprecated],
+ )
)
- self.search = async_to_streamed_response_wrapper(
- files.search,
+ self.search = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ files.search, # pyright: ignore[reportDeprecated],
+ )
)
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 75d11b1c..548ffe13 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+import typing_extensions
from typing import Union, Iterable, Optional
import httpx
@@ -67,6 +68,7 @@ def with_streaming_response(self) -> VectorStoresResourceWithStreamingResponse:
"""
return VectorStoresResourceWithStreamingResponse(self)
+ @typing_extensions.deprecated("deprecated")
def create(
self,
*,
@@ -84,12 +86,7 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
- Create a new vector store.
-
- Args: vector_store_create: VectorStoreCreate object containing the name,
- description, and metadata.
-
- Returns: VectorStore: The response containing the created vector store details.
+ DEPRECATED: Use POST /stores instead
Args:
name: Name for the new vector store
@@ -98,7 +95,7 @@ def create(
is_public: Whether the vector store can be accessed by anyone with valid login credentials
- expires_after: Represents an expiration policy for a vector store.
+ expires_after: Represents an expiration policy for a store.
metadata: Optional metadata key-value pairs
@@ -131,6 +128,7 @@ def create(
cast_to=VectorStore,
)
+ @typing_extensions.deprecated("deprecated")
def retrieve(
self,
vector_store_identifier: str,
@@ -143,11 +141,7 @@ def retrieve(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
- Get a vector store by ID or name.
-
- Args: vector_store_identifier: The ID or name of the vector store to retrieve.
-
- Returns: VectorStore: The response containing the vector store details.
+ DEPRECATED: Use GET /stores/{store_identifier} instead
Args:
vector_store_identifier: The ID or name of the vector store
@@ -172,6 +166,7 @@ def retrieve(
cast_to=VectorStore,
)
+ @typing_extensions.deprecated("deprecated")
def update(
self,
vector_store_identifier: str,
@@ -189,24 +184,18 @@ def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
- Update a vector store by ID or name.
-
- Args: vector_store_identifier: The ID or name of the vector store to update.
- vector_store_update: VectorStoreCreate object containing the name, description,
- and metadata.
-
- Returns: VectorStore: The response containing the updated vector store details.
+ DEPRECATED: Use PUT /stores/{store_identifier} instead
Args:
vector_store_identifier: The ID or name of the vector store
- name: New name for the vector store
+ name: New name for the store
description: New description
is_public: Whether the vector store can be accessed by anyone with valid login credentials
- expires_after: Represents an expiration policy for a vector store.
+ expires_after: Represents an expiration policy for a store.
metadata: Optional metadata key-value pairs
@@ -240,6 +229,7 @@ def update(
cast_to=VectorStore,
)
+ @typing_extensions.deprecated("deprecated")
def list(
self,
*,
@@ -256,12 +246,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncCursor[VectorStore]:
"""
- List all vector stores with optional search.
-
- Args: pagination: The pagination options. q: Optional search query to filter
- vector stores.
-
- Returns: VectorStoreListResponse: The list of vector stores.
+ DEPRECATED: Use GET /stores instead
Args:
limit: Maximum number of items to return per page (1-100)
@@ -306,6 +291,7 @@ def list(
model=VectorStore,
)
+ @typing_extensions.deprecated("deprecated")
def delete(
self,
vector_store_identifier: str,
@@ -318,11 +304,7 @@ def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreDeleteResponse:
"""
- Delete a vector store by ID or name.
-
- Args: vector_store_identifier: The ID or name of the vector store to delete.
-
- Returns: VectorStore: The response containing the deleted vector store details.
+ DEPRECATED: Use DELETE /stores/{store_identifier} instead
Args:
vector_store_identifier: The ID or name of the vector store to delete
@@ -347,6 +329,7 @@ def delete(
cast_to=VectorStoreDeleteResponse,
)
+ @typing_extensions.deprecated("deprecated")
def question_answering(
self,
*,
@@ -365,12 +348,11 @@ def question_answering(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreQuestionAnsweringResponse:
- """Question answering
+ """
+ DEPRECATED: Use POST /stores/question-answering instead
Args:
- query: Question to answer.
-
- If not provided, the question will be extracted from the
+ query: Question to answer. If not provided, the question will be extracted from the
passed messages.
vector_store_identifiers: IDs or names of vector stores to search
@@ -416,6 +398,7 @@ def question_answering(
cast_to=VectorStoreQuestionAnsweringResponse,
)
+ @typing_extensions.deprecated("deprecated")
def search(
self,
*,
@@ -433,23 +416,7 @@ def search(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreSearchResponse:
"""
- Perform semantic search across vector store chunks.
-
- This endpoint searches through vector store chunks using semantic similarity
- matching. It supports complex search queries with filters and returns
- relevance-scored results.
-
- Args: search_params: Search configuration including: - query text or
- embeddings - vector_store_ids: List of vector stores to search - file_ids:
- Optional list of file IDs to filter chunks by (or tuple of list and condition
- operator) - metadata filters - pagination parameters - sorting preferences
- \\__state: API state dependency \\__ctx: Service context dependency
-
- Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks
- with relevance scores - Pagination details including total result count
-
- Raises: HTTPException (400): If search parameters are invalid HTTPException
- (404): If no vector stores are found to search
+ DEPRECATED: Use POST /stores/search instead
Args:
query: Search query text
@@ -516,6 +483,7 @@ def with_streaming_response(self) -> AsyncVectorStoresResourceWithStreamingRespo
"""
return AsyncVectorStoresResourceWithStreamingResponse(self)
+ @typing_extensions.deprecated("deprecated")
async def create(
self,
*,
@@ -533,12 +501,7 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
- Create a new vector store.
-
- Args: vector_store_create: VectorStoreCreate object containing the name,
- description, and metadata.
-
- Returns: VectorStore: The response containing the created vector store details.
+ DEPRECATED: Use POST /stores instead
Args:
name: Name for the new vector store
@@ -547,7 +510,7 @@ async def create(
is_public: Whether the vector store can be accessed by anyone with valid login credentials
- expires_after: Represents an expiration policy for a vector store.
+ expires_after: Represents an expiration policy for a store.
metadata: Optional metadata key-value pairs
@@ -580,6 +543,7 @@ async def create(
cast_to=VectorStore,
)
+ @typing_extensions.deprecated("deprecated")
async def retrieve(
self,
vector_store_identifier: str,
@@ -592,11 +556,7 @@ async def retrieve(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
- Get a vector store by ID or name.
-
- Args: vector_store_identifier: The ID or name of the vector store to retrieve.
-
- Returns: VectorStore: The response containing the vector store details.
+ DEPRECATED: Use GET /stores/{store_identifier} instead
Args:
vector_store_identifier: The ID or name of the vector store
@@ -621,6 +581,7 @@ async def retrieve(
cast_to=VectorStore,
)
+ @typing_extensions.deprecated("deprecated")
async def update(
self,
vector_store_identifier: str,
@@ -638,24 +599,18 @@ async def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStore:
"""
- Update a vector store by ID or name.
-
- Args: vector_store_identifier: The ID or name of the vector store to update.
- vector_store_update: VectorStoreCreate object containing the name, description,
- and metadata.
-
- Returns: VectorStore: The response containing the updated vector store details.
+ DEPRECATED: Use PUT /stores/{store_identifier} instead
Args:
vector_store_identifier: The ID or name of the vector store
- name: New name for the vector store
+ name: New name for the store
description: New description
is_public: Whether the vector store can be accessed by anyone with valid login credentials
- expires_after: Represents an expiration policy for a vector store.
+ expires_after: Represents an expiration policy for a store.
metadata: Optional metadata key-value pairs
@@ -689,6 +644,7 @@ async def update(
cast_to=VectorStore,
)
+ @typing_extensions.deprecated("deprecated")
def list(
self,
*,
@@ -705,12 +661,7 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[VectorStore, AsyncCursor[VectorStore]]:
"""
- List all vector stores with optional search.
-
- Args: pagination: The pagination options. q: Optional search query to filter
- vector stores.
-
- Returns: VectorStoreListResponse: The list of vector stores.
+ DEPRECATED: Use GET /stores instead
Args:
limit: Maximum number of items to return per page (1-100)
@@ -755,6 +706,7 @@ def list(
model=VectorStore,
)
+ @typing_extensions.deprecated("deprecated")
async def delete(
self,
vector_store_identifier: str,
@@ -767,11 +719,7 @@ async def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreDeleteResponse:
"""
- Delete a vector store by ID or name.
-
- Args: vector_store_identifier: The ID or name of the vector store to delete.
-
- Returns: VectorStore: The response containing the deleted vector store details.
+ DEPRECATED: Use DELETE /stores/{store_identifier} instead
Args:
vector_store_identifier: The ID or name of the vector store to delete
@@ -796,6 +744,7 @@ async def delete(
cast_to=VectorStoreDeleteResponse,
)
+ @typing_extensions.deprecated("deprecated")
async def question_answering(
self,
*,
@@ -814,12 +763,11 @@ async def question_answering(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreQuestionAnsweringResponse:
- """Question answering
+ """
+ DEPRECATED: Use POST /stores/question-answering instead
Args:
- query: Question to answer.
-
- If not provided, the question will be extracted from the
+ query: Question to answer. If not provided, the question will be extracted from the
passed messages.
vector_store_identifiers: IDs or names of vector stores to search
@@ -865,6 +813,7 @@ async def question_answering(
cast_to=VectorStoreQuestionAnsweringResponse,
)
+ @typing_extensions.deprecated("deprecated")
async def search(
self,
*,
@@ -882,23 +831,7 @@ async def search(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> VectorStoreSearchResponse:
"""
- Perform semantic search across vector store chunks.
-
- This endpoint searches through vector store chunks using semantic similarity
- matching. It supports complex search queries with filters and returns
- relevance-scored results.
-
- Args: search_params: Search configuration including: - query text or
- embeddings - vector_store_ids: List of vector stores to search - file_ids:
- Optional list of file IDs to filter chunks by (or tuple of list and condition
- operator) - metadata filters - pagination parameters - sorting preferences
- \\__state: API state dependency \\__ctx: Service context dependency
-
- Returns: VectorStoreSearchChunkResponse containing: - List of matched chunks
- with relevance scores - Pagination details including total result count
-
- Raises: HTTPException (400): If search parameters are invalid HTTPException
- (404): If no vector stores are found to search
+ DEPRECATED: Use POST /stores/search instead
Args:
query: Search query text
@@ -945,26 +878,40 @@ class VectorStoresResourceWithRawResponse:
def __init__(self, vector_stores: VectorStoresResource) -> None:
self._vector_stores = vector_stores
- self.create = to_raw_response_wrapper(
- vector_stores.create,
+ self.create = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ vector_stores.create, # pyright: ignore[reportDeprecated],
+ )
)
- self.retrieve = to_raw_response_wrapper(
- vector_stores.retrieve,
+ self.retrieve = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ vector_stores.retrieve, # pyright: ignore[reportDeprecated],
+ )
)
- self.update = to_raw_response_wrapper(
- vector_stores.update,
+ self.update = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ vector_stores.update, # pyright: ignore[reportDeprecated],
+ )
)
- self.list = to_raw_response_wrapper(
- vector_stores.list,
+ self.list = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ vector_stores.list, # pyright: ignore[reportDeprecated],
+ )
)
- self.delete = to_raw_response_wrapper(
- vector_stores.delete,
+ self.delete = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ vector_stores.delete, # pyright: ignore[reportDeprecated],
+ )
)
- self.question_answering = to_raw_response_wrapper(
- vector_stores.question_answering,
+ self.question_answering = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ vector_stores.question_answering, # pyright: ignore[reportDeprecated],
+ )
)
- self.search = to_raw_response_wrapper(
- vector_stores.search,
+ self.search = ( # pyright: ignore[reportDeprecated]
+ to_raw_response_wrapper(
+ vector_stores.search, # pyright: ignore[reportDeprecated],
+ )
)
@cached_property
@@ -976,26 +923,40 @@ class AsyncVectorStoresResourceWithRawResponse:
def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self._vector_stores = vector_stores
- self.create = async_to_raw_response_wrapper(
- vector_stores.create,
+ self.create = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ vector_stores.create, # pyright: ignore[reportDeprecated],
+ )
)
- self.retrieve = async_to_raw_response_wrapper(
- vector_stores.retrieve,
+ self.retrieve = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ vector_stores.retrieve, # pyright: ignore[reportDeprecated],
+ )
)
- self.update = async_to_raw_response_wrapper(
- vector_stores.update,
+ self.update = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ vector_stores.update, # pyright: ignore[reportDeprecated],
+ )
)
- self.list = async_to_raw_response_wrapper(
- vector_stores.list,
+ self.list = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ vector_stores.list, # pyright: ignore[reportDeprecated],
+ )
)
- self.delete = async_to_raw_response_wrapper(
- vector_stores.delete,
+ self.delete = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ vector_stores.delete, # pyright: ignore[reportDeprecated],
+ )
)
- self.question_answering = async_to_raw_response_wrapper(
- vector_stores.question_answering,
+ self.question_answering = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ vector_stores.question_answering, # pyright: ignore[reportDeprecated],
+ )
)
- self.search = async_to_raw_response_wrapper(
- vector_stores.search,
+ self.search = ( # pyright: ignore[reportDeprecated]
+ async_to_raw_response_wrapper(
+ vector_stores.search, # pyright: ignore[reportDeprecated],
+ )
)
@cached_property
@@ -1007,26 +968,40 @@ class VectorStoresResourceWithStreamingResponse:
def __init__(self, vector_stores: VectorStoresResource) -> None:
self._vector_stores = vector_stores
- self.create = to_streamed_response_wrapper(
- vector_stores.create,
+ self.create = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ vector_stores.create, # pyright: ignore[reportDeprecated],
+ )
)
- self.retrieve = to_streamed_response_wrapper(
- vector_stores.retrieve,
+ self.retrieve = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ vector_stores.retrieve, # pyright: ignore[reportDeprecated],
+ )
)
- self.update = to_streamed_response_wrapper(
- vector_stores.update,
+ self.update = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ vector_stores.update, # pyright: ignore[reportDeprecated],
+ )
)
- self.list = to_streamed_response_wrapper(
- vector_stores.list,
+ self.list = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ vector_stores.list, # pyright: ignore[reportDeprecated],
+ )
)
- self.delete = to_streamed_response_wrapper(
- vector_stores.delete,
+ self.delete = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ vector_stores.delete, # pyright: ignore[reportDeprecated],
+ )
)
- self.question_answering = to_streamed_response_wrapper(
- vector_stores.question_answering,
+ self.question_answering = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ vector_stores.question_answering, # pyright: ignore[reportDeprecated],
+ )
)
- self.search = to_streamed_response_wrapper(
- vector_stores.search,
+ self.search = ( # pyright: ignore[reportDeprecated]
+ to_streamed_response_wrapper(
+ vector_stores.search, # pyright: ignore[reportDeprecated],
+ )
)
@cached_property
@@ -1038,26 +1013,40 @@ class AsyncVectorStoresResourceWithStreamingResponse:
def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
self._vector_stores = vector_stores
- self.create = async_to_streamed_response_wrapper(
- vector_stores.create,
+ self.create = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ vector_stores.create, # pyright: ignore[reportDeprecated],
+ )
)
- self.retrieve = async_to_streamed_response_wrapper(
- vector_stores.retrieve,
+ self.retrieve = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ vector_stores.retrieve, # pyright: ignore[reportDeprecated],
+ )
)
- self.update = async_to_streamed_response_wrapper(
- vector_stores.update,
+ self.update = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ vector_stores.update, # pyright: ignore[reportDeprecated],
+ )
)
- self.list = async_to_streamed_response_wrapper(
- vector_stores.list,
+ self.list = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ vector_stores.list, # pyright: ignore[reportDeprecated],
+ )
)
- self.delete = async_to_streamed_response_wrapper(
- vector_stores.delete,
+ self.delete = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ vector_stores.delete, # pyright: ignore[reportDeprecated],
+ )
)
- self.question_answering = async_to_streamed_response_wrapper(
- vector_stores.question_answering,
+ self.question_answering = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ vector_stores.question_answering, # pyright: ignore[reportDeprecated],
+ )
)
- self.search = async_to_streamed_response_wrapper(
- vector_stores.search,
+ self.search = ( # pyright: ignore[reportDeprecated]
+ async_to_streamed_response_wrapper(
+ vector_stores.search, # pyright: ignore[reportDeprecated],
+ )
)
@cached_property
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 651a8004..87fe66f4 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -30,7 +30,6 @@
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 .linear_data_source_param import LinearDataSourceParam as LinearDataSourceParam
from .multi_encoding_embedding import MultiEncodingEmbedding as MultiEncodingEmbedding
from .notion_data_source_param import NotionDataSourceParam as NotionDataSourceParam
@@ -43,9 +42,6 @@
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 .vector_store_question_answering_params import (
diff --git a/src/mixedbread/types/data_sources/connector_create_params.py b/src/mixedbread/types/data_sources/connector_create_params.py
index 43c23c67..185c3894 100644
--- a/src/mixedbread/types/data_sources/connector_create_params.py
+++ b/src/mixedbread/types/data_sources/connector_create_params.py
@@ -9,8 +9,8 @@
class ConnectorCreateParams(TypedDict, total=False):
- vector_store_id: Required[str]
- """The ID of the vector store"""
+ store_id: Required[str]
+ """The ID of the store"""
name: str
"""The name of the connector"""
diff --git a/src/mixedbread/types/data_sources/data_source_connector.py b/src/mixedbread/types/data_sources/data_source_connector.py
index bda39237..7534233d 100644
--- a/src/mixedbread/types/data_sources/data_source_connector.py
+++ b/src/mixedbread/types/data_sources/data_source_connector.py
@@ -19,8 +19,8 @@ class DataSourceConnector(BaseModel):
updated_at: datetime
"""The last update time of the connector"""
- vector_store_id: str
- """The ID of the vector store"""
+ store_id: str
+ """The ID of the store"""
data_source_id: str
"""The ID of the data source"""
diff --git a/src/mixedbread/types/expires_after.py b/src/mixedbread/types/expires_after.py
index 8550ad0a..66126cb9 100644
--- a/src/mixedbread/types/expires_after.py
+++ b/src/mixedbread/types/expires_after.py
@@ -13,4 +13,4 @@ class ExpiresAfter(BaseModel):
"""Anchor date for the expiration policy"""
days: Optional[int] = None
- """Number of days after which the vector store expires"""
+ """Number of days after which the store expires"""
diff --git a/src/mixedbread/types/expires_after_param.py b/src/mixedbread/types/expires_after_param.py
index e7b4bee0..432f29d7 100644
--- a/src/mixedbread/types/expires_after_param.py
+++ b/src/mixedbread/types/expires_after_param.py
@@ -12,4 +12,4 @@ class ExpiresAfterParam(TypedDict, total=False):
"""Anchor date for the expiration policy"""
days: int
- """Number of days after which the vector store expires"""
+ """Number of days after which the store expires"""
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
deleted file mode 100644
index 59d6423f..00000000
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, 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"""
-
- generated_metadata: Optional[Dict[str, object]] = None
- """metadata 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"""
-
- 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."""
-
- sampling_rate: int
- """The sampling rate 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
deleted file mode 100644
index 9bd0deb2..00000000
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, 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."""
-
- format: Optional[str] = None
- """The image format/mimetype"""
-
-
-class ScoredImageURLInputChunk(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"""
-
- 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"""
-
- 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."""
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
deleted file mode 100644
index 35f20c06..00000000
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, 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"""
-
- generated_metadata: Optional[Dict[str, object]] = None
- """metadata 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"""
-
- 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"""
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
deleted file mode 100644
index 78d77359..00000000
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict, 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"""
-
- generated_metadata: Optional[Dict[str, object]] = None
- """metadata 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"""
-
- 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."""
diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py
index 331c9913..cbdeeeb8 100644
--- a/src/mixedbread/types/vector_store.py
+++ b/src/mixedbread/types/vector_store.py
@@ -50,7 +50,7 @@ class VectorStore(BaseModel):
"""Counts of files in different states"""
expires_after: Optional[ExpiresAfter] = None
- """Represents an expiration policy for a vector store."""
+ """Represents an expiration policy for a store."""
status: Optional[Literal["expired", "in_progress", "completed"]] = None
"""Processing status of the vector store"""
diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py
index f22e2673..713342a5 100644
--- a/src/mixedbread/types/vector_store_create_params.py
+++ b/src/mixedbread/types/vector_store_create_params.py
@@ -22,7 +22,7 @@ class VectorStoreCreateParams(TypedDict, total=False):
"""Whether the vector store can be accessed by anyone with valid login credentials"""
expires_after: Optional[ExpiresAfterParam]
- """Represents an expiration policy for a vector store."""
+ """Represents an expiration policy for a store."""
metadata: object
"""Optional metadata key-value pairs"""
diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py
index 2a477a87..7b2961f2 100644
--- a/src/mixedbread/types/vector_store_question_answering_response.py
+++ b/src/mixedbread/types/vector_store_question_answering_response.py
@@ -1,19 +1,213 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
-from typing_extensions import Annotated, TypeAlias
+from typing import Dict, List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
from .._utils import PropertyInfo
from .._models import BaseModel
-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", "Source"]
+__all__ = [
+ "VectorStoreQuestionAnsweringResponse",
+ "Source",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL",
+]
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
+ url: str
+ """The image URL. Can be either a URL or a Data URI."""
+
+ format: Optional[str] = None
+ """The image format/mimetype"""
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ image_url: SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL
+ """The image input specification."""
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
+ url: str
+ """The audio URL. Can be either a URL or a Data URI."""
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ audio_url: SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL
+ """The audio input specification."""
+
+ sampling_rate: int
+ """The sampling rate of the audio."""
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
+ url: str
+ """The video URL. Can be either a URL or a Data URI."""
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ video_url: SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL
+ """The video input specification."""
+
Source: TypeAlias = Annotated[
- Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
+ Union[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk,
+ ],
PropertyInfo(discriminator="type"),
]
diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py
index 50143c9f..3d49be57 100644
--- a/src/mixedbread/types/vector_store_search_response.py
+++ b/src/mixedbread/types/vector_store_search_response.py
@@ -1,19 +1,213 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import Dict, List, Union, Optional
from typing_extensions import Literal, Annotated, TypeAlias
from .._utils import PropertyInfo
from .._models import BaseModel
-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", "Data"]
+__all__ = [
+ "VectorStoreSearchResponse",
+ "Data",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL",
+]
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
+ url: str
+ """The image URL. Can be either a URL or a Data URI."""
+
+ format: Optional[str] = None
+ """The image format/mimetype"""
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ image_url: DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL
+ """The image input specification."""
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
+ url: str
+ """The audio URL. Can be either a URL or a Data URI."""
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ audio_url: DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL
+ """The audio input specification."""
+
+ sampling_rate: int
+ """The sampling rate of the audio."""
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
+ url: str
+ """The video URL. Can be either a URL or a Data URI."""
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ video_url: DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL
+ """The video input specification."""
+
Data: TypeAlias = Annotated[
- Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
+ Union[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk,
+ ],
PropertyInfo(discriminator="type"),
]
diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py
index 7bf9e2ed..22545d43 100644
--- a/src/mixedbread/types/vector_store_update_params.py
+++ b/src/mixedbread/types/vector_store_update_params.py
@@ -12,7 +12,7 @@
class VectorStoreUpdateParams(TypedDict, total=False):
name: Optional[str]
- """New name for the vector store"""
+ """New name for the store"""
description: Optional[str]
"""New description"""
@@ -21,7 +21,7 @@ class VectorStoreUpdateParams(TypedDict, total=False):
"""Whether the vector store can be accessed by anyone with valid login credentials"""
expires_after: Optional[ExpiresAfterParam]
- """Represents an expiration policy for a vector store."""
+ """Represents an expiration policy for a store."""
metadata: object
"""Optional metadata key-value pairs"""
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
index a4ac03c8..9f89685c 100644
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -3,9 +3,8 @@
from __future__ import annotations
from typing import List, Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict
+from typing_extensions import Literal, TypeAlias, TypedDict
-from .vector_store_file_status import VectorStoreFileStatus
from ..shared_params.search_filter_condition import SearchFilterCondition
__all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"]
@@ -30,7 +29,7 @@ class FileListParams(TypedDict, total=False):
include_total: bool
"""Whether to include total count in response (expensive operation)"""
- statuses: Optional[List[VectorStoreFileStatus]]
+ statuses: Optional[List[Literal["pending", "in_progress", "cancelled", "completed", "failed"]]]
"""Status to filter by"""
metadata_filter: Optional[MetadataFilter]
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 12d8ddd0..247d7d39 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -1,21 +1,214 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, Annotated, TypeAlias
from ..._utils import PropertyInfo
from ..._models import BaseModel
-from ..scored_text_input_chunk import ScoredTextInputChunk
-from .vector_store_file_status import VectorStoreFileStatus
-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", "Chunk"]
+__all__ = [
+ "ScoredVectorStoreFile",
+ "Chunk",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL",
+]
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
+ url: str
+ """The image URL. Can be either a URL or a Data URI."""
+
+ format: Optional[str] = None
+ """The image format/mimetype"""
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ image_url: ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL
+ """The image input specification."""
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
+ url: str
+ """The audio URL. Can be either a URL or a Data URI."""
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ audio_url: ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL
+ """The audio input specification."""
+
+ sampling_rate: int
+ """The sampling rate of the audio."""
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
+ url: str
+ """The video URL. Can be either a URL or a Data URI."""
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ vector_store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ video_url: ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL
+ """The video input specification."""
+
Chunk: TypeAlias = Annotated[
- Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
+ Union[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk,
+ ],
PropertyInfo(discriminator="type"),
]
@@ -30,17 +223,17 @@ class ScoredVectorStoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
- status: Optional[VectorStoreFileStatus] = None
+ status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None
"""Processing status of the file"""
last_error: Optional[object] = None
"""Last error message if processing failed"""
vector_store_id: str
- """ID of the containing vector store"""
+ """ID of the containing store"""
created_at: datetime
- """Timestamp of vector store file creation"""
+ """Timestamp of store file creation"""
version: Optional[int] = None
"""Version number of the file"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index e9c535d4..89f64d8a 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -6,7 +6,6 @@
from ..._utils import PropertyInfo
from ..._models import BaseModel
-from .vector_store_file_status import VectorStoreFileStatus
__all__ = [
"VectorStoreFile",
@@ -159,17 +158,17 @@ class VectorStoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
- status: Optional[VectorStoreFileStatus] = None
+ status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None
"""Processing status of the file"""
last_error: Optional[object] = None
"""Last error message if processing failed"""
vector_store_id: str
- """ID of the containing vector store"""
+ """ID of the containing store"""
created_at: datetime
- """Timestamp of vector store file creation"""
+ """Timestamp of store file creation"""
version: Optional[int] = None
"""Version number of the file"""
diff --git a/tests/api_resources/data_sources/test_connectors.py b/tests/api_resources/data_sources/test_connectors.py
index 23c313d4..20d3847e 100644
--- a/tests/api_resources/data_sources/test_connectors.py
+++ b/tests/api_resources/data_sources/test_connectors.py
@@ -25,7 +25,7 @@ class TestConnectors:
def test_method_create(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.create(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="vector_store_id",
+ store_id="store_id",
)
assert_matches_type(DataSourceConnector, connector, path=["response"])
@@ -33,7 +33,7 @@ def test_method_create(self, client: Mixedbread) -> None:
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
connector = client.data_sources.connectors.create(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="vector_store_id",
+ store_id="store_id",
name="name",
trigger_sync=True,
metadata={},
@@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
def test_raw_response_create(self, client: Mixedbread) -> None:
response = client.data_sources.connectors.with_raw_response.create(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="vector_store_id",
+ store_id="store_id",
)
assert response.is_closed is True
@@ -57,7 +57,7 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
def test_streaming_response_create(self, client: Mixedbread) -> None:
with client.data_sources.connectors.with_streaming_response.create(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="vector_store_id",
+ store_id="store_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -72,7 +72,7 @@ def test_path_params_create(self, client: Mixedbread) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
client.data_sources.connectors.with_raw_response.create(
data_source_id="",
- vector_store_id="vector_store_id",
+ store_id="store_id",
)
@parametrize
@@ -290,7 +290,7 @@ class TestAsyncConnectors:
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.create(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="vector_store_id",
+ store_id="store_id",
)
assert_matches_type(DataSourceConnector, connector, path=["response"])
@@ -298,7 +298,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
connector = await async_client.data_sources.connectors.create(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="vector_store_id",
+ store_id="store_id",
name="name",
trigger_sync=True,
metadata={},
@@ -310,7 +310,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
response = await async_client.data_sources.connectors.with_raw_response.create(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="vector_store_id",
+ store_id="store_id",
)
assert response.is_closed is True
@@ -322,7 +322,7 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
async with async_client.data_sources.connectors.with_streaming_response.create(
data_source_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_id="vector_store_id",
+ store_id="store_id",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -337,7 +337,7 @@ async def test_path_params_create(self, async_client: AsyncMixedbread) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `data_source_id` but received ''"):
await async_client.data_sources.connectors.with_raw_response.create(
data_source_id="",
- vector_store_id="vector_store_id",
+ store_id="store_id",
)
@parametrize
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 61cbf6c2..5b0c443a 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -17,6 +17,8 @@
)
from mixedbread.pagination import SyncCursor, AsyncCursor
+# pyright: reportDeprecated=false
+
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -25,27 +27,32 @@ class TestVectorStores:
@parametrize
def test_method_create(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.create()
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.create()
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.create(
- name="Technical Documentation",
- description="Contains technical specifications and guides",
- is_public=False,
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.create(
+ name="Technical Documentation",
+ description="Contains technical specifications and guides",
+ is_public=False,
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.create()
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -54,27 +61,31 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.create() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.with_streaming_response.create() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ vector_store = response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_method_retrieve(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.retrieve(
- "vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.retrieve(
+ "vector_store_identifier",
+ )
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_raw_response_retrieve(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.retrieve(
- "vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.with_raw_response.retrieve(
+ "vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -83,53 +94,60 @@ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.retrieve(
- "vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.with_streaming_response.retrieve(
+ "vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ vector_store = response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.with_raw_response.retrieve(
- "",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.with_raw_response.retrieve(
+ "",
+ )
@parametrize
def test_method_update(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.update(
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.update(
+ vector_store_identifier="vector_store_identifier",
+ )
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_method_update_with_all_params(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.update(
- vector_store_identifier="vector_store_identifier",
- name="x",
- description="description",
- is_public=True,
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.update(
+ vector_store_identifier="vector_store_identifier",
+ name="x",
+ description="description",
+ is_public=True,
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ )
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
def test_raw_response_update(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.update(
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.with_raw_response.update(
+ vector_store_identifier="vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -138,45 +156,52 @@ def test_raw_response_update(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_update(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.update(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.with_streaming_response.update(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ vector_store = response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_update(self, client: Mixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.with_raw_response.update(
- vector_store_identifier="",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.with_raw_response.update(
+ vector_store_identifier="",
+ )
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.list()
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.list()
+
assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- q="x",
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.list(
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ q="x",
+ )
+
assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.list()
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -185,27 +210,31 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.list() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
+ vector_store = response.parse()
+ assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_method_delete(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.delete(
- "vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.delete(
+ "vector_store_identifier",
+ )
+
assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_delete(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.delete(
- "vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.with_raw_response.delete(
+ "vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -214,98 +243,105 @@ def test_raw_response_delete(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_delete(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.delete(
- "vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.with_streaming_response.delete(
+ "vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
+ vector_store = response.parse()
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_delete(self, client: Mixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.with_raw_response.delete(
- "",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.with_raw_response.delete(
+ "",
+ )
@parametrize
def test_method_question_answering(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.question_answering(
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.question_answering(
+ vector_store_identifiers=["string"],
+ )
+
assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
def test_method_question_answering_with_all_params(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.question_answering(
- query="x",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "return_metadata": True,
- "apply_search_rules": True,
- },
- stream=True,
- qa_options={
- "cite": True,
- "multimodal": True,
- },
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.question_answering(
+ query="x",
+ vector_store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ stream=True,
+ qa_options={
+ "cite": True,
+ "multimodal": True,
+ },
+ )
+
assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_question_answering(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.question_answering(
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.with_raw_response.question_answering(
+ vector_store_identifiers=["string"],
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -314,86 +350,92 @@ def test_raw_response_question_answering(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_question_answering(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.question_answering(
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.with_streaming_response.question_answering(
+ vector_store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
+ vector_store = response.parse()
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_method_search(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ )
+
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@parametrize
def test_method_search_with_all_params(self, client: Mixedbread) -> None:
- vector_store = client.vector_stores.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "return_metadata": True,
- "apply_search_rules": True,
- },
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = client.vector_stores.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ )
+
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@parametrize
def test_raw_response_search(self, client: Mixedbread) -> None:
- response = client.vector_stores.with_raw_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.with_raw_response.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -402,15 +444,16 @@ def test_raw_response_search(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_search(self, client: Mixedbread) -> None:
- with client.vector_stores.with_streaming_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.with_streaming_response.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
+ vector_store = response.parse()
+ assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -422,27 +465,32 @@ class TestAsyncVectorStores:
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.create()
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.create()
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.create(
- name="Technical Documentation",
- description="Contains technical specifications and guides",
- is_public=False,
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.create(
+ name="Technical Documentation",
+ description="Contains technical specifications and guides",
+ is_public=False,
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.create()
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.with_raw_response.create()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -451,27 +499,31 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.create() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.with_streaming_response.create() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ vector_store = await response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.retrieve(
- "vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.retrieve(
+ "vector_store_identifier",
+ )
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.retrieve(
- "vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.with_raw_response.retrieve(
+ "vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -480,53 +532,60 @@ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> Non
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.retrieve(
- "vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.with_streaming_response.retrieve(
+ "vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ vector_store = await response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.with_raw_response.retrieve(
- "",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.with_raw_response.retrieve(
+ "",
+ )
@parametrize
async def test_method_update(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.update(
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.update(
+ vector_store_identifier="vector_store_identifier",
+ )
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.update(
- vector_store_identifier="vector_store_identifier",
- name="x",
- description="description",
- is_public=True,
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.update(
+ vector_store_identifier="vector_store_identifier",
+ name="x",
+ description="description",
+ is_public=True,
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ )
+
assert_matches_type(VectorStore, vector_store, path=["response"])
@parametrize
async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.update(
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.with_raw_response.update(
+ vector_store_identifier="vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -535,45 +594,52 @@ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.update(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.with_streaming_response.update(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
+ vector_store = await response.parse()
+ assert_matches_type(VectorStore, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.with_raw_response.update(
- vector_store_identifier="",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.with_raw_response.update(
+ vector_store_identifier="",
+ )
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.list()
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.list()
+
assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- q="x",
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.list(
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ q="x",
+ )
+
assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.list()
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.with_raw_response.list()
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -582,27 +648,31 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.list() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
+ vector_store = await response.parse()
+ assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.delete(
- "vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.delete(
+ "vector_store_identifier",
+ )
+
assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.delete(
- "vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.with_raw_response.delete(
+ "vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -611,98 +681,105 @@ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.delete(
- "vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.with_streaming_response.delete(
+ "vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
+ vector_store = await response.parse()
+ assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.with_raw_response.delete(
- "",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.with_raw_response.delete(
+ "",
+ )
@parametrize
async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.question_answering(
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.question_answering(
+ vector_store_identifiers=["string"],
+ )
+
assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
async def test_method_question_answering_with_all_params(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.question_answering(
- query="x",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "return_metadata": True,
- "apply_search_rules": True,
- },
- stream=True,
- qa_options={
- "cite": True,
- "multimodal": True,
- },
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.question_answering(
+ query="x",
+ vector_store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ stream=True,
+ qa_options={
+ "cite": True,
+ "multimodal": True,
+ },
+ )
+
assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.question_answering(
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.with_raw_response.question_answering(
+ vector_store_identifiers=["string"],
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -711,86 +788,92 @@ async def test_raw_response_question_answering(self, async_client: AsyncMixedbre
@parametrize
async def test_streaming_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.question_answering(
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.with_streaming_response.question_answering(
+ vector_store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
+ vector_store = await response.parse()
+ assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ )
+
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@parametrize
async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None:
- vector_store = await async_client.vector_stores.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "return_metadata": True,
- "apply_search_rules": True,
- },
- )
+ with pytest.warns(DeprecationWarning):
+ vector_store = await async_client.vector_stores.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ )
+
assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
@parametrize
async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.with_raw_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.with_raw_response.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -799,14 +882,15 @@ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.with_streaming_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.with_streaming_response.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ vector_store = await response.parse()
+ assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index eb15c4b6..21e79500 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -16,6 +16,8 @@
FileSearchResponse,
)
+# pyright: reportDeprecated=false
+
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -24,31 +26,36 @@ class TestFiles:
@parametrize
def test_method_create(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
+ with pytest.warns(DeprecationWarning):
+ file = client.vector_stores.files.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
assert_matches_type(VectorStoreFile, file, path=["response"])
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.create(
- vector_store_identifier="vector_store_identifier",
- metadata={},
- experimental={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
+ with pytest.warns(DeprecationWarning):
+ file = client.vector_stores.files.create(
+ vector_store_identifier="vector_store_identifier",
+ metadata={},
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
assert_matches_type(VectorStoreFile, file, path=["response"])
@parametrize
def test_raw_response_create(self, client: Mixedbread) -> None:
- response = client.vector_stores.files.with_raw_response.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.files.with_raw_response.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -57,51 +64,58 @@ def test_raw_response_create(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_create(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.files.with_streaming_response.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
+ file = response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_create(self, client: Mixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.create(
- vector_store_identifier="",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.create(
+ vector_store_identifier="",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
@parametrize
def test_method_retrieve(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ file = client.vector_stores.files.retrieve(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ )
+
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,
- )
+ with pytest.warns(DeprecationWarning):
+ file = client.vector_stores.files.retrieve(
+ file_id="file_id",
+ 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(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.files.with_raw_response.retrieve(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -110,96 +124,103 @@ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.files.with_streaming_response.retrieve(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
+ file = response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.retrieve(
+ file_id="file_id",
+ vector_store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ client.vector_stores.files.with_raw_response.retrieve(
+ file_id="",
+ vector_store_identifier="vector_store_identifier",
+ )
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- client.vector_stores.files.with_raw_response.retrieve(
- file_id="",
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ with pytest.warns(DeprecationWarning):
+ file = client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- @parametrize
- def test_method_list(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- )
assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_method_list_with_all_params(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending"],
- metadata_filter={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- )
+ with pytest.warns(DeprecationWarning):
+ file = client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending"],
+ metadata_filter={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ )
+
assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
def test_raw_response_list(self, client: Mixedbread) -> None:
- response = client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -208,40 +229,45 @@ def test_raw_response_list(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_list(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.list(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.files.with_streaming_response.list(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ file = response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_list(self, client: Mixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="",
+ )
@parametrize
def test_method_delete(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ file = client.vector_stores.files.delete(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ )
+
assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
def test_raw_response_delete(self, client: Mixedbread) -> None:
- response = client.vector_stores.files.with_raw_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.files.with_raw_response.delete(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -250,105 +276,112 @@ def test_raw_response_delete(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_delete(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.files.with_streaming_response.delete(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
+ file = response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
def test_path_params_delete(self, client: Mixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- client.vector_stores.files.with_raw_response.delete(
- file_id="",
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ client.vector_stores.files.with_raw_response.delete(
+ file_id="file_id",
+ vector_store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ client.vector_stores.files.with_raw_response.delete(
+ file_id="",
+ vector_store_identifier="vector_store_identifier",
+ )
@parametrize
def test_method_search(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ file = client.vector_stores.files.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ )
+
assert_matches_type(FileSearchResponse, file, path=["response"])
@parametrize
def test_method_search_with_all_params(self, client: Mixedbread) -> None:
- file = client.vector_stores.files.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "return_metadata": True,
- "return_chunks": True,
- "chunks_per_file": 0,
- "apply_search_rules": True,
- },
- )
+ with pytest.warns(DeprecationWarning):
+ file = client.vector_stores.files.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "return_chunks": True,
+ "chunks_per_file": 0,
+ "apply_search_rules": True,
+ },
+ )
+
assert_matches_type(FileSearchResponse, file, path=["response"])
@parametrize
def test_raw_response_search(self, client: Mixedbread) -> None:
- response = client.vector_stores.files.with_raw_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ response = client.vector_stores.files.with_raw_response.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -357,15 +390,16 @@ def test_raw_response_search(self, client: Mixedbread) -> None:
@parametrize
def test_streaming_response_search(self, client: Mixedbread) -> None:
- with client.vector_stores.files.with_streaming_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ with client.vector_stores.files.with_streaming_response.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileSearchResponse, file, path=["response"])
+ file = response.parse()
+ assert_matches_type(FileSearchResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -377,31 +411,36 @@ class TestAsyncFiles:
@parametrize
async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
+ with pytest.warns(DeprecationWarning):
+ file = await async_client.vector_stores.files.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
assert_matches_type(VectorStoreFile, file, path=["response"])
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.create(
- vector_store_identifier="vector_store_identifier",
- metadata={},
- experimental={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
+ with pytest.warns(DeprecationWarning):
+ file = await async_client.vector_stores.files.create(
+ vector_store_identifier="vector_store_identifier",
+ metadata={},
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
assert_matches_type(VectorStoreFile, file, path=["response"])
@parametrize
async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.files.with_raw_response.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.files.with_raw_response.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -410,51 +449,58 @@ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.files.with_streaming_response.create(
+ vector_store_identifier="vector_store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
+ file = await response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_create(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.create(
- vector_store_identifier="",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.create(
+ vector_store_identifier="",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
@parametrize
async def test_method_retrieve(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",
- )
+ with pytest.warns(DeprecationWarning):
+ file = await async_client.vector_stores.files.retrieve(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ )
+
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,
- )
+ with pytest.warns(DeprecationWarning):
+ file = await async_client.vector_stores.files.retrieve(
+ file_id="file_id",
+ 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(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.files.with_raw_response.retrieve(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -463,96 +509,103 @@ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> Non
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.files.with_streaming_response.retrieve(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
+ file = await response.parse()
+ assert_matches_type(VectorStoreFile, file, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.retrieve(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.retrieve(
+ file_id="file_id",
+ vector_store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ await async_client.vector_stores.files.with_raw_response.retrieve(
+ file_id="",
+ vector_store_identifier="vector_store_identifier",
+ )
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.retrieve(
- file_id="",
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ with pytest.warns(DeprecationWarning):
+ file = await async_client.vector_stores.files.list(
vector_store_identifier="vector_store_identifier",
)
- @parametrize
- async def test_method_list(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- )
assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending"],
- metadata_filter={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- )
+ with pytest.warns(DeprecationWarning):
+ file = await async_client.vector_stores.files.list(
+ vector_store_identifier="vector_store_identifier",
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending"],
+ metadata_filter={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ )
+
assert_matches_type(FileListResponse, file, path=["response"])
@parametrize
async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -561,40 +614,45 @@ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.list(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.files.with_streaming_response.list(
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
+ file = await response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.list(
+ vector_store_identifier="",
+ )
@parametrize
async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ file = await async_client.vector_stores.files.delete(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ )
+
assert_matches_type(FileDeleteResponse, file, path=["response"])
@parametrize
async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.files.with_raw_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.files.with_raw_response.delete(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -603,105 +661,112 @@ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.files.with_streaming_response.delete(
+ file_id="file_id",
+ vector_store_identifier="vector_store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
+ file = await response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.delete(
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- vector_store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.delete(
- file_id="",
- vector_store_identifier="vector_store_identifier",
- )
+ with pytest.warns(DeprecationWarning):
+ with pytest.raises(
+ ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
+ ):
+ await async_client.vector_stores.files.with_raw_response.delete(
+ file_id="file_id",
+ vector_store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ await async_client.vector_stores.files.with_raw_response.delete(
+ file_id="",
+ vector_store_identifier="vector_store_identifier",
+ )
@parametrize
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ file = await async_client.vector_stores.files.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ )
+
assert_matches_type(FileSearchResponse, file, path=["response"])
@parametrize
async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.vector_stores.files.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "return_metadata": True,
- "return_chunks": True,
- "chunks_per_file": 0,
- "apply_search_rules": True,
- },
- )
+ with pytest.warns(DeprecationWarning):
+ file = await async_client.vector_stores.files.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "return_chunks": True,
+ "chunks_per_file": 0,
+ "apply_search_rules": True,
+ },
+ )
+
assert_matches_type(FileSearchResponse, file, path=["response"])
@parametrize
async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.vector_stores.files.with_raw_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
+ with pytest.warns(DeprecationWarning):
+ response = await async_client.vector_stores.files.with_raw_response.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ )
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -710,14 +775,15 @@ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
- async with async_client.vector_stores.files.with_streaming_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(FileSearchResponse, file, path=["response"])
+ with pytest.warns(DeprecationWarning):
+ async with async_client.vector_stores.files.with_streaming_response.search(
+ query="how to configure SSL",
+ vector_store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(FileSearchResponse, file, path=["response"])
assert cast(Any, response.is_closed) is True
From b8ed505a2dae53b20a88d17c0f8ae8e2d4e4fbd5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 1 Oct 2025 09:28:12 +0000
Subject: [PATCH 275/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index bc469a36..add3762c 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-badb544207d1a5cbf542ecf662d4d4f085dd7d402c367620eeda31c2949c2f79.yml
-openapi_spec_hash: 27c151b834d6c5a5dc72e8f10c861840
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-34b8fc657696023cc3a74eee6febe0d2fc0decda668f874bfa42abe6222d8566.yml
+openapi_spec_hash: dcd015b362c3fcb4ef449606a8027873
config_hash: fef0ea78daf11093ff503919baae5ec0
From 09bd0feca90576edec0a2346fb7d4cf5290ea197 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 1 Oct 2025 10:20:04 +0000
Subject: [PATCH 276/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index add3762c..4d54820a 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-34b8fc657696023cc3a74eee6febe0d2fc0decda668f874bfa42abe6222d8566.yml
openapi_spec_hash: dcd015b362c3fcb4ef449606a8027873
-config_hash: fef0ea78daf11093ff503919baae5ec0
+config_hash: 5947672ad343483af4cc320558877dd1
From 3d21114e667b9c4b1ff4a7722eb3dbaeaf660740 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 1 Oct 2025 10:22:24 +0000
Subject: [PATCH 277/375] feat(api): update via SDK Studio
---
.stats.yml | 2 +-
api.md | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 4d54820a..193855ae 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-34b8fc657696023cc3a74eee6febe0d2fc0decda668f874bfa42abe6222d8566.yml
openapi_spec_hash: dcd015b362c3fcb4ef449606a8027873
-config_hash: 5947672ad343483af4cc320558877dd1
+config_hash: a2549e1f1923904c8cee4ea4f5ff58e1
diff --git a/api.md b/api.md
index 1f6ce1dd..2a054ea2 100644
--- a/api.md
+++ b/api.md
@@ -31,6 +31,10 @@ Types:
```python
from mixedbread.types import (
ExpiresAfter,
+ ScoredAudioURLInputChunk,
+ ScoredImageURLInputChunk,
+ ScoredTextInputChunk,
+ ScoredVideoURLInputChunk,
VectorStore,
VectorStoreChunkSearchOptions,
VectorStoreDeleteResponse,
From 38618cf868256a26f628eadd31bb46255c6f7ec5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 1 Oct 2025 10:32:33 +0000
Subject: [PATCH 278/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 554e34bb..f81bf992 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.30.0"
+ ".": "0.31.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 897de283..e3bc88a2 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.30.0"
+version = "0.31.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 341d4e2a..fae94c2c 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.30.0" # x-release-please-version
+__version__ = "0.31.0" # x-release-please-version
From 042e84ad9344eaf09d1a96d035b86ab3d003289c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 1 Oct 2025 10:43:37 +0000
Subject: [PATCH 279/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
README.md | 56 +-
api.md | 47 +
src/mixedbread/_client.py | 9 +
src/mixedbread/resources/__init__.py | 14 +
src/mixedbread/resources/stores/__init__.py | 33 +
src/mixedbread/resources/stores/files.py | 741 ++++++++++++
src/mixedbread/resources/stores/stores.py | 1053 +++++++++++++++++
.../resources/vector_stores/files.py | 26 +-
.../resources/vector_stores/vector_stores.py | 28 +-
src/mixedbread/types/__init__.py | 14 +
.../types/scored_audio_url_input_chunk.py | 57 +
.../types/scored_image_url_input_chunk.py | 57 +
.../types/scored_text_input_chunk.py | 46 +
.../types/scored_video_url_input_chunk.py | 54 +
src/mixedbread/types/store.py | 74 ++
.../types/store_chunk_search_options_param.py | 29 +
src/mixedbread/types/store_create_params.py | 31 +
src/mixedbread/types/store_delete_response.py | 19 +
src/mixedbread/types/store_list_params.py | 31 +
.../types/store_question_answering_params.py | 57 +
.../store_question_answering_response.py | 26 +
src/mixedbread/types/store_search_params.py | 39 +
src/mixedbread/types/store_search_response.py | 26 +
src/mixedbread/types/store_update_params.py | 27 +
src/mixedbread/types/stores/__init__.py | 14 +
.../types/stores/file_create_params.py | 26 +
.../types/stores/file_delete_response.py | 19 +
.../types/stores/file_list_params.py | 44 +
.../types/stores/file_list_response.py | 48 +
.../types/stores/file_retrieve_params.py | 15 +
.../types/stores/file_search_params.py | 65 +
.../types/stores/file_search_response.py | 17 +
.../types/stores/scored_store_file.py | 58 +
src/mixedbread/types/stores/store_file.py | 184 +++
.../types/stores/store_file_status.py | 7 +
.../types/vector_stores/file_list_params.py | 5 +-
.../vector_stores/scored_vector_store_file.py | 3 +-
.../types/vector_stores/vector_store_file.py | 3 +-
tests/api_resources/stores/__init__.py | 1 +
tests/api_resources/stores/test_files.py | 707 +++++++++++
tests/api_resources/test_stores.py | 800 +++++++++++++
tests/test_client.py | 42 +-
43 files changed, 4573 insertions(+), 83 deletions(-)
create mode 100644 src/mixedbread/resources/stores/__init__.py
create mode 100644 src/mixedbread/resources/stores/files.py
create mode 100644 src/mixedbread/resources/stores/stores.py
create mode 100644 src/mixedbread/types/scored_audio_url_input_chunk.py
create mode 100644 src/mixedbread/types/scored_image_url_input_chunk.py
create mode 100644 src/mixedbread/types/scored_text_input_chunk.py
create mode 100644 src/mixedbread/types/scored_video_url_input_chunk.py
create mode 100644 src/mixedbread/types/store.py
create mode 100644 src/mixedbread/types/store_chunk_search_options_param.py
create mode 100644 src/mixedbread/types/store_create_params.py
create mode 100644 src/mixedbread/types/store_delete_response.py
create mode 100644 src/mixedbread/types/store_list_params.py
create mode 100644 src/mixedbread/types/store_question_answering_params.py
create mode 100644 src/mixedbread/types/store_question_answering_response.py
create mode 100644 src/mixedbread/types/store_search_params.py
create mode 100644 src/mixedbread/types/store_search_response.py
create mode 100644 src/mixedbread/types/store_update_params.py
create mode 100644 src/mixedbread/types/stores/__init__.py
create mode 100644 src/mixedbread/types/stores/file_create_params.py
create mode 100644 src/mixedbread/types/stores/file_delete_response.py
create mode 100644 src/mixedbread/types/stores/file_list_params.py
create mode 100644 src/mixedbread/types/stores/file_list_response.py
create mode 100644 src/mixedbread/types/stores/file_retrieve_params.py
create mode 100644 src/mixedbread/types/stores/file_search_params.py
create mode 100644 src/mixedbread/types/stores/file_search_response.py
create mode 100644 src/mixedbread/types/stores/scored_store_file.py
create mode 100644 src/mixedbread/types/stores/store_file.py
create mode 100644 src/mixedbread/types/stores/store_file_status.py
create mode 100644 tests/api_resources/stores/__init__.py
create mode 100644 tests/api_resources/stores/test_files.py
create mode 100644 tests/api_resources/test_stores.py
diff --git a/.stats.yml b/.stats.yml
index 193855ae..1b0430f8 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 49
+configured_endpoints: 61
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-34b8fc657696023cc3a74eee6febe0d2fc0decda668f874bfa42abe6222d8566.yml
openapi_spec_hash: dcd015b362c3fcb4ef449606a8027873
-config_hash: a2549e1f1923904c8cee4ea4f5ff58e1
+config_hash: 2de40c343cf7b242d5925e3405ee8908
diff --git a/README.md b/README.md
index b9c96e63..ade28bb0 100644
--- a/README.md
+++ b/README.md
@@ -34,8 +34,8 @@ client = Mixedbread(
environment="development",
)
-vector_store = client.vector_stores.create()
-print(vector_store.id)
+store = client.stores.create()
+print(store.id)
```
While you can provide an `api_key` keyword argument,
@@ -60,8 +60,8 @@ client = AsyncMixedbread(
async def main() -> None:
- vector_store = await client.vector_stores.create()
- print(vector_store.id)
+ store = await client.stores.create()
+ print(store.id)
asyncio.run(main())
@@ -93,8 +93,8 @@ async def main() -> None:
api_key="My API Key",
http_client=DefaultAioHttpClient(),
) as client:
- vector_store = await client.vector_stores.create()
- print(vector_store.id)
+ store = await client.stores.create()
+ print(store.id)
asyncio.run(main())
@@ -120,12 +120,12 @@ from mixedbread import Mixedbread
client = Mixedbread()
-all_vector_stores = []
+all_stores = []
# Automatically fetches more pages as needed.
-for vector_store in client.vector_stores.list():
- # Do something with vector_store here
- all_vector_stores.append(vector_store)
-print(all_vector_stores)
+for store in client.stores.list():
+ # Do something with store here
+ all_stores.append(store)
+print(all_stores)
```
Or, asynchronously:
@@ -138,11 +138,11 @@ client = AsyncMixedbread()
async def main() -> None:
- all_vector_stores = []
+ all_stores = []
# Iterate through items across all pages, issuing requests as needed.
- async for vector_store in client.vector_stores.list():
- all_vector_stores.append(vector_store)
- print(all_vector_stores)
+ async for store in client.stores.list():
+ all_stores.append(store)
+ print(all_stores)
asyncio.run(main())
@@ -151,7 +151,7 @@ asyncio.run(main())
Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages:
```python
-first_page = await client.vector_stores.list()
+first_page = await client.stores.list()
if first_page.has_next_page():
print(f"will fetch next page using these details: {first_page.next_page_info()}")
next_page = await first_page.get_next_page()
@@ -163,11 +163,11 @@ if first_page.has_next_page():
Or just work directly with the returned data:
```python
-first_page = await client.vector_stores.list()
+first_page = await client.stores.list()
print(f"next page cursor: {first_page.pagination.last_cursor}") # => "next page cursor: ..."
-for vector_store in first_page.data:
- print(vector_store.id)
+for store in first_page.data:
+ print(store.id)
# Remove `await` for non-async usage.
```
@@ -181,10 +181,10 @@ from mixedbread import Mixedbread
client = Mixedbread()
-vector_store = client.vector_stores.create(
+store = client.stores.create(
expires_after={},
)
-print(vector_store.expires_after)
+print(store.expires_after)
```
## File uploads
@@ -220,7 +220,7 @@ from mixedbread import Mixedbread
client = Mixedbread()
try:
- client.vector_stores.create()
+ client.stores.create()
except mixedbread.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -263,7 +263,7 @@ client = Mixedbread(
)
# Or, configure per-request:
-client.with_options(max_retries=5).vector_stores.create()
+client.with_options(max_retries=5).stores.create()
```
### Timeouts
@@ -286,7 +286,7 @@ client = Mixedbread(
)
# Override per-request:
-client.with_options(timeout=5.0).vector_stores.create()
+client.with_options(timeout=5.0).stores.create()
```
On timeout, an `APITimeoutError` is thrown.
@@ -327,11 +327,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
from mixedbread import Mixedbread
client = Mixedbread()
-response = client.vector_stores.with_raw_response.create()
+response = client.stores.with_raw_response.create()
print(response.headers.get('X-My-Header'))
-vector_store = response.parse() # get the object that `vector_stores.create()` would have returned
-print(vector_store.id)
+store = response.parse() # get the object that `stores.create()` would have returned
+print(store.id)
```
These methods return an [`APIResponse`](https://github.com/mixedbread-ai/mixedbread-python/tree/main/src/mixedbread/_response.py) object.
@@ -345,7 +345,7 @@ The above interface eagerly reads the full response body when you make the reque
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
```python
-with client.vector_stores.with_streaming_response.create() as response:
+with client.stores.with_streaming_response.create() as response:
print(response.headers.get("X-My-Header"))
for line in response.iter_lines():
diff --git a/api.md b/api.md
index 2a054ea2..ba725e0b 100644
--- a/api.md
+++ b/api.md
@@ -77,6 +77,53 @@ Methods:
- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
+# Stores
+
+Types:
+
+```python
+from mixedbread.types import (
+ Store,
+ StoreChunkSearchOptions,
+ StoreDeleteResponse,
+ StoreQuestionAnsweringResponse,
+ StoreSearchResponse,
+)
+```
+
+Methods:
+
+- client.stores.create(\*\*params) -> Store
+- client.stores.retrieve(store_identifier) -> Store
+- client.stores.update(store_identifier, \*\*params) -> Store
+- client.stores.list(\*\*params) -> SyncCursor[Store]
+- client.stores.delete(store_identifier) -> StoreDeleteResponse
+- client.stores.question_answering(\*\*params) -> StoreQuestionAnsweringResponse
+- client.stores.search(\*\*params) -> StoreSearchResponse
+
+## Files
+
+Types:
+
+```python
+from mixedbread.types.stores import (
+ ScoredStoreFile,
+ StoreFileStatus,
+ StoreFile,
+ FileListResponse,
+ FileDeleteResponse,
+ FileSearchResponse,
+)
+```
+
+Methods:
+
+- client.stores.files.create(store_identifier, \*\*params) -> StoreFile
+- client.stores.files.retrieve(file_id, \*, store_identifier, \*\*params) -> StoreFile
+- client.stores.files.list(store_identifier, \*\*params) -> FileListResponse
+- client.stores.files.delete(file_id, \*, store_identifier) -> FileDeleteResponse
+- client.stores.files.search(\*\*params) -> FileSearchResponse
+
# Parsing
## Jobs
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 31462225..0a01cdd2 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -47,6 +47,7 @@
AsyncAPIClient,
make_request_options,
)
+from .resources.stores import stores
from .resources.parsing import parsing
from .types.info_response import InfoResponse
from .resources.extractions import extractions
@@ -77,6 +78,7 @@
class Mixedbread(SyncAPIClient):
vector_stores: vector_stores.VectorStoresResource
+ stores: stores.StoresResource
parsing: parsing.ParsingResource
files: files.FilesResource
extractions: extractions.ExtractionsResource
@@ -166,6 +168,7 @@ def __init__(
)
self.vector_stores = vector_stores.VectorStoresResource(self)
+ self.stores = stores.StoresResource(self)
self.parsing = parsing.ParsingResource(self)
self.files = files.FilesResource(self)
self.extractions = extractions.ExtractionsResource(self)
@@ -440,6 +443,7 @@ def _make_status_error(
class AsyncMixedbread(AsyncAPIClient):
vector_stores: vector_stores.AsyncVectorStoresResource
+ stores: stores.AsyncStoresResource
parsing: parsing.AsyncParsingResource
files: files.AsyncFilesResource
extractions: extractions.AsyncExtractionsResource
@@ -529,6 +533,7 @@ def __init__(
)
self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
+ self.stores = stores.AsyncStoresResource(self)
self.parsing = parsing.AsyncParsingResource(self)
self.files = files.AsyncFilesResource(self)
self.extractions = extractions.AsyncExtractionsResource(self)
@@ -804,6 +809,7 @@ def _make_status_error(
class MixedbreadWithRawResponse:
def __init__(self, client: Mixedbread) -> None:
self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
+ self.stores = stores.StoresResourceWithRawResponse(client.stores)
self.parsing = parsing.ParsingResourceWithRawResponse(client.parsing)
self.files = files.FilesResourceWithRawResponse(client.files)
self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
@@ -826,6 +832,7 @@ def __init__(self, client: Mixedbread) -> None:
class AsyncMixedbreadWithRawResponse:
def __init__(self, client: AsyncMixedbread) -> None:
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
+ self.stores = stores.AsyncStoresResourceWithRawResponse(client.stores)
self.parsing = parsing.AsyncParsingResourceWithRawResponse(client.parsing)
self.files = files.AsyncFilesResourceWithRawResponse(client.files)
self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
@@ -848,6 +855,7 @@ def __init__(self, client: AsyncMixedbread) -> None:
class MixedbreadWithStreamedResponse:
def __init__(self, client: Mixedbread) -> None:
self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
+ self.stores = stores.StoresResourceWithStreamingResponse(client.stores)
self.parsing = parsing.ParsingResourceWithStreamingResponse(client.parsing)
self.files = files.FilesResourceWithStreamingResponse(client.files)
self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
@@ -870,6 +878,7 @@ def __init__(self, client: Mixedbread) -> None:
class AsyncMixedbreadWithStreamedResponse:
def __init__(self, client: AsyncMixedbread) -> None:
self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
+ self.stores = stores.AsyncStoresResourceWithStreamingResponse(client.stores)
self.parsing = parsing.AsyncParsingResourceWithStreamingResponse(client.parsing)
self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index 0b3e0954..368addbe 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -16,6 +16,14 @@
FilesResourceWithStreamingResponse,
AsyncFilesResourceWithStreamingResponse,
)
+from .stores import (
+ StoresResource,
+ AsyncStoresResource,
+ StoresResourceWithRawResponse,
+ AsyncStoresResourceWithRawResponse,
+ StoresResourceWithStreamingResponse,
+ AsyncStoresResourceWithStreamingResponse,
+)
from .parsing import (
ParsingResource,
AsyncParsingResource,
@@ -72,6 +80,12 @@
"AsyncVectorStoresResourceWithRawResponse",
"VectorStoresResourceWithStreamingResponse",
"AsyncVectorStoresResourceWithStreamingResponse",
+ "StoresResource",
+ "AsyncStoresResource",
+ "StoresResourceWithRawResponse",
+ "AsyncStoresResourceWithRawResponse",
+ "StoresResourceWithStreamingResponse",
+ "AsyncStoresResourceWithStreamingResponse",
"ParsingResource",
"AsyncParsingResource",
"ParsingResourceWithRawResponse",
diff --git a/src/mixedbread/resources/stores/__init__.py b/src/mixedbread/resources/stores/__init__.py
new file mode 100644
index 00000000..8ec1ec90
--- /dev/null
+++ b/src/mixedbread/resources/stores/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .files import (
+ FilesResource,
+ AsyncFilesResource,
+ FilesResourceWithRawResponse,
+ AsyncFilesResourceWithRawResponse,
+ FilesResourceWithStreamingResponse,
+ AsyncFilesResourceWithStreamingResponse,
+)
+from .stores import (
+ StoresResource,
+ AsyncStoresResource,
+ StoresResourceWithRawResponse,
+ AsyncStoresResourceWithRawResponse,
+ StoresResourceWithStreamingResponse,
+ AsyncStoresResourceWithStreamingResponse,
+)
+
+__all__ = [
+ "FilesResource",
+ "AsyncFilesResource",
+ "FilesResourceWithRawResponse",
+ "AsyncFilesResourceWithRawResponse",
+ "FilesResourceWithStreamingResponse",
+ "AsyncFilesResourceWithStreamingResponse",
+ "StoresResource",
+ "AsyncStoresResource",
+ "StoresResourceWithRawResponse",
+ "AsyncStoresResourceWithRawResponse",
+ "StoresResourceWithStreamingResponse",
+ "AsyncStoresResourceWithStreamingResponse",
+]
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
new file mode 100644
index 00000000..9fc14bb6
--- /dev/null
+++ b/src/mixedbread/resources/stores/files.py
@@ -0,0 +1,741 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Iterable, Optional
+
+import httpx
+
+from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
+from ..._utils import maybe_transform, async_maybe_transform
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._base_client import make_request_options
+from ...types.stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
+from ...types.stores.store_file import StoreFile
+from ...types.stores.store_file_status import StoreFileStatus
+from ...types.stores.file_list_response import FileListResponse
+from ...types.stores.file_delete_response import FileDeleteResponse
+from ...types.stores.file_search_response import FileSearchResponse
+
+__all__ = ["FilesResource", "AsyncFilesResource"]
+
+
+class FilesResource(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> FilesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return FilesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return FilesResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ store_identifier: str,
+ *,
+ metadata: object | Omit = omit,
+ experimental: file_create_params.Experimental | Omit = omit,
+ file_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreFile:
+ """Upload a file to a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_add_params: The file
+ to add to the store.
+
+ Returns: VectorStoreFile: The uploaded file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ metadata: Optional metadata for the file
+
+ experimental: Strategy for adding the file
+
+ file_id: ID of the file to add
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return self._post(
+ f"/v1/stores/{store_identifier}/files",
+ body=maybe_transform(
+ {
+ "metadata": metadata,
+ "experimental": experimental,
+ "file_id": file_id,
+ },
+ file_create_params.FileCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreFile,
+ )
+
+ def retrieve(
+ self,
+ file_id: str,
+ *,
+ store_identifier: str,
+ return_chunks: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreFile:
+ """Get a file from a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_id: The ID or name of
+ the file. options: Get file options.
+
+ Returns: VectorStoreFile: The file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_id: The ID or name 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
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ return self._get(
+ f"/v1/stores/{store_identifier}/files/{file_id}",
+ options=make_request_options(
+ 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=StoreFile,
+ )
+
+ def list(
+ self,
+ store_identifier: str,
+ *,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ statuses: Optional[List[StoreFileStatus]] | Omit = omit,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> FileListResponse:
+ """
+ List files indexed in a vector store with pagination and metadata filter.
+
+ Args: vector_store_identifier: The ID or name of the vector store pagination:
+ Pagination parameters and metadata filter
+
+ Returns: VectorStoreFileListResponse: Paginated list of vector store files
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ statuses: Status to filter by
+
+ metadata_filter: Metadata filter to apply to the query
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return self._post(
+ f"/v1/stores/{store_identifier}/files/list",
+ body=maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "statuses": statuses,
+ "metadata_filter": metadata_filter,
+ },
+ file_list_params.FileListParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileListResponse,
+ )
+
+ def delete(
+ self,
+ file_id: str,
+ *,
+ store_identifier: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> FileDeleteResponse:
+ """Delete a file from a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_id: The ID or name of
+ the file to delete.
+
+ Returns: VectorStoreFileDeleted: The deleted file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_id: The ID or name of the file to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ return self._delete(
+ f"/v1/stores/{store_identifier}/files/{file_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileDeleteResponse,
+ )
+
+ def search(
+ self,
+ *,
+ query: str,
+ store_identifiers: SequenceNotStr[str],
+ top_k: int | Omit = omit,
+ filters: Optional[file_search_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: file_search_params.SearchOptions | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> FileSearchResponse:
+ """
+ Search for files within a store based on semantic similarity.
+
+ Args: store_identifier: The ID or name of the store to search within
+ search_params: Search configuration including query text, pagination, and
+ filters
+
+ Returns: StoreFileSearchResponse: List of matching files with relevance scores
+
+ Args:
+ query: Search query text
+
+ store_identifiers: IDs or names of stores to search
+
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
+
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
+ search_options: Search configuration options
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/stores/files/search",
+ body=maybe_transform(
+ {
+ "query": query,
+ "store_identifiers": store_identifiers,
+ "top_k": top_k,
+ "filters": filters,
+ "file_ids": file_ids,
+ "search_options": search_options,
+ },
+ file_search_params.FileSearchParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileSearchResponse,
+ )
+
+
+class AsyncFilesResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncFilesResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncFilesResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncFilesResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ store_identifier: str,
+ *,
+ metadata: object | Omit = omit,
+ experimental: file_create_params.Experimental | Omit = omit,
+ file_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreFile:
+ """Upload a file to a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_add_params: The file
+ to add to the store.
+
+ Returns: VectorStoreFile: The uploaded file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ metadata: Optional metadata for the file
+
+ experimental: Strategy for adding the file
+
+ file_id: ID of the file to add
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return await self._post(
+ f"/v1/stores/{store_identifier}/files",
+ body=await async_maybe_transform(
+ {
+ "metadata": metadata,
+ "experimental": experimental,
+ "file_id": file_id,
+ },
+ file_create_params.FileCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreFile,
+ )
+
+ async def retrieve(
+ self,
+ file_id: str,
+ *,
+ store_identifier: str,
+ return_chunks: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreFile:
+ """Get a file from a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_id: The ID or name of
+ the file. options: Get file options.
+
+ Returns: VectorStoreFile: The file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_id: The ID or name 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
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ return await self._get(
+ f"/v1/stores/{store_identifier}/files/{file_id}",
+ options=make_request_options(
+ 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=StoreFile,
+ )
+
+ async def list(
+ self,
+ store_identifier: str,
+ *,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ statuses: Optional[List[StoreFileStatus]] | Omit = omit,
+ metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> FileListResponse:
+ """
+ List files indexed in a vector store with pagination and metadata filter.
+
+ Args: vector_store_identifier: The ID or name of the vector store pagination:
+ Pagination parameters and metadata filter
+
+ Returns: VectorStoreFileListResponse: Paginated list of vector store files
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ statuses: Status to filter by
+
+ metadata_filter: Metadata filter to apply to the query
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return await self._post(
+ f"/v1/stores/{store_identifier}/files/list",
+ body=await async_maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "statuses": statuses,
+ "metadata_filter": metadata_filter,
+ },
+ file_list_params.FileListParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileListResponse,
+ )
+
+ async def delete(
+ self,
+ file_id: str,
+ *,
+ store_identifier: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> FileDeleteResponse:
+ """Delete a file from a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_id: The ID or name of
+ the file to delete.
+
+ Returns: VectorStoreFileDeleted: The deleted file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_id: The ID or name of the file to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_id:
+ raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
+ return await self._delete(
+ f"/v1/stores/{store_identifier}/files/{file_id}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileDeleteResponse,
+ )
+
+ async def search(
+ self,
+ *,
+ query: str,
+ store_identifiers: SequenceNotStr[str],
+ top_k: int | Omit = omit,
+ filters: Optional[file_search_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: file_search_params.SearchOptions | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> FileSearchResponse:
+ """
+ Search for files within a store based on semantic similarity.
+
+ Args: store_identifier: The ID or name of the store to search within
+ search_params: Search configuration including query text, pagination, and
+ filters
+
+ Returns: StoreFileSearchResponse: List of matching files with relevance scores
+
+ Args:
+ query: Search query text
+
+ store_identifiers: IDs or names of stores to search
+
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
+
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
+ search_options: Search configuration options
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/stores/files/search",
+ body=await async_maybe_transform(
+ {
+ "query": query,
+ "store_identifiers": store_identifiers,
+ "top_k": top_k,
+ "filters": filters,
+ "file_ids": file_ids,
+ "search_options": search_options,
+ },
+ file_search_params.FileSearchParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileSearchResponse,
+ )
+
+
+class FilesResourceWithRawResponse:
+ def __init__(self, files: FilesResource) -> None:
+ self._files = files
+
+ self.create = to_raw_response_wrapper(
+ files.create,
+ )
+ self.retrieve = to_raw_response_wrapper(
+ files.retrieve,
+ )
+ self.list = to_raw_response_wrapper(
+ files.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ files.delete,
+ )
+ self.search = to_raw_response_wrapper(
+ files.search,
+ )
+
+
+class AsyncFilesResourceWithRawResponse:
+ def __init__(self, files: AsyncFilesResource) -> None:
+ self._files = files
+
+ self.create = async_to_raw_response_wrapper(
+ files.create,
+ )
+ self.retrieve = async_to_raw_response_wrapper(
+ files.retrieve,
+ )
+ self.list = async_to_raw_response_wrapper(
+ files.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ files.delete,
+ )
+ self.search = async_to_raw_response_wrapper(
+ files.search,
+ )
+
+
+class FilesResourceWithStreamingResponse:
+ def __init__(self, files: FilesResource) -> None:
+ self._files = files
+
+ self.create = to_streamed_response_wrapper(
+ files.create,
+ )
+ self.retrieve = to_streamed_response_wrapper(
+ files.retrieve,
+ )
+ self.list = to_streamed_response_wrapper(
+ files.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ files.delete,
+ )
+ self.search = to_streamed_response_wrapper(
+ files.search,
+ )
+
+
+class AsyncFilesResourceWithStreamingResponse:
+ def __init__(self, files: AsyncFilesResource) -> None:
+ self._files = files
+
+ self.create = async_to_streamed_response_wrapper(
+ files.create,
+ )
+ self.retrieve = async_to_streamed_response_wrapper(
+ files.retrieve,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ files.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ files.delete,
+ )
+ self.search = async_to_streamed_response_wrapper(
+ files.search,
+ )
diff --git a/src/mixedbread/resources/stores/stores.py b/src/mixedbread/resources/stores/stores.py
new file mode 100644
index 00000000..a2128963
--- /dev/null
+++ b/src/mixedbread/resources/stores/stores.py
@@ -0,0 +1,1053 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Iterable, Optional
+
+import httpx
+
+from .files import (
+ FilesResource,
+ AsyncFilesResource,
+ FilesResourceWithRawResponse,
+ AsyncFilesResourceWithRawResponse,
+ FilesResourceWithStreamingResponse,
+ AsyncFilesResourceWithStreamingResponse,
+)
+from ...types import (
+ store_list_params,
+ store_create_params,
+ store_search_params,
+ store_update_params,
+ store_question_answering_params,
+)
+from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
+from ..._utils import maybe_transform, async_maybe_transform
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...pagination import SyncCursor, AsyncCursor
+from ...types.store import Store
+from ..._base_client import AsyncPaginator, make_request_options
+from ...types.expires_after_param import ExpiresAfterParam
+from ...types.store_delete_response import StoreDeleteResponse
+from ...types.store_search_response import StoreSearchResponse
+from ...types.store_chunk_search_options_param import StoreChunkSearchOptionsParam
+from ...types.store_question_answering_response import StoreQuestionAnsweringResponse
+
+__all__ = ["StoresResource", "AsyncStoresResource"]
+
+
+class StoresResource(SyncAPIResource):
+ @cached_property
+ def files(self) -> FilesResource:
+ return FilesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> StoresResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return StoresResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> StoresResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return StoresResourceWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ name: Optional[str] | Omit = omit,
+ description: Optional[str] | Omit = omit,
+ is_public: bool | Omit = omit,
+ expires_after: Optional[ExpiresAfterParam] | Omit = omit,
+ metadata: object | Omit = omit,
+ file_ids: Optional[SequenceNotStr[str]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Store:
+ """
+ Create a new vector store.
+
+ Args: vector_store_create: VectorStoreCreate object containing the name,
+ description, and metadata.
+
+ Returns: VectorStore: The response containing the created vector store details.
+
+ Args:
+ name: Name for the new store
+
+ description: Description of the store
+
+ is_public: Whether the store can be accessed by anyone with valid login credentials
+
+ expires_after: Represents an expiration policy for a store.
+
+ metadata: Optional metadata key-value pairs
+
+ file_ids: Optional list of file IDs
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/stores",
+ body=maybe_transform(
+ {
+ "name": name,
+ "description": description,
+ "is_public": is_public,
+ "expires_after": expires_after,
+ "metadata": metadata,
+ "file_ids": file_ids,
+ },
+ store_create_params.StoreCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=Store,
+ )
+
+ def retrieve(
+ self,
+ store_identifier: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Store:
+ """
+ Get a store by ID or name.
+
+ Args: store_identifier: The ID or name of the store to retrieve.
+
+ Returns: Store: The response containing the store details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return self._get(
+ f"/v1/stores/{store_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=Store,
+ )
+
+ def update(
+ self,
+ store_identifier: str,
+ *,
+ name: Optional[str] | Omit = omit,
+ description: Optional[str] | Omit = omit,
+ is_public: Optional[bool] | Omit = omit,
+ expires_after: Optional[ExpiresAfterParam] | Omit = omit,
+ metadata: object | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Store:
+ """
+ Update a store by ID or name.
+
+ Args: store_identifier: The ID or name of the store to update. store_update:
+ StoreCreate object containing the name, description, and metadata.
+
+ Returns: Store: The response containing the updated store details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ name: New name for the store
+
+ description: New description
+
+ is_public: Whether the store can be accessed by anyone with valid login credentials
+
+ expires_after: Represents an expiration policy for a store.
+
+ metadata: Optional metadata key-value pairs
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return self._put(
+ f"/v1/stores/{store_identifier}",
+ body=maybe_transform(
+ {
+ "name": name,
+ "description": description,
+ "is_public": is_public,
+ "expires_after": expires_after,
+ "metadata": metadata,
+ },
+ store_update_params.StoreUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=Store,
+ )
+
+ def list(
+ self,
+ *,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ q: Optional[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> SyncCursor[Store]:
+ """List all stores with optional search.
+
+ Args: pagination: The pagination options.
+
+ q: Optional search query to filter
+ vector stores.
+
+ Returns: StoreListResponse: The list of stores.
+
+ Args:
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ q: Search query for fuzzy matching over name and description fields
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/v1/stores",
+ page=SyncCursor[Store],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "q": q,
+ },
+ store_list_params.StoreListParams,
+ ),
+ ),
+ model=Store,
+ )
+
+ def delete(
+ self,
+ store_identifier: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreDeleteResponse:
+ """
+ Delete a store by ID or name.
+
+ Args: store_identifier: The ID or name of the store to delete.
+
+ Returns: Store: The response containing the deleted store details.
+
+ Args:
+ store_identifier: The ID or name of the store to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return self._delete(
+ f"/v1/stores/{store_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreDeleteResponse,
+ )
+
+ def question_answering(
+ self,
+ *,
+ query: str | Omit = omit,
+ store_identifiers: SequenceNotStr[str],
+ top_k: int | Omit = omit,
+ filters: Optional[store_question_answering_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: StoreChunkSearchOptionsParam | Omit = omit,
+ stream: bool | Omit = omit,
+ qa_options: store_question_answering_params.QaOptions | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreQuestionAnsweringResponse:
+ """Question answering
+
+ Args:
+ query: Question to answer.
+
+ If not provided, the question will be extracted from the
+ passed messages.
+
+ store_identifiers: IDs or names of stores to search
+
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
+
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
+ search_options: Search configuration options
+
+ stream: Whether to stream the answer
+
+ qa_options: Question answering configuration options
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/stores/question-answering",
+ body=maybe_transform(
+ {
+ "query": query,
+ "store_identifiers": store_identifiers,
+ "top_k": top_k,
+ "filters": filters,
+ "file_ids": file_ids,
+ "search_options": search_options,
+ "stream": stream,
+ "qa_options": qa_options,
+ },
+ store_question_answering_params.StoreQuestionAnsweringParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreQuestionAnsweringResponse,
+ )
+
+ def search(
+ self,
+ *,
+ query: str,
+ store_identifiers: SequenceNotStr[str],
+ top_k: int | Omit = omit,
+ filters: Optional[store_search_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: StoreChunkSearchOptionsParam | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreSearchResponse:
+ """
+ Perform semantic search across store chunks.
+
+ This endpoint searches through store chunks using semantic similarity matching.
+ It supports complex search queries with filters and returns relevance-scored
+ results.
+
+ Args: search_params: Search configuration including: - query text or
+ embeddings - store_identifiers: List of store identifiers to search - file_ids:
+ Optional list of file IDs to filter chunks by (or tuple of list and condition
+ operator) - metadata filters - pagination parameters - sorting preferences
+ \\__state: API state dependency \\__ctx: Service context dependency
+
+ Returns: StoreSearchResponse containing: - List of matched chunks with relevance
+ scores - Pagination details including total result count
+
+ Raises: HTTPException (400): If search parameters are invalid HTTPException
+ (404): If no vector stores are found to search
+
+ Args:
+ query: Search query text
+
+ store_identifiers: IDs or names of stores to search
+
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
+
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
+ search_options: Search configuration options
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/stores/search",
+ body=maybe_transform(
+ {
+ "query": query,
+ "store_identifiers": store_identifiers,
+ "top_k": top_k,
+ "filters": filters,
+ "file_ids": file_ids,
+ "search_options": search_options,
+ },
+ store_search_params.StoreSearchParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreSearchResponse,
+ )
+
+
+class AsyncStoresResource(AsyncAPIResource):
+ @cached_property
+ def files(self) -> AsyncFilesResource:
+ return AsyncFilesResource(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncStoresResourceWithRawResponse:
+ """
+ This property can be used as a prefix for any HTTP method call to return
+ the raw response object instead of the parsed content.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
+ """
+ return AsyncStoresResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncStoresResourceWithStreamingResponse:
+ """
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
+
+ For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
+ """
+ return AsyncStoresResourceWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ name: Optional[str] | Omit = omit,
+ description: Optional[str] | Omit = omit,
+ is_public: bool | Omit = omit,
+ expires_after: Optional[ExpiresAfterParam] | Omit = omit,
+ metadata: object | Omit = omit,
+ file_ids: Optional[SequenceNotStr[str]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Store:
+ """
+ Create a new vector store.
+
+ Args: vector_store_create: VectorStoreCreate object containing the name,
+ description, and metadata.
+
+ Returns: VectorStore: The response containing the created vector store details.
+
+ Args:
+ name: Name for the new store
+
+ description: Description of the store
+
+ is_public: Whether the store can be accessed by anyone with valid login credentials
+
+ expires_after: Represents an expiration policy for a store.
+
+ metadata: Optional metadata key-value pairs
+
+ file_ids: Optional list of file IDs
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/stores",
+ body=await async_maybe_transform(
+ {
+ "name": name,
+ "description": description,
+ "is_public": is_public,
+ "expires_after": expires_after,
+ "metadata": metadata,
+ "file_ids": file_ids,
+ },
+ store_create_params.StoreCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=Store,
+ )
+
+ async def retrieve(
+ self,
+ store_identifier: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Store:
+ """
+ Get a store by ID or name.
+
+ Args: store_identifier: The ID or name of the store to retrieve.
+
+ Returns: Store: The response containing the store details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return await self._get(
+ f"/v1/stores/{store_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=Store,
+ )
+
+ async def update(
+ self,
+ store_identifier: str,
+ *,
+ name: Optional[str] | Omit = omit,
+ description: Optional[str] | Omit = omit,
+ is_public: Optional[bool] | Omit = omit,
+ expires_after: Optional[ExpiresAfterParam] | Omit = omit,
+ metadata: object | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Store:
+ """
+ Update a store by ID or name.
+
+ Args: store_identifier: The ID or name of the store to update. store_update:
+ StoreCreate object containing the name, description, and metadata.
+
+ Returns: Store: The response containing the updated store details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ name: New name for the store
+
+ description: New description
+
+ is_public: Whether the store can be accessed by anyone with valid login credentials
+
+ expires_after: Represents an expiration policy for a store.
+
+ metadata: Optional metadata key-value pairs
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return await self._put(
+ f"/v1/stores/{store_identifier}",
+ body=await async_maybe_transform(
+ {
+ "name": name,
+ "description": description,
+ "is_public": is_public,
+ "expires_after": expires_after,
+ "metadata": metadata,
+ },
+ store_update_params.StoreUpdateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=Store,
+ )
+
+ def list(
+ self,
+ *,
+ limit: int | Omit = omit,
+ after: Optional[str] | Omit = omit,
+ before: Optional[str] | Omit = omit,
+ include_total: bool | Omit = omit,
+ q: Optional[str] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> AsyncPaginator[Store, AsyncCursor[Store]]:
+ """List all stores with optional search.
+
+ Args: pagination: The pagination options.
+
+ q: Optional search query to filter
+ vector stores.
+
+ Returns: StoreListResponse: The list of stores.
+
+ Args:
+ limit: Maximum number of items to return per page (1-100)
+
+ after: Cursor for forward pagination - get items after this position. Use last_cursor
+ from previous response.
+
+ before: Cursor for backward pagination - get items before this position. Use
+ first_cursor from previous response.
+
+ include_total: Whether to include total count in response (expensive operation)
+
+ q: Search query for fuzzy matching over name and description fields
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get_api_list(
+ "/v1/stores",
+ page=AsyncCursor[Store],
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform(
+ {
+ "limit": limit,
+ "after": after,
+ "before": before,
+ "include_total": include_total,
+ "q": q,
+ },
+ store_list_params.StoreListParams,
+ ),
+ ),
+ model=Store,
+ )
+
+ async def delete(
+ self,
+ store_identifier: str,
+ *,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreDeleteResponse:
+ """
+ Delete a store by ID or name.
+
+ Args: store_identifier: The ID or name of the store to delete.
+
+ Returns: Store: The response containing the deleted store details.
+
+ Args:
+ store_identifier: The ID or name of the store to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return await self._delete(
+ f"/v1/stores/{store_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreDeleteResponse,
+ )
+
+ async def question_answering(
+ self,
+ *,
+ query: str | Omit = omit,
+ store_identifiers: SequenceNotStr[str],
+ top_k: int | Omit = omit,
+ filters: Optional[store_question_answering_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: StoreChunkSearchOptionsParam | Omit = omit,
+ stream: bool | Omit = omit,
+ qa_options: store_question_answering_params.QaOptions | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreQuestionAnsweringResponse:
+ """Question answering
+
+ Args:
+ query: Question to answer.
+
+ If not provided, the question will be extracted from the
+ passed messages.
+
+ store_identifiers: IDs or names of stores to search
+
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
+
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
+ search_options: Search configuration options
+
+ stream: Whether to stream the answer
+
+ qa_options: Question answering configuration options
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/stores/question-answering",
+ body=await async_maybe_transform(
+ {
+ "query": query,
+ "store_identifiers": store_identifiers,
+ "top_k": top_k,
+ "filters": filters,
+ "file_ids": file_ids,
+ "search_options": search_options,
+ "stream": stream,
+ "qa_options": qa_options,
+ },
+ store_question_answering_params.StoreQuestionAnsweringParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreQuestionAnsweringResponse,
+ )
+
+ async def search(
+ self,
+ *,
+ query: str,
+ store_identifiers: SequenceNotStr[str],
+ top_k: int | Omit = omit,
+ filters: Optional[store_search_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: StoreChunkSearchOptionsParam | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreSearchResponse:
+ """
+ Perform semantic search across store chunks.
+
+ This endpoint searches through store chunks using semantic similarity matching.
+ It supports complex search queries with filters and returns relevance-scored
+ results.
+
+ Args: search_params: Search configuration including: - query text or
+ embeddings - store_identifiers: List of store identifiers to search - file_ids:
+ Optional list of file IDs to filter chunks by (or tuple of list and condition
+ operator) - metadata filters - pagination parameters - sorting preferences
+ \\__state: API state dependency \\__ctx: Service context dependency
+
+ Returns: StoreSearchResponse containing: - List of matched chunks with relevance
+ scores - Pagination details including total result count
+
+ Raises: HTTPException (400): If search parameters are invalid HTTPException
+ (404): If no vector stores are found to search
+
+ Args:
+ query: Search query text
+
+ store_identifiers: IDs or names of stores to search
+
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
+
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
+ search_options: Search configuration options
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/stores/search",
+ body=await async_maybe_transform(
+ {
+ "query": query,
+ "store_identifiers": store_identifiers,
+ "top_k": top_k,
+ "filters": filters,
+ "file_ids": file_ids,
+ "search_options": search_options,
+ },
+ store_search_params.StoreSearchParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreSearchResponse,
+ )
+
+
+class StoresResourceWithRawResponse:
+ def __init__(self, stores: StoresResource) -> None:
+ self._stores = stores
+
+ self.create = to_raw_response_wrapper(
+ stores.create,
+ )
+ self.retrieve = to_raw_response_wrapper(
+ stores.retrieve,
+ )
+ self.update = to_raw_response_wrapper(
+ stores.update,
+ )
+ self.list = to_raw_response_wrapper(
+ stores.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ stores.delete,
+ )
+ self.question_answering = to_raw_response_wrapper(
+ stores.question_answering,
+ )
+ self.search = to_raw_response_wrapper(
+ stores.search,
+ )
+
+ @cached_property
+ def files(self) -> FilesResourceWithRawResponse:
+ return FilesResourceWithRawResponse(self._stores.files)
+
+
+class AsyncStoresResourceWithRawResponse:
+ def __init__(self, stores: AsyncStoresResource) -> None:
+ self._stores = stores
+
+ self.create = async_to_raw_response_wrapper(
+ stores.create,
+ )
+ self.retrieve = async_to_raw_response_wrapper(
+ stores.retrieve,
+ )
+ self.update = async_to_raw_response_wrapper(
+ stores.update,
+ )
+ self.list = async_to_raw_response_wrapper(
+ stores.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ stores.delete,
+ )
+ self.question_answering = async_to_raw_response_wrapper(
+ stores.question_answering,
+ )
+ self.search = async_to_raw_response_wrapper(
+ stores.search,
+ )
+
+ @cached_property
+ def files(self) -> AsyncFilesResourceWithRawResponse:
+ return AsyncFilesResourceWithRawResponse(self._stores.files)
+
+
+class StoresResourceWithStreamingResponse:
+ def __init__(self, stores: StoresResource) -> None:
+ self._stores = stores
+
+ self.create = to_streamed_response_wrapper(
+ stores.create,
+ )
+ self.retrieve = to_streamed_response_wrapper(
+ stores.retrieve,
+ )
+ self.update = to_streamed_response_wrapper(
+ stores.update,
+ )
+ self.list = to_streamed_response_wrapper(
+ stores.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ stores.delete,
+ )
+ self.question_answering = to_streamed_response_wrapper(
+ stores.question_answering,
+ )
+ self.search = to_streamed_response_wrapper(
+ stores.search,
+ )
+
+ @cached_property
+ def files(self) -> FilesResourceWithStreamingResponse:
+ return FilesResourceWithStreamingResponse(self._stores.files)
+
+
+class AsyncStoresResourceWithStreamingResponse:
+ def __init__(self, stores: AsyncStoresResource) -> None:
+ self._stores = stores
+
+ self.create = async_to_streamed_response_wrapper(
+ stores.create,
+ )
+ self.retrieve = async_to_streamed_response_wrapper(
+ stores.retrieve,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ stores.update,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ stores.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ stores.delete,
+ )
+ self.question_answering = async_to_streamed_response_wrapper(
+ stores.question_answering,
+ )
+ self.search = async_to_streamed_response_wrapper(
+ stores.search,
+ )
+
+ @cached_property
+ def files(self) -> AsyncFilesResourceWithStreamingResponse:
+ return AsyncFilesResourceWithStreamingResponse(self._stores.files)
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 300f9d99..99bfcddb 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -4,7 +4,6 @@
import typing_extensions
from typing import List, Union, Iterable, Optional
-from typing_extensions import Literal
import httpx
@@ -20,6 +19,7 @@
)
from ..._base_client import make_request_options
from ...types.vector_stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
+from ...types.stores.store_file_status import StoreFileStatus
from ...types.vector_stores.vector_store_file import VectorStoreFile
from ...types.vector_stores.file_list_response import FileListResponse
from ...types.vector_stores.file_delete_response import FileDeleteResponse
@@ -48,7 +48,7 @@ def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
"""
return FilesResourceWithStreamingResponse(self)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use post stores.files instead")
def create(
self,
vector_store_identifier: str,
@@ -103,7 +103,7 @@ def create(
cast_to=VectorStoreFile,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.files instead")
def retrieve(
self,
file_id: str,
@@ -153,7 +153,7 @@ def retrieve(
cast_to=VectorStoreFile,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use post stores.files.list instead")
def list(
self,
vector_store_identifier: str,
@@ -162,7 +162,7 @@ def list(
after: Optional[str] | Omit = omit,
before: Optional[str] | Omit = omit,
include_total: bool | Omit = omit,
- statuses: Optional[List[Literal["pending", "in_progress", "cancelled", "completed", "failed"]]] | Omit = omit,
+ statuses: Optional[List[StoreFileStatus]] | Omit = omit,
metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -222,7 +222,7 @@ def list(
cast_to=FileListResponse,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.files instead")
def delete(
self,
file_id: str,
@@ -265,7 +265,7 @@ def delete(
cast_to=FileDeleteResponse,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.files.search instead")
def search(
self,
*,
@@ -346,7 +346,7 @@ def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
"""
return AsyncFilesResourceWithStreamingResponse(self)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use post stores.files instead")
async def create(
self,
vector_store_identifier: str,
@@ -401,7 +401,7 @@ async def create(
cast_to=VectorStoreFile,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.files instead")
async def retrieve(
self,
file_id: str,
@@ -453,7 +453,7 @@ async def retrieve(
cast_to=VectorStoreFile,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use post stores.files.list instead")
async def list(
self,
vector_store_identifier: str,
@@ -462,7 +462,7 @@ async def list(
after: Optional[str] | Omit = omit,
before: Optional[str] | Omit = omit,
include_total: bool | Omit = omit,
- statuses: Optional[List[Literal["pending", "in_progress", "cancelled", "completed", "failed"]]] | Omit = omit,
+ statuses: Optional[List[StoreFileStatus]] | Omit = omit,
metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -522,7 +522,7 @@ async def list(
cast_to=FileListResponse,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.files instead")
async def delete(
self,
file_id: str,
@@ -565,7 +565,7 @@ async def delete(
cast_to=FileDeleteResponse,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.files.search instead")
async def search(
self,
*,
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
index 548ffe13..b8e3dd13 100644
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ b/src/mixedbread/resources/vector_stores/vector_stores.py
@@ -68,7 +68,7 @@ def with_streaming_response(self) -> VectorStoresResourceWithStreamingResponse:
"""
return VectorStoresResourceWithStreamingResponse(self)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
def create(
self,
*,
@@ -128,7 +128,7 @@ def create(
cast_to=VectorStore,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
def retrieve(
self,
vector_store_identifier: str,
@@ -166,7 +166,7 @@ def retrieve(
cast_to=VectorStore,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
def update(
self,
vector_store_identifier: str,
@@ -229,7 +229,7 @@ def update(
cast_to=VectorStore,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
def list(
self,
*,
@@ -291,7 +291,7 @@ def list(
model=VectorStore,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
def delete(
self,
vector_store_identifier: str,
@@ -329,7 +329,7 @@ def delete(
cast_to=VectorStoreDeleteResponse,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.question_answering instead")
def question_answering(
self,
*,
@@ -398,7 +398,7 @@ def question_answering(
cast_to=VectorStoreQuestionAnsweringResponse,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.search instead")
def search(
self,
*,
@@ -483,7 +483,7 @@ def with_streaming_response(self) -> AsyncVectorStoresResourceWithStreamingRespo
"""
return AsyncVectorStoresResourceWithStreamingResponse(self)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
async def create(
self,
*,
@@ -543,7 +543,7 @@ async def create(
cast_to=VectorStore,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
async def retrieve(
self,
vector_store_identifier: str,
@@ -581,7 +581,7 @@ async def retrieve(
cast_to=VectorStore,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
async def update(
self,
vector_store_identifier: str,
@@ -644,7 +644,7 @@ async def update(
cast_to=VectorStore,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
def list(
self,
*,
@@ -706,7 +706,7 @@ def list(
model=VectorStore,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores instead")
async def delete(
self,
vector_store_identifier: str,
@@ -744,7 +744,7 @@ async def delete(
cast_to=VectorStoreDeleteResponse,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.question_answering instead")
async def question_answering(
self,
*,
@@ -813,7 +813,7 @@ async def question_answering(
cast_to=VectorStoreQuestionAnsweringResponse,
)
- @typing_extensions.deprecated("deprecated")
+ @typing_extensions.deprecated("Use stores.search instead")
async def search(
self,
*,
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 87fe66f4..3ec3253b 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -4,6 +4,7 @@
from . import shared
from .. import _compat
+from .store import Store as Store
from .shared import Usage as Usage, SearchFilter as SearchFilter, SearchFilterCondition as SearchFilterCondition
from .api_key import APIKey as APIKey
from .embedding import Embedding as Embedding
@@ -18,18 +19,25 @@
from .rerank_response import RerankResponse as RerankResponse
from .data_source_type import DataSourceType as DataSourceType
from .file_list_params import FileListParams as FileListParams
+from .store_list_params import StoreListParams as StoreListParams
from .file_create_params import FileCreateParams as FileCreateParams
from .file_update_params import FileUpdateParams as FileUpdateParams
from .api_key_list_params import APIKeyListParams as APIKeyListParams
from .client_embed_params import ClientEmbedParams as ClientEmbedParams
from .expires_after_param import ExpiresAfterParam as ExpiresAfterParam
+from .store_create_params import StoreCreateParams as StoreCreateParams
+from .store_search_params import StoreSearchParams as StoreSearchParams
+from .store_update_params import StoreUpdateParams as StoreUpdateParams
from .client_rerank_params import ClientRerankParams as ClientRerankParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .api_key_create_params import APIKeyCreateParams as APIKeyCreateParams
from .pagination_with_total import PaginationWithTotal as PaginationWithTotal
+from .store_delete_response import StoreDeleteResponse as StoreDeleteResponse
+from .store_search_response import StoreSearchResponse as StoreSearchResponse
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 .linear_data_source_param import LinearDataSourceParam as LinearDataSourceParam
from .multi_encoding_embedding import MultiEncodingEmbedding as MultiEncodingEmbedding
from .notion_data_source_param import NotionDataSourceParam as NotionDataSourceParam
@@ -42,8 +50,14 @@
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 .store_question_answering_params import StoreQuestionAnsweringParams as StoreQuestionAnsweringParams
+from .store_chunk_search_options_param import StoreChunkSearchOptionsParam as StoreChunkSearchOptionsParam
+from .store_question_answering_response import StoreQuestionAnsweringResponse as StoreQuestionAnsweringResponse
from .vector_store_question_answering_params import (
VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams,
)
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..0e749c30
--- /dev/null
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -0,0 +1,57 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict, 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"""
+
+ generated_metadata: Optional[Dict[str, object]] = None
+ """metadata 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"""
+
+ store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ audio_url: AudioURL
+ """The audio input specification."""
+
+ sampling_rate: int
+ """The sampling rate 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..b7a925fd
--- /dev/null
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -0,0 +1,57 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict, 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."""
+
+ format: Optional[str] = None
+ """The image format/mimetype"""
+
+
+class ScoredImageURLInputChunk(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"""
+
+ score: float
+ """score of the chunk"""
+
+ file_id: str
+ """file id"""
+
+ filename: str
+ """filename"""
+
+ store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ image_url: ImageURL
+ """The image input specification."""
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..6a120e42
--- /dev/null
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -0,0 +1,46 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict, 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"""
+
+ generated_metadata: Optional[Dict[str, object]] = None
+ """metadata 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"""
+
+ store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
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..c31cb23c
--- /dev/null
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -0,0 +1,54 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict, 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"""
+
+ generated_metadata: Optional[Dict[str, object]] = None
+ """metadata 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"""
+
+ store_id: str
+ """store id"""
+
+ metadata: Optional[object] = None
+ """file metadata"""
+
+ 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"""
+
+ video_url: VideoURL
+ """The video input specification."""
diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py
new file mode 100644
index 00000000..5c7db5d1
--- /dev/null
+++ b/src/mixedbread/types/store.py
@@ -0,0 +1,74 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from datetime import datetime
+from typing_extensions import Literal
+
+from .._models import BaseModel
+from .expires_after import ExpiresAfter
+
+__all__ = ["Store", "FileCounts"]
+
+
+class FileCounts(BaseModel):
+ pending: Optional[int] = None
+ """Number of files waiting to be processed"""
+
+ 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 Store(BaseModel):
+ id: str
+ """Unique identifier for the store"""
+
+ name: str
+ """Name of the store"""
+
+ description: Optional[str] = None
+ """Detailed description of the store's purpose and contents"""
+
+ is_public: Optional[bool] = None
+ """Whether the store can be accessed by anyone with valid login credentials"""
+
+ metadata: Optional[object] = None
+ """Additional metadata associated with the store"""
+
+ file_counts: Optional[FileCounts] = None
+ """Counts of files in different states"""
+
+ expires_after: Optional[ExpiresAfter] = None
+ """Represents an expiration policy for a store."""
+
+ status: Optional[Literal["expired", "in_progress", "completed"]] = None
+ """Processing status of the store"""
+
+ created_at: datetime
+ """Timestamp when the store was created"""
+
+ updated_at: datetime
+ """Timestamp when the store was last updated"""
+
+ last_active_at: Optional[datetime] = None
+ """Timestamp when the store was last used"""
+
+ usage_bytes: Optional[int] = None
+ """Total storage usage in bytes"""
+
+ expires_at: Optional[datetime] = None
+ """Optional expiration timestamp for the store"""
+
+ object: Optional[Literal["store"]] = None
+ """Type of the object"""
diff --git a/src/mixedbread/types/store_chunk_search_options_param.py b/src/mixedbread/types/store_chunk_search_options_param.py
new file mode 100644
index 00000000..89c64712
--- /dev/null
+++ b/src/mixedbread/types/store_chunk_search_options_param.py
@@ -0,0 +1,29 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Optional
+from typing_extensions import TypeAlias, TypedDict
+
+from .vector_stores.rerank_config_param import RerankConfigParam
+
+__all__ = ["StoreChunkSearchOptionsParam", "Rerank"]
+
+Rerank: TypeAlias = Union[bool, RerankConfigParam]
+
+
+class StoreChunkSearchOptionsParam(TypedDict, total=False):
+ score_threshold: float
+ """Minimum similarity score threshold"""
+
+ rewrite_query: bool
+ """Whether to rewrite the query"""
+
+ rerank: Optional[Rerank]
+ """Whether to rerank results and optional reranking configuration"""
+
+ return_metadata: bool
+ """Whether to return file metadata"""
+
+ apply_search_rules: bool
+ """Whether to apply search rules"""
diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py
new file mode 100644
index 00000000..1c307c18
--- /dev/null
+++ b/src/mixedbread/types/store_create_params.py
@@ -0,0 +1,31 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Optional
+from typing_extensions import TypedDict
+
+from .._types import SequenceNotStr
+from .expires_after_param import ExpiresAfterParam
+
+__all__ = ["StoreCreateParams"]
+
+
+class StoreCreateParams(TypedDict, total=False):
+ name: Optional[str]
+ """Name for the new store"""
+
+ description: Optional[str]
+ """Description of the store"""
+
+ is_public: bool
+ """Whether the store can be accessed by anyone with valid login credentials"""
+
+ expires_after: Optional[ExpiresAfterParam]
+ """Represents an expiration policy for a store."""
+
+ metadata: object
+ """Optional metadata key-value pairs"""
+
+ file_ids: Optional[SequenceNotStr[str]]
+ """Optional list of file IDs"""
diff --git a/src/mixedbread/types/store_delete_response.py b/src/mixedbread/types/store_delete_response.py
new file mode 100644
index 00000000..c35970ab
--- /dev/null
+++ b/src/mixedbread/types/store_delete_response.py
@@ -0,0 +1,19 @@
+# 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__ = ["StoreDeleteResponse"]
+
+
+class StoreDeleteResponse(BaseModel):
+ id: str
+ """ID of the deleted store"""
+
+ deleted: bool
+ """Whether the deletion was successful"""
+
+ object: Optional[Literal["store"]] = None
+ """Type of the deleted object"""
diff --git a/src/mixedbread/types/store_list_params.py b/src/mixedbread/types/store_list_params.py
new file mode 100644
index 00000000..addec411
--- /dev/null
+++ b/src/mixedbread/types/store_list_params.py
@@ -0,0 +1,31 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Optional
+from typing_extensions import TypedDict
+
+__all__ = ["StoreListParams"]
+
+
+class StoreListParams(TypedDict, total=False):
+ limit: int
+ """Maximum number of items to return per page (1-100)"""
+
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
+
+ include_total: bool
+ """Whether to include total count in response (expensive operation)"""
+
+ q: Optional[str]
+ """Search query for fuzzy matching over name and description fields"""
diff --git a/src/mixedbread/types/store_question_answering_params.py b/src/mixedbread/types/store_question_answering_params.py
new file mode 100644
index 00000000..37366a6f
--- /dev/null
+++ b/src/mixedbread/types/store_question_answering_params.py
@@ -0,0 +1,57 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Iterable, Optional
+from typing_extensions import Required, TypeAlias, TypedDict
+
+from .._types import SequenceNotStr
+from .store_chunk_search_options_param import StoreChunkSearchOptionsParam
+from .shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["StoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
+
+
+class StoreQuestionAnsweringParams(TypedDict, total=False):
+ query: str
+ """Question to answer.
+
+ If not provided, the question will be extracted from the passed messages.
+ """
+
+ store_identifiers: Required[SequenceNotStr[str]]
+ """IDs or names of stores to search"""
+
+ top_k: int
+ """Number of results to return"""
+
+ filters: Optional[Filters]
+ """Optional filter conditions"""
+
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None]
+ """Optional list of file IDs to filter chunks by (inclusion filter)"""
+
+ search_options: StoreChunkSearchOptionsParam
+ """Search configuration options"""
+
+ stream: bool
+ """Whether to stream the answer"""
+
+ qa_options: QaOptions
+ """Question answering configuration options"""
+
+
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+
+
+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/store_question_answering_response.py b/src/mixedbread/types/store_question_answering_response.py
new file mode 100644
index 00000000..f47f71b3
--- /dev/null
+++ b/src/mixedbread/types/store_question_answering_response.py
@@ -0,0 +1,26 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union, Optional
+from typing_extensions import Annotated, TypeAlias
+
+from .._utils import PropertyInfo
+from .._models import BaseModel
+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__ = ["StoreQuestionAnsweringResponse", "Source"]
+
+Source: TypeAlias = Annotated[
+ Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class StoreQuestionAnsweringResponse(BaseModel):
+ answer: str
+ """The answer generated by the LLM"""
+
+ sources: Optional[List[Source]] = None
+ """Source documents used to generate the answer"""
diff --git a/src/mixedbread/types/store_search_params.py b/src/mixedbread/types/store_search_params.py
new file mode 100644
index 00000000..1bff13de
--- /dev/null
+++ b/src/mixedbread/types/store_search_params.py
@@ -0,0 +1,39 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Iterable, Optional
+from typing_extensions import Required, TypeAlias, TypedDict
+
+from .._types import SequenceNotStr
+from .store_chunk_search_options_param import StoreChunkSearchOptionsParam
+from .shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["StoreSearchParams", "Filters", "FiltersUnionMember2"]
+
+
+class StoreSearchParams(TypedDict, total=False):
+ query: Required[str]
+ """Search query text"""
+
+ store_identifiers: Required[SequenceNotStr[str]]
+ """IDs or names of stores to search"""
+
+ top_k: int
+ """Number of results to return"""
+
+ filters: Optional[Filters]
+ """Optional filter conditions"""
+
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None]
+ """Optional list of file IDs to filter chunks by (inclusion filter)"""
+
+ search_options: StoreChunkSearchOptionsParam
+ """Search configuration options"""
+
+
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+
+from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/store_search_response.py b/src/mixedbread/types/store_search_response.py
new file mode 100644
index 00000000..6ab757c5
--- /dev/null
+++ b/src/mixedbread/types/store_search_response.py
@@ -0,0 +1,26 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+
+from .._utils import PropertyInfo
+from .._models import BaseModel
+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__ = ["StoreSearchResponse", "Data"]
+
+Data: TypeAlias = Annotated[
+ Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class StoreSearchResponse(BaseModel):
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[Data]
+ """The list of scored store file chunks"""
diff --git a/src/mixedbread/types/store_update_params.py b/src/mixedbread/types/store_update_params.py
new file mode 100644
index 00000000..6133eb5c
--- /dev/null
+++ b/src/mixedbread/types/store_update_params.py
@@ -0,0 +1,27 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Optional
+from typing_extensions import TypedDict
+
+from .expires_after_param import ExpiresAfterParam
+
+__all__ = ["StoreUpdateParams"]
+
+
+class StoreUpdateParams(TypedDict, total=False):
+ name: Optional[str]
+ """New name for the store"""
+
+ description: Optional[str]
+ """New description"""
+
+ is_public: Optional[bool]
+ """Whether the store can be accessed by anyone with valid login credentials"""
+
+ expires_after: Optional[ExpiresAfterParam]
+ """Represents an expiration policy for a store."""
+
+ metadata: object
+ """Optional metadata key-value pairs"""
diff --git a/src/mixedbread/types/stores/__init__.py b/src/mixedbread/types/stores/__init__.py
new file mode 100644
index 00000000..3dee7dac
--- /dev/null
+++ b/src/mixedbread/types/stores/__init__.py
@@ -0,0 +1,14 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .store_file import StoreFile as StoreFile
+from .file_list_params import FileListParams as FileListParams
+from .scored_store_file import ScoredStoreFile as ScoredStoreFile
+from .store_file_status import StoreFileStatus as StoreFileStatus
+from .file_create_params import FileCreateParams as FileCreateParams
+from .file_list_response import FileListResponse as FileListResponse
+from .file_search_params import FileSearchParams as FileSearchParams
+from .file_delete_response import FileDeleteResponse as FileDeleteResponse
+from .file_retrieve_params import FileRetrieveParams as FileRetrieveParams
+from .file_search_response import FileSearchResponse as FileSearchResponse
diff --git a/src/mixedbread/types/stores/file_create_params.py b/src/mixedbread/types/stores/file_create_params.py
new file mode 100644
index 00000000..ce39cfd1
--- /dev/null
+++ b/src/mixedbread/types/stores/file_create_params.py
@@ -0,0 +1,26 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["FileCreateParams", "Experimental"]
+
+
+class FileCreateParams(TypedDict, total=False):
+ metadata: object
+ """Optional metadata for the file"""
+
+ experimental: Experimental
+ """Strategy for adding the file"""
+
+ file_id: Required[str]
+ """ID of the file to add"""
+
+
+class Experimental(TypedDict, total=False):
+ parsing_strategy: Literal["fast", "high_quality"]
+ """Strategy for adding the file"""
+
+ contextualization: bool
+ """Whether to contextualize the file"""
diff --git a/src/mixedbread/types/stores/file_delete_response.py b/src/mixedbread/types/stores/file_delete_response.py
new file mode 100644
index 00000000..ada45e9c
--- /dev/null
+++ b/src/mixedbread/types/stores/file_delete_response.py
@@ -0,0 +1,19 @@
+# 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__ = ["FileDeleteResponse"]
+
+
+class FileDeleteResponse(BaseModel):
+ id: str
+ """ID of the deleted file"""
+
+ deleted: Optional[bool] = None
+ """Whether the deletion was successful"""
+
+ object: Optional[Literal["store.file"]] = None
+ """Type of the deleted object"""
diff --git a/src/mixedbread/types/stores/file_list_params.py b/src/mixedbread/types/stores/file_list_params.py
new file mode 100644
index 00000000..27edd05e
--- /dev/null
+++ b/src/mixedbread/types/stores/file_list_params.py
@@ -0,0 +1,44 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict
+
+from .store_file_status import StoreFileStatus
+from ..shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"]
+
+
+class FileListParams(TypedDict, total=False):
+ limit: int
+ """Maximum number of items to return per page (1-100)"""
+
+ after: Optional[str]
+ """Cursor for forward pagination - get items after this position.
+
+ Use last_cursor from previous response.
+ """
+
+ before: Optional[str]
+ """Cursor for backward pagination - get items before this position.
+
+ Use first_cursor from previous response.
+ """
+
+ include_total: bool
+ """Whether to include total count in response (expensive operation)"""
+
+ statuses: Optional[List[StoreFileStatus]]
+ """Status to filter by"""
+
+ metadata_filter: Optional[MetadataFilter]
+ """Metadata filter to apply to the query"""
+
+
+MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+MetadataFilter: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[MetadataFilterUnionMember2]]
+
+from ..shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/stores/file_list_response.py b/src/mixedbread/types/stores/file_list_response.py
new file mode 100644
index 00000000..2d47abcc
--- /dev/null
+++ b/src/mixedbread/types/stores/file_list_response.py
@@ -0,0 +1,48 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+from .store_file import StoreFile
+
+__all__ = ["FileListResponse", "Pagination"]
+
+
+class Pagination(BaseModel):
+ has_more: bool
+ """
+ Contextual direction-aware flag: True if more items exist in the requested
+ pagination direction. For 'after': more items after this page. For 'before':
+ more items before this page.
+ """
+
+ first_cursor: Optional[str] = None
+ """Cursor of the first item in this page.
+
+ Use for backward pagination. None if page is empty.
+ """
+
+ last_cursor: Optional[str] = None
+ """Cursor of the last item in this page.
+
+ Use for forward pagination. None if page is empty.
+ """
+
+ total: Optional[int] = None
+ """Total number of items available across all pages.
+
+ Only included when include_total=true was requested. Expensive operation - use
+ sparingly.
+ """
+
+
+class FileListResponse(BaseModel):
+ pagination: Pagination
+ """Response model for cursor-based pagination."""
+
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[StoreFile]
+ """The list of store files"""
diff --git a/src/mixedbread/types/stores/file_retrieve_params.py b/src/mixedbread/types/stores/file_retrieve_params.py
new file mode 100644
index 00000000..ae924454
--- /dev/null
+++ b/src/mixedbread/types/stores/file_retrieve_params.py
@@ -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):
+ store_identifier: Required[str]
+ """The ID or name of the store"""
+
+ return_chunks: bool
+ """Whether to return the chunks for the file"""
diff --git a/src/mixedbread/types/stores/file_search_params.py b/src/mixedbread/types/stores/file_search_params.py
new file mode 100644
index 00000000..8558e0c8
--- /dev/null
+++ b/src/mixedbread/types/stores/file_search_params.py
@@ -0,0 +1,65 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Iterable, Optional
+from typing_extensions import Required, TypeAlias, TypedDict
+
+from ..._types import SequenceNotStr
+from ..vector_stores.rerank_config_param import RerankConfigParam
+from ..shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["FileSearchParams", "Filters", "FiltersUnionMember2", "SearchOptions", "SearchOptionsRerank"]
+
+
+class FileSearchParams(TypedDict, total=False):
+ query: Required[str]
+ """Search query text"""
+
+ store_identifiers: Required[SequenceNotStr[str]]
+ """IDs or names of stores to search"""
+
+ top_k: int
+ """Number of results to return"""
+
+ filters: Optional[Filters]
+ """Optional filter conditions"""
+
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None]
+ """Optional list of file IDs to filter chunks by (inclusion filter)"""
+
+ search_options: SearchOptions
+ """Search configuration options"""
+
+
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+
+SearchOptionsRerank: TypeAlias = Union[bool, RerankConfigParam]
+
+
+class SearchOptions(TypedDict, total=False):
+ score_threshold: float
+ """Minimum similarity score threshold"""
+
+ rewrite_query: bool
+ """Whether to rewrite the query"""
+
+ rerank: Optional[SearchOptionsRerank]
+ """Whether to rerank results and optional reranking configuration"""
+
+ 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"""
+
+ apply_search_rules: bool
+ """Whether to apply search rules"""
+
+
+from ..shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/stores/file_search_response.py b/src/mixedbread/types/stores/file_search_response.py
new file mode 100644
index 00000000..304512e4
--- /dev/null
+++ b/src/mixedbread/types/stores/file_search_response.py
@@ -0,0 +1,17 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+from .scored_store_file import ScoredStoreFile
+
+__all__ = ["FileSearchResponse"]
+
+
+class FileSearchResponse(BaseModel):
+ object: Optional[Literal["list"]] = None
+ """The object type of the response"""
+
+ data: List[ScoredStoreFile]
+ """The list of scored store files"""
diff --git a/src/mixedbread/types/stores/scored_store_file.py b/src/mixedbread/types/stores/scored_store_file.py
new file mode 100644
index 00000000..24aafbbe
--- /dev/null
+++ b/src/mixedbread/types/stores/scored_store_file.py
@@ -0,0 +1,58 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union, Optional
+from datetime import datetime
+from typing_extensions import Literal, Annotated, TypeAlias
+
+from ..._utils import PropertyInfo
+from ..._models import BaseModel
+from .store_file_status import StoreFileStatus
+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__ = ["ScoredStoreFile", "Chunk"]
+
+Chunk: TypeAlias = Annotated[
+ Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class ScoredStoreFile(BaseModel):
+ id: str
+ """Unique identifier for the file"""
+
+ filename: Optional[str] = None
+ """Name of the file"""
+
+ metadata: Optional[object] = None
+ """Optional file metadata"""
+
+ status: Optional[StoreFileStatus] = None
+ """Processing status of the file"""
+
+ last_error: Optional[object] = None
+ """Last error message if processing failed"""
+
+ store_id: str
+ """ID of the containing store"""
+
+ created_at: datetime
+ """Timestamp of store file creation"""
+
+ version: Optional[int] = None
+ """Version number of the file"""
+
+ usage_bytes: Optional[int] = None
+ """Storage usage in bytes"""
+
+ object: Optional[Literal["store.file"]] = None
+ """Type of the object"""
+
+ chunks: Optional[List[Chunk]] = None
+ """Array of scored file chunks"""
+
+ score: float
+ """score of the file"""
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
new file mode 100644
index 00000000..75d385cb
--- /dev/null
+++ b/src/mixedbread/types/stores/store_file.py
@@ -0,0 +1,184 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict, List, Union, Optional
+from datetime import datetime
+from typing_extensions import Literal, Annotated, TypeAlias
+
+from ..._utils import PropertyInfo
+from ..._models import BaseModel
+from .store_file_status import StoreFileStatus
+
+__all__ = [
+ "StoreFile",
+ "Chunk",
+ "ChunkTextInputChunk",
+ "ChunkImageURLInputChunk",
+ "ChunkImageURLInputChunkImageURL",
+ "ChunkAudioURLInputChunk",
+ "ChunkAudioURLInputChunkAudioURL",
+ "ChunkVideoURLInputChunk",
+ "ChunkVideoURLInputChunkVideoURL",
+]
+
+
+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 ChunkImageURLInputChunkImageURL(BaseModel):
+ url: str
+ """The image URL. Can be either a URL or a Data URI."""
+
+ format: Optional[str] = None
+ """The image format/mimetype"""
+
+
+class ChunkImageURLInputChunk(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"""
+
+ image_url: ChunkImageURLInputChunkImageURL
+ """The image input specification."""
+
+
+class ChunkAudioURLInputChunkAudioURL(BaseModel):
+ url: str
+ """The audio URL. Can be either a URL or a Data URI."""
+
+
+class ChunkAudioURLInputChunk(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"""
+
+ audio_url: ChunkAudioURLInputChunkAudioURL
+ """The audio input specification."""
+
+ sampling_rate: int
+ """The sampling rate of the audio."""
+
+
+class ChunkVideoURLInputChunkVideoURL(BaseModel):
+ url: str
+ """The video URL. Can be either a URL or a Data URI."""
+
+
+class ChunkVideoURLInputChunk(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"""
+
+ video_url: ChunkVideoURLInputChunkVideoURL
+ """The video input specification."""
+
+
+Chunk: TypeAlias = Annotated[
+ Union[ChunkTextInputChunk, ChunkImageURLInputChunk, ChunkAudioURLInputChunk, ChunkVideoURLInputChunk],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class StoreFile(BaseModel):
+ id: str
+ """Unique identifier for the file"""
+
+ filename: Optional[str] = None
+ """Name of the file"""
+
+ metadata: Optional[object] = None
+ """Optional file metadata"""
+
+ status: Optional[StoreFileStatus] = None
+ """Processing status of the file"""
+
+ last_error: Optional[object] = None
+ """Last error message if processing failed"""
+
+ store_id: str
+ """ID of the containing store"""
+
+ created_at: datetime
+ """Timestamp of store file creation"""
+
+ version: Optional[int] = None
+ """Version number of the file"""
+
+ usage_bytes: Optional[int] = None
+ """Storage usage in bytes"""
+
+ object: Optional[Literal["store.file"]] = None
+ """Type of the object"""
+
+ chunks: Optional[List[Chunk]] = None
+ """chunks"""
diff --git a/src/mixedbread/types/stores/store_file_status.py b/src/mixedbread/types/stores/store_file_status.py
new file mode 100644
index 00000000..a0061477
--- /dev/null
+++ b/src/mixedbread/types/stores/store_file_status.py
@@ -0,0 +1,7 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal, TypeAlias
+
+__all__ = ["StoreFileStatus"]
+
+StoreFileStatus: TypeAlias = Literal["pending", "in_progress", "cancelled", "completed", "failed"]
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
index 9f89685c..ef2c2848 100644
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ b/src/mixedbread/types/vector_stores/file_list_params.py
@@ -3,8 +3,9 @@
from __future__ import annotations
from typing import List, Union, Iterable, Optional
-from typing_extensions import Literal, TypeAlias, TypedDict
+from typing_extensions import TypeAlias, TypedDict
+from ..stores.store_file_status import StoreFileStatus
from ..shared_params.search_filter_condition import SearchFilterCondition
__all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"]
@@ -29,7 +30,7 @@ class FileListParams(TypedDict, total=False):
include_total: bool
"""Whether to include total count in response (expensive operation)"""
- statuses: Optional[List[Literal["pending", "in_progress", "cancelled", "completed", "failed"]]]
+ statuses: Optional[List[StoreFileStatus]]
"""Status to filter by"""
metadata_filter: Optional[MetadataFilter]
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 247d7d39..7300999c 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -6,6 +6,7 @@
from ..._utils import PropertyInfo
from ..._models import BaseModel
+from ..stores.store_file_status import StoreFileStatus
__all__ = [
"ScoredVectorStoreFile",
@@ -223,7 +224,7 @@ class ScoredVectorStoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
- status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None
+ status: Optional[StoreFileStatus] = None
"""Processing status of the file"""
last_error: Optional[object] = None
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 89f64d8a..9b0713fc 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -6,6 +6,7 @@
from ..._utils import PropertyInfo
from ..._models import BaseModel
+from ..stores.store_file_status import StoreFileStatus
__all__ = [
"VectorStoreFile",
@@ -158,7 +159,7 @@ class VectorStoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
- status: Optional[Literal["pending", "in_progress", "cancelled", "completed", "failed"]] = None
+ status: Optional[StoreFileStatus] = None
"""Processing status of the file"""
last_error: Optional[object] = None
diff --git a/tests/api_resources/stores/__init__.py b/tests/api_resources/stores/__init__.py
new file mode 100644
index 00000000..fd8019a9
--- /dev/null
+++ b/tests/api_resources/stores/__init__.py
@@ -0,0 +1 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py
new file mode 100644
index 00000000..66797c82
--- /dev/null
+++ b/tests/api_resources/stores/test_files.py
@@ -0,0 +1,707 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types.stores import (
+ StoreFile,
+ FileListResponse,
+ FileDeleteResponse,
+ FileSearchResponse,
+)
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestFiles:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ file = client.stores.files.create(
+ store_identifier="store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
+ file = client.stores.files.create(
+ store_identifier="store_identifier",
+ metadata={},
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.stores.files.with_raw_response.create(
+ store_identifier="store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.stores.files.with_streaming_response.create(
+ store_identifier="store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_create(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.files.with_raw_response.create(
+ store_identifier="",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ file = client.stores.files.retrieve(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_method_retrieve_with_all_params(self, client: Mixedbread) -> None:
+ file = client.stores.files.retrieve(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ return_chunks=True,
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
+ response = client.stores.files.with_raw_response.retrieve(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.stores.files.with_streaming_response.retrieve(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.files.with_raw_response.retrieve(
+ file_id="file_id",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ client.stores.files.with_raw_response.retrieve(
+ file_id="",
+ store_identifier="store_identifier",
+ )
+
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ file = client.stores.files.list(
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
+ file = client.stores.files.list(
+ store_identifier="store_identifier",
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending"],
+ metadata_filter={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Mixedbread) -> None:
+ response = client.stores.files.with_raw_response.list(
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Mixedbread) -> None:
+ with client.stores.files.with_streaming_response.list(
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_list(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.files.with_raw_response.list(
+ store_identifier="",
+ )
+
+ @parametrize
+ def test_method_delete(self, client: Mixedbread) -> None:
+ file = client.stores.files.delete(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_delete(self, client: Mixedbread) -> None:
+ response = client.stores.files.with_raw_response.delete(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_delete(self, client: Mixedbread) -> None:
+ with client.stores.files.with_streaming_response.delete(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_delete(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.files.with_raw_response.delete(
+ file_id="file_id",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ client.stores.files.with_raw_response.delete(
+ file_id="",
+ store_identifier="store_identifier",
+ )
+
+ @parametrize
+ def test_method_search(self, client: Mixedbread) -> None:
+ file = client.stores.files.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ )
+ assert_matches_type(FileSearchResponse, file, path=["response"])
+
+ @parametrize
+ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
+ file = client.stores.files.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "return_chunks": True,
+ "chunks_per_file": 0,
+ "apply_search_rules": True,
+ },
+ )
+ assert_matches_type(FileSearchResponse, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_search(self, client: Mixedbread) -> None:
+ response = client.stores.files.with_raw_response.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(FileSearchResponse, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_search(self, client: Mixedbread) -> None:
+ with client.stores.files.with_streaming_response.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(FileSearchResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncFiles:
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.create(
+ store_identifier="store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.create(
+ store_identifier="store_identifier",
+ metadata={},
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.files.with_raw_response.create(
+ store_identifier="store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.files.with_streaming_response.create(
+ store_identifier="store_identifier",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_create(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.create(
+ store_identifier="",
+ file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.retrieve(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_method_retrieve_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.retrieve(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ return_chunks=True,
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.files.with_raw_response.retrieve(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.files.with_streaming_response.retrieve(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.retrieve(
+ file_id="file_id",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ await async_client.stores.files.with_raw_response.retrieve(
+ file_id="",
+ store_identifier="store_identifier",
+ )
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.list(
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.list(
+ store_identifier="store_identifier",
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ statuses=["pending"],
+ metadata_filter={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ )
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.files.with_raw_response.list(
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.files.with_streaming_response.list(
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(FileListResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.list(
+ store_identifier="",
+ )
+
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.delete(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.files.with_raw_response.delete(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.files.with_streaming_response.delete(
+ file_id="file_id",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.delete(
+ file_id="file_id",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
+ await async_client.stores.files.with_raw_response.delete(
+ file_id="",
+ store_identifier="store_identifier",
+ )
+
+ @parametrize
+ async def test_method_search(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ )
+ assert_matches_type(FileSearchResponse, file, path=["response"])
+
+ @parametrize
+ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "return_chunks": True,
+ "chunks_per_file": 0,
+ "apply_search_rules": True,
+ },
+ )
+ assert_matches_type(FileSearchResponse, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.files.with_raw_response.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(FileSearchResponse, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.files.with_streaming_response.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(FileSearchResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/test_stores.py b/tests/api_resources/test_stores.py
new file mode 100644
index 00000000..180773e7
--- /dev/null
+++ b/tests/api_resources/test_stores.py
@@ -0,0 +1,800 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from mixedbread import Mixedbread, AsyncMixedbread
+from tests.utils import assert_matches_type
+from mixedbread.types import (
+ Store,
+ StoreDeleteResponse,
+ StoreSearchResponse,
+ StoreQuestionAnsweringResponse,
+)
+from mixedbread.pagination import SyncCursor, AsyncCursor
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestStores:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ def test_method_create(self, client: Mixedbread) -> None:
+ store = client.stores.create()
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
+ store = client.stores.create(
+ name="Technical Documentation",
+ description="Contains technical specifications and guides",
+ is_public=False,
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ def test_raw_response_create(self, client: Mixedbread) -> None:
+ response = client.stores.with_raw_response.create()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_create(self, client: Mixedbread) -> None:
+ with client.stores.with_streaming_response.create() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ store = client.stores.retrieve(
+ "store_identifier",
+ )
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
+ response = client.stores.with_raw_response.retrieve(
+ "store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.stores.with_streaming_response.retrieve(
+ "store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ def test_method_update(self, client: Mixedbread) -> None:
+ store = client.stores.update(
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
+ store = client.stores.update(
+ store_identifier="store_identifier",
+ name="x",
+ description="description",
+ is_public=True,
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ )
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ def test_raw_response_update(self, client: Mixedbread) -> None:
+ response = client.stores.with_raw_response.update(
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_update(self, client: Mixedbread) -> None:
+ with client.stores.with_streaming_response.update(
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_update(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.with_raw_response.update(
+ store_identifier="",
+ )
+
+ @parametrize
+ def test_method_list(self, client: Mixedbread) -> None:
+ store = client.stores.list()
+ assert_matches_type(SyncCursor[Store], store, path=["response"])
+
+ @parametrize
+ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
+ store = client.stores.list(
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ q="x",
+ )
+ assert_matches_type(SyncCursor[Store], store, path=["response"])
+
+ @parametrize
+ def test_raw_response_list(self, client: Mixedbread) -> None:
+ response = client.stores.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = response.parse()
+ assert_matches_type(SyncCursor[Store], store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_list(self, client: Mixedbread) -> None:
+ with client.stores.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = response.parse()
+ assert_matches_type(SyncCursor[Store], store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_delete(self, client: Mixedbread) -> None:
+ store = client.stores.delete(
+ "store_identifier",
+ )
+ assert_matches_type(StoreDeleteResponse, store, path=["response"])
+
+ @parametrize
+ def test_raw_response_delete(self, client: Mixedbread) -> None:
+ response = client.stores.with_raw_response.delete(
+ "store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = response.parse()
+ assert_matches_type(StoreDeleteResponse, store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_delete(self, client: Mixedbread) -> None:
+ with client.stores.with_streaming_response.delete(
+ "store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = response.parse()
+ assert_matches_type(StoreDeleteResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_delete(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.with_raw_response.delete(
+ "",
+ )
+
+ @parametrize
+ def test_method_question_answering(self, client: Mixedbread) -> None:
+ store = client.stores.question_answering(
+ store_identifiers=["string"],
+ )
+ assert_matches_type(StoreQuestionAnsweringResponse, store, path=["response"])
+
+ @parametrize
+ def test_method_question_answering_with_all_params(self, client: Mixedbread) -> None:
+ store = client.stores.question_answering(
+ query="x",
+ store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ stream=True,
+ qa_options={
+ "cite": True,
+ "multimodal": True,
+ },
+ )
+ assert_matches_type(StoreQuestionAnsweringResponse, store, path=["response"])
+
+ @parametrize
+ def test_raw_response_question_answering(self, client: Mixedbread) -> None:
+ response = client.stores.with_raw_response.question_answering(
+ store_identifiers=["string"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = response.parse()
+ assert_matches_type(StoreQuestionAnsweringResponse, store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_question_answering(self, client: Mixedbread) -> None:
+ with client.stores.with_streaming_response.question_answering(
+ store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = response.parse()
+ assert_matches_type(StoreQuestionAnsweringResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_method_search(self, client: Mixedbread) -> None:
+ store = client.stores.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ )
+ assert_matches_type(StoreSearchResponse, store, path=["response"])
+
+ @parametrize
+ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
+ store = client.stores.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ )
+ assert_matches_type(StoreSearchResponse, store, path=["response"])
+
+ @parametrize
+ def test_raw_response_search(self, client: Mixedbread) -> None:
+ response = client.stores.with_raw_response.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = response.parse()
+ assert_matches_type(StoreSearchResponse, store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_search(self, client: Mixedbread) -> None:
+ with client.stores.with_streaming_response.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = response.parse()
+ assert_matches_type(StoreSearchResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncStores:
+ parametrize = pytest.mark.parametrize(
+ "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
+ )
+
+ @parametrize
+ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.create()
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.create(
+ name="Technical Documentation",
+ description="Contains technical specifications and guides",
+ is_public=False,
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
+ )
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.with_raw_response.create()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = await response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.with_streaming_response.create() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = await response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.retrieve(
+ "store_identifier",
+ )
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.with_raw_response.retrieve(
+ "store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = await response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.with_streaming_response.retrieve(
+ "store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = await response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.with_raw_response.retrieve(
+ "",
+ )
+
+ @parametrize
+ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.update(
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.update(
+ store_identifier="store_identifier",
+ name="x",
+ description="description",
+ is_public=True,
+ expires_after={
+ "anchor": "last_active_at",
+ "days": 0,
+ },
+ metadata={},
+ )
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.with_raw_response.update(
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = await response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.with_streaming_response.update(
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = await response.parse()
+ assert_matches_type(Store, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.with_raw_response.update(
+ store_identifier="",
+ )
+
+ @parametrize
+ async def test_method_list(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.list()
+ assert_matches_type(AsyncCursor[Store], store, path=["response"])
+
+ @parametrize
+ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.list(
+ limit=10,
+ after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
+ include_total=False,
+ q="x",
+ )
+ assert_matches_type(AsyncCursor[Store], store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.with_raw_response.list()
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = await response.parse()
+ assert_matches_type(AsyncCursor[Store], store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.with_streaming_response.list() as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = await response.parse()
+ assert_matches_type(AsyncCursor[Store], store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.delete(
+ "store_identifier",
+ )
+ assert_matches_type(StoreDeleteResponse, store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.with_raw_response.delete(
+ "store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = await response.parse()
+ assert_matches_type(StoreDeleteResponse, store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.with_streaming_response.delete(
+ "store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = await response.parse()
+ assert_matches_type(StoreDeleteResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.with_raw_response.delete(
+ "",
+ )
+
+ @parametrize
+ async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.question_answering(
+ store_identifiers=["string"],
+ )
+ assert_matches_type(StoreQuestionAnsweringResponse, store, path=["response"])
+
+ @parametrize
+ async def test_method_question_answering_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.question_answering(
+ query="x",
+ store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ stream=True,
+ qa_options={
+ "cite": True,
+ "multimodal": True,
+ },
+ )
+ assert_matches_type(StoreQuestionAnsweringResponse, store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_question_answering(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.with_raw_response.question_answering(
+ store_identifiers=["string"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = await response.parse()
+ assert_matches_type(StoreQuestionAnsweringResponse, store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_question_answering(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.with_streaming_response.question_answering(
+ store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = await response.parse()
+ assert_matches_type(StoreQuestionAnsweringResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_method_search(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ )
+ assert_matches_type(StoreSearchResponse, store, path=["response"])
+
+ @parametrize
+ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ )
+ assert_matches_type(StoreSearchResponse, store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.with_raw_response.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = await response.parse()
+ assert_matches_type(StoreSearchResponse, store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.with_streaming_response.search(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = await response.parse()
+ assert_matches_type(StoreSearchResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/test_client.py b/tests/test_client.py
index 177f226f..ef2e38b3 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -732,20 +732,20 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Mixedbread) -> None:
- respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
+ respx_mock.post("/v1/stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
- client.vector_stores.with_streaming_response.create().__enter__()
+ client.stores.with_streaming_response.create().__enter__()
assert _get_open_connections(self.client) == 0
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Mixedbread) -> None:
- respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
+ respx_mock.post("/v1/stores").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
- client.vector_stores.with_streaming_response.create().__enter__()
+ client.stores.with_streaming_response.create().__enter__()
assert _get_open_connections(self.client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@@ -772,9 +772,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/stores").mock(side_effect=retry_handler)
- response = client.vector_stores.with_raw_response.create()
+ response = client.stores.with_raw_response.create()
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -796,9 +796,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/stores").mock(side_effect=retry_handler)
- response = client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()})
+ response = client.stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()})
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -819,9 +819,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/stores").mock(side_effect=retry_handler)
- response = client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
+ response = client.stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
@@ -1559,10 +1559,10 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte
async def test_retrying_timeout_errors_doesnt_leak(
self, respx_mock: MockRouter, async_client: AsyncMixedbread
) -> None:
- respx_mock.post("/v1/vector_stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
+ respx_mock.post("/v1/stores").mock(side_effect=httpx.TimeoutException("Test timeout error"))
with pytest.raises(APITimeoutError):
- await async_client.vector_stores.with_streaming_response.create().__aenter__()
+ await async_client.stores.with_streaming_response.create().__aenter__()
assert _get_open_connections(self.client) == 0
@@ -1571,10 +1571,10 @@ async def test_retrying_timeout_errors_doesnt_leak(
async def test_retrying_status_errors_doesnt_leak(
self, respx_mock: MockRouter, async_client: AsyncMixedbread
) -> None:
- respx_mock.post("/v1/vector_stores").mock(return_value=httpx.Response(500))
+ respx_mock.post("/v1/stores").mock(return_value=httpx.Response(500))
with pytest.raises(APIStatusError):
- await async_client.vector_stores.with_streaming_response.create().__aenter__()
+ await async_client.stores.with_streaming_response.create().__aenter__()
assert _get_open_connections(self.client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@@ -1602,9 +1602,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/stores").mock(side_effect=retry_handler)
- response = await client.vector_stores.with_raw_response.create()
+ response = await client.stores.with_raw_response.create()
assert response.retries_taken == failures_before_success
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
@@ -1627,11 +1627,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/stores").mock(side_effect=retry_handler)
- response = await client.vector_stores.with_raw_response.create(
- extra_headers={"x-stainless-retry-count": Omit()}
- )
+ response = await client.stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()})
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -1653,9 +1651,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
return httpx.Response(500)
return httpx.Response(200)
- respx_mock.post("/v1/vector_stores").mock(side_effect=retry_handler)
+ respx_mock.post("/v1/stores").mock(side_effect=retry_handler)
- response = await client.vector_stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
+ response = await client.stores.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"})
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
From 756af324d60a7e0f7be2e67f61580c5704e45a8b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 1 Oct 2025 10:47:09 +0000
Subject: [PATCH 280/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index f81bf992..f04d0896 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.31.0"
+ ".": "0.32.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index e3bc88a2..f9ec7480 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.31.0"
+version = "0.32.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 fae94c2c..6c91f797 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.31.0" # x-release-please-version
+__version__ = "0.32.0" # x-release-please-version
From db77fa7564c8d1d0f966bff990c4bf9973a5f2d0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 1 Oct 2025 11:28:11 +0000
Subject: [PATCH 281/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 1b0430f8..1595cfa2 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 61
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-34b8fc657696023cc3a74eee6febe0d2fc0decda668f874bfa42abe6222d8566.yml
-openapi_spec_hash: dcd015b362c3fcb4ef449606a8027873
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-2b47fdec8c177fb55b563457ef8e3e972177a8d395a341b77112a26909e98d43.yml
+openapi_spec_hash: d818396c05166e73b409c28893e790b7
config_hash: 2de40c343cf7b242d5925e3405ee8908
From f7ad002c038196eb468fca7a0490deeb3a90e423 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 1 Oct 2025 15:49:52 +0000
Subject: [PATCH 282/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index f04d0896..12d488c3 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.32.0"
+ ".": "0.32.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index f9ec7480..4fa80431 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.32.0"
+version = "0.32.1"
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 6c91f797..7ffd30e4 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.32.0" # x-release-please-version
+__version__ = "0.32.1" # x-release-please-version
From 9abd51c50499cde3bd63b9ba3a467b8bb852c31e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 4 Oct 2025 11:28:13 +0000
Subject: [PATCH 283/375] feat(api): api update
---
.stats.yml | 4 +-
.../types/scored_audio_url_input_chunk.py | 173 +++-
.../types/scored_image_url_input_chunk.py | 173 +++-
.../types/scored_text_input_chunk.py | 172 +++-
.../types/scored_video_url_input_chunk.py | 173 +++-
src/mixedbread/types/stores/store_file.py | 664 +++++++++++++++-
...ector_store_question_answering_response.py | 744 +++++++++++++++++-
.../types/vector_store_search_response.py | 744 +++++++++++++++++-
.../vector_stores/scored_vector_store_file.py | 744 +++++++++++++++++-
.../types/vector_stores/vector_store_file.py | 664 +++++++++++++++-
10 files changed, 4212 insertions(+), 43 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 1595cfa2..944ffff7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 61
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-2b47fdec8c177fb55b563457ef8e3e972177a8d395a341b77112a26909e98d43.yml
-openapi_spec_hash: d818396c05166e73b409c28893e790b7
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-136dd0d094bdfb186f81578f8b5cd97431d7fb5a5ee104e319df8a046d78970a.yml
+openapi_spec_hash: 294ee9fea2dbbe49681a675ae359cdd1
config_hash: 2de40c343cf7b242d5925e3405ee8908
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 0e749c30..0babf168 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -1,11 +1,176 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, Optional
-from typing_extensions import Literal
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
+from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = ["ScoredAudioURLInputChunk", "AudioURL"]
+__all__ = [
+ "ScoredAudioURLInputChunk",
+ "GeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "GeneratedMetadataTextChunkGeneratedMetadata",
+ "GeneratedMetadataPdfChunkGeneratedMetadata",
+ "GeneratedMetadataCodeChunkGeneratedMetadata",
+ "GeneratedMetadataAudioChunkGeneratedMetadata",
+ "AudioURL",
+]
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
+
+ heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+GeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ GeneratedMetadataMarkdownChunkGeneratedMetadata,
+ GeneratedMetadataTextChunkGeneratedMetadata,
+ GeneratedMetadataPdfChunkGeneratedMetadata,
+ GeneratedMetadataCodeChunkGeneratedMetadata,
+ GeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
class AudioURL(BaseModel):
@@ -20,7 +185,7 @@ class ScoredAudioURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[GeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index b7a925fd..c1ea6bfa 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -1,11 +1,176 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, Optional
-from typing_extensions import Literal
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
+from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = ["ScoredImageURLInputChunk", "ImageURL"]
+__all__ = [
+ "ScoredImageURLInputChunk",
+ "GeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "GeneratedMetadataTextChunkGeneratedMetadata",
+ "GeneratedMetadataPdfChunkGeneratedMetadata",
+ "GeneratedMetadataCodeChunkGeneratedMetadata",
+ "GeneratedMetadataAudioChunkGeneratedMetadata",
+ "ImageURL",
+]
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
+
+ heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+GeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ GeneratedMetadataMarkdownChunkGeneratedMetadata,
+ GeneratedMetadataTextChunkGeneratedMetadata,
+ GeneratedMetadataPdfChunkGeneratedMetadata,
+ GeneratedMetadataCodeChunkGeneratedMetadata,
+ GeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
class ImageURL(BaseModel):
@@ -23,7 +188,7 @@ class ScoredImageURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[GeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index 6a120e42..762a2a1c 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -1,11 +1,175 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, Optional
-from typing_extensions import Literal
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
+from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = ["ScoredTextInputChunk"]
+__all__ = [
+ "ScoredTextInputChunk",
+ "GeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "GeneratedMetadataTextChunkGeneratedMetadata",
+ "GeneratedMetadataPdfChunkGeneratedMetadata",
+ "GeneratedMetadataCodeChunkGeneratedMetadata",
+ "GeneratedMetadataAudioChunkGeneratedMetadata",
+]
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
+
+ heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+GeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ GeneratedMetadataMarkdownChunkGeneratedMetadata,
+ GeneratedMetadataTextChunkGeneratedMetadata,
+ GeneratedMetadataPdfChunkGeneratedMetadata,
+ GeneratedMetadataCodeChunkGeneratedMetadata,
+ GeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
class ScoredTextInputChunk(BaseModel):
@@ -15,7 +179,7 @@ class ScoredTextInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[GeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index c31cb23c..3329d671 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -1,11 +1,176 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, Optional
-from typing_extensions import Literal
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
+from .._utils import PropertyInfo
from .._models import BaseModel
-__all__ = ["ScoredVideoURLInputChunk", "VideoURL"]
+__all__ = [
+ "ScoredVideoURLInputChunk",
+ "GeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "GeneratedMetadataTextChunkGeneratedMetadata",
+ "GeneratedMetadataPdfChunkGeneratedMetadata",
+ "GeneratedMetadataCodeChunkGeneratedMetadata",
+ "GeneratedMetadataAudioChunkGeneratedMetadata",
+ "VideoURL",
+]
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = None
+
+ heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = 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 GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 GeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+GeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ GeneratedMetadataMarkdownChunkGeneratedMetadata,
+ GeneratedMetadataTextChunkGeneratedMetadata,
+ GeneratedMetadataPdfChunkGeneratedMetadata,
+ GeneratedMetadataCodeChunkGeneratedMetadata,
+ GeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
class VideoURL(BaseModel):
@@ -20,7 +185,7 @@ class ScoredVideoURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[GeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index 75d385cb..e62a6c61 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -1,9 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, List, Union, Optional
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
from ..._utils import PropertyInfo
from ..._models import BaseModel
from .store_file_status import StoreFileStatus
@@ -12,15 +14,202 @@
"StoreFile",
"Chunk",
"ChunkTextInputChunk",
+ "ChunkTextInputChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkImageURLInputChunk",
+ "ChunkImageURLInputChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkImageURLInputChunkImageURL",
"ChunkAudioURLInputChunk",
+ "ChunkAudioURLInputChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkAudioURLInputChunkAudioURL",
"ChunkVideoURLInputChunk",
+ "ChunkVideoURLInputChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkVideoURLInputChunkVideoURL",
]
+class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = (
+ None
+ )
+
+ heading_context: Optional[
+ List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkTextInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -28,7 +217,7 @@ class ChunkTextInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkTextInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -44,6 +233,161 @@ class ChunkTextInputChunk(BaseModel):
"""Text content to process"""
+class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
+ ] = None
+
+ heading_context: Optional[
+ List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkImageURLInputChunkImageURL(BaseModel):
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -59,7 +403,7 @@ class ChunkImageURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkImageURLInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -78,6 +422,161 @@ class ChunkImageURLInputChunk(BaseModel):
"""The image input specification."""
+class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
+ ] = None
+
+ heading_context: Optional[
+ List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkAudioURLInputChunkAudioURL(BaseModel):
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -90,7 +589,7 @@ class ChunkAudioURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkAudioURLInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -112,6 +611,161 @@ class ChunkAudioURLInputChunk(BaseModel):
"""The sampling rate of the audio."""
+class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
+ ] = None
+
+ heading_context: Optional[
+ List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkVideoURLInputChunkVideoURL(BaseModel):
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -124,7 +778,7 @@ class ChunkVideoURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkVideoURLInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py
index 7b2961f2..29d115f6 100644
--- a/src/mixedbread/types/vector_store_question_answering_response.py
+++ b/src/mixedbread/types/vector_store_question_answering_response.py
@@ -1,8 +1,10 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, List, Union, Optional
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
from .._utils import PropertyInfo
from .._models import BaseModel
@@ -10,15 +12,220 @@
"VectorStoreQuestionAnsweringResponse",
"Source",
"SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL",
"SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL",
"SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL",
]
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -26,7 +233,9 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -57,6 +266,179 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk
"""Text content to process"""
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -72,7 +454,9 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputC
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -106,6 +490,179 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputC
"""The image input specification."""
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -118,7 +675,9 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputC
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -155,6 +714,179 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputC
"""The sampling rate of the audio."""
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -167,7 +899,9 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputC
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py
index 3d49be57..41f4d77b 100644
--- a/src/mixedbread/types/vector_store_search_response.py
+++ b/src/mixedbread/types/vector_store_search_response.py
@@ -1,8 +1,10 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, List, Union, Optional
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
from .._utils import PropertyInfo
from .._models import BaseModel
@@ -10,15 +12,220 @@
"VectorStoreSearchResponse",
"Data",
"DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL",
"DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL",
"DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL",
]
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -26,7 +233,9 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(B
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -57,6 +266,179 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(B
"""Text content to process"""
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -72,7 +454,9 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChu
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -106,6 +490,179 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChu
"""The image input specification."""
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -118,7 +675,9 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChu
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -155,6 +714,179 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChu
"""The sampling rate of the audio."""
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -167,7 +899,9 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChu
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
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 7300999c..85e4721e 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -1,9 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, List, Union, Optional
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
from ..._utils import PropertyInfo
from ..._models import BaseModel
from ..stores.store_file_status import StoreFileStatus
@@ -12,15 +14,220 @@
"ScoredVectorStoreFile",
"Chunk",
"ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL",
"ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL",
"ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL",
]
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -28,7 +235,9 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -59,6 +268,179 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(
"""Text content to process"""
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -74,7 +456,9 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputCh
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -108,6 +492,179 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputCh
"""The image input specification."""
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -120,7 +677,9 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputCh
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -157,6 +716,179 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputCh
"""The sampling rate of the audio."""
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
+ BaseModel
+):
+ level: int
+
+ text: str
+
+
+class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
+ ]
+ ] = None
+
+ heading_context: Optional[
+ List[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
+ ]
+ ] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
+ BaseModel
+):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -169,7 +901,9 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputCh
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[
+ ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata
+ ] = None
"""metadata of the chunk"""
model: Optional[str] = None
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 9b0713fc..2fc6168d 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -1,9 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Dict, List, Union, Optional
+from typing import TYPE_CHECKING, Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, Annotated, TypeAlias
+from pydantic import Field as FieldInfo
+
from ..._utils import PropertyInfo
from ..._models import BaseModel
from ..stores.store_file_status import StoreFileStatus
@@ -12,15 +14,202 @@
"VectorStoreFile",
"Chunk",
"ChunkTextInputChunk",
+ "ChunkTextInputChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkImageURLInputChunk",
+ "ChunkImageURLInputChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkImageURLInputChunkImageURL",
"ChunkAudioURLInputChunk",
+ "ChunkAudioURLInputChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkAudioURLInputChunkAudioURL",
"ChunkVideoURLInputChunk",
+ "ChunkVideoURLInputChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
+ "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
+ "ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
"ChunkVideoURLInputChunkVideoURL",
]
+class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = (
+ None
+ )
+
+ heading_context: Optional[
+ List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkTextInputChunk(BaseModel):
chunk_index: int
"""position of the chunk in a file"""
@@ -28,7 +217,7 @@ class ChunkTextInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkTextInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -44,6 +233,161 @@ class ChunkTextInputChunk(BaseModel):
"""Text content to process"""
+class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
+ ] = None
+
+ heading_context: Optional[
+ List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkImageURLInputChunkImageURL(BaseModel):
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -59,7 +403,7 @@ class ChunkImageURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkImageURLInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -78,6 +422,161 @@ class ChunkImageURLInputChunk(BaseModel):
"""The image input specification."""
+class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
+ ] = None
+
+ heading_context: Optional[
+ List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkAudioURLInputChunkAudioURL(BaseModel):
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -90,7 +589,7 @@ class ChunkAudioURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkAudioURLInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
@@ -112,6 +611,161 @@ class ChunkAudioURLInputChunk(BaseModel):
"""The sampling rate of the audio."""
+class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
+ level: int
+
+ text: str
+
+
+class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["markdown"]] = None
+
+ file_type: Optional[Literal["text/markdown"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ chunk_headings: Optional[
+ List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
+ ] = None
+
+ heading_context: Optional[
+ List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
+ ] = 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 ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["text"]] = None
+
+ file_type: Optional[Literal["text/plain"]] = None
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["pdf"]] = None
+
+ file_type: Optional[Literal["application/pdf"]] = None
+
+ total_pages: int
+
+ total_size: int
+
+ 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 ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["code"]] = None
+
+ file_type: str
+
+ language: str
+
+ word_count: int
+
+ file_size: int
+
+ 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 ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["audio"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ sample_rate: int
+
+ channels: int
+
+ audio_format: int
+
+ 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]
+
+
+ChunkVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
+ Union[
+ ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ None,
+ ],
+ PropertyInfo(discriminator="type"),
+]
+
+
class ChunkVideoURLInputChunkVideoURL(BaseModel):
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -124,7 +778,7 @@ class ChunkVideoURLInputChunk(BaseModel):
mime_type: Optional[str] = None
"""mime type of the chunk"""
- generated_metadata: Optional[Dict[str, object]] = None
+ generated_metadata: Optional[ChunkVideoURLInputChunkGeneratedMetadata] = None
"""metadata of the chunk"""
model: Optional[str] = None
From de6b9dfc9806b601aa1e36ebf3e66e53f14d277f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 6 Oct 2025 21:28:27 +0000
Subject: [PATCH 284/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 944ffff7..50487375 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 61
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-136dd0d094bdfb186f81578f8b5cd97431d7fb5a5ee104e319df8a046d78970a.yml
-openapi_spec_hash: 294ee9fea2dbbe49681a675ae359cdd1
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-3bdc7b5f293ea927a961e6480cd3efb406c4e1a5ca21a4066f84b0d0e24b141c.yml
+openapi_spec_hash: 44d5194554a7f6b454b38c96ac6736fb
config_hash: 2de40c343cf7b242d5925e3405ee8908
From e8b97807e17bf4d71ad35f0b68dfb61b9c6a3f38 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 6 Oct 2025 22:28:16 +0000
Subject: [PATCH 285/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 50487375..944ffff7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 61
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-3bdc7b5f293ea927a961e6480cd3efb406c4e1a5ca21a4066f84b0d0e24b141c.yml
-openapi_spec_hash: 44d5194554a7f6b454b38c96ac6736fb
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-136dd0d094bdfb186f81578f8b5cd97431d7fb5a5ee104e319df8a046d78970a.yml
+openapi_spec_hash: 294ee9fea2dbbe49681a675ae359cdd1
config_hash: 2de40c343cf7b242d5925e3405ee8908
From dea4eb9a06b1965e75e0c9f57e851f89fd6ed02b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 8 Oct 2025 09:28:14 +0000
Subject: [PATCH 286/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 944ffff7..50487375 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 61
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-136dd0d094bdfb186f81578f8b5cd97431d7fb5a5ee104e319df8a046d78970a.yml
-openapi_spec_hash: 294ee9fea2dbbe49681a675ae359cdd1
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-3bdc7b5f293ea927a961e6480cd3efb406c4e1a5ca21a4066f84b0d0e24b141c.yml
+openapi_spec_hash: 44d5194554a7f6b454b38c96ac6736fb
config_hash: 2de40c343cf7b242d5925e3405ee8908
From 727f8cbbe92a0920c8b34519689fe899f6c0a6de Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 8 Oct 2025 14:08:18 +0000
Subject: [PATCH 287/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 12d488c3..57dc0c3d 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.32.1"
+ ".": "0.33.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 4fa80431..dbf2a256 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.32.1"
+version = "0.33.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 7ffd30e4..26e8ce76 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.32.1" # x-release-please-version
+__version__ = "0.33.0" # x-release-please-version
From 565c9d03784c4ff83ce1e6ddcae2894b37848464 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 8 Oct 2025 14:17:04 +0000
Subject: [PATCH 288/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/stores/files.py | 20 +++++++++++++------
.../resources/vector_stores/files.py | 20 +++++++++++++------
.../types/stores/file_create_params.py | 18 ++++++++++++++---
.../types/stores/scored_store_file.py | 14 ++++++++++++-
src/mixedbread/types/stores/store_file.py | 12 +++++++++++
.../types/vector_stores/file_create_params.py | 18 ++++++++++++++---
tests/api_resources/stores/test_files.py | 12 +++++++++--
.../api_resources/vector_stores/test_files.py | 12 +++++++++--
9 files changed, 105 insertions(+), 25 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 50487375..5148ba96 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 61
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-3bdc7b5f293ea927a961e6480cd3efb406c4e1a5ca21a4066f84b0d0e24b141c.yml
-openapi_spec_hash: 44d5194554a7f6b454b38c96ac6736fb
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-a14d1b895964291692e90504f3db6d263a4a8d9cca6f1137548ceae0fdc5d82e.yml
+openapi_spec_hash: 0608955c434731be0e392470f511e026
config_hash: 2de40c343cf7b242d5925e3405ee8908
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index 9fc14bb6..2cffa40d 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -52,8 +52,9 @@ def create(
store_identifier: str,
*,
metadata: object | Omit = omit,
- experimental: file_create_params.Experimental | Omit = omit,
+ config: file_create_params.Config | Omit = omit,
file_id: str,
+ experimental: Optional[file_create_params.Experimental] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -75,10 +76,12 @@ def create(
metadata: Optional metadata for the file
- experimental: Strategy for adding the file
+ config: Configuration for adding the file
file_id: ID of the file to add
+ experimental: Configuration for a file.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -94,8 +97,9 @@ def create(
body=maybe_transform(
{
"metadata": metadata,
- "experimental": experimental,
+ "config": config,
"file_id": file_id,
+ "experimental": experimental,
},
file_create_params.FileCreateParams,
),
@@ -366,8 +370,9 @@ async def create(
store_identifier: str,
*,
metadata: object | Omit = omit,
- experimental: file_create_params.Experimental | Omit = omit,
+ config: file_create_params.Config | Omit = omit,
file_id: str,
+ experimental: Optional[file_create_params.Experimental] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -389,10 +394,12 @@ async def create(
metadata: Optional metadata for the file
- experimental: Strategy for adding the file
+ config: Configuration for adding the file
file_id: ID of the file to add
+ experimental: Configuration for a file.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -408,8 +415,9 @@ async def create(
body=await async_maybe_transform(
{
"metadata": metadata,
- "experimental": experimental,
+ "config": config,
"file_id": file_id,
+ "experimental": experimental,
},
file_create_params.FileCreateParams,
),
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 99bfcddb..3fff5988 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -54,8 +54,9 @@ def create(
vector_store_identifier: str,
*,
metadata: object | Omit = omit,
- experimental: file_create_params.Experimental | Omit = omit,
+ config: file_create_params.Config | Omit = omit,
file_id: str,
+ experimental: Optional[file_create_params.Experimental] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -71,10 +72,12 @@ def create(
metadata: Optional metadata for the file
- experimental: Strategy for adding the file
+ config: Configuration for adding the file
file_id: ID of the file to add
+ experimental: Configuration for a file.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -92,8 +95,9 @@ def create(
body=maybe_transform(
{
"metadata": metadata,
- "experimental": experimental,
+ "config": config,
"file_id": file_id,
+ "experimental": experimental,
},
file_create_params.FileCreateParams,
),
@@ -352,8 +356,9 @@ async def create(
vector_store_identifier: str,
*,
metadata: object | Omit = omit,
- experimental: file_create_params.Experimental | Omit = omit,
+ config: file_create_params.Config | Omit = omit,
file_id: str,
+ experimental: Optional[file_create_params.Experimental] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -369,10 +374,12 @@ async def create(
metadata: Optional metadata for the file
- experimental: Strategy for adding the file
+ config: Configuration for adding the file
file_id: ID of the file to add
+ experimental: Configuration for a file.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -390,8 +397,9 @@ async def create(
body=await async_maybe_transform(
{
"metadata": metadata,
- "experimental": experimental,
+ "config": config,
"file_id": file_id,
+ "experimental": experimental,
},
file_create_params.FileCreateParams,
),
diff --git a/src/mixedbread/types/stores/file_create_params.py b/src/mixedbread/types/stores/file_create_params.py
index ce39cfd1..1cd99bf7 100644
--- a/src/mixedbread/types/stores/file_create_params.py
+++ b/src/mixedbread/types/stores/file_create_params.py
@@ -2,21 +2,33 @@
from __future__ import annotations
+from typing import Optional
from typing_extensions import Literal, Required, TypedDict
-__all__ = ["FileCreateParams", "Experimental"]
+__all__ = ["FileCreateParams", "Config", "Experimental"]
class FileCreateParams(TypedDict, total=False):
metadata: object
"""Optional metadata for the file"""
- experimental: Experimental
- """Strategy for adding the file"""
+ config: Config
+ """Configuration for adding the file"""
file_id: Required[str]
"""ID of the file to add"""
+ experimental: Optional[Experimental]
+ """Configuration for a file."""
+
+
+class Config(TypedDict, total=False):
+ parsing_strategy: Literal["fast", "high_quality"]
+ """Strategy for adding the file"""
+
+ contextualization: bool
+ """Whether to contextualize the file"""
+
class Experimental(TypedDict, total=False):
parsing_strategy: Literal["fast", "high_quality"]
diff --git a/src/mixedbread/types/stores/scored_store_file.py b/src/mixedbread/types/stores/scored_store_file.py
index 24aafbbe..ee98c03e 100644
--- a/src/mixedbread/types/stores/scored_store_file.py
+++ b/src/mixedbread/types/stores/scored_store_file.py
@@ -12,7 +12,16 @@
from ..scored_image_url_input_chunk import ScoredImageURLInputChunk
from ..scored_video_url_input_chunk import ScoredVideoURLInputChunk
-__all__ = ["ScoredStoreFile", "Chunk"]
+__all__ = ["ScoredStoreFile", "Config", "Chunk"]
+
+
+class Config(BaseModel):
+ parsing_strategy: Optional[Literal["fast", "high_quality"]] = None
+ """Strategy for adding the file"""
+
+ contextualization: Optional[bool] = None
+ """Whether to contextualize the file"""
+
Chunk: TypeAlias = Annotated[
Union[ScoredTextInputChunk, ScoredImageURLInputChunk, ScoredAudioURLInputChunk, ScoredVideoURLInputChunk],
@@ -48,6 +57,9 @@ class ScoredStoreFile(BaseModel):
usage_bytes: Optional[int] = None
"""Storage usage in bytes"""
+ config: Optional[Config] = None
+ """Configuration for a file."""
+
object: Optional[Literal["store.file"]] = None
"""Type of the object"""
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index e62a6c61..9bb6902c 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -12,6 +12,7 @@
__all__ = [
"StoreFile",
+ "Config",
"Chunk",
"ChunkTextInputChunk",
"ChunkTextInputChunkGeneratedMetadata",
@@ -55,6 +56,14 @@
]
+class Config(BaseModel):
+ parsing_strategy: Optional[Literal["fast", "high_quality"]] = None
+ """Strategy for adding the file"""
+
+ contextualization: Optional[bool] = None
+ """Whether to contextualize the file"""
+
+
class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
level: int
@@ -831,6 +840,9 @@ class StoreFile(BaseModel):
usage_bytes: Optional[int] = None
"""Storage usage in bytes"""
+ config: Optional[Config] = None
+ """Configuration for a file."""
+
object: Optional[Literal["store.file"]] = None
"""Type of the object"""
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
index ce39cfd1..1cd99bf7 100644
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -2,21 +2,33 @@
from __future__ import annotations
+from typing import Optional
from typing_extensions import Literal, Required, TypedDict
-__all__ = ["FileCreateParams", "Experimental"]
+__all__ = ["FileCreateParams", "Config", "Experimental"]
class FileCreateParams(TypedDict, total=False):
metadata: object
"""Optional metadata for the file"""
- experimental: Experimental
- """Strategy for adding the file"""
+ config: Config
+ """Configuration for adding the file"""
file_id: Required[str]
"""ID of the file to add"""
+ experimental: Optional[Experimental]
+ """Configuration for a file."""
+
+
+class Config(TypedDict, total=False):
+ parsing_strategy: Literal["fast", "high_quality"]
+ """Strategy for adding the file"""
+
+ contextualization: bool
+ """Whether to contextualize the file"""
+
class Experimental(TypedDict, total=False):
parsing_strategy: Literal["fast", "high_quality"]
diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py
index 66797c82..a42698ed 100644
--- a/tests/api_resources/stores/test_files.py
+++ b/tests/api_resources/stores/test_files.py
@@ -35,11 +35,15 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
file = client.stores.files.create(
store_identifier="store_identifier",
metadata={},
- experimental={
+ config={
"parsing_strategy": "fast",
"contextualization": True,
},
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
)
assert_matches_type(StoreFile, file, path=["response"])
@@ -380,11 +384,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.stores.files.create(
store_identifier="store_identifier",
metadata={},
- experimental={
+ config={
"parsing_strategy": "fast",
"contextualization": True,
},
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
)
assert_matches_type(StoreFile, file, path=["response"])
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 21e79500..0565e8a9 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -40,11 +40,15 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.create(
vector_store_identifier="vector_store_identifier",
metadata={},
- experimental={
+ config={
"parsing_strategy": "fast",
"contextualization": True,
},
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -425,11 +429,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.vector_stores.files.create(
vector_store_identifier="vector_store_identifier",
metadata={},
- experimental={
+ config={
"parsing_strategy": "fast",
"contextualization": True,
},
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ experimental={
+ "parsing_strategy": "fast",
+ "contextualization": True,
+ },
)
assert_matches_type(VectorStoreFile, file, path=["response"])
From 625da7a93952ab9d8e69c917587c2d3a6df13470 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 8 Oct 2025 14:22:50 +0000
Subject: [PATCH 289/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 57dc0c3d..e4e1c3ce 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.33.0"
+ ".": "0.34.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index dbf2a256..f5c946c4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.33.0"
+version = "0.34.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 26e8ce76..9e8303ed 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.33.0" # x-release-please-version
+__version__ = "0.34.0" # x-release-please-version
From 04adb5c88b541053b77018a341454eccc392c40d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 11 Oct 2025 02:39:28 +0000
Subject: [PATCH 290/375] chore(internal): detect missing future annotations
with ruff
---
pyproject.toml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyproject.toml b/pyproject.toml
index f5c946c4..facb40f7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -224,6 +224,8 @@ select = [
"B",
# remove unused imports
"F401",
+ # check for missing future annotations
+ "FA102",
# bare except statements
"E722",
# unused arguments
@@ -246,6 +248,8 @@ unfixable = [
"T203",
]
+extend-safe-fixes = ["FA102"]
+
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
From 2c26b1e543e96cd631e58fe5441838670e5b8fa6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 15 Oct 2025 01:28:32 +0000
Subject: [PATCH 291/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/api_keys.py | 10 +++++++++-
src/mixedbread/types/api_key.py | 15 +++++++++++++--
src/mixedbread/types/api_key_create_params.py | 17 ++++++++++++++---
src/mixedbread/types/api_key_created.py | 15 +++++++++++++--
tests/api_resources/test_api_keys.py | 14 ++++++++++++++
6 files changed, 65 insertions(+), 10 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 5148ba96..6e5f2e83 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 61
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-a14d1b895964291692e90504f3db6d263a4a8d9cca6f1137548ceae0fdc5d82e.yml
-openapi_spec_hash: 0608955c434731be0e392470f511e026
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e5518f2225715b2adad67d59871ad9ee827460252fc576b9552e4eaaa940b8be.yml
+openapi_spec_hash: c59193ecc594d6b1a54ed97a0f7d87a4
config_hash: 2de40c343cf7b242d5925e3405ee8908
diff --git a/src/mixedbread/resources/api_keys.py b/src/mixedbread/resources/api_keys.py
index f304929e..66408456 100644
--- a/src/mixedbread/resources/api_keys.py
+++ b/src/mixedbread/resources/api_keys.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import Union
+from typing import Union, Iterable, Optional
from datetime import datetime
import httpx
@@ -51,6 +51,7 @@ def create(
self,
*,
name: str | Omit = omit,
+ scope: Optional[Iterable[api_key_create_params.Scope]] | Omit = omit,
expires_at: Union[str, datetime, None] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -70,6 +71,8 @@ def create(
Args:
name: A name/description for the API key
+ scope: The scope of the API key
+
expires_at: Optional expiration datetime
extra_headers: Send extra headers
@@ -85,6 +88,7 @@ def create(
body=maybe_transform(
{
"name": name,
+ "scope": scope,
"expires_at": expires_at,
},
api_key_create_params.APIKeyCreateParams,
@@ -331,6 +335,7 @@ async def create(
self,
*,
name: str | Omit = omit,
+ scope: Optional[Iterable[api_key_create_params.Scope]] | Omit = omit,
expires_at: Union[str, datetime, None] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -350,6 +355,8 @@ async def create(
Args:
name: A name/description for the API key
+ scope: The scope of the API key
+
expires_at: Optional expiration datetime
extra_headers: Send extra headers
@@ -365,6 +372,7 @@ async def create(
body=await async_maybe_transform(
{
"name": name,
+ "scope": scope,
"expires_at": expires_at,
},
api_key_create_params.APIKeyCreateParams,
diff --git a/src/mixedbread/types/api_key.py b/src/mixedbread/types/api_key.py
index 15e7cbc2..87a23797 100644
--- a/src/mixedbread/types/api_key.py
+++ b/src/mixedbread/types/api_key.py
@@ -1,12 +1,20 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
+from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal
from .._models import BaseModel
-__all__ = ["APIKey"]
+__all__ = ["APIKey", "Scope"]
+
+
+class Scope(BaseModel):
+ method: Literal["read", "write", "delete", "list", "create"]
+
+ resource_type: Optional[Literal["store"]] = None
+
+ resource_id: Optional[str] = None
class APIKey(BaseModel):
@@ -33,3 +41,6 @@ class APIKey(BaseModel):
object: Optional[Literal["api_key"]] = None
"""The type of the object"""
+
+ scope: Optional[List[Scope]] = None
+ """The scope of the API key"""
diff --git a/src/mixedbread/types/api_key_create_params.py b/src/mixedbread/types/api_key_create_params.py
index 074ae0e0..a7687543 100644
--- a/src/mixedbread/types/api_key_create_params.py
+++ b/src/mixedbread/types/api_key_create_params.py
@@ -2,18 +2,29 @@
from __future__ import annotations
-from typing import Union
+from typing import Union, Iterable, Optional
from datetime import datetime
-from typing_extensions import Annotated, TypedDict
+from typing_extensions import Literal, Required, Annotated, TypedDict
from .._utils import PropertyInfo
-__all__ = ["APIKeyCreateParams"]
+__all__ = ["APIKeyCreateParams", "Scope"]
class APIKeyCreateParams(TypedDict, total=False):
name: str
"""A name/description for the API key"""
+ scope: Optional[Iterable[Scope]]
+ """The scope of the API key"""
+
expires_at: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
"""Optional expiration datetime"""
+
+
+class Scope(TypedDict, total=False):
+ method: Required[Literal["read", "write", "delete", "list", "create"]]
+
+ resource_type: Optional[Literal["store"]]
+
+ resource_id: Optional[str]
diff --git a/src/mixedbread/types/api_key_created.py b/src/mixedbread/types/api_key_created.py
index 052910e8..08f16806 100644
--- a/src/mixedbread/types/api_key_created.py
+++ b/src/mixedbread/types/api_key_created.py
@@ -1,12 +1,20 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
+from typing import List, Optional
from datetime import datetime
from typing_extensions import Literal
from .._models import BaseModel
-__all__ = ["APIKeyCreated"]
+__all__ = ["APIKeyCreated", "Scope"]
+
+
+class Scope(BaseModel):
+ method: Literal["read", "write", "delete", "list", "create"]
+
+ resource_type: Optional[Literal["store"]] = None
+
+ resource_id: Optional[str] = None
class APIKeyCreated(BaseModel):
@@ -34,5 +42,8 @@ class APIKeyCreated(BaseModel):
object: Optional[Literal["api_key"]] = None
"""The type of the object"""
+ scope: Optional[List[Scope]] = None
+ """The scope of the API key"""
+
value: str
"""The value of the API key"""
diff --git a/tests/api_resources/test_api_keys.py b/tests/api_resources/test_api_keys.py
index 7da5d8aa..aa8310ee 100644
--- a/tests/api_resources/test_api_keys.py
+++ b/tests/api_resources/test_api_keys.py
@@ -28,6 +28,13 @@ def test_method_create(self, client: Mixedbread) -> None:
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
api_key = client.api_keys.create(
name="name",
+ scope=[
+ {
+ "method": "read",
+ "resource_type": "store",
+ "resource_id": "resource_id",
+ }
+ ],
expires_at=parse_datetime("2019-12-27T18:11:19.117Z"),
)
assert_matches_type(APIKeyCreated, api_key, path=["response"])
@@ -252,6 +259,13 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
api_key = await async_client.api_keys.create(
name="name",
+ scope=[
+ {
+ "method": "read",
+ "resource_type": "store",
+ "resource_id": "resource_id",
+ }
+ ],
expires_at=parse_datetime("2019-12-27T18:11:19.117Z"),
)
assert_matches_type(APIKeyCreated, api_key, path=["response"])
From bed8c3b03768a67d51ce3347430e49ba5c57bfb0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 18 Oct 2025 02:24:06 +0000
Subject: [PATCH 292/375] chore: bump `httpx-aiohttp` version to 0.1.9
---
pyproject.toml | 2 +-
requirements-dev.lock | 2 +-
requirements.lock | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index facb40f7..7c316a04 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -39,7 +39,7 @@ Homepage = "https://github.com/mixedbread-ai/mixedbread-python"
Repository = "https://github.com/mixedbread-ai/mixedbread-python"
[project.optional-dependencies]
-aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
+aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
[tool.rye]
managed = true
diff --git a/requirements-dev.lock b/requirements-dev.lock
index f24d36ed..3813c2e4 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -56,7 +56,7 @@ httpx==0.28.1
# via httpx-aiohttp
# via mixedbread
# via respx
-httpx-aiohttp==0.1.8
+httpx-aiohttp==0.1.9
# via mixedbread
idna==3.4
# via anyio
diff --git a/requirements.lock b/requirements.lock
index 57e00706..8d80628d 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -43,7 +43,7 @@ httpcore==1.0.9
httpx==0.28.1
# via httpx-aiohttp
# via mixedbread
-httpx-aiohttp==0.1.8
+httpx-aiohttp==0.1.9
# via mixedbread
idna==3.4
# via anyio
From d861a1cd761a77a77e47399524a745c58c29ee01 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 02:54:34 +0000
Subject: [PATCH 293/375] fix(client): close streams without requiring full
consumption
---
src/mixedbread/_streaming.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/mixedbread/_streaming.py b/src/mixedbread/_streaming.py
index e5834ace..ffe39031 100644
--- a/src/mixedbread/_streaming.py
+++ b/src/mixedbread/_streaming.py
@@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]:
for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
- # Ensure the entire stream is consumed
- for _sse in iterator:
- ...
+ # As we might not fully consume the response stream, we need to close it explicitly
+ response.close()
def __enter__(self) -> Self:
return self
@@ -121,9 +120,8 @@ async def __stream__(self) -> AsyncIterator[_T]:
async for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
- # Ensure the entire stream is consumed
- async for _sse in iterator:
- ...
+ # As we might not fully consume the response stream, we need to close it explicitly
+ await response.aclose()
async def __aenter__(self) -> Self:
return self
From 0f3abb18c1b9c67700550c4376bf59dc4c1d05b7 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 06:28:56 +0000
Subject: [PATCH 294/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 6e5f2e83..d8c421cd 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 61
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e5518f2225715b2adad67d59871ad9ee827460252fc576b9552e4eaaa940b8be.yml
-openapi_spec_hash: c59193ecc594d6b1a54ed97a0f7d87a4
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-d4c4a6e0d99b371dc5e84a63cf447770fc684d6a0650b2e36013404245a5876b.yml
+openapi_spec_hash: 9d377ce6164438d3207d8a50c954a9cd
config_hash: 2de40c343cf7b242d5925e3405ee8908
From ecbad61638ec0ef482a49500f58b91948d1647b8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 07:17:48 +0000
Subject: [PATCH 295/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index e4e1c3ce..ce5e5c7c 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.34.0"
+ ".": "0.35.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 7c316a04..cc1d73b6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.34.0"
+version = "0.35.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 9e8303ed..372ffb33 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.34.0" # x-release-please-version
+__version__ = "0.35.0" # x-release-please-version
From c2b346fc3ff3fcc0ff4517d23477de85e762d10b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 07:20:20 +0000
Subject: [PATCH 296/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 2 +
src/mixedbread/resources/stores/stores.py | 110 ++++++++++++
src/mixedbread/types/__init__.py | 2 +
.../types/store_metadata_facets_params.py | 26 +++
.../types/store_metadata_facets_response.py | 12 ++
tests/api_resources/test_stores.py | 169 ++++++++++++++++++
7 files changed, 323 insertions(+), 2 deletions(-)
create mode 100644 src/mixedbread/types/store_metadata_facets_params.py
create mode 100644 src/mixedbread/types/store_metadata_facets_response.py
diff --git a/.stats.yml b/.stats.yml
index d8c421cd..2373becf 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 61
+configured_endpoints: 62
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-d4c4a6e0d99b371dc5e84a63cf447770fc684d6a0650b2e36013404245a5876b.yml
openapi_spec_hash: 9d377ce6164438d3207d8a50c954a9cd
-config_hash: 2de40c343cf7b242d5925e3405ee8908
+config_hash: 1f4b314dbc7ae3afe6d669e36217b842
diff --git a/api.md b/api.md
index ba725e0b..664fa3c1 100644
--- a/api.md
+++ b/api.md
@@ -86,6 +86,7 @@ from mixedbread.types import (
Store,
StoreChunkSearchOptions,
StoreDeleteResponse,
+ StoreMetadataFacetsResponse,
StoreQuestionAnsweringResponse,
StoreSearchResponse,
)
@@ -98,6 +99,7 @@ Methods:
- client.stores.update(store_identifier, \*\*params) -> Store
- client.stores.list(\*\*params) -> SyncCursor[Store]
- client.stores.delete(store_identifier) -> StoreDeleteResponse
+- client.stores.metadata_facets(store_identifier, \*\*params) -> StoreMetadataFacetsResponse
- client.stores.question_answering(\*\*params) -> StoreQuestionAnsweringResponse
- client.stores.search(\*\*params) -> StoreSearchResponse
diff --git a/src/mixedbread/resources/stores/stores.py b/src/mixedbread/resources/stores/stores.py
index a2128963..f5f00bc5 100644
--- a/src/mixedbread/resources/stores/stores.py
+++ b/src/mixedbread/resources/stores/stores.py
@@ -19,6 +19,7 @@
store_create_params,
store_search_params,
store_update_params,
+ store_metadata_facets_params,
store_question_answering_params,
)
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
@@ -37,6 +38,7 @@
from ...types.expires_after_param import ExpiresAfterParam
from ...types.store_delete_response import StoreDeleteResponse
from ...types.store_search_response import StoreSearchResponse
+from ...types.store_metadata_facets_response import StoreMetadataFacetsResponse
from ...types.store_chunk_search_options_param import StoreChunkSearchOptionsParam
from ...types.store_question_answering_response import StoreQuestionAnsweringResponse
@@ -341,6 +343,54 @@ def delete(
cast_to=StoreDeleteResponse,
)
+ def metadata_facets(
+ self,
+ store_identifier: str,
+ *,
+ filters: Optional[store_metadata_facets_params.Filters] | Omit = omit,
+ facets: Optional[SequenceNotStr[str]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreMetadataFacetsResponse:
+ """
+ Get metadata facets
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ filters: Optional filter conditions
+
+ facets: Optional list of facets to return. Use dot for nested fields.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return self._post(
+ f"/v1/stores/{store_identifier}/metadata-facets",
+ body=maybe_transform(
+ {
+ "filters": filters,
+ "facets": facets,
+ },
+ store_metadata_facets_params.StoreMetadataFacetsParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreMetadataFacetsResponse,
+ )
+
def question_answering(
self,
*,
@@ -784,6 +834,54 @@ async def delete(
cast_to=StoreDeleteResponse,
)
+ async def metadata_facets(
+ self,
+ store_identifier: str,
+ *,
+ filters: Optional[store_metadata_facets_params.Filters] | Omit = omit,
+ facets: Optional[SequenceNotStr[str]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreMetadataFacetsResponse:
+ """
+ Get metadata facets
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ filters: Optional filter conditions
+
+ facets: Optional list of facets to return. Use dot for nested fields.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ return await self._post(
+ f"/v1/stores/{store_identifier}/metadata-facets",
+ body=await async_maybe_transform(
+ {
+ "filters": filters,
+ "facets": facets,
+ },
+ store_metadata_facets_params.StoreMetadataFacetsParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreMetadataFacetsResponse,
+ )
+
async def question_answering(
self,
*,
@@ -948,6 +1046,9 @@ def __init__(self, stores: StoresResource) -> None:
self.delete = to_raw_response_wrapper(
stores.delete,
)
+ self.metadata_facets = to_raw_response_wrapper(
+ stores.metadata_facets,
+ )
self.question_answering = to_raw_response_wrapper(
stores.question_answering,
)
@@ -979,6 +1080,9 @@ def __init__(self, stores: AsyncStoresResource) -> None:
self.delete = async_to_raw_response_wrapper(
stores.delete,
)
+ self.metadata_facets = async_to_raw_response_wrapper(
+ stores.metadata_facets,
+ )
self.question_answering = async_to_raw_response_wrapper(
stores.question_answering,
)
@@ -1010,6 +1114,9 @@ def __init__(self, stores: StoresResource) -> None:
self.delete = to_streamed_response_wrapper(
stores.delete,
)
+ self.metadata_facets = to_streamed_response_wrapper(
+ stores.metadata_facets,
+ )
self.question_answering = to_streamed_response_wrapper(
stores.question_answering,
)
@@ -1041,6 +1148,9 @@ def __init__(self, stores: AsyncStoresResource) -> None:
self.delete = async_to_streamed_response_wrapper(
stores.delete,
)
+ self.metadata_facets = async_to_streamed_response_wrapper(
+ stores.metadata_facets,
+ )
self.question_answering = async_to_streamed_response_wrapper(
stores.question_answering,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 3ec3253b..20bcd899 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -53,8 +53,10 @@
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 .store_metadata_facets_params import StoreMetadataFacetsParams as StoreMetadataFacetsParams
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
+from .store_metadata_facets_response import StoreMetadataFacetsResponse as StoreMetadataFacetsResponse
from .store_question_answering_params import StoreQuestionAnsweringParams as StoreQuestionAnsweringParams
from .store_chunk_search_options_param import StoreChunkSearchOptionsParam as StoreChunkSearchOptionsParam
from .store_question_answering_response import StoreQuestionAnsweringResponse as StoreQuestionAnsweringResponse
diff --git a/src/mixedbread/types/store_metadata_facets_params.py b/src/mixedbread/types/store_metadata_facets_params.py
new file mode 100644
index 00000000..e1b87603
--- /dev/null
+++ b/src/mixedbread/types/store_metadata_facets_params.py
@@ -0,0 +1,26 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Iterable, Optional
+from typing_extensions import TypeAlias, TypedDict
+
+from .._types import SequenceNotStr
+from .shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["StoreMetadataFacetsParams", "Filters", "FiltersUnionMember2"]
+
+
+class StoreMetadataFacetsParams(TypedDict, total=False):
+ filters: Optional[Filters]
+ """Optional filter conditions"""
+
+ facets: Optional[SequenceNotStr[str]]
+ """Optional list of facets to return. Use dot for nested fields."""
+
+
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+
+from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/store_metadata_facets_response.py b/src/mixedbread/types/store_metadata_facets_response.py
new file mode 100644
index 00000000..989562c4
--- /dev/null
+++ b/src/mixedbread/types/store_metadata_facets_response.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict
+
+from .._models import BaseModel
+
+__all__ = ["StoreMetadataFacetsResponse"]
+
+
+class StoreMetadataFacetsResponse(BaseModel):
+ facets: Dict[str, Dict[str, object]]
+ """Metadata facets"""
diff --git a/tests/api_resources/test_stores.py b/tests/api_resources/test_stores.py
index 180773e7..895c5494 100644
--- a/tests/api_resources/test_stores.py
+++ b/tests/api_resources/test_stores.py
@@ -13,6 +13,7 @@
Store,
StoreDeleteResponse,
StoreSearchResponse,
+ StoreMetadataFacetsResponse,
StoreQuestionAnsweringResponse,
)
from mixedbread.pagination import SyncCursor, AsyncCursor
@@ -228,6 +229,90 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
"",
)
+ @parametrize
+ def test_method_metadata_facets(self, client: Mixedbread) -> None:
+ store = client.stores.metadata_facets(
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ def test_method_metadata_facets_with_all_params(self, client: Mixedbread) -> None:
+ store = client.stores.metadata_facets(
+ store_identifier="store_identifier",
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ facets=["string"],
+ )
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ def test_raw_response_metadata_facets(self, client: Mixedbread) -> None:
+ response = client.stores.with_raw_response.metadata_facets(
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = response.parse()
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_metadata_facets(self, client: Mixedbread) -> None:
+ with client.stores.with_streaming_response.metadata_facets(
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = response.parse()
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_metadata_facets(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.with_raw_response.metadata_facets(
+ store_identifier="",
+ )
+
@parametrize
def test_method_question_answering(self, client: Mixedbread) -> None:
store = client.stores.question_answering(
@@ -619,6 +704,90 @@ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
"",
)
+ @parametrize
+ async def test_method_metadata_facets(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.metadata_facets(
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ async def test_method_metadata_facets_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.metadata_facets(
+ store_identifier="store_identifier",
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ facets=["string"],
+ )
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_metadata_facets(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.with_raw_response.metadata_facets(
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = await response.parse()
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_metadata_facets(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.with_streaming_response.metadata_facets(
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = await response.parse()
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_metadata_facets(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.with_raw_response.metadata_facets(
+ store_identifier="",
+ )
+
@parametrize
async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
store = await async_client.stores.question_answering(
From 4fee14b38566ff85701b57209ca03e7756682638 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 07:29:13 +0000
Subject: [PATCH 297/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index ce5e5c7c..157f0355 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.35.0"
+ ".": "0.36.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index cc1d73b6..aee7303a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.35.0"
+version = "0.36.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 372ffb33..90e190d2 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.35.0" # x-release-please-version
+__version__ = "0.36.0" # x-release-please-version
From 88fee3d6f5d14220725115a8cf5ea57092692742 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 30 Oct 2025 18:28:56 +0000
Subject: [PATCH 298/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 2373becf..4282a055 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-d4c4a6e0d99b371dc5e84a63cf447770fc684d6a0650b2e36013404245a5876b.yml
-openapi_spec_hash: 9d377ce6164438d3207d8a50c954a9cd
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-fd92f46929d60af07c2abfd39a9850b71e4ba2ebfd67627f6ebec99e48dee5db.yml
+openapi_spec_hash: 450000939194685c6b33fec0dee1ce30
config_hash: 1f4b314dbc7ae3afe6d669e36217b842
From 1c250d484c081810a57383ab261bfdf8bcf3891b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 31 Oct 2025 04:12:28 +0000
Subject: [PATCH 299/375] chore(internal/tests): avoid race condition with
implicit client cleanup
---
tests/test_client.py | 368 ++++++++++++++++++++++++-------------------
1 file changed, 204 insertions(+), 164 deletions(-)
diff --git a/tests/test_client.py b/tests/test_client.py
index ef2e38b3..831e0224 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -59,51 +59,49 @@ def _get_open_connections(client: Mixedbread | AsyncMixedbread) -> int:
class TestMixedbread:
- client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
-
@pytest.mark.respx(base_url=base_url)
- def test_raw_response(self, respx_mock: MockRouter) -> None:
+ def test_raw_response(self, respx_mock: MockRouter, client: Mixedbread) -> None:
respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"}))
- response = self.client.post("/foo", cast_to=httpx.Response)
+ response = client.post("/foo", cast_to=httpx.Response)
assert response.status_code == 200
assert isinstance(response, httpx.Response)
assert response.json() == {"foo": "bar"}
@pytest.mark.respx(base_url=base_url)
- def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None:
+ def test_raw_response_for_binary(self, respx_mock: MockRouter, client: Mixedbread) -> None:
respx_mock.post("/foo").mock(
return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}')
)
- response = self.client.post("/foo", cast_to=httpx.Response)
+ response = client.post("/foo", cast_to=httpx.Response)
assert response.status_code == 200
assert isinstance(response, httpx.Response)
assert response.json() == {"foo": "bar"}
- def test_copy(self) -> None:
- copied = self.client.copy()
- assert id(copied) != id(self.client)
+ def test_copy(self, client: Mixedbread) -> None:
+ copied = client.copy()
+ assert id(copied) != id(client)
- copied = self.client.copy(api_key="another My API Key")
+ copied = client.copy(api_key="another My API Key")
assert copied.api_key == "another My API Key"
- assert self.client.api_key == "My API Key"
+ assert client.api_key == "My API Key"
- def test_copy_default_options(self) -> None:
+ def test_copy_default_options(self, client: Mixedbread) -> None:
# options that have a default are overridden correctly
- copied = self.client.copy(max_retries=7)
+ copied = client.copy(max_retries=7)
assert copied.max_retries == 7
- assert self.client.max_retries == 2
+ assert client.max_retries == 2
copied2 = copied.copy(max_retries=6)
assert copied2.max_retries == 6
assert copied.max_retries == 7
# timeout
- assert isinstance(self.client.timeout, httpx.Timeout)
- copied = self.client.copy(timeout=None)
+ assert isinstance(client.timeout, httpx.Timeout)
+ copied = client.copy(timeout=None)
assert copied.timeout is None
- assert isinstance(self.client.timeout, httpx.Timeout)
+ assert isinstance(client.timeout, httpx.Timeout)
def test_copy_default_headers(self) -> None:
client = Mixedbread(
@@ -138,6 +136,7 @@ def test_copy_default_headers(self) -> None:
match="`default_headers` and `set_default_headers` arguments are mutually exclusive",
):
client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"})
+ client.close()
def test_copy_default_query(self) -> None:
client = Mixedbread(
@@ -175,13 +174,15 @@ def test_copy_default_query(self) -> None:
):
client.copy(set_default_query={}, default_query={"foo": "Bar"})
- def test_copy_signature(self) -> None:
+ client.close()
+
+ def test_copy_signature(self, client: Mixedbread) -> None:
# ensure the same parameters that can be passed to the client are defined in the `.copy()` method
init_signature = inspect.signature(
# mypy doesn't like that we access the `__init__` property.
- self.client.__init__, # type: ignore[misc]
+ client.__init__, # type: ignore[misc]
)
- copy_signature = inspect.signature(self.client.copy)
+ copy_signature = inspect.signature(client.copy)
exclude_params = {"transport", "proxies", "_strict_response_validation"}
for name in init_signature.parameters.keys():
@@ -192,12 +193,12 @@ def test_copy_signature(self) -> None:
assert copy_param is not None, f"copy() signature is missing the {name} param"
@pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12")
- def test_copy_build_request(self) -> None:
+ def test_copy_build_request(self, client: Mixedbread) -> None:
options = FinalRequestOptions(method="get", url="/foo")
def build_request(options: FinalRequestOptions) -> None:
- client = self.client.copy()
- client._build_request(options)
+ client_copy = client.copy()
+ client_copy._build_request(options)
# ensure that the machinery is warmed up before tracing starts.
build_request(options)
@@ -254,14 +255,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic
print(frame)
raise AssertionError()
- def test_request_timeout(self) -> None:
- request = self.client._build_request(FinalRequestOptions(method="get", url="/foo"))
+ def test_request_timeout(self, client: Mixedbread) -> None:
+ request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == DEFAULT_TIMEOUT
- request = self.client._build_request(
- FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0))
- )
+ request = client._build_request(FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == httpx.Timeout(100.0)
@@ -274,6 +273,8 @@ def test_client_timeout_option(self) -> None:
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == httpx.Timeout(0)
+ client.close()
+
def test_http_client_timeout_option(self) -> None:
# custom timeout given to the httpx client should be used
with httpx.Client(timeout=None) as http_client:
@@ -285,6 +286,8 @@ def test_http_client_timeout_option(self) -> None:
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == httpx.Timeout(None)
+ client.close()
+
# no timeout given to the httpx client should not use the httpx default
with httpx.Client() as http_client:
client = Mixedbread(
@@ -295,6 +298,8 @@ def test_http_client_timeout_option(self) -> None:
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == DEFAULT_TIMEOUT
+ client.close()
+
# explicitly passing the default timeout currently results in it being ignored
with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client:
client = Mixedbread(
@@ -305,6 +310,8 @@ def test_http_client_timeout_option(self) -> None:
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == DEFAULT_TIMEOUT # our default
+ client.close()
+
async def test_invalid_http_client(self) -> None:
with pytest.raises(TypeError, match="Invalid `http_client` arg"):
async with httpx.AsyncClient() as http_client:
@@ -316,14 +323,14 @@ async def test_invalid_http_client(self) -> None:
)
def test_default_headers_option(self) -> None:
- client = Mixedbread(
+ test_client = Mixedbread(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"}
)
- request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
+ request = test_client._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "bar"
assert request.headers.get("x-stainless-lang") == "python"
- client2 = Mixedbread(
+ test_client2 = Mixedbread(
base_url=base_url,
api_key=api_key,
_strict_response_validation=True,
@@ -332,10 +339,13 @@ def test_default_headers_option(self) -> None:
"X-Stainless-Lang": "my-overriding-header",
},
)
- request = client2._build_request(FinalRequestOptions(method="get", url="/foo"))
+ request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "stainless"
assert request.headers.get("x-stainless-lang") == "my-overriding-header"
+ test_client.close()
+ test_client2.close()
+
def test_validate_headers(self) -> None:
client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
@@ -364,8 +374,10 @@ def test_default_query_option(self) -> None:
url = httpx.URL(request.url)
assert dict(url.params) == {"foo": "baz", "query_param": "overridden"}
- def test_request_extra_json(self) -> None:
- request = self.client._build_request(
+ client.close()
+
+ def test_request_extra_json(self, client: Mixedbread) -> None:
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -376,7 +388,7 @@ def test_request_extra_json(self) -> None:
data = json.loads(request.content.decode("utf-8"))
assert data == {"foo": "bar", "baz": False}
- request = self.client._build_request(
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -387,7 +399,7 @@ def test_request_extra_json(self) -> None:
assert data == {"baz": False}
# `extra_json` takes priority over `json_data` when keys clash
- request = self.client._build_request(
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -398,8 +410,8 @@ def test_request_extra_json(self) -> None:
data = json.loads(request.content.decode("utf-8"))
assert data == {"foo": "bar", "baz": None}
- def test_request_extra_headers(self) -> None:
- request = self.client._build_request(
+ def test_request_extra_headers(self, client: Mixedbread) -> None:
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -409,7 +421,7 @@ def test_request_extra_headers(self) -> None:
assert request.headers.get("X-Foo") == "Foo"
# `extra_headers` takes priority over `default_headers` when keys clash
- request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request(
+ request = client.with_options(default_headers={"X-Bar": "true"})._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -420,8 +432,8 @@ def test_request_extra_headers(self) -> None:
)
assert request.headers.get("X-Bar") == "false"
- def test_request_extra_query(self) -> None:
- request = self.client._build_request(
+ def test_request_extra_query(self, client: Mixedbread) -> None:
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -434,7 +446,7 @@ def test_request_extra_query(self) -> None:
assert params == {"my_query_param": "Foo"}
# if both `query` and `extra_query` are given, they are merged
- request = self.client._build_request(
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -448,7 +460,7 @@ def test_request_extra_query(self) -> None:
assert params == {"bar": "1", "foo": "2"}
# `extra_query` takes priority over `query` when keys clash
- request = self.client._build_request(
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -491,7 +503,7 @@ def test_multipart_repeating_array(self, client: Mixedbread) -> None:
]
@pytest.mark.respx(base_url=base_url)
- def test_basic_union_response(self, respx_mock: MockRouter) -> None:
+ def test_basic_union_response(self, respx_mock: MockRouter, client: Mixedbread) -> None:
class Model1(BaseModel):
name: str
@@ -500,12 +512,12 @@ class Model2(BaseModel):
respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"}))
- response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
+ response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
assert isinstance(response, Model2)
assert response.foo == "bar"
@pytest.mark.respx(base_url=base_url)
- def test_union_response_different_types(self, respx_mock: MockRouter) -> None:
+ def test_union_response_different_types(self, respx_mock: MockRouter, client: Mixedbread) -> None:
"""Union of objects with the same field name using a different type"""
class Model1(BaseModel):
@@ -516,18 +528,18 @@ class Model2(BaseModel):
respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"}))
- response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
+ response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
assert isinstance(response, Model2)
assert response.foo == "bar"
respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1}))
- response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
+ response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
assert isinstance(response, Model1)
assert response.foo == 1
@pytest.mark.respx(base_url=base_url)
- def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None:
+ def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter, client: Mixedbread) -> None:
"""
Response that sets Content-Type to something other than application/json but returns json data
"""
@@ -543,7 +555,7 @@ class Model(BaseModel):
)
)
- response = self.client.get("/foo", cast_to=Model)
+ response = client.get("/foo", cast_to=Model)
assert isinstance(response, Model)
assert response.foo == 2
@@ -555,6 +567,8 @@ def test_base_url_setter(self) -> None:
assert client.base_url == "https://example.com/from_setter/"
+ client.close()
+
def test_base_url_env(self) -> None:
with update_env(MIXEDBREAD_BASE_URL="http://localhost:5000/from/env"):
client = Mixedbread(api_key=api_key, _strict_response_validation=True)
@@ -570,6 +584,8 @@ def test_base_url_env(self) -> None:
)
assert str(client.base_url).startswith("https://api.mixedbread.com")
+ client.close()
+
@pytest.mark.parametrize(
"client",
[
@@ -594,6 +610,7 @@ def test_base_url_trailing_slash(self, client: Mixedbread) -> None:
),
)
assert request.url == "http://localhost:5000/custom/path/foo"
+ client.close()
@pytest.mark.parametrize(
"client",
@@ -619,6 +636,7 @@ def test_base_url_no_trailing_slash(self, client: Mixedbread) -> None:
),
)
assert request.url == "http://localhost:5000/custom/path/foo"
+ client.close()
@pytest.mark.parametrize(
"client",
@@ -644,35 +662,36 @@ def test_absolute_request_url(self, client: Mixedbread) -> None:
),
)
assert request.url == "https://myapi.com/foo"
+ client.close()
def test_copied_client_does_not_close_http(self) -> None:
- client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
- assert not client.is_closed()
+ test_client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ assert not test_client.is_closed()
- copied = client.copy()
- assert copied is not client
+ copied = test_client.copy()
+ assert copied is not test_client
del copied
- assert not client.is_closed()
+ assert not test_client.is_closed()
def test_client_context_manager(self) -> None:
- client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
- with client as c2:
- assert c2 is client
+ test_client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ with test_client as c2:
+ assert c2 is test_client
assert not c2.is_closed()
- assert not client.is_closed()
- assert client.is_closed()
+ assert not test_client.is_closed()
+ assert test_client.is_closed()
@pytest.mark.respx(base_url=base_url)
- def test_client_response_validation_error(self, respx_mock: MockRouter) -> None:
+ def test_client_response_validation_error(self, respx_mock: MockRouter, client: Mixedbread) -> None:
class Model(BaseModel):
foo: str
respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}}))
with pytest.raises(APIResponseValidationError) as exc:
- self.client.get("/foo", cast_to=Model)
+ client.get("/foo", cast_to=Model)
assert isinstance(exc.value.__cause__, ValidationError)
@@ -694,11 +713,14 @@ class Model(BaseModel):
with pytest.raises(APIResponseValidationError):
strict_client.get("/foo", cast_to=Model)
- client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=False)
+ non_strict_client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=False)
- response = client.get("/foo", cast_to=Model)
+ response = non_strict_client.get("/foo", cast_to=Model)
assert isinstance(response, str) # type: ignore[unreachable]
+ strict_client.close()
+ non_strict_client.close()
+
@pytest.mark.parametrize(
"remaining_retries,retry_after,timeout",
[
@@ -721,9 +743,9 @@ class Model(BaseModel):
],
)
@mock.patch("time.time", mock.MagicMock(return_value=1696004797))
- def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None:
- client = Mixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
-
+ def test_parse_retry_after_header(
+ self, remaining_retries: int, retry_after: str, timeout: float, client: Mixedbread
+ ) -> None:
headers = httpx.Headers({"retry-after": retry_after})
options = FinalRequestOptions(method="get", url="/foo", max_retries=3)
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
@@ -737,7 +759,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien
with pytest.raises(APITimeoutError):
client.stores.with_streaming_response.create().__enter__()
- assert _get_open_connections(self.client) == 0
+ assert _get_open_connections(client) == 0
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@@ -746,7 +768,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client
with pytest.raises(APIStatusError):
client.stores.with_streaming_response.create().__enter__()
- assert _get_open_connections(self.client) == 0
+ assert _get_open_connections(client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@@ -848,83 +870,77 @@ def test_default_client_creation(self) -> None:
)
@pytest.mark.respx(base_url=base_url)
- def test_follow_redirects(self, respx_mock: MockRouter) -> None:
+ def test_follow_redirects(self, respx_mock: MockRouter, client: Mixedbread) -> None:
# Test that the default follow_redirects=True allows following redirects
respx_mock.post("/redirect").mock(
return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
)
respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
- response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
+ response = client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
assert response.status_code == 200
assert response.json() == {"status": "ok"}
@pytest.mark.respx(base_url=base_url)
- def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
+ def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: Mixedbread) -> None:
# Test that follow_redirects=False prevents following redirects
respx_mock.post("/redirect").mock(
return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
)
with pytest.raises(APIStatusError) as exc_info:
- self.client.post(
- "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
- )
+ client.post("/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response)
assert exc_info.value.response.status_code == 302
assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
class TestAsyncMixedbread:
- client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
-
@pytest.mark.respx(base_url=base_url)
- @pytest.mark.asyncio
- async def test_raw_response(self, respx_mock: MockRouter) -> None:
+ async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncMixedbread) -> None:
respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"}))
- response = await self.client.post("/foo", cast_to=httpx.Response)
+ response = await async_client.post("/foo", cast_to=httpx.Response)
assert response.status_code == 200
assert isinstance(response, httpx.Response)
assert response.json() == {"foo": "bar"}
@pytest.mark.respx(base_url=base_url)
- @pytest.mark.asyncio
- async def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None:
+ async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncMixedbread) -> None:
respx_mock.post("/foo").mock(
return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}')
)
- response = await self.client.post("/foo", cast_to=httpx.Response)
+ response = await async_client.post("/foo", cast_to=httpx.Response)
assert response.status_code == 200
assert isinstance(response, httpx.Response)
assert response.json() == {"foo": "bar"}
- def test_copy(self) -> None:
- copied = self.client.copy()
- assert id(copied) != id(self.client)
+ def test_copy(self, async_client: AsyncMixedbread) -> None:
+ copied = async_client.copy()
+ assert id(copied) != id(async_client)
- copied = self.client.copy(api_key="another My API Key")
+ copied = async_client.copy(api_key="another My API Key")
assert copied.api_key == "another My API Key"
- assert self.client.api_key == "My API Key"
+ assert async_client.api_key == "My API Key"
- def test_copy_default_options(self) -> None:
+ def test_copy_default_options(self, async_client: AsyncMixedbread) -> None:
# options that have a default are overridden correctly
- copied = self.client.copy(max_retries=7)
+ copied = async_client.copy(max_retries=7)
assert copied.max_retries == 7
- assert self.client.max_retries == 2
+ assert async_client.max_retries == 2
copied2 = copied.copy(max_retries=6)
assert copied2.max_retries == 6
assert copied.max_retries == 7
# timeout
- assert isinstance(self.client.timeout, httpx.Timeout)
- copied = self.client.copy(timeout=None)
+ assert isinstance(async_client.timeout, httpx.Timeout)
+ copied = async_client.copy(timeout=None)
assert copied.timeout is None
- assert isinstance(self.client.timeout, httpx.Timeout)
+ assert isinstance(async_client.timeout, httpx.Timeout)
- def test_copy_default_headers(self) -> None:
+ async def test_copy_default_headers(self) -> None:
client = AsyncMixedbread(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"}
)
@@ -957,8 +973,9 @@ def test_copy_default_headers(self) -> None:
match="`default_headers` and `set_default_headers` arguments are mutually exclusive",
):
client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"})
+ await client.close()
- def test_copy_default_query(self) -> None:
+ async def test_copy_default_query(self) -> None:
client = AsyncMixedbread(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"foo": "bar"}
)
@@ -994,13 +1011,15 @@ def test_copy_default_query(self) -> None:
):
client.copy(set_default_query={}, default_query={"foo": "Bar"})
- def test_copy_signature(self) -> None:
+ await client.close()
+
+ def test_copy_signature(self, async_client: AsyncMixedbread) -> None:
# ensure the same parameters that can be passed to the client are defined in the `.copy()` method
init_signature = inspect.signature(
# mypy doesn't like that we access the `__init__` property.
- self.client.__init__, # type: ignore[misc]
+ async_client.__init__, # type: ignore[misc]
)
- copy_signature = inspect.signature(self.client.copy)
+ copy_signature = inspect.signature(async_client.copy)
exclude_params = {"transport", "proxies", "_strict_response_validation"}
for name in init_signature.parameters.keys():
@@ -1011,12 +1030,12 @@ def test_copy_signature(self) -> None:
assert copy_param is not None, f"copy() signature is missing the {name} param"
@pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12")
- def test_copy_build_request(self) -> None:
+ def test_copy_build_request(self, async_client: AsyncMixedbread) -> None:
options = FinalRequestOptions(method="get", url="/foo")
def build_request(options: FinalRequestOptions) -> None:
- client = self.client.copy()
- client._build_request(options)
+ client_copy = async_client.copy()
+ client_copy._build_request(options)
# ensure that the machinery is warmed up before tracing starts.
build_request(options)
@@ -1073,12 +1092,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic
print(frame)
raise AssertionError()
- async def test_request_timeout(self) -> None:
- request = self.client._build_request(FinalRequestOptions(method="get", url="/foo"))
+ async def test_request_timeout(self, async_client: AsyncMixedbread) -> None:
+ request = async_client._build_request(FinalRequestOptions(method="get", url="/foo"))
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == DEFAULT_TIMEOUT
- request = self.client._build_request(
+ request = async_client._build_request(
FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0))
)
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
@@ -1093,6 +1112,8 @@ async def test_client_timeout_option(self) -> None:
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == httpx.Timeout(0)
+ await client.close()
+
async def test_http_client_timeout_option(self) -> None:
# custom timeout given to the httpx client should be used
async with httpx.AsyncClient(timeout=None) as http_client:
@@ -1104,6 +1125,8 @@ async def test_http_client_timeout_option(self) -> None:
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == httpx.Timeout(None)
+ await client.close()
+
# no timeout given to the httpx client should not use the httpx default
async with httpx.AsyncClient() as http_client:
client = AsyncMixedbread(
@@ -1114,6 +1137,8 @@ async def test_http_client_timeout_option(self) -> None:
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == DEFAULT_TIMEOUT
+ await client.close()
+
# explicitly passing the default timeout currently results in it being ignored
async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client:
client = AsyncMixedbread(
@@ -1124,6 +1149,8 @@ async def test_http_client_timeout_option(self) -> None:
timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore
assert timeout == DEFAULT_TIMEOUT # our default
+ await client.close()
+
def test_invalid_http_client(self) -> None:
with pytest.raises(TypeError, match="Invalid `http_client` arg"):
with httpx.Client() as http_client:
@@ -1134,15 +1161,15 @@ def test_invalid_http_client(self) -> None:
http_client=cast(Any, http_client),
)
- def test_default_headers_option(self) -> None:
- client = AsyncMixedbread(
+ async def test_default_headers_option(self) -> None:
+ test_client = AsyncMixedbread(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"}
)
- request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
+ request = test_client._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "bar"
assert request.headers.get("x-stainless-lang") == "python"
- client2 = AsyncMixedbread(
+ test_client2 = AsyncMixedbread(
base_url=base_url,
api_key=api_key,
_strict_response_validation=True,
@@ -1151,10 +1178,13 @@ def test_default_headers_option(self) -> None:
"X-Stainless-Lang": "my-overriding-header",
},
)
- request = client2._build_request(FinalRequestOptions(method="get", url="/foo"))
+ request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo"))
assert request.headers.get("x-foo") == "stainless"
assert request.headers.get("x-stainless-lang") == "my-overriding-header"
+ await test_client.close()
+ await test_client2.close()
+
def test_validate_headers(self) -> None:
client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
request = client._build_request(FinalRequestOptions(method="get", url="/foo"))
@@ -1165,7 +1195,7 @@ def test_validate_headers(self) -> None:
client2 = AsyncMixedbread(base_url=base_url, api_key=None, _strict_response_validation=True)
_ = client2
- def test_default_query_option(self) -> None:
+ async def test_default_query_option(self) -> None:
client = AsyncMixedbread(
base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"}
)
@@ -1183,8 +1213,10 @@ def test_default_query_option(self) -> None:
url = httpx.URL(request.url)
assert dict(url.params) == {"foo": "baz", "query_param": "overridden"}
- def test_request_extra_json(self) -> None:
- request = self.client._build_request(
+ await client.close()
+
+ def test_request_extra_json(self, client: Mixedbread) -> None:
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -1195,7 +1227,7 @@ def test_request_extra_json(self) -> None:
data = json.loads(request.content.decode("utf-8"))
assert data == {"foo": "bar", "baz": False}
- request = self.client._build_request(
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -1206,7 +1238,7 @@ def test_request_extra_json(self) -> None:
assert data == {"baz": False}
# `extra_json` takes priority over `json_data` when keys clash
- request = self.client._build_request(
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -1217,8 +1249,8 @@ def test_request_extra_json(self) -> None:
data = json.loads(request.content.decode("utf-8"))
assert data == {"foo": "bar", "baz": None}
- def test_request_extra_headers(self) -> None:
- request = self.client._build_request(
+ def test_request_extra_headers(self, client: Mixedbread) -> None:
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -1228,7 +1260,7 @@ def test_request_extra_headers(self) -> None:
assert request.headers.get("X-Foo") == "Foo"
# `extra_headers` takes priority over `default_headers` when keys clash
- request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request(
+ request = client.with_options(default_headers={"X-Bar": "true"})._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -1239,8 +1271,8 @@ def test_request_extra_headers(self) -> None:
)
assert request.headers.get("X-Bar") == "false"
- def test_request_extra_query(self) -> None:
- request = self.client._build_request(
+ def test_request_extra_query(self, client: Mixedbread) -> None:
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -1253,7 +1285,7 @@ def test_request_extra_query(self) -> None:
assert params == {"my_query_param": "Foo"}
# if both `query` and `extra_query` are given, they are merged
- request = self.client._build_request(
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -1267,7 +1299,7 @@ def test_request_extra_query(self) -> None:
assert params == {"bar": "1", "foo": "2"}
# `extra_query` takes priority over `query` when keys clash
- request = self.client._build_request(
+ request = client._build_request(
FinalRequestOptions(
method="post",
url="/foo",
@@ -1310,7 +1342,7 @@ def test_multipart_repeating_array(self, async_client: AsyncMixedbread) -> None:
]
@pytest.mark.respx(base_url=base_url)
- async def test_basic_union_response(self, respx_mock: MockRouter) -> None:
+ async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncMixedbread) -> None:
class Model1(BaseModel):
name: str
@@ -1319,12 +1351,12 @@ class Model2(BaseModel):
respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"}))
- response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
+ response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
assert isinstance(response, Model2)
assert response.foo == "bar"
@pytest.mark.respx(base_url=base_url)
- async def test_union_response_different_types(self, respx_mock: MockRouter) -> None:
+ async def test_union_response_different_types(self, respx_mock: MockRouter, async_client: AsyncMixedbread) -> None:
"""Union of objects with the same field name using a different type"""
class Model1(BaseModel):
@@ -1335,18 +1367,20 @@ class Model2(BaseModel):
respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"}))
- response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
+ response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
assert isinstance(response, Model2)
assert response.foo == "bar"
respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1}))
- response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
+ response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2]))
assert isinstance(response, Model1)
assert response.foo == 1
@pytest.mark.respx(base_url=base_url)
- async def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None:
+ async def test_non_application_json_content_type_for_json_data(
+ self, respx_mock: MockRouter, async_client: AsyncMixedbread
+ ) -> None:
"""
Response that sets Content-Type to something other than application/json but returns json data
"""
@@ -1362,11 +1396,11 @@ class Model(BaseModel):
)
)
- response = await self.client.get("/foo", cast_to=Model)
+ response = await async_client.get("/foo", cast_to=Model)
assert isinstance(response, Model)
assert response.foo == 2
- def test_base_url_setter(self) -> None:
+ async def test_base_url_setter(self) -> None:
client = AsyncMixedbread(
base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True
)
@@ -1376,7 +1410,9 @@ def test_base_url_setter(self) -> None:
assert client.base_url == "https://example.com/from_setter/"
- def test_base_url_env(self) -> None:
+ await client.close()
+
+ async def test_base_url_env(self) -> None:
with update_env(MIXEDBREAD_BASE_URL="http://localhost:5000/from/env"):
client = AsyncMixedbread(api_key=api_key, _strict_response_validation=True)
assert client.base_url == "http://localhost:5000/from/env/"
@@ -1391,6 +1427,8 @@ def test_base_url_env(self) -> None:
)
assert str(client.base_url).startswith("https://api.mixedbread.com")
+ await client.close()
+
@pytest.mark.parametrize(
"client",
[
@@ -1406,7 +1444,7 @@ def test_base_url_env(self) -> None:
],
ids=["standard", "custom http client"],
)
- def test_base_url_trailing_slash(self, client: AsyncMixedbread) -> None:
+ async def test_base_url_trailing_slash(self, client: AsyncMixedbread) -> None:
request = client._build_request(
FinalRequestOptions(
method="post",
@@ -1415,6 +1453,7 @@ def test_base_url_trailing_slash(self, client: AsyncMixedbread) -> None:
),
)
assert request.url == "http://localhost:5000/custom/path/foo"
+ await client.close()
@pytest.mark.parametrize(
"client",
@@ -1431,7 +1470,7 @@ def test_base_url_trailing_slash(self, client: AsyncMixedbread) -> None:
],
ids=["standard", "custom http client"],
)
- def test_base_url_no_trailing_slash(self, client: AsyncMixedbread) -> None:
+ async def test_base_url_no_trailing_slash(self, client: AsyncMixedbread) -> None:
request = client._build_request(
FinalRequestOptions(
method="post",
@@ -1440,6 +1479,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncMixedbread) -> None:
),
)
assert request.url == "http://localhost:5000/custom/path/foo"
+ await client.close()
@pytest.mark.parametrize(
"client",
@@ -1456,7 +1496,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncMixedbread) -> None:
],
ids=["standard", "custom http client"],
)
- def test_absolute_request_url(self, client: AsyncMixedbread) -> None:
+ async def test_absolute_request_url(self, client: AsyncMixedbread) -> None:
request = client._build_request(
FinalRequestOptions(
method="post",
@@ -1465,37 +1505,39 @@ def test_absolute_request_url(self, client: AsyncMixedbread) -> None:
),
)
assert request.url == "https://myapi.com/foo"
+ await client.close()
async def test_copied_client_does_not_close_http(self) -> None:
- client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
- assert not client.is_closed()
+ test_client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ assert not test_client.is_closed()
- copied = client.copy()
- assert copied is not client
+ copied = test_client.copy()
+ assert copied is not test_client
del copied
await asyncio.sleep(0.2)
- assert not client.is_closed()
+ assert not test_client.is_closed()
async def test_client_context_manager(self) -> None:
- client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
- async with client as c2:
- assert c2 is client
+ test_client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
+ async with test_client as c2:
+ assert c2 is test_client
assert not c2.is_closed()
- assert not client.is_closed()
- assert client.is_closed()
+ assert not test_client.is_closed()
+ assert test_client.is_closed()
@pytest.mark.respx(base_url=base_url)
- @pytest.mark.asyncio
- async def test_client_response_validation_error(self, respx_mock: MockRouter) -> None:
+ async def test_client_response_validation_error(
+ self, respx_mock: MockRouter, async_client: AsyncMixedbread
+ ) -> None:
class Model(BaseModel):
foo: str
respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}}))
with pytest.raises(APIResponseValidationError) as exc:
- await self.client.get("/foo", cast_to=Model)
+ await async_client.get("/foo", cast_to=Model)
assert isinstance(exc.value.__cause__, ValidationError)
@@ -1506,7 +1548,6 @@ async def test_client_max_retries_validation(self) -> None:
)
@pytest.mark.respx(base_url=base_url)
- @pytest.mark.asyncio
async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None:
class Model(BaseModel):
name: str
@@ -1518,11 +1559,14 @@ class Model(BaseModel):
with pytest.raises(APIResponseValidationError):
await strict_client.get("/foo", cast_to=Model)
- client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=False)
+ non_strict_client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=False)
- response = await client.get("/foo", cast_to=Model)
+ response = await non_strict_client.get("/foo", cast_to=Model)
assert isinstance(response, str) # type: ignore[unreachable]
+ await strict_client.close()
+ await non_strict_client.close()
+
@pytest.mark.parametrize(
"remaining_retries,retry_after,timeout",
[
@@ -1545,13 +1589,12 @@ class Model(BaseModel):
],
)
@mock.patch("time.time", mock.MagicMock(return_value=1696004797))
- @pytest.mark.asyncio
- async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None:
- client = AsyncMixedbread(base_url=base_url, api_key=api_key, _strict_response_validation=True)
-
+ async def test_parse_retry_after_header(
+ self, remaining_retries: int, retry_after: str, timeout: float, async_client: AsyncMixedbread
+ ) -> None:
headers = httpx.Headers({"retry-after": retry_after})
options = FinalRequestOptions(method="get", url="/foo", max_retries=3)
- calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
+ calculated = async_client._calculate_retry_timeout(remaining_retries, options, headers)
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@@ -1564,7 +1607,7 @@ async def test_retrying_timeout_errors_doesnt_leak(
with pytest.raises(APITimeoutError):
await async_client.stores.with_streaming_response.create().__aenter__()
- assert _get_open_connections(self.client) == 0
+ assert _get_open_connections(async_client) == 0
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
@@ -1575,12 +1618,11 @@ async def test_retrying_status_errors_doesnt_leak(
with pytest.raises(APIStatusError):
await async_client.stores.with_streaming_response.create().__aenter__()
- assert _get_open_connections(self.client) == 0
+ assert _get_open_connections(async_client) == 0
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- @pytest.mark.asyncio
@pytest.mark.parametrize("failure_mode", ["status", "exception"])
async def test_retries_taken(
self,
@@ -1612,7 +1654,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- @pytest.mark.asyncio
async def test_omit_retry_count_header(
self, async_client: AsyncMixedbread, failures_before_success: int, respx_mock: MockRouter
) -> None:
@@ -1636,7 +1677,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
@mock.patch("mixedbread._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
@pytest.mark.respx(base_url=base_url)
- @pytest.mark.asyncio
async def test_overwrite_retry_count_header(
self, async_client: AsyncMixedbread, failures_before_success: int, respx_mock: MockRouter
) -> None:
@@ -1684,26 +1724,26 @@ async def test_default_client_creation(self) -> None:
)
@pytest.mark.respx(base_url=base_url)
- async def test_follow_redirects(self, respx_mock: MockRouter) -> None:
+ async def test_follow_redirects(self, respx_mock: MockRouter, async_client: AsyncMixedbread) -> None:
# Test that the default follow_redirects=True allows following redirects
respx_mock.post("/redirect").mock(
return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
)
respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
- response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
+ response = await async_client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
assert response.status_code == 200
assert response.json() == {"status": "ok"}
@pytest.mark.respx(base_url=base_url)
- async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
+ async def test_follow_redirects_disabled(self, respx_mock: MockRouter, async_client: AsyncMixedbread) -> None:
# Test that follow_redirects=False prevents following redirects
respx_mock.post("/redirect").mock(
return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
)
with pytest.raises(APIStatusError) as exc_info:
- await self.client.post(
+ await async_client.post(
"/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
)
From 2be835fd0df74a2cc679905083057b616d9d4431 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 3 Nov 2025 21:06:15 +0000
Subject: [PATCH 300/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 157f0355..559b4513 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.36.0"
+ ".": "0.36.1"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index aee7303a..f7e0b842 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.36.0"
+version = "0.36.1"
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 90e190d2..3546b3a5 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.36.0" # x-release-please-version
+__version__ = "0.36.1" # x-release-please-version
From 03d8a517ad455a2d3fd1c2ddf93336ed3fd8d836 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 3 Nov 2025 21:07:48 +0000
Subject: [PATCH 301/375] feat(api): api update
---
.stats.yml | 6 +-
api.md | 3 -
src/mixedbread/resources/stores/files.py | 138 ++------------
src/mixedbread/resources/stores/stores.py | 118 +-----------
.../resources/vector_stores/files.py | 16 ++
src/mixedbread/types/__init__.py | 2 -
src/mixedbread/types/store.py | 27 ++-
src/mixedbread/types/store_create_params.py | 27 ++-
.../types/store_metadata_facets_params.py | 26 ---
.../types/store_metadata_facets_response.py | 12 --
src/mixedbread/types/stores/__init__.py | 1 -
.../types/stores/file_create_params.py | 16 +-
.../types/stores/file_retrieve_params.py | 15 --
.../types/stores/scored_store_file.py | 8 +-
src/mixedbread/types/stores/store_file.py | 8 +-
.../types/vector_stores/file_create_params.py | 16 +-
tests/api_resources/stores/test_files.py | 138 +-------------
tests/api_resources/test_stores.py | 171 +-----------------
.../api_resources/vector_stores/test_files.py | 24 +--
19 files changed, 134 insertions(+), 638 deletions(-)
delete mode 100644 src/mixedbread/types/store_metadata_facets_params.py
delete mode 100644 src/mixedbread/types/store_metadata_facets_response.py
delete mode 100644 src/mixedbread/types/stores/file_retrieve_params.py
diff --git a/.stats.yml b/.stats.yml
index 4282a055..20916644 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-fd92f46929d60af07c2abfd39a9850b71e4ba2ebfd67627f6ebec99e48dee5db.yml
-openapi_spec_hash: 450000939194685c6b33fec0dee1ce30
+configured_endpoints: 60
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b091721a627d75feb8567f628f99405d5778b0b88e9cc09fc664dd8e97c6d720.yml
+openapi_spec_hash: a23a2aecdcff5fa1d6c8cdc0df0bdfb7
config_hash: 1f4b314dbc7ae3afe6d669e36217b842
diff --git a/api.md b/api.md
index 664fa3c1..37efd031 100644
--- a/api.md
+++ b/api.md
@@ -86,7 +86,6 @@ from mixedbread.types import (
Store,
StoreChunkSearchOptions,
StoreDeleteResponse,
- StoreMetadataFacetsResponse,
StoreQuestionAnsweringResponse,
StoreSearchResponse,
)
@@ -99,7 +98,6 @@ Methods:
- client.stores.update(store_identifier, \*\*params) -> Store
- client.stores.list(\*\*params) -> SyncCursor[Store]
- client.stores.delete(store_identifier) -> StoreDeleteResponse
-- client.stores.metadata_facets(store_identifier, \*\*params) -> StoreMetadataFacetsResponse
- client.stores.question_answering(\*\*params) -> StoreQuestionAnsweringResponse
- client.stores.search(\*\*params) -> StoreSearchResponse
@@ -121,7 +119,6 @@ from mixedbread.types.stores import (
Methods:
- client.stores.files.create(store_identifier, \*\*params) -> StoreFile
-- client.stores.files.retrieve(file_id, \*, store_identifier, \*\*params) -> StoreFile
- client.stores.files.list(store_identifier, \*\*params) -> FileListResponse
- client.stores.files.delete(file_id, \*, store_identifier) -> FileDeleteResponse
- client.stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index 2cffa40d..32df06d4 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -17,7 +17,7 @@
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
-from ...types.stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
+from ...types.stores import file_list_params, file_create_params, file_search_params
from ...types.stores.store_file import StoreFile
from ...types.stores.store_file_status import StoreFileStatus
from ...types.stores.file_list_response import FileListResponse
@@ -53,6 +53,8 @@ def create(
*,
metadata: object | Omit = omit,
config: file_create_params.Config | Omit = omit,
+ external_id: Optional[str] | Omit = omit,
+ overwrite: bool | Omit = omit,
file_id: str,
experimental: Optional[file_create_params.Experimental] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -78,6 +80,10 @@ def create(
config: Configuration for adding the file
+ external_id: External identifier for this file in the store
+
+ overwrite: If true, overwrite an existing file with the same external_id
+
file_id: ID of the file to add
experimental: Configuration for a file.
@@ -98,6 +104,8 @@ def create(
{
"metadata": metadata,
"config": config,
+ "external_id": external_id,
+ "overwrite": overwrite,
"file_id": file_id,
"experimental": experimental,
},
@@ -109,59 +117,6 @@ def create(
cast_to=StoreFile,
)
- def retrieve(
- self,
- file_id: str,
- *,
- store_identifier: str,
- return_chunks: bool | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> StoreFile:
- """Get a file from a store.
-
- Args: store_identifier: The ID or name of the store.
-
- file_id: The ID or name of
- the file. options: Get file options.
-
- Returns: VectorStoreFile: The file details.
-
- Args:
- store_identifier: The ID or name of the store
-
- file_id: The ID or name 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
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not store_identifier:
- raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return self._get(
- f"/v1/stores/{store_identifier}/files/{file_id}",
- options=make_request_options(
- 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=StoreFile,
- )
-
def list(
self,
store_identifier: str,
@@ -371,6 +326,8 @@ async def create(
*,
metadata: object | Omit = omit,
config: file_create_params.Config | Omit = omit,
+ external_id: Optional[str] | Omit = omit,
+ overwrite: bool | Omit = omit,
file_id: str,
experimental: Optional[file_create_params.Experimental] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -396,6 +353,10 @@ async def create(
config: Configuration for adding the file
+ external_id: External identifier for this file in the store
+
+ overwrite: If true, overwrite an existing file with the same external_id
+
file_id: ID of the file to add
experimental: Configuration for a file.
@@ -416,6 +377,8 @@ async def create(
{
"metadata": metadata,
"config": config,
+ "external_id": external_id,
+ "overwrite": overwrite,
"file_id": file_id,
"experimental": experimental,
},
@@ -427,61 +390,6 @@ async def create(
cast_to=StoreFile,
)
- async def retrieve(
- self,
- file_id: str,
- *,
- store_identifier: str,
- return_chunks: bool | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> StoreFile:
- """Get a file from a store.
-
- Args: store_identifier: The ID or name of the store.
-
- file_id: The ID or name of
- the file. options: Get file options.
-
- Returns: VectorStoreFile: The file details.
-
- Args:
- store_identifier: The ID or name of the store
-
- file_id: The ID or name 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
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not store_identifier:
- raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return await self._get(
- f"/v1/stores/{store_identifier}/files/{file_id}",
- options=make_request_options(
- 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=StoreFile,
- )
-
async def list(
self,
store_identifier: str,
@@ -672,9 +580,6 @@ def __init__(self, files: FilesResource) -> None:
self.create = to_raw_response_wrapper(
files.create,
)
- self.retrieve = to_raw_response_wrapper(
- files.retrieve,
- )
self.list = to_raw_response_wrapper(
files.list,
)
@@ -693,9 +598,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.create = async_to_raw_response_wrapper(
files.create,
)
- self.retrieve = async_to_raw_response_wrapper(
- files.retrieve,
- )
self.list = async_to_raw_response_wrapper(
files.list,
)
@@ -714,9 +616,6 @@ def __init__(self, files: FilesResource) -> None:
self.create = to_streamed_response_wrapper(
files.create,
)
- self.retrieve = to_streamed_response_wrapper(
- files.retrieve,
- )
self.list = to_streamed_response_wrapper(
files.list,
)
@@ -735,9 +634,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.create = async_to_streamed_response_wrapper(
files.create,
)
- self.retrieve = async_to_streamed_response_wrapper(
- files.retrieve,
- )
self.list = async_to_streamed_response_wrapper(
files.list,
)
diff --git a/src/mixedbread/resources/stores/stores.py b/src/mixedbread/resources/stores/stores.py
index f5f00bc5..c21f70d1 100644
--- a/src/mixedbread/resources/stores/stores.py
+++ b/src/mixedbread/resources/stores/stores.py
@@ -19,7 +19,6 @@
store_create_params,
store_search_params,
store_update_params,
- store_metadata_facets_params,
store_question_answering_params,
)
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
@@ -38,7 +37,6 @@
from ...types.expires_after_param import ExpiresAfterParam
from ...types.store_delete_response import StoreDeleteResponse
from ...types.store_search_response import StoreSearchResponse
-from ...types.store_metadata_facets_response import StoreMetadataFacetsResponse
from ...types.store_chunk_search_options_param import StoreChunkSearchOptionsParam
from ...types.store_question_answering_response import StoreQuestionAnsweringResponse
@@ -77,6 +75,7 @@ def create(
is_public: bool | Omit = omit,
expires_after: Optional[ExpiresAfterParam] | Omit = omit,
metadata: object | Omit = omit,
+ config: Optional[store_create_params.Config] | Omit = omit,
file_ids: Optional[SequenceNotStr[str]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -104,6 +103,8 @@ def create(
metadata: Optional metadata key-value pairs
+ config: Configuration for a store.
+
file_ids: Optional list of file IDs
extra_headers: Send extra headers
@@ -123,6 +124,7 @@ def create(
"is_public": is_public,
"expires_after": expires_after,
"metadata": metadata,
+ "config": config,
"file_ids": file_ids,
},
store_create_params.StoreCreateParams,
@@ -343,54 +345,6 @@ def delete(
cast_to=StoreDeleteResponse,
)
- def metadata_facets(
- self,
- store_identifier: str,
- *,
- filters: Optional[store_metadata_facets_params.Filters] | Omit = omit,
- facets: Optional[SequenceNotStr[str]] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> StoreMetadataFacetsResponse:
- """
- Get metadata facets
-
- Args:
- store_identifier: The ID or name of the store
-
- filters: Optional filter conditions
-
- facets: Optional list of facets to return. Use dot for nested fields.
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not store_identifier:
- raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
- return self._post(
- f"/v1/stores/{store_identifier}/metadata-facets",
- body=maybe_transform(
- {
- "filters": filters,
- "facets": facets,
- },
- store_metadata_facets_params.StoreMetadataFacetsParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=StoreMetadataFacetsResponse,
- )
-
def question_answering(
self,
*,
@@ -568,6 +522,7 @@ async def create(
is_public: bool | Omit = omit,
expires_after: Optional[ExpiresAfterParam] | Omit = omit,
metadata: object | Omit = omit,
+ config: Optional[store_create_params.Config] | Omit = omit,
file_ids: Optional[SequenceNotStr[str]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -595,6 +550,8 @@ async def create(
metadata: Optional metadata key-value pairs
+ config: Configuration for a store.
+
file_ids: Optional list of file IDs
extra_headers: Send extra headers
@@ -614,6 +571,7 @@ async def create(
"is_public": is_public,
"expires_after": expires_after,
"metadata": metadata,
+ "config": config,
"file_ids": file_ids,
},
store_create_params.StoreCreateParams,
@@ -834,54 +792,6 @@ async def delete(
cast_to=StoreDeleteResponse,
)
- async def metadata_facets(
- self,
- store_identifier: str,
- *,
- filters: Optional[store_metadata_facets_params.Filters] | Omit = omit,
- facets: Optional[SequenceNotStr[str]] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> StoreMetadataFacetsResponse:
- """
- Get metadata facets
-
- Args:
- store_identifier: The ID or name of the store
-
- filters: Optional filter conditions
-
- facets: Optional list of facets to return. Use dot for nested fields.
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not store_identifier:
- raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
- return await self._post(
- f"/v1/stores/{store_identifier}/metadata-facets",
- body=await async_maybe_transform(
- {
- "filters": filters,
- "facets": facets,
- },
- store_metadata_facets_params.StoreMetadataFacetsParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=StoreMetadataFacetsResponse,
- )
-
async def question_answering(
self,
*,
@@ -1046,9 +956,6 @@ def __init__(self, stores: StoresResource) -> None:
self.delete = to_raw_response_wrapper(
stores.delete,
)
- self.metadata_facets = to_raw_response_wrapper(
- stores.metadata_facets,
- )
self.question_answering = to_raw_response_wrapper(
stores.question_answering,
)
@@ -1080,9 +987,6 @@ def __init__(self, stores: AsyncStoresResource) -> None:
self.delete = async_to_raw_response_wrapper(
stores.delete,
)
- self.metadata_facets = async_to_raw_response_wrapper(
- stores.metadata_facets,
- )
self.question_answering = async_to_raw_response_wrapper(
stores.question_answering,
)
@@ -1114,9 +1018,6 @@ def __init__(self, stores: StoresResource) -> None:
self.delete = to_streamed_response_wrapper(
stores.delete,
)
- self.metadata_facets = to_streamed_response_wrapper(
- stores.metadata_facets,
- )
self.question_answering = to_streamed_response_wrapper(
stores.question_answering,
)
@@ -1148,9 +1049,6 @@ def __init__(self, stores: AsyncStoresResource) -> None:
self.delete = async_to_streamed_response_wrapper(
stores.delete,
)
- self.metadata_facets = async_to_streamed_response_wrapper(
- stores.metadata_facets,
- )
self.question_answering = async_to_streamed_response_wrapper(
stores.question_answering,
)
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
index 3fff5988..689c9dca 100644
--- a/src/mixedbread/resources/vector_stores/files.py
+++ b/src/mixedbread/resources/vector_stores/files.py
@@ -55,6 +55,8 @@ def create(
*,
metadata: object | Omit = omit,
config: file_create_params.Config | Omit = omit,
+ external_id: Optional[str] | Omit = omit,
+ overwrite: bool | Omit = omit,
file_id: str,
experimental: Optional[file_create_params.Experimental] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -74,6 +76,10 @@ def create(
config: Configuration for adding the file
+ external_id: External identifier for this file in the store
+
+ overwrite: If true, overwrite an existing file with the same external_id
+
file_id: ID of the file to add
experimental: Configuration for a file.
@@ -96,6 +102,8 @@ def create(
{
"metadata": metadata,
"config": config,
+ "external_id": external_id,
+ "overwrite": overwrite,
"file_id": file_id,
"experimental": experimental,
},
@@ -357,6 +365,8 @@ async def create(
*,
metadata: object | Omit = omit,
config: file_create_params.Config | Omit = omit,
+ external_id: Optional[str] | Omit = omit,
+ overwrite: bool | Omit = omit,
file_id: str,
experimental: Optional[file_create_params.Experimental] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -376,6 +386,10 @@ async def create(
config: Configuration for adding the file
+ external_id: External identifier for this file in the store
+
+ overwrite: If true, overwrite an existing file with the same external_id
+
file_id: ID of the file to add
experimental: Configuration for a file.
@@ -398,6 +412,8 @@ async def create(
{
"metadata": metadata,
"config": config,
+ "external_id": external_id,
+ "overwrite": overwrite,
"file_id": file_id,
"experimental": experimental,
},
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 20bcd899..3ec3253b 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -53,10 +53,8 @@
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 .store_metadata_facets_params import StoreMetadataFacetsParams as StoreMetadataFacetsParams
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
-from .store_metadata_facets_response import StoreMetadataFacetsResponse as StoreMetadataFacetsResponse
from .store_question_answering_params import StoreQuestionAnsweringParams as StoreQuestionAnsweringParams
from .store_chunk_search_options_param import StoreChunkSearchOptionsParam as StoreChunkSearchOptionsParam
from .store_question_answering_response import StoreQuestionAnsweringResponse as StoreQuestionAnsweringResponse
diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py
index 5c7db5d1..c380b69f 100644
--- a/src/mixedbread/types/store.py
+++ b/src/mixedbread/types/store.py
@@ -1,13 +1,31 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
+from typing import List, Union, Optional
from datetime import datetime
-from typing_extensions import Literal
+from typing_extensions import Literal, TypeAlias
from .._models import BaseModel
from .expires_after import ExpiresAfter
-__all__ = ["Store", "FileCounts"]
+__all__ = ["Store", "Config", "ConfigContextualization", "ConfigContextualizationContextualizationConfig", "FileCounts"]
+
+
+class ConfigContextualizationContextualizationConfig(BaseModel):
+ with_metadata: Union[bool, List[str], None] = None
+ """Include all metadata or specific fields in the contextualization.
+
+ Supports dot notation for nested fields (e.g., 'author.name'). When True, all
+ metadata is included (flattened). When a list, only specified fields are
+ included.
+ """
+
+
+ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig]
+
+
+class Config(BaseModel):
+ contextualization: Optional[ConfigContextualization] = None
+ """Contextualize files with metadata"""
class FileCounts(BaseModel):
@@ -46,6 +64,9 @@ class Store(BaseModel):
metadata: Optional[object] = None
"""Additional metadata associated with the store"""
+ config: Optional[Config] = None
+ """Configuration for a store."""
+
file_counts: Optional[FileCounts] = None
"""Counts of files in different states"""
diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py
index 1c307c18..92cece44 100644
--- a/src/mixedbread/types/store_create_params.py
+++ b/src/mixedbread/types/store_create_params.py
@@ -2,13 +2,13 @@
from __future__ import annotations
-from typing import Optional
-from typing_extensions import TypedDict
+from typing import Union, Optional
+from typing_extensions import TypeAlias, TypedDict
from .._types import SequenceNotStr
from .expires_after_param import ExpiresAfterParam
-__all__ = ["StoreCreateParams"]
+__all__ = ["StoreCreateParams", "Config", "ConfigContextualization", "ConfigContextualizationContextualizationConfig"]
class StoreCreateParams(TypedDict, total=False):
@@ -27,5 +27,26 @@ class StoreCreateParams(TypedDict, total=False):
metadata: object
"""Optional metadata key-value pairs"""
+ config: Optional[Config]
+ """Configuration for a store."""
+
file_ids: Optional[SequenceNotStr[str]]
"""Optional list of file IDs"""
+
+
+class ConfigContextualizationContextualizationConfig(TypedDict, total=False):
+ with_metadata: Union[bool, SequenceNotStr[str]]
+ """Include all metadata or specific fields in the contextualization.
+
+ Supports dot notation for nested fields (e.g., 'author.name'). When True, all
+ metadata is included (flattened). When a list, only specified fields are
+ included.
+ """
+
+
+ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig]
+
+
+class Config(TypedDict, total=False):
+ contextualization: ConfigContextualization
+ """Contextualize files with metadata"""
diff --git a/src/mixedbread/types/store_metadata_facets_params.py b/src/mixedbread/types/store_metadata_facets_params.py
deleted file mode 100644
index e1b87603..00000000
--- a/src/mixedbread/types/store_metadata_facets_params.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict
-
-from .._types import SequenceNotStr
-from .shared_params.search_filter_condition import SearchFilterCondition
-
-__all__ = ["StoreMetadataFacetsParams", "Filters", "FiltersUnionMember2"]
-
-
-class StoreMetadataFacetsParams(TypedDict, total=False):
- filters: Optional[Filters]
- """Optional filter conditions"""
-
- facets: Optional[SequenceNotStr[str]]
- """Optional list of facets to return. Use dot for nested fields."""
-
-
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
-
-from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/store_metadata_facets_response.py b/src/mixedbread/types/store_metadata_facets_response.py
deleted file mode 100644
index 989562c4..00000000
--- a/src/mixedbread/types/store_metadata_facets_response.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Dict
-
-from .._models import BaseModel
-
-__all__ = ["StoreMetadataFacetsResponse"]
-
-
-class StoreMetadataFacetsResponse(BaseModel):
- facets: Dict[str, Dict[str, object]]
- """Metadata facets"""
diff --git a/src/mixedbread/types/stores/__init__.py b/src/mixedbread/types/stores/__init__.py
index 3dee7dac..c2cec401 100644
--- a/src/mixedbread/types/stores/__init__.py
+++ b/src/mixedbread/types/stores/__init__.py
@@ -10,5 +10,4 @@
from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
-from .file_retrieve_params import FileRetrieveParams as FileRetrieveParams
from .file_search_response import FileSearchResponse as FileSearchResponse
diff --git a/src/mixedbread/types/stores/file_create_params.py b/src/mixedbread/types/stores/file_create_params.py
index 1cd99bf7..76441bf9 100644
--- a/src/mixedbread/types/stores/file_create_params.py
+++ b/src/mixedbread/types/stores/file_create_params.py
@@ -15,6 +15,12 @@ class FileCreateParams(TypedDict, total=False):
config: Config
"""Configuration for adding the file"""
+ external_id: Optional[str]
+ """External identifier for this file in the store"""
+
+ overwrite: bool
+ """If true, overwrite an existing file with the same external_id"""
+
file_id: Required[str]
"""ID of the file to add"""
@@ -24,15 +30,9 @@ class FileCreateParams(TypedDict, total=False):
class Config(TypedDict, total=False):
parsing_strategy: Literal["fast", "high_quality"]
- """Strategy for adding the file"""
-
- contextualization: bool
- """Whether to contextualize the file"""
+ """Strategy for adding the file, this overrides the store-level default"""
class Experimental(TypedDict, total=False):
parsing_strategy: Literal["fast", "high_quality"]
- """Strategy for adding the file"""
-
- contextualization: bool
- """Whether to contextualize the file"""
+ """Strategy for adding the file, this overrides the store-level default"""
diff --git a/src/mixedbread/types/stores/file_retrieve_params.py b/src/mixedbread/types/stores/file_retrieve_params.py
deleted file mode 100644
index ae924454..00000000
--- a/src/mixedbread/types/stores/file_retrieve_params.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# 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):
- store_identifier: Required[str]
- """The ID or name of the store"""
-
- return_chunks: bool
- """Whether to return the chunks for the file"""
diff --git a/src/mixedbread/types/stores/scored_store_file.py b/src/mixedbread/types/stores/scored_store_file.py
index ee98c03e..3d8a3c02 100644
--- a/src/mixedbread/types/stores/scored_store_file.py
+++ b/src/mixedbread/types/stores/scored_store_file.py
@@ -17,10 +17,7 @@
class Config(BaseModel):
parsing_strategy: Optional[Literal["fast", "high_quality"]] = None
- """Strategy for adding the file"""
-
- contextualization: Optional[bool] = None
- """Whether to contextualize the file"""
+ """Strategy for adding the file, this overrides the store-level default"""
Chunk: TypeAlias = Annotated[
@@ -39,6 +36,9 @@ class ScoredStoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
+ external_id: Optional[str] = None
+ """External identifier for this file in the store"""
+
status: Optional[StoreFileStatus] = None
"""Processing status of the file"""
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index 9bb6902c..58dcef0c 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -58,10 +58,7 @@
class Config(BaseModel):
parsing_strategy: Optional[Literal["fast", "high_quality"]] = None
- """Strategy for adding the file"""
-
- contextualization: Optional[bool] = None
- """Whether to contextualize the file"""
+ """Strategy for adding the file, this overrides the store-level default"""
class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
@@ -822,6 +819,9 @@ class StoreFile(BaseModel):
metadata: Optional[object] = None
"""Optional file metadata"""
+ external_id: Optional[str] = None
+ """External identifier for this file in the store"""
+
status: Optional[StoreFileStatus] = None
"""Processing status of the file"""
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
index 1cd99bf7..76441bf9 100644
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -15,6 +15,12 @@ class FileCreateParams(TypedDict, total=False):
config: Config
"""Configuration for adding the file"""
+ external_id: Optional[str]
+ """External identifier for this file in the store"""
+
+ overwrite: bool
+ """If true, overwrite an existing file with the same external_id"""
+
file_id: Required[str]
"""ID of the file to add"""
@@ -24,15 +30,9 @@ class FileCreateParams(TypedDict, total=False):
class Config(TypedDict, total=False):
parsing_strategy: Literal["fast", "high_quality"]
- """Strategy for adding the file"""
-
- contextualization: bool
- """Whether to contextualize the file"""
+ """Strategy for adding the file, this overrides the store-level default"""
class Experimental(TypedDict, total=False):
parsing_strategy: Literal["fast", "high_quality"]
- """Strategy for adding the file"""
-
- contextualization: bool
- """Whether to contextualize the file"""
+ """Strategy for adding the file, this overrides the store-level default"""
diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py
index a42698ed..7241cfa8 100644
--- a/tests/api_resources/stores/test_files.py
+++ b/tests/api_resources/stores/test_files.py
@@ -35,15 +35,11 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
file = client.stores.files.create(
store_identifier="store_identifier",
metadata={},
- config={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
+ config={"parsing_strategy": "fast"},
+ external_id="external_id",
+ overwrite=False,
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
+ experimental={"parsing_strategy": "fast"},
)
assert_matches_type(StoreFile, file, path=["response"])
@@ -81,63 +77,6 @@ def test_path_params_create(self, client: Mixedbread) -> None:
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- @parametrize
- def test_method_retrieve(self, client: Mixedbread) -> None:
- file = client.stores.files.retrieve(
- file_id="file_id",
- store_identifier="store_identifier",
- )
- assert_matches_type(StoreFile, file, path=["response"])
-
- @parametrize
- def test_method_retrieve_with_all_params(self, client: Mixedbread) -> None:
- file = client.stores.files.retrieve(
- file_id="file_id",
- store_identifier="store_identifier",
- return_chunks=True,
- )
- assert_matches_type(StoreFile, file, path=["response"])
-
- @parametrize
- def test_raw_response_retrieve(self, client: Mixedbread) -> None:
- response = client.stores.files.with_raw_response.retrieve(
- file_id="file_id",
- store_identifier="store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(StoreFile, file, path=["response"])
-
- @parametrize
- def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with client.stores.files.with_streaming_response.retrieve(
- file_id="file_id",
- store_identifier="store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(StoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
- client.stores.files.with_raw_response.retrieve(
- file_id="file_id",
- store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- client.stores.files.with_raw_response.retrieve(
- file_id="",
- store_identifier="store_identifier",
- )
-
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
file = client.stores.files.list(
@@ -384,15 +323,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.stores.files.create(
store_identifier="store_identifier",
metadata={},
- config={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
+ config={"parsing_strategy": "fast"},
+ external_id="external_id",
+ overwrite=False,
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
+ experimental={"parsing_strategy": "fast"},
)
assert_matches_type(StoreFile, file, path=["response"])
@@ -430,63 +365,6 @@ async def test_path_params_create(self, async_client: AsyncMixedbread) -> None:
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
- @parametrize
- async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.stores.files.retrieve(
- file_id="file_id",
- store_identifier="store_identifier",
- )
- assert_matches_type(StoreFile, file, path=["response"])
-
- @parametrize
- async def test_method_retrieve_with_all_params(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.stores.files.retrieve(
- file_id="file_id",
- store_identifier="store_identifier",
- return_chunks=True,
- )
- assert_matches_type(StoreFile, file, path=["response"])
-
- @parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.stores.files.with_raw_response.retrieve(
- file_id="file_id",
- store_identifier="store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(StoreFile, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- async with async_client.stores.files.with_streaming_response.retrieve(
- file_id="file_id",
- store_identifier="store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(StoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
- await async_client.stores.files.with_raw_response.retrieve(
- file_id="file_id",
- store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- await async_client.stores.files.with_raw_response.retrieve(
- file_id="",
- store_identifier="store_identifier",
- )
-
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.stores.files.list(
diff --git a/tests/api_resources/test_stores.py b/tests/api_resources/test_stores.py
index 895c5494..8f7c5460 100644
--- a/tests/api_resources/test_stores.py
+++ b/tests/api_resources/test_stores.py
@@ -13,7 +13,6 @@
Store,
StoreDeleteResponse,
StoreSearchResponse,
- StoreMetadataFacetsResponse,
StoreQuestionAnsweringResponse,
)
from mixedbread.pagination import SyncCursor, AsyncCursor
@@ -40,6 +39,7 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
"days": 0,
},
metadata={},
+ config={"contextualization": True},
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(Store, store, path=["response"])
@@ -229,90 +229,6 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
"",
)
- @parametrize
- def test_method_metadata_facets(self, client: Mixedbread) -> None:
- store = client.stores.metadata_facets(
- store_identifier="store_identifier",
- )
- assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
-
- @parametrize
- def test_method_metadata_facets_with_all_params(self, client: Mixedbread) -> None:
- store = client.stores.metadata_facets(
- store_identifier="store_identifier",
- filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- facets=["string"],
- )
- assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
-
- @parametrize
- def test_raw_response_metadata_facets(self, client: Mixedbread) -> None:
- response = client.stores.with_raw_response.metadata_facets(
- store_identifier="store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- store = response.parse()
- assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
-
- @parametrize
- def test_streaming_response_metadata_facets(self, client: Mixedbread) -> None:
- with client.stores.with_streaming_response.metadata_facets(
- store_identifier="store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- store = response.parse()
- assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_metadata_facets(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
- client.stores.with_raw_response.metadata_facets(
- store_identifier="",
- )
-
@parametrize
def test_method_question_answering(self, client: Mixedbread) -> None:
store = client.stores.question_answering(
@@ -515,6 +431,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
"days": 0,
},
metadata={},
+ config={"contextualization": True},
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(Store, store, path=["response"])
@@ -704,90 +621,6 @@ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
"",
)
- @parametrize
- async def test_method_metadata_facets(self, async_client: AsyncMixedbread) -> None:
- store = await async_client.stores.metadata_facets(
- store_identifier="store_identifier",
- )
- assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
-
- @parametrize
- async def test_method_metadata_facets_with_all_params(self, async_client: AsyncMixedbread) -> None:
- store = await async_client.stores.metadata_facets(
- store_identifier="store_identifier",
- filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- },
- facets=["string"],
- )
- assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
-
- @parametrize
- async def test_raw_response_metadata_facets(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.stores.with_raw_response.metadata_facets(
- store_identifier="store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- store = await response.parse()
- assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
-
- @parametrize
- async def test_streaming_response_metadata_facets(self, async_client: AsyncMixedbread) -> None:
- async with async_client.stores.with_streaming_response.metadata_facets(
- store_identifier="store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- store = await response.parse()
- assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_metadata_facets(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
- await async_client.stores.with_raw_response.metadata_facets(
- store_identifier="",
- )
-
@parametrize
async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
store = await async_client.stores.question_answering(
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index 0565e8a9..ab709026 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -40,15 +40,11 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
file = client.vector_stores.files.create(
vector_store_identifier="vector_store_identifier",
metadata={},
- config={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
+ config={"parsing_strategy": "fast"},
+ external_id="external_id",
+ overwrite=False,
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
+ experimental={"parsing_strategy": "fast"},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
@@ -429,15 +425,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
file = await async_client.vector_stores.files.create(
vector_store_identifier="vector_store_identifier",
metadata={},
- config={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
+ config={"parsing_strategy": "fast"},
+ external_id="external_id",
+ overwrite=False,
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={
- "parsing_strategy": "fast",
- "contextualization": True,
- },
+ experimental={"parsing_strategy": "fast"},
)
assert_matches_type(VectorStoreFile, file, path=["response"])
From 3f63adff02bea5aa4280a804771562be194f247e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 3 Nov 2025 21:12:43 +0000
Subject: [PATCH 302/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 3 +
src/mixedbread/resources/stores/files.py | 122 +++++++++++-
src/mixedbread/resources/stores/stores.py | 140 ++++++++++++++
src/mixedbread/types/__init__.py | 2 +
.../types/store_metadata_facets_params.py | 42 +++++
.../types/store_metadata_facets_response.py | 12 ++
src/mixedbread/types/stores/__init__.py | 1 +
.../types/stores/file_retrieve_params.py | 15 ++
tests/api_resources/stores/test_files.py | 114 ++++++++++++
tests/api_resources/test_stores.py | 175 ++++++++++++++++++
11 files changed, 627 insertions(+), 3 deletions(-)
create mode 100644 src/mixedbread/types/store_metadata_facets_params.py
create mode 100644 src/mixedbread/types/store_metadata_facets_response.py
create mode 100644 src/mixedbread/types/stores/file_retrieve_params.py
diff --git a/.stats.yml b/.stats.yml
index 20916644..fe0dd56b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 60
+configured_endpoints: 62
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b091721a627d75feb8567f628f99405d5778b0b88e9cc09fc664dd8e97c6d720.yml
openapi_spec_hash: a23a2aecdcff5fa1d6c8cdc0df0bdfb7
-config_hash: 1f4b314dbc7ae3afe6d669e36217b842
+config_hash: 22ce3b96e325037f81e7dbf22bdd8d24
diff --git a/api.md b/api.md
index 37efd031..326815b5 100644
--- a/api.md
+++ b/api.md
@@ -86,6 +86,7 @@ from mixedbread.types import (
Store,
StoreChunkSearchOptions,
StoreDeleteResponse,
+ StoreMetadataFacetsResponse,
StoreQuestionAnsweringResponse,
StoreSearchResponse,
)
@@ -98,6 +99,7 @@ Methods:
- client.stores.update(store_identifier, \*\*params) -> Store
- client.stores.list(\*\*params) -> SyncCursor[Store]
- client.stores.delete(store_identifier) -> StoreDeleteResponse
+- client.stores.metadata_facets(\*\*params) -> StoreMetadataFacetsResponse
- client.stores.question_answering(\*\*params) -> StoreQuestionAnsweringResponse
- client.stores.search(\*\*params) -> StoreSearchResponse
@@ -119,6 +121,7 @@ from mixedbread.types.stores import (
Methods:
- client.stores.files.create(store_identifier, \*\*params) -> StoreFile
+- client.stores.files.retrieve(file_identifier, \*, store_identifier, \*\*params) -> StoreFile
- client.stores.files.list(store_identifier, \*\*params) -> FileListResponse
- client.stores.files.delete(file_id, \*, store_identifier) -> FileDeleteResponse
- client.stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index 32df06d4..472f904e 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -17,7 +17,7 @@
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
-from ...types.stores import file_list_params, file_create_params, file_search_params
+from ...types.stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
from ...types.stores.store_file import StoreFile
from ...types.stores.store_file_status import StoreFileStatus
from ...types.stores.file_list_response import FileListResponse
@@ -117,6 +117,59 @@ def create(
cast_to=StoreFile,
)
+ def retrieve(
+ self,
+ file_identifier: str,
+ *,
+ store_identifier: str,
+ return_chunks: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreFile:
+ """Get a file from a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_id: The ID or name of
+ the file. options: Get file options.
+
+ Returns: VectorStoreFile: The file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_identifier: The ID or name 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
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_identifier:
+ raise ValueError(f"Expected a non-empty value for `file_identifier` but received {file_identifier!r}")
+ return self._get(
+ f"/v1/stores/{store_identifier}/files/{file_identifier}",
+ options=make_request_options(
+ 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=StoreFile,
+ )
+
def list(
self,
store_identifier: str,
@@ -390,6 +443,61 @@ async def create(
cast_to=StoreFile,
)
+ async def retrieve(
+ self,
+ file_identifier: str,
+ *,
+ store_identifier: str,
+ return_chunks: bool | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreFile:
+ """Get a file from a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_id: The ID or name of
+ the file. options: Get file options.
+
+ Returns: VectorStoreFile: The file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_identifier: The ID or name 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
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_identifier:
+ raise ValueError(f"Expected a non-empty value for `file_identifier` but received {file_identifier!r}")
+ return await self._get(
+ f"/v1/stores/{store_identifier}/files/{file_identifier}",
+ options=make_request_options(
+ 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=StoreFile,
+ )
+
async def list(
self,
store_identifier: str,
@@ -580,6 +688,9 @@ def __init__(self, files: FilesResource) -> None:
self.create = to_raw_response_wrapper(
files.create,
)
+ self.retrieve = to_raw_response_wrapper(
+ files.retrieve,
+ )
self.list = to_raw_response_wrapper(
files.list,
)
@@ -598,6 +709,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.create = async_to_raw_response_wrapper(
files.create,
)
+ self.retrieve = async_to_raw_response_wrapper(
+ files.retrieve,
+ )
self.list = async_to_raw_response_wrapper(
files.list,
)
@@ -616,6 +730,9 @@ def __init__(self, files: FilesResource) -> None:
self.create = to_streamed_response_wrapper(
files.create,
)
+ self.retrieve = to_streamed_response_wrapper(
+ files.retrieve,
+ )
self.list = to_streamed_response_wrapper(
files.list,
)
@@ -634,6 +751,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.create = async_to_streamed_response_wrapper(
files.create,
)
+ self.retrieve = async_to_streamed_response_wrapper(
+ files.retrieve,
+ )
self.list = async_to_streamed_response_wrapper(
files.list,
)
diff --git a/src/mixedbread/resources/stores/stores.py b/src/mixedbread/resources/stores/stores.py
index c21f70d1..2ac5c027 100644
--- a/src/mixedbread/resources/stores/stores.py
+++ b/src/mixedbread/resources/stores/stores.py
@@ -19,6 +19,7 @@
store_create_params,
store_search_params,
store_update_params,
+ store_metadata_facets_params,
store_question_answering_params,
)
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
@@ -37,6 +38,7 @@
from ...types.expires_after_param import ExpiresAfterParam
from ...types.store_delete_response import StoreDeleteResponse
from ...types.store_search_response import StoreSearchResponse
+from ...types.store_metadata_facets_response import StoreMetadataFacetsResponse
from ...types.store_chunk_search_options_param import StoreChunkSearchOptionsParam
from ...types.store_question_answering_response import StoreQuestionAnsweringResponse
@@ -345,6 +347,69 @@ def delete(
cast_to=StoreDeleteResponse,
)
+ def metadata_facets(
+ self,
+ *,
+ query: Optional[str] | Omit = omit,
+ store_identifiers: SequenceNotStr[str],
+ top_k: int | Omit = omit,
+ filters: Optional[store_metadata_facets_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: StoreChunkSearchOptionsParam | Omit = omit,
+ facets: Optional[SequenceNotStr[str]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreMetadataFacetsResponse:
+ """
+ Get metadata facets
+
+ Args:
+ query: Search query text
+
+ store_identifiers: IDs or names of stores to search
+
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
+
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
+ search_options: Search configuration options
+
+ facets: Optional list of facets to return. Use dot for nested fields.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ "/v1/stores/metadata-facets",
+ body=maybe_transform(
+ {
+ "query": query,
+ "store_identifiers": store_identifiers,
+ "top_k": top_k,
+ "filters": filters,
+ "file_ids": file_ids,
+ "search_options": search_options,
+ "facets": facets,
+ },
+ store_metadata_facets_params.StoreMetadataFacetsParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreMetadataFacetsResponse,
+ )
+
def question_answering(
self,
*,
@@ -792,6 +857,69 @@ async def delete(
cast_to=StoreDeleteResponse,
)
+ async def metadata_facets(
+ self,
+ *,
+ query: Optional[str] | Omit = omit,
+ store_identifiers: SequenceNotStr[str],
+ top_k: int | Omit = omit,
+ filters: Optional[store_metadata_facets_params.Filters] | Omit = omit,
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
+ search_options: StoreChunkSearchOptionsParam | Omit = omit,
+ facets: Optional[SequenceNotStr[str]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreMetadataFacetsResponse:
+ """
+ Get metadata facets
+
+ Args:
+ query: Search query text
+
+ store_identifiers: IDs or names of stores to search
+
+ top_k: Number of results to return
+
+ filters: Optional filter conditions
+
+ file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
+
+ search_options: Search configuration options
+
+ facets: Optional list of facets to return. Use dot for nested fields.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ "/v1/stores/metadata-facets",
+ body=await async_maybe_transform(
+ {
+ "query": query,
+ "store_identifiers": store_identifiers,
+ "top_k": top_k,
+ "filters": filters,
+ "file_ids": file_ids,
+ "search_options": search_options,
+ "facets": facets,
+ },
+ store_metadata_facets_params.StoreMetadataFacetsParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreMetadataFacetsResponse,
+ )
+
async def question_answering(
self,
*,
@@ -956,6 +1084,9 @@ def __init__(self, stores: StoresResource) -> None:
self.delete = to_raw_response_wrapper(
stores.delete,
)
+ self.metadata_facets = to_raw_response_wrapper(
+ stores.metadata_facets,
+ )
self.question_answering = to_raw_response_wrapper(
stores.question_answering,
)
@@ -987,6 +1118,9 @@ def __init__(self, stores: AsyncStoresResource) -> None:
self.delete = async_to_raw_response_wrapper(
stores.delete,
)
+ self.metadata_facets = async_to_raw_response_wrapper(
+ stores.metadata_facets,
+ )
self.question_answering = async_to_raw_response_wrapper(
stores.question_answering,
)
@@ -1018,6 +1152,9 @@ def __init__(self, stores: StoresResource) -> None:
self.delete = to_streamed_response_wrapper(
stores.delete,
)
+ self.metadata_facets = to_streamed_response_wrapper(
+ stores.metadata_facets,
+ )
self.question_answering = to_streamed_response_wrapper(
stores.question_answering,
)
@@ -1049,6 +1186,9 @@ def __init__(self, stores: AsyncStoresResource) -> None:
self.delete = async_to_streamed_response_wrapper(
stores.delete,
)
+ self.metadata_facets = async_to_streamed_response_wrapper(
+ stores.metadata_facets,
+ )
self.question_answering = async_to_streamed_response_wrapper(
stores.question_answering,
)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 3ec3253b..20bcd899 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -53,8 +53,10 @@
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 .store_metadata_facets_params import StoreMetadataFacetsParams as StoreMetadataFacetsParams
from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
+from .store_metadata_facets_response import StoreMetadataFacetsResponse as StoreMetadataFacetsResponse
from .store_question_answering_params import StoreQuestionAnsweringParams as StoreQuestionAnsweringParams
from .store_chunk_search_options_param import StoreChunkSearchOptionsParam as StoreChunkSearchOptionsParam
from .store_question_answering_response import StoreQuestionAnsweringResponse as StoreQuestionAnsweringResponse
diff --git a/src/mixedbread/types/store_metadata_facets_params.py b/src/mixedbread/types/store_metadata_facets_params.py
new file mode 100644
index 00000000..64aa124e
--- /dev/null
+++ b/src/mixedbread/types/store_metadata_facets_params.py
@@ -0,0 +1,42 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union, Iterable, Optional
+from typing_extensions import Required, TypeAlias, TypedDict
+
+from .._types import SequenceNotStr
+from .store_chunk_search_options_param import StoreChunkSearchOptionsParam
+from .shared_params.search_filter_condition import SearchFilterCondition
+
+__all__ = ["StoreMetadataFacetsParams", "Filters", "FiltersUnionMember2"]
+
+
+class StoreMetadataFacetsParams(TypedDict, total=False):
+ query: Optional[str]
+ """Search query text"""
+
+ store_identifiers: Required[SequenceNotStr[str]]
+ """IDs or names of stores to search"""
+
+ top_k: int
+ """Number of results to return"""
+
+ filters: Optional[Filters]
+ """Optional filter conditions"""
+
+ file_ids: Union[Iterable[object], SequenceNotStr[str], None]
+ """Optional list of file IDs to filter chunks by (inclusion filter)"""
+
+ search_options: StoreChunkSearchOptionsParam
+ """Search configuration options"""
+
+ facets: Optional[SequenceNotStr[str]]
+ """Optional list of facets to return. Use dot for nested fields."""
+
+
+FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
+
+Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
+
+from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/store_metadata_facets_response.py b/src/mixedbread/types/store_metadata_facets_response.py
new file mode 100644
index 00000000..989562c4
--- /dev/null
+++ b/src/mixedbread/types/store_metadata_facets_response.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Dict
+
+from .._models import BaseModel
+
+__all__ = ["StoreMetadataFacetsResponse"]
+
+
+class StoreMetadataFacetsResponse(BaseModel):
+ facets: Dict[str, Dict[str, object]]
+ """Metadata facets"""
diff --git a/src/mixedbread/types/stores/__init__.py b/src/mixedbread/types/stores/__init__.py
index c2cec401..3dee7dac 100644
--- a/src/mixedbread/types/stores/__init__.py
+++ b/src/mixedbread/types/stores/__init__.py
@@ -10,4 +10,5 @@
from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
+from .file_retrieve_params import FileRetrieveParams as FileRetrieveParams
from .file_search_response import FileSearchResponse as FileSearchResponse
diff --git a/src/mixedbread/types/stores/file_retrieve_params.py b/src/mixedbread/types/stores/file_retrieve_params.py
new file mode 100644
index 00000000..ae924454
--- /dev/null
+++ b/src/mixedbread/types/stores/file_retrieve_params.py
@@ -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):
+ store_identifier: Required[str]
+ """The ID or name of the store"""
+
+ return_chunks: bool
+ """Whether to return the chunks for the file"""
diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py
index 7241cfa8..ea9fc27b 100644
--- a/tests/api_resources/stores/test_files.py
+++ b/tests/api_resources/stores/test_files.py
@@ -77,6 +77,63 @@ def test_path_params_create(self, client: Mixedbread) -> None:
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
+ @parametrize
+ def test_method_retrieve(self, client: Mixedbread) -> None:
+ file = client.stores.files.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_method_retrieve_with_all_params(self, client: Mixedbread) -> None:
+ file = client.stores.files.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ return_chunks=True,
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_retrieve(self, client: Mixedbread) -> None:
+ response = client.stores.files.with_raw_response.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
+ with client.stores.files.with_streaming_response.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_retrieve(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.files.with_raw_response.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_identifier` but received ''"):
+ client.stores.files.with_raw_response.retrieve(
+ file_identifier="",
+ store_identifier="store_identifier",
+ )
+
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
file = client.stores.files.list(
@@ -365,6 +422,63 @@ async def test_path_params_create(self, async_client: AsyncMixedbread) -> None:
file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
+ @parametrize
+ async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_method_retrieve_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ return_chunks=True,
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.files.with_raw_response.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.files.with_streaming_response.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.retrieve(
+ file_identifier="file_identifier",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.retrieve(
+ file_identifier="",
+ store_identifier="store_identifier",
+ )
+
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.stores.files.list(
diff --git a/tests/api_resources/test_stores.py b/tests/api_resources/test_stores.py
index 8f7c5460..47710508 100644
--- a/tests/api_resources/test_stores.py
+++ b/tests/api_resources/test_stores.py
@@ -13,6 +13,7 @@
Store,
StoreDeleteResponse,
StoreSearchResponse,
+ StoreMetadataFacetsResponse,
StoreQuestionAnsweringResponse,
)
from mixedbread.pagination import SyncCursor, AsyncCursor
@@ -229,6 +230,93 @@ def test_path_params_delete(self, client: Mixedbread) -> None:
"",
)
+ @parametrize
+ def test_method_metadata_facets(self, client: Mixedbread) -> None:
+ store = client.stores.metadata_facets(
+ store_identifiers=["string"],
+ )
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ def test_method_metadata_facets_with_all_params(self, client: Mixedbread) -> None:
+ store = client.stores.metadata_facets(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ facets=["string"],
+ )
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ def test_raw_response_metadata_facets(self, client: Mixedbread) -> None:
+ response = client.stores.with_raw_response.metadata_facets(
+ store_identifiers=["string"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = response.parse()
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ def test_streaming_response_metadata_facets(self, client: Mixedbread) -> None:
+ with client.stores.with_streaming_response.metadata_facets(
+ store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = response.parse()
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
@parametrize
def test_method_question_answering(self, client: Mixedbread) -> None:
store = client.stores.question_answering(
@@ -621,6 +709,93 @@ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
"",
)
+ @parametrize
+ async def test_method_metadata_facets(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.metadata_facets(
+ store_identifiers=["string"],
+ )
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ async def test_method_metadata_facets_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ store = await async_client.stores.metadata_facets(
+ query="how to configure SSL",
+ store_identifiers=["string"],
+ top_k=1,
+ filters={
+ "all": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "any": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ "none": [
+ {
+ "key": "price",
+ "value": "100",
+ "operator": "gt",
+ },
+ {
+ "key": "color",
+ "value": "red",
+ "operator": "eq",
+ },
+ ],
+ },
+ file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
+ search_options={
+ "score_threshold": 0,
+ "rewrite_query": True,
+ "rerank": True,
+ "return_metadata": True,
+ "apply_search_rules": True,
+ },
+ facets=["string"],
+ )
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ async def test_raw_response_metadata_facets(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.with_raw_response.metadata_facets(
+ store_identifiers=["string"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ store = await response.parse()
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_metadata_facets(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.with_streaming_response.metadata_facets(
+ store_identifiers=["string"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ store = await response.parse()
+ assert_matches_type(StoreMetadataFacetsResponse, store, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
@parametrize
async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
store = await async_client.stores.question_answering(
From 0aca2f587b67150481b317857335436497c26f97 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 3 Nov 2025 21:15:26 +0000
Subject: [PATCH 303/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 559b4513..51acdaa4 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.36.1"
+ ".": "0.37.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index f7e0b842..154ff1cd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.36.1"
+version = "0.37.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 3546b3a5..d0589864 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.36.1" # x-release-please-version
+__version__ = "0.37.0" # x-release-please-version
From 20862416f203e7749cce8dd43efd23e46106e59e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 3 Nov 2025 22:24:49 +0000
Subject: [PATCH 304/375] feat(api): update via SDK Studio
---
.stats.yml | 4 ++--
src/mixedbread/types/store.py | 2 +-
src/mixedbread/types/store_create_params.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index fe0dd56b..4244981e 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b091721a627d75feb8567f628f99405d5778b0b88e9cc09fc664dd8e97c6d720.yml
-openapi_spec_hash: a23a2aecdcff5fa1d6c8cdc0df0bdfb7
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-638e345e86725ddacfcc65291e29de92cf37b9a73da1f98fb605decb7d6be6a0.yml
+openapi_spec_hash: 55fbc9be48514291bc7f84f9f41ccfaa
config_hash: 22ce3b96e325037f81e7dbf22bdd8d24
diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py
index c380b69f..61f8fa24 100644
--- a/src/mixedbread/types/store.py
+++ b/src/mixedbread/types/store.py
@@ -20,7 +20,7 @@ class ConfigContextualizationContextualizationConfig(BaseModel):
"""
-ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig]
+ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig, None]
class Config(BaseModel):
diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py
index 92cece44..e9971d9d 100644
--- a/src/mixedbread/types/store_create_params.py
+++ b/src/mixedbread/types/store_create_params.py
@@ -48,5 +48,5 @@ class ConfigContextualizationContextualizationConfig(TypedDict, total=False):
class Config(TypedDict, total=False):
- contextualization: ConfigContextualization
+ contextualization: Optional[ConfigContextualization]
"""Contextualize files with metadata"""
From 40b3367b601efe9ba144cd5e72921c31e2502eeb Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 3 Nov 2025 22:29:08 +0000
Subject: [PATCH 305/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/store.py | 2 +-
src/mixedbread/types/store_create_params.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 4244981e..fe0dd56b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-638e345e86725ddacfcc65291e29de92cf37b9a73da1f98fb605decb7d6be6a0.yml
-openapi_spec_hash: 55fbc9be48514291bc7f84f9f41ccfaa
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b091721a627d75feb8567f628f99405d5778b0b88e9cc09fc664dd8e97c6d720.yml
+openapi_spec_hash: a23a2aecdcff5fa1d6c8cdc0df0bdfb7
config_hash: 22ce3b96e325037f81e7dbf22bdd8d24
diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py
index 61f8fa24..c380b69f 100644
--- a/src/mixedbread/types/store.py
+++ b/src/mixedbread/types/store.py
@@ -20,7 +20,7 @@ class ConfigContextualizationContextualizationConfig(BaseModel):
"""
-ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig, None]
+ConfigContextualization: TypeAlias = Union[bool, ConfigContextualizationContextualizationConfig]
class Config(BaseModel):
diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py
index e9971d9d..92cece44 100644
--- a/src/mixedbread/types/store_create_params.py
+++ b/src/mixedbread/types/store_create_params.py
@@ -48,5 +48,5 @@ class ConfigContextualizationContextualizationConfig(TypedDict, total=False):
class Config(TypedDict, total=False):
- contextualization: Optional[ConfigContextualization]
+ contextualization: ConfigContextualization
"""Contextualize files with metadata"""
From 11c4beb1b0475f99891f6d683db7ca823992333d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 3 Nov 2025 23:22:10 +0000
Subject: [PATCH 306/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index fe0dd56b..eb55da54 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b091721a627d75feb8567f628f99405d5778b0b88e9cc09fc664dd8e97c6d720.yml
openapi_spec_hash: a23a2aecdcff5fa1d6c8cdc0df0bdfb7
-config_hash: 22ce3b96e325037f81e7dbf22bdd8d24
+config_hash: c56a6c9375e7640ce70ff00420e8605a
From bdb0e9086ed0d354ea5b4f4281bd6eafa1d26779 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 4 Nov 2025 06:07:49 +0000
Subject: [PATCH 307/375] chore(internal): grammar fix (it's -> its)
---
src/mixedbread/_utils/_utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mixedbread/_utils/_utils.py b/src/mixedbread/_utils/_utils.py
index 50d59269..eec7f4a1 100644
--- a/src/mixedbread/_utils/_utils.py
+++ b/src/mixedbread/_utils/_utils.py
@@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
# Type safe methods for narrowing types with TypeVars.
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
# however this cause Pyright to rightfully report errors. As we know we don't
-# care about the contained types we can safely use `object` in it's place.
+# care about the contained types we can safely use `object` in its place.
#
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
# `is_*` is for when you're dealing with an unknown input
From b6947075da6e1d3943b64bd04d86838bc4caa001 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 4 Nov 2025 19:02:46 +0000
Subject: [PATCH 308/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 51acdaa4..8ea07c9a 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.37.0"
+ ".": "0.38.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 154ff1cd..37b16b5c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.37.0"
+version = "0.38.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 d0589864..07ad0132 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.37.0" # x-release-please-version
+__version__ = "0.38.0" # x-release-please-version
From 2a94708558886cd350426188cdc5f947a56857da Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 6 Nov 2025 00:29:04 +0000
Subject: [PATCH 309/375] feat(api): api update
---
.stats.yml | 6 +-
api.md | 2 -
src/mixedbread/resources/stores/files.py | 105 ------------------
src/mixedbread/types/stores/__init__.py | 1 -
.../types/stores/file_delete_response.py | 19 ----
tests/api_resources/stores/test_files.py | 97 ----------------
6 files changed, 3 insertions(+), 227 deletions(-)
delete mode 100644 src/mixedbread/types/stores/file_delete_response.py
diff --git a/.stats.yml b/.stats.yml
index eb55da54..0ed21676 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b091721a627d75feb8567f628f99405d5778b0b88e9cc09fc664dd8e97c6d720.yml
-openapi_spec_hash: a23a2aecdcff5fa1d6c8cdc0df0bdfb7
+configured_endpoints: 61
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-656ab86d86574c9c2fba1f067de2c3930f1f83e571d1bf77fb5720b3d7a50b79.yml
+openapi_spec_hash: 4ed47395165578f566c4ddc52338cfb5
config_hash: c56a6c9375e7640ce70ff00420e8605a
diff --git a/api.md b/api.md
index 326815b5..76ad5259 100644
--- a/api.md
+++ b/api.md
@@ -113,7 +113,6 @@ from mixedbread.types.stores import (
StoreFileStatus,
StoreFile,
FileListResponse,
- FileDeleteResponse,
FileSearchResponse,
)
```
@@ -123,7 +122,6 @@ Methods:
- client.stores.files.create(store_identifier, \*\*params) -> StoreFile
- client.stores.files.retrieve(file_identifier, \*, store_identifier, \*\*params) -> StoreFile
- client.stores.files.list(store_identifier, \*\*params) -> FileListResponse
-- client.stores.files.delete(file_id, \*, store_identifier) -> FileDeleteResponse
- client.stores.files.search(\*\*params) -> FileSearchResponse
# Parsing
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index 472f904e..a1a29ffa 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -21,7 +21,6 @@
from ...types.stores.store_file import StoreFile
from ...types.stores.store_file_status import StoreFileStatus
from ...types.stores.file_list_response import FileListResponse
-from ...types.stores.file_delete_response import FileDeleteResponse
from ...types.stores.file_search_response import FileSearchResponse
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -241,52 +240,6 @@ def list(
cast_to=FileListResponse,
)
- def delete(
- self,
- file_id: str,
- *,
- store_identifier: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> FileDeleteResponse:
- """Delete a file from a store.
-
- Args: store_identifier: The ID or name of the store.
-
- file_id: The ID or name of
- the file to delete.
-
- Returns: VectorStoreFileDeleted: The deleted file details.
-
- Args:
- store_identifier: The ID or name of the store
-
- file_id: The ID or name of the file to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not store_identifier:
- raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return self._delete(
- f"/v1/stores/{store_identifier}/files/{file_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileDeleteResponse,
- )
-
def search(
self,
*,
@@ -569,52 +522,6 @@ async def list(
cast_to=FileListResponse,
)
- async def delete(
- self,
- file_id: str,
- *,
- store_identifier: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> FileDeleteResponse:
- """Delete a file from a store.
-
- Args: store_identifier: The ID or name of the store.
-
- file_id: The ID or name of
- the file to delete.
-
- Returns: VectorStoreFileDeleted: The deleted file details.
-
- Args:
- store_identifier: The ID or name of the store
-
- file_id: The ID or name of the file to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not store_identifier:
- raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return await self._delete(
- f"/v1/stores/{store_identifier}/files/{file_id}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileDeleteResponse,
- )
-
async def search(
self,
*,
@@ -694,9 +601,6 @@ def __init__(self, files: FilesResource) -> None:
self.list = to_raw_response_wrapper(
files.list,
)
- self.delete = to_raw_response_wrapper(
- files.delete,
- )
self.search = to_raw_response_wrapper(
files.search,
)
@@ -715,9 +619,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.list = async_to_raw_response_wrapper(
files.list,
)
- self.delete = async_to_raw_response_wrapper(
- files.delete,
- )
self.search = async_to_raw_response_wrapper(
files.search,
)
@@ -736,9 +637,6 @@ def __init__(self, files: FilesResource) -> None:
self.list = to_streamed_response_wrapper(
files.list,
)
- self.delete = to_streamed_response_wrapper(
- files.delete,
- )
self.search = to_streamed_response_wrapper(
files.search,
)
@@ -757,9 +655,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.list = async_to_streamed_response_wrapper(
files.list,
)
- self.delete = async_to_streamed_response_wrapper(
- files.delete,
- )
self.search = async_to_streamed_response_wrapper(
files.search,
)
diff --git a/src/mixedbread/types/stores/__init__.py b/src/mixedbread/types/stores/__init__.py
index 3dee7dac..b20cdb89 100644
--- a/src/mixedbread/types/stores/__init__.py
+++ b/src/mixedbread/types/stores/__init__.py
@@ -9,6 +9,5 @@
from .file_create_params import FileCreateParams as FileCreateParams
from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
-from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .file_retrieve_params import FileRetrieveParams as FileRetrieveParams
from .file_search_response import FileSearchResponse as FileSearchResponse
diff --git a/src/mixedbread/types/stores/file_delete_response.py b/src/mixedbread/types/stores/file_delete_response.py
deleted file mode 100644
index ada45e9c..00000000
--- a/src/mixedbread/types/stores/file_delete_response.py
+++ /dev/null
@@ -1,19 +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__ = ["FileDeleteResponse"]
-
-
-class FileDeleteResponse(BaseModel):
- id: str
- """ID of the deleted file"""
-
- deleted: Optional[bool] = None
- """Whether the deletion was successful"""
-
- object: Optional[Literal["store.file"]] = None
- """Type of the deleted object"""
diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py
index ea9fc27b..e4f24043 100644
--- a/tests/api_resources/stores/test_files.py
+++ b/tests/api_resources/stores/test_files.py
@@ -12,7 +12,6 @@
from mixedbread.types.stores import (
StoreFile,
FileListResponse,
- FileDeleteResponse,
FileSearchResponse,
)
@@ -222,54 +221,6 @@ def test_path_params_list(self, client: Mixedbread) -> None:
store_identifier="",
)
- @parametrize
- def test_method_delete(self, client: Mixedbread) -> None:
- file = client.stores.files.delete(
- file_id="file_id",
- store_identifier="store_identifier",
- )
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- def test_raw_response_delete(self, client: Mixedbread) -> None:
- response = client.stores.files.with_raw_response.delete(
- file_id="file_id",
- store_identifier="store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- def test_streaming_response_delete(self, client: Mixedbread) -> None:
- with client.stores.files.with_streaming_response.delete(
- file_id="file_id",
- store_identifier="store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_delete(self, client: Mixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
- client.stores.files.with_raw_response.delete(
- file_id="file_id",
- store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- client.stores.files.with_raw_response.delete(
- file_id="",
- store_identifier="store_identifier",
- )
-
@parametrize
def test_method_search(self, client: Mixedbread) -> None:
file = client.stores.files.search(
@@ -567,54 +518,6 @@ async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
store_identifier="",
)
- @parametrize
- async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
- file = await async_client.stores.files.delete(
- file_id="file_id",
- store_identifier="store_identifier",
- )
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
- response = await async_client.stores.files.with_raw_response.delete(
- file_id="file_id",
- store_identifier="store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
- async with async_client.stores.files.with_streaming_response.delete(
- file_id="file_id",
- store_identifier="store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
- await async_client.stores.files.with_raw_response.delete(
- file_id="file_id",
- store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- await async_client.stores.files.with_raw_response.delete(
- file_id="",
- store_identifier="store_identifier",
- )
-
@parametrize
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
file = await async_client.stores.files.search(
From 629c80e06ee718a42f1a56a293c57693682b28c5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 7 Nov 2025 22:29:06 +0000
Subject: [PATCH 310/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/shared/search_filter_condition.py | 2 +-
src/mixedbread/types/shared_params/search_filter_condition.py | 4 +++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 0ed21676..a50756d0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 61
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-656ab86d86574c9c2fba1f067de2c3930f1f83e571d1bf77fb5720b3d7a50b79.yml
-openapi_spec_hash: 4ed47395165578f566c4ddc52338cfb5
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-c53a9b02bf4bd345435a03b4178aed1b7c8ac04a2508f370b5361bf305a3f803.yml
+openapi_spec_hash: f05a6df876280efad08ed2f0ab78d5fc
config_hash: c56a6c9375e7640ce70ff00420e8605a
diff --git a/src/mixedbread/types/shared/search_filter_condition.py b/src/mixedbread/types/shared/search_filter_condition.py
index 9e6f8c6e..36309f1d 100644
--- a/src/mixedbread/types/shared/search_filter_condition.py
+++ b/src/mixedbread/types/shared/search_filter_condition.py
@@ -14,5 +14,5 @@ class SearchFilterCondition(BaseModel):
value: object
"""The value to compare against"""
- operator: Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "not_like"]
+ operator: Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like"]
"""The operator for the condition"""
diff --git a/src/mixedbread/types/shared_params/search_filter_condition.py b/src/mixedbread/types/shared_params/search_filter_condition.py
index f2241f70..83863974 100644
--- a/src/mixedbread/types/shared_params/search_filter_condition.py
+++ b/src/mixedbread/types/shared_params/search_filter_condition.py
@@ -14,5 +14,7 @@ class SearchFilterCondition(TypedDict, total=False):
value: Required[object]
"""The value to compare against"""
- operator: Required[Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "not_like"]]
+ operator: Required[
+ Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like"]
+ ]
"""The operator for the condition"""
From 7bf9268574b9f62c20e8cd4d357e80d3f6f44ca6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 7 Nov 2025 23:47:58 +0000
Subject: [PATCH 311/375] feat(api): update via SDK Studio
---
.stats.yml | 4 +-
api.md | 2 +
src/mixedbread/resources/stores/files.py | 105 ++++++++++++++++++
src/mixedbread/types/stores/__init__.py | 1 +
.../types/stores/file_delete_response.py | 19 ++++
tests/api_resources/stores/test_files.py | 97 ++++++++++++++++
6 files changed, 226 insertions(+), 2 deletions(-)
create mode 100644 src/mixedbread/types/stores/file_delete_response.py
diff --git a/.stats.yml b/.stats.yml
index a50756d0..82ef3004 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 61
+configured_endpoints: 62
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-c53a9b02bf4bd345435a03b4178aed1b7c8ac04a2508f370b5361bf305a3f803.yml
openapi_spec_hash: f05a6df876280efad08ed2f0ab78d5fc
-config_hash: c56a6c9375e7640ce70ff00420e8605a
+config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
diff --git a/api.md b/api.md
index 76ad5259..4332059c 100644
--- a/api.md
+++ b/api.md
@@ -113,6 +113,7 @@ from mixedbread.types.stores import (
StoreFileStatus,
StoreFile,
FileListResponse,
+ FileDeleteResponse,
FileSearchResponse,
)
```
@@ -122,6 +123,7 @@ Methods:
- client.stores.files.create(store_identifier, \*\*params) -> StoreFile
- client.stores.files.retrieve(file_identifier, \*, store_identifier, \*\*params) -> StoreFile
- client.stores.files.list(store_identifier, \*\*params) -> FileListResponse
+- client.stores.files.delete(file_identifier, \*, store_identifier) -> FileDeleteResponse
- client.stores.files.search(\*\*params) -> FileSearchResponse
# Parsing
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index a1a29ffa..2b7172b3 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -21,6 +21,7 @@
from ...types.stores.store_file import StoreFile
from ...types.stores.store_file_status import StoreFileStatus
from ...types.stores.file_list_response import FileListResponse
+from ...types.stores.file_delete_response import FileDeleteResponse
from ...types.stores.file_search_response import FileSearchResponse
__all__ = ["FilesResource", "AsyncFilesResource"]
@@ -240,6 +241,52 @@ def list(
cast_to=FileListResponse,
)
+ def delete(
+ self,
+ file_identifier: str,
+ *,
+ store_identifier: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> FileDeleteResponse:
+ """Delete a file from a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_id: The ID or name of
+ the file to delete.
+
+ Returns: VectorStoreFileDeleted: The deleted file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_identifier: The ID or name of the file to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_identifier:
+ raise ValueError(f"Expected a non-empty value for `file_identifier` but received {file_identifier!r}")
+ return self._delete(
+ f"/v1/stores/{store_identifier}/files/{file_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileDeleteResponse,
+ )
+
def search(
self,
*,
@@ -522,6 +569,52 @@ async def list(
cast_to=FileListResponse,
)
+ async def delete(
+ self,
+ file_identifier: str,
+ *,
+ store_identifier: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> FileDeleteResponse:
+ """Delete a file from a store.
+
+ Args: store_identifier: The ID or name of the store.
+
+ file_id: The ID or name of
+ the file to delete.
+
+ Returns: VectorStoreFileDeleted: The deleted file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_identifier: The ID or name of the file to delete
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_identifier:
+ raise ValueError(f"Expected a non-empty value for `file_identifier` but received {file_identifier!r}")
+ return await self._delete(
+ f"/v1/stores/{store_identifier}/files/{file_identifier}",
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=FileDeleteResponse,
+ )
+
async def search(
self,
*,
@@ -601,6 +694,9 @@ def __init__(self, files: FilesResource) -> None:
self.list = to_raw_response_wrapper(
files.list,
)
+ self.delete = to_raw_response_wrapper(
+ files.delete,
+ )
self.search = to_raw_response_wrapper(
files.search,
)
@@ -619,6 +715,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.list = async_to_raw_response_wrapper(
files.list,
)
+ self.delete = async_to_raw_response_wrapper(
+ files.delete,
+ )
self.search = async_to_raw_response_wrapper(
files.search,
)
@@ -637,6 +736,9 @@ def __init__(self, files: FilesResource) -> None:
self.list = to_streamed_response_wrapper(
files.list,
)
+ self.delete = to_streamed_response_wrapper(
+ files.delete,
+ )
self.search = to_streamed_response_wrapper(
files.search,
)
@@ -655,6 +757,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.list = async_to_streamed_response_wrapper(
files.list,
)
+ self.delete = async_to_streamed_response_wrapper(
+ files.delete,
+ )
self.search = async_to_streamed_response_wrapper(
files.search,
)
diff --git a/src/mixedbread/types/stores/__init__.py b/src/mixedbread/types/stores/__init__.py
index b20cdb89..3dee7dac 100644
--- a/src/mixedbread/types/stores/__init__.py
+++ b/src/mixedbread/types/stores/__init__.py
@@ -9,5 +9,6 @@
from .file_create_params import FileCreateParams as FileCreateParams
from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
+from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .file_retrieve_params import FileRetrieveParams as FileRetrieveParams
from .file_search_response import FileSearchResponse as FileSearchResponse
diff --git a/src/mixedbread/types/stores/file_delete_response.py b/src/mixedbread/types/stores/file_delete_response.py
new file mode 100644
index 00000000..ada45e9c
--- /dev/null
+++ b/src/mixedbread/types/stores/file_delete_response.py
@@ -0,0 +1,19 @@
+# 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__ = ["FileDeleteResponse"]
+
+
+class FileDeleteResponse(BaseModel):
+ id: str
+ """ID of the deleted file"""
+
+ deleted: Optional[bool] = None
+ """Whether the deletion was successful"""
+
+ object: Optional[Literal["store.file"]] = None
+ """Type of the deleted object"""
diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py
index e4f24043..97ac0e9e 100644
--- a/tests/api_resources/stores/test_files.py
+++ b/tests/api_resources/stores/test_files.py
@@ -12,6 +12,7 @@
from mixedbread.types.stores import (
StoreFile,
FileListResponse,
+ FileDeleteResponse,
FileSearchResponse,
)
@@ -221,6 +222,54 @@ def test_path_params_list(self, client: Mixedbread) -> None:
store_identifier="",
)
+ @parametrize
+ def test_method_delete(self, client: Mixedbread) -> None:
+ file = client.stores.files.delete(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_delete(self, client: Mixedbread) -> None:
+ response = client.stores.files.with_raw_response.delete(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_delete(self, client: Mixedbread) -> None:
+ with client.stores.files.with_streaming_response.delete(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_delete(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.files.with_raw_response.delete(
+ file_identifier="file_identifier",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_identifier` but received ''"):
+ client.stores.files.with_raw_response.delete(
+ file_identifier="",
+ store_identifier="store_identifier",
+ )
+
@parametrize
def test_method_search(self, client: Mixedbread) -> None:
file = client.stores.files.search(
@@ -518,6 +567,54 @@ async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
store_identifier="",
)
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.delete(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.files.with_raw_response.delete(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.files.with_streaming_response.delete(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(FileDeleteResponse, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.delete(
+ file_identifier="file_identifier",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.delete(
+ file_identifier="",
+ store_identifier="store_identifier",
+ )
+
@parametrize
async def test_method_search(self, async_client: AsyncMixedbread) -> None:
file = await async_client.stores.files.search(
From 3d598d8ceb5615da09bcacdeca4000e264d50771 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 7 Nov 2025 23:50:25 +0000
Subject: [PATCH 312/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 8ea07c9a..1b5dc400 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.38.0"
+ ".": "0.39.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 37b16b5c..f2df0f6e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.38.0"
+version = "0.39.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 07ad0132..d0ade071 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.38.0" # x-release-please-version
+__version__ = "0.39.0" # x-release-please-version
From 1de9ff51375712ac0aae887d724e11f675b91ef2 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sun, 9 Nov 2025 03:29:24 +0000
Subject: [PATCH 313/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/parsing/parsing_job.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 82ef3004..f3a847f6 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-c53a9b02bf4bd345435a03b4178aed1b7c8ac04a2508f370b5361bf305a3f803.yml
-openapi_spec_hash: f05a6df876280efad08ed2f0ab78d5fc
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b21f3d9109043701eae9766fe5a5d0893132e2b8ba8b0bb9faff3021f28d4484.yml
+openapi_spec_hash: fe6feb5f5dc2dc45ad3893e161fc20f2
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index c950c5a4..7eaa134d 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -34,7 +34,7 @@ class ResultChunkElement(BaseModel):
class ResultChunk(BaseModel):
- content: str
+ content: Optional[str] = None
"""The full content of the chunk"""
content_to_embed: str
From 39bad66a468288711bd0278ef8099f700884adbd Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 11 Nov 2025 06:01:53 +0000
Subject: [PATCH 314/375] chore(package): drop Python 3.8 support
---
README.md | 4 ++--
pyproject.toml | 5 ++---
src/mixedbread/_utils/_sync.py | 34 +++-------------------------------
3 files changed, 7 insertions(+), 36 deletions(-)
diff --git a/README.md b/README.md
index ade28bb0..fc0e2f30 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[)](https://pypi.org/project/mixedbread/)
-The Mixedbread API Python SDK library provides convenient access to the Mixedbread REST API from any Python 3.8+
+The Mixedbread API Python SDK library provides convenient access to the Mixedbread REST API from any Python 3.9+
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
@@ -455,7 +455,7 @@ print(mixedbread.__version__)
## Requirements
-Python 3.8 or higher.
+Python 3.9 or higher.
## Contributing
diff --git a/pyproject.toml b/pyproject.toml
index f2df0f6e..4d90e990 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -15,11 +15,10 @@ dependencies = [
"distro>=1.7.0, <2",
"sniffio",
]
-requires-python = ">= 3.8"
+requires-python = ">= 3.9"
classifiers = [
"Typing :: Typed",
"Intended Audience :: Developers",
- "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
@@ -141,7 +140,7 @@ filterwarnings = [
# there are a couple of flags that are still disabled by
# default in strict mode as they are experimental and niche.
typeCheckingMode = "strict"
-pythonVersion = "3.8"
+pythonVersion = "3.9"
exclude = [
"_dev",
diff --git a/src/mixedbread/_utils/_sync.py b/src/mixedbread/_utils/_sync.py
index ad7ec71b..f6027c18 100644
--- a/src/mixedbread/_utils/_sync.py
+++ b/src/mixedbread/_utils/_sync.py
@@ -1,10 +1,8 @@
from __future__ import annotations
-import sys
import asyncio
import functools
-import contextvars
-from typing import Any, TypeVar, Callable, Awaitable
+from typing import TypeVar, Callable, Awaitable
from typing_extensions import ParamSpec
import anyio
@@ -15,34 +13,11 @@
T_ParamSpec = ParamSpec("T_ParamSpec")
-if sys.version_info >= (3, 9):
- _asyncio_to_thread = asyncio.to_thread
-else:
- # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
- # for Python 3.8 support
- async def _asyncio_to_thread(
- func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
- ) -> Any:
- """Asynchronously run function *func* in a separate thread.
-
- Any *args and **kwargs supplied for this function are directly passed
- to *func*. Also, the current :class:`contextvars.Context` is propagated,
- allowing context variables from the main thread to be accessed in the
- separate thread.
-
- Returns a coroutine that can be awaited to get the eventual result of *func*.
- """
- loop = asyncio.events.get_running_loop()
- ctx = contextvars.copy_context()
- func_call = functools.partial(ctx.run, func, *args, **kwargs)
- return await loop.run_in_executor(None, func_call)
-
-
async def to_thread(
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
) -> T_Retval:
if sniffio.current_async_library() == "asyncio":
- return await _asyncio_to_thread(func, *args, **kwargs)
+ return await asyncio.to_thread(func, *args, **kwargs)
return await anyio.to_thread.run_sync(
functools.partial(func, *args, **kwargs),
@@ -53,10 +28,7 @@ async def to_thread(
def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
"""
Take a blocking function and create an async one that receives the same
- positional and keyword arguments. For python version 3.9 and above, it uses
- asyncio.to_thread to run the function in a separate thread. For python version
- 3.8, it uses locally defined copy of the asyncio.to_thread function which was
- introduced in python 3.9.
+ positional and keyword arguments.
Usage:
From 5199bc300ecff6fdd2798ede1def775ee0858f08 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 11 Nov 2025 06:02:41 +0000
Subject: [PATCH 315/375] fix: compat with Python 3.14
---
src/mixedbread/_models.py | 11 ++++++++---
tests/test_models.py | 8 ++++----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index 6a3cd1d2..fcec2cf9 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -2,6 +2,7 @@
import os
import inspect
+import weakref
from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
from datetime import date, datetime
from typing_extensions import (
@@ -573,6 +574,9 @@ class CachedDiscriminatorType(Protocol):
__discriminator__: DiscriminatorDetails
+DISCRIMINATOR_CACHE: weakref.WeakKeyDictionary[type, DiscriminatorDetails] = weakref.WeakKeyDictionary()
+
+
class DiscriminatorDetails:
field_name: str
"""The name of the discriminator field in the variant class, e.g.
@@ -615,8 +619,9 @@ def __init__(
def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None:
- if isinstance(union, CachedDiscriminatorType):
- return union.__discriminator__
+ cached = DISCRIMINATOR_CACHE.get(union)
+ if cached is not None:
+ return cached
discriminator_field_name: str | None = None
@@ -669,7 +674,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any,
discriminator_field=discriminator_field_name,
discriminator_alias=discriminator_alias,
)
- cast(CachedDiscriminatorType, union).__discriminator__ = details
+ DISCRIMINATOR_CACHE.setdefault(union, details)
return details
diff --git a/tests/test_models.py b/tests/test_models.py
index 4a12ab5d..a8c78064 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -9,7 +9,7 @@
from mixedbread._utils import PropertyInfo
from mixedbread._compat import PYDANTIC_V1, parse_obj, model_dump, model_json
-from mixedbread._models import BaseModel, construct_type
+from mixedbread._models import DISCRIMINATOR_CACHE, BaseModel, construct_type
class BasicModel(BaseModel):
@@ -809,7 +809,7 @@ class B(BaseModel):
UnionType = cast(Any, Union[A, B])
- assert not hasattr(UnionType, "__discriminator__")
+ assert not DISCRIMINATOR_CACHE.get(UnionType)
m = construct_type(
value={"type": "b", "data": "foo"}, type_=cast(Any, Annotated[UnionType, PropertyInfo(discriminator="type")])
@@ -818,7 +818,7 @@ class B(BaseModel):
assert m.type == "b"
assert m.data == "foo" # type: ignore[comparison-overlap]
- discriminator = UnionType.__discriminator__
+ discriminator = DISCRIMINATOR_CACHE.get(UnionType)
assert discriminator is not None
m = construct_type(
@@ -830,7 +830,7 @@ class B(BaseModel):
# if the discriminator details object stays the same between invocations then
# we hit the cache
- assert UnionType.__discriminator__ is discriminator
+ assert DISCRIMINATOR_CACHE.get(UnionType) is discriminator
@pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1")
From 93130c5f5d2298c75ef483f085880aaa3bd24970 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 11 Nov 2025 06:29:11 +0000
Subject: [PATCH 316/375] feat(api): api update
---
.stats.yml | 4 +-
.../types/scored_audio_url_input_chunk.py | 12 +++++
.../types/scored_image_url_input_chunk.py | 12 +++++
.../types/scored_text_input_chunk.py | 12 +++++
.../types/scored_video_url_input_chunk.py | 12 +++++
src/mixedbread/types/stores/store_file.py | 48 +++++++++++++++++++
...ector_store_question_answering_response.py | 48 +++++++++++++++++++
.../types/vector_store_search_response.py | 48 +++++++++++++++++++
.../vector_stores/scored_vector_store_file.py | 48 +++++++++++++++++++
.../types/vector_stores/vector_store_file.py | 48 +++++++++++++++++++
10 files changed, 290 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index f3a847f6..e44510d0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b21f3d9109043701eae9766fe5a5d0893132e2b8ba8b0bb9faff3021f28d4484.yml
-openapi_spec_hash: fe6feb5f5dc2dc45ad3893e161fc20f2
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-636ffd012f5b88d33c33cd0de8290a01564009f31d8004a87a2d516435c03868.yml
+openapi_spec_hash: 91c662ed12c45e766bc325d47fd6e285
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 0babf168..107ae57e 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -49,6 +49,10 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -73,6 +77,10 @@ class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -119,6 +127,10 @@ class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index c1ea6bfa..fc929eb4 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -49,6 +49,10 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -73,6 +77,10 @@ class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -119,6 +127,10 @@ class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index 762a2a1c..2eeddb07 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -48,6 +48,10 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -72,6 +76,10 @@ class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -118,6 +126,10 @@ class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index 3329d671..488f80d0 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -49,6 +49,10 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
heading_context: Optional[List[GeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -73,6 +77,10 @@ class GeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -119,6 +127,10 @@ class GeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index 58dcef0c..dccbbe40 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -92,6 +92,10 @@ class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseMod
List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -116,6 +120,10 @@ class ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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 +170,10 @@ class ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -270,6 +282,10 @@ class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas
List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -294,6 +310,10 @@ class ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -340,6 +360,10 @@ class ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -459,6 +483,10 @@ class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas
List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -483,6 +511,10 @@ class ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -529,6 +561,10 @@ class ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -648,6 +684,10 @@ class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas
List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -672,6 +712,10 @@ class ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -718,6 +762,10 @@ class ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py
index 29d115f6..6f1d5a9b 100644
--- a/src/mixedbread/types/vector_store_question_answering_response.py
+++ b/src/mixedbread/types/vector_store_question_answering_response.py
@@ -94,6 +94,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -120,6 +124,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -170,6 +178,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -307,6 +319,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputC
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -333,6 +349,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputC
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -383,6 +403,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputC
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -531,6 +555,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputC
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -557,6 +585,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputC
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -607,6 +639,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputC
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -755,6 +791,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputC
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -781,6 +821,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputC
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -831,6 +875,10 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputC
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py
index 41f4d77b..dd5c4f2c 100644
--- a/src/mixedbread/types/vector_store_search_response.py
+++ b/src/mixedbread/types/vector_store_search_response.py
@@ -94,6 +94,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGe
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -120,6 +124,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGe
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -170,6 +178,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGe
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -307,6 +319,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChu
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -333,6 +349,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChu
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -383,6 +403,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChu
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -531,6 +555,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChu
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -557,6 +585,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChu
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -607,6 +639,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChu
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -755,6 +791,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChu
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -781,6 +821,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChu
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -831,6 +875,10 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChu
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
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 85e4721e..55e1ed55 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -96,6 +96,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkG
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -122,6 +126,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkG
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -172,6 +180,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkG
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -309,6 +321,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputCh
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -335,6 +351,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputCh
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -385,6 +405,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputCh
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -533,6 +557,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputCh
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -559,6 +587,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputCh
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -609,6 +641,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputCh
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -757,6 +793,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputCh
]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -783,6 +823,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputCh
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -833,6 +877,10 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputCh
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 2fc6168d..02f8f31a 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -86,6 +86,10 @@ class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseMod
List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -110,6 +114,10 @@ class ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -156,6 +164,10 @@ class ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -264,6 +276,10 @@ class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas
List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -288,6 +304,10 @@ class ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -334,6 +354,10 @@ class ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -453,6 +477,10 @@ class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas
List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -477,6 +505,10 @@ class ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -523,6 +555,10 @@ class ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -642,6 +678,10 @@ class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas
List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
] = None
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -666,6 +706,10 @@ class ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
@@ -712,6 +756,10 @@ class ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseMod
file_size: int
+ start_line: Optional[int] = None
+
+ num_lines: Optional[int] = 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.
From 4bfaa0acb91f071b10043798b929af50f97fa467 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 11 Nov 2025 06:36:18 +0000
Subject: [PATCH 317/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 1b5dc400..0a40b9d7 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.39.0"
+ ".": "0.40.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 4d90e990..5b3f8eab 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.39.0"
+version = "0.40.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 d0ade071..326f9b6c 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.39.0" # x-release-please-version
+__version__ = "0.40.0" # x-release-please-version
From 1ae292fc1c27a3f19213b64bc23981e7e76e9505 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 12 Nov 2025 05:34:12 +0000
Subject: [PATCH 318/375] fix(compat): update signatures of `model_dump` and
`model_dump_json` for Pydantic v1
---
src/mixedbread/_models.py | 41 +++++++++++++++++++++++++++------------
1 file changed, 29 insertions(+), 12 deletions(-)
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index fcec2cf9..ca9500b2 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -257,15 +257,16 @@ def model_dump(
mode: Literal["json", "python"] | str = "python",
include: IncEx | None = None,
exclude: IncEx | None = None,
+ context: Any | None = None,
by_alias: bool | None = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
+ exclude_computed_fields: bool = False,
round_trip: bool = False,
warnings: bool | Literal["none", "warn", "error"] = True,
- context: dict[str, Any] | None = None,
- serialize_as_any: bool = False,
fallback: Callable[[Any], Any] | None = None,
+ serialize_as_any: bool = False,
) -> dict[str, Any]:
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
@@ -273,16 +274,24 @@ def model_dump(
Args:
mode: The mode in which `to_python` should run.
- If mode is 'json', the dictionary will only contain JSON serializable types.
- If mode is 'python', the dictionary may contain any Python objects.
- include: A list of fields to include in the output.
- exclude: A list of fields to exclude from the output.
+ If mode is 'json', the output will only contain JSON serializable types.
+ If mode is 'python', the output may contain non-JSON-serializable Python objects.
+ include: A set of fields to include in the output.
+ exclude: A set of fields to exclude from the output.
+ context: Additional context to pass to the serializer.
by_alias: Whether to use the field's alias in the dictionary key if defined.
- exclude_unset: Whether to exclude fields that are unset or None from the output.
- exclude_defaults: Whether to exclude fields that are set to their default value from the output.
- exclude_none: Whether to exclude fields that have a value of `None` from the output.
- round_trip: Whether to enable serialization and deserialization round-trip support.
- warnings: Whether to log warnings when invalid fields are encountered.
+ exclude_unset: Whether to exclude fields that have not been explicitly set.
+ exclude_defaults: Whether to exclude fields that are set to their default value.
+ exclude_none: Whether to exclude fields that have a value of `None`.
+ exclude_computed_fields: Whether to exclude computed fields.
+ While this can be useful for round-tripping, it is usually recommended to use the dedicated
+ `round_trip` parameter instead.
+ round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T].
+ warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors,
+ "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError].
+ fallback: A function to call when an unknown value is encountered. If not provided,
+ a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised.
+ serialize_as_any: Whether to serialize fields with duck-typing serialization behavior.
Returns:
A dictionary representation of the model.
@@ -299,6 +308,8 @@ def model_dump(
raise ValueError("serialize_as_any is only supported in Pydantic v2")
if fallback is not None:
raise ValueError("fallback is only supported in Pydantic v2")
+ if exclude_computed_fields != False:
+ raise ValueError("exclude_computed_fields is only supported in Pydantic v2")
dumped = super().dict( # pyright: ignore[reportDeprecated]
include=include,
exclude=exclude,
@@ -315,15 +326,17 @@ def model_dump_json(
self,
*,
indent: int | None = None,
+ ensure_ascii: bool = False,
include: IncEx | None = None,
exclude: IncEx | None = None,
+ context: Any | None = None,
by_alias: bool | None = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
+ exclude_computed_fields: bool = False,
round_trip: bool = False,
warnings: bool | Literal["none", "warn", "error"] = True,
- context: dict[str, Any] | None = None,
fallback: Callable[[Any], Any] | None = None,
serialize_as_any: bool = False,
) -> str:
@@ -355,6 +368,10 @@ def model_dump_json(
raise ValueError("serialize_as_any is only supported in Pydantic v2")
if fallback is not None:
raise ValueError("fallback is only supported in Pydantic v2")
+ if ensure_ascii != False:
+ raise ValueError("ensure_ascii is only supported in Pydantic v2")
+ if exclude_computed_fields != False:
+ raise ValueError("exclude_computed_fields is only supported in Pydantic v2")
return super().json( # type: ignore[reportDeprecated]
indent=indent,
include=include,
From 31a7385a5d0d6c4c8636bbfa9e841f06a90c5e3f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 13 Nov 2025 21:29:12 +0000
Subject: [PATCH 319/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e44510d0..0d2ca48a 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-636ffd012f5b88d33c33cd0de8290a01564009f31d8004a87a2d516435c03868.yml
-openapi_spec_hash: 91c662ed12c45e766bc325d47fd6e285
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-262a1de59b353f54a133eb2632ea6d62574343316d901f0b0aeb49b89146679d.yml
+openapi_spec_hash: 104eed2d3bd33e2fb191094a7b9e6323
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
From 620f394991312b8b1b5d4c0854a493eb619a2e76 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 15 Nov 2025 02:11:27 +0000
Subject: [PATCH 320/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/stores/files.py | 10 ++++++----
src/mixedbread/types/stores/file_retrieve_params.py | 9 +++++++--
3 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 0d2ca48a..31055583 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-262a1de59b353f54a133eb2632ea6d62574343316d901f0b0aeb49b89146679d.yml
-openapi_spec_hash: 104eed2d3bd33e2fb191094a7b9e6323
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e9dc6c785e53888e6234a39f02c1a5c8b71dd423e4b7b31aa963324b713bf240.yml
+openapi_spec_hash: 31f9db79886e161a1696309b67d3997c
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index 2b7172b3..ec5d311b 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -122,7 +122,7 @@ def retrieve(
file_identifier: str,
*,
store_identifier: str,
- return_chunks: bool | Omit = omit,
+ return_chunks: Union[bool, Iterable[int]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -144,7 +144,8 @@ def retrieve(
file_identifier: The ID or name of the file
- return_chunks: Whether to return the chunks for the file
+ return_chunks: Whether to return the chunks for the file. If a list of integers is provided,
+ only the chunks at the specified indices will be returned.
extra_headers: Send extra headers
@@ -448,7 +449,7 @@ async def retrieve(
file_identifier: str,
*,
store_identifier: str,
- return_chunks: bool | Omit = omit,
+ return_chunks: Union[bool, Iterable[int]] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -470,7 +471,8 @@ async def retrieve(
file_identifier: The ID or name of the file
- return_chunks: Whether to return the chunks for the file
+ return_chunks: Whether to return the chunks for the file. If a list of integers is provided,
+ only the chunks at the specified indices will be returned.
extra_headers: Send extra headers
diff --git a/src/mixedbread/types/stores/file_retrieve_params.py b/src/mixedbread/types/stores/file_retrieve_params.py
index ae924454..b77c870a 100644
--- a/src/mixedbread/types/stores/file_retrieve_params.py
+++ b/src/mixedbread/types/stores/file_retrieve_params.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Union, Iterable
from typing_extensions import Required, TypedDict
__all__ = ["FileRetrieveParams"]
@@ -11,5 +12,9 @@ class FileRetrieveParams(TypedDict, total=False):
store_identifier: Required[str]
"""The ID or name of the store"""
- return_chunks: bool
- """Whether to return the chunks for the file"""
+ return_chunks: Union[bool, Iterable[int]]
+ """Whether to return the chunks for the file.
+
+ If a list of integers is provided, only the chunks at the specified indices will
+ be returned.
+ """
From 3663018f6733d3b0d00e672e4fb11bf587b0a62f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 15 Nov 2025 02:16:03 +0000
Subject: [PATCH 321/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 0a40b9d7..ea2682c3 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.40.0"
+ ".": "0.41.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 5b3f8eab..e23c54f4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.40.0"
+version = "0.41.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 326f9b6c..5f340587 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.40.0" # x-release-please-version
+__version__ = "0.41.0" # x-release-please-version
From adf0c05429c58a84350ab8b18b53680d965128f7 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 17 Nov 2025 23:29:23 +0000
Subject: [PATCH 322/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 31055583..83c78741 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-e9dc6c785e53888e6234a39f02c1a5c8b71dd423e4b7b31aa963324b713bf240.yml
-openapi_spec_hash: 31f9db79886e161a1696309b67d3997c
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-d1138fb7b1e44f4ac0842616e0ca134f665de02877b82d583a6bca8b514dbfe5.yml
+openapi_spec_hash: 6e79bccf0622ba0484cbabc1874d2b3e
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
From 54105b1d345542215e55c5dcac858a609b97b2ff Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 22 Nov 2025 05:06:12 +0000
Subject: [PATCH 323/375] chore: add Python 3.14 classifier and testing
---
pyproject.toml | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyproject.toml b/pyproject.toml
index e23c54f4..a19d0e3e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
From b7795165fcabb1460aacd116d091cccf8a43861a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 28 Nov 2025 03:46:11 +0000
Subject: [PATCH 324/375] fix: ensure streams are always closed
---
src/mixedbread/_streaming.py | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/mixedbread/_streaming.py b/src/mixedbread/_streaming.py
index ffe39031..e7f6340f 100644
--- a/src/mixedbread/_streaming.py
+++ b/src/mixedbread/_streaming.py
@@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]:
process_data = self._client._process_response_data
iterator = self._iter_events()
- for sse in iterator:
- yield process_data(data=sse.json(), cast_to=cast_to, response=response)
-
- # As we might not fully consume the response stream, we need to close it explicitly
- response.close()
+ try:
+ for sse in iterator:
+ yield process_data(data=sse.json(), cast_to=cast_to, response=response)
+ finally:
+ # Ensure the response is closed even if the consumer doesn't read all data
+ response.close()
def __enter__(self) -> Self:
return self
@@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]:
process_data = self._client._process_response_data
iterator = self._iter_events()
- async for sse in iterator:
- yield process_data(data=sse.json(), cast_to=cast_to, response=response)
-
- # As we might not fully consume the response stream, we need to close it explicitly
- await response.aclose()
+ try:
+ async for sse in iterator:
+ yield process_data(data=sse.json(), cast_to=cast_to, response=response)
+ finally:
+ # Ensure the response is closed even if the consumer doesn't read all data
+ await response.aclose()
async def __aenter__(self) -> Self:
return self
From 8d17523cb94b68aacf1b0881cae1dcd6bd2e0b4f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 28 Nov 2025 03:47:17 +0000
Subject: [PATCH 325/375] chore(deps): mypy 1.18.1 has a regression, pin to
1.17
---
pyproject.toml | 2 +-
requirements-dev.lock | 4 +++-
requirements.lock | 8 ++++----
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index a19d0e3e..ec572136 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -46,7 +46,7 @@ managed = true
# version pins are in requirements-dev.lock
dev-dependencies = [
"pyright==1.1.399",
- "mypy",
+ "mypy==1.17",
"respx",
"pytest",
"pytest-asyncio",
diff --git a/requirements-dev.lock b/requirements-dev.lock
index 3813c2e4..21a0482b 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -72,7 +72,7 @@ mdurl==0.1.2
multidict==6.4.4
# via aiohttp
# via yarl
-mypy==1.14.1
+mypy==1.17.0
mypy-extensions==1.0.0
# via mypy
nodeenv==1.8.0
@@ -81,6 +81,8 @@ nox==2023.4.22
packaging==23.2
# via nox
# via pytest
+pathspec==0.12.1
+ # via mypy
platformdirs==3.11.0
# via virtualenv
pluggy==1.5.0
diff --git a/requirements.lock b/requirements.lock
index 8d80628d..4bbda835 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -55,21 +55,21 @@ multidict==6.4.4
propcache==0.3.1
# via aiohttp
# via yarl
-pydantic==2.11.9
+pydantic==2.12.5
# via mixedbread
-pydantic-core==2.33.2
+pydantic-core==2.41.5
# via pydantic
sniffio==1.3.0
# via anyio
# via mixedbread
-typing-extensions==4.12.2
+typing-extensions==4.15.0
# via anyio
# via mixedbread
# via multidict
# via pydantic
# via pydantic-core
# via typing-inspection
-typing-inspection==0.4.1
+typing-inspection==0.4.2
# via pydantic
yarl==1.20.0
# via aiohttp
From 76587e04acd2bd08a2964da3dca82556789efd07 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 28 Nov 2025 10:29:06 +0000
Subject: [PATCH 326/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/shared/search_filter_condition.py | 4 +++-
src/mixedbread/types/shared_params/search_filter_condition.py | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 83c78741..e293ab94 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-d1138fb7b1e44f4ac0842616e0ca134f665de02877b82d583a6bca8b514dbfe5.yml
-openapi_spec_hash: 6e79bccf0622ba0484cbabc1874d2b3e
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-2f025280572fdb5ba0f4a511b7d9c231620a50fbcee2d256eebabf6ffa71af67.yml
+openapi_spec_hash: d205f6a69f62e98c326301a586c22fb9
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
diff --git a/src/mixedbread/types/shared/search_filter_condition.py b/src/mixedbread/types/shared/search_filter_condition.py
index 36309f1d..9ba20f6d 100644
--- a/src/mixedbread/types/shared/search_filter_condition.py
+++ b/src/mixedbread/types/shared/search_filter_condition.py
@@ -14,5 +14,7 @@ class SearchFilterCondition(BaseModel):
value: object
"""The value to compare against"""
- operator: Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like"]
+ operator: Literal[
+ "eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like", "regex"
+ ]
"""The operator for the condition"""
diff --git a/src/mixedbread/types/shared_params/search_filter_condition.py b/src/mixedbread/types/shared_params/search_filter_condition.py
index 83863974..b7ba328c 100644
--- a/src/mixedbread/types/shared_params/search_filter_condition.py
+++ b/src/mixedbread/types/shared_params/search_filter_condition.py
@@ -15,6 +15,6 @@ class SearchFilterCondition(TypedDict, total=False):
"""The value to compare against"""
operator: Required[
- Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like"]
+ Literal["eq", "not_eq", "gt", "gte", "lt", "lte", "in", "not_in", "like", "starts_with", "not_like", "regex"]
]
"""The operator for the condition"""
From 9f0e7f324243ec93730822f44bf760042e0b887e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 3 Dec 2025 07:43:36 +0000
Subject: [PATCH 327/375] chore: update lockfile
---
pyproject.toml | 14 +++---
requirements-dev.lock | 108 +++++++++++++++++++++++-------------------
requirements.lock | 31 ++++++------
3 files changed, 83 insertions(+), 70 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index ec572136..eec1566d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,14 +7,16 @@ license = "Apache-2.0"
authors = [
{ name = "Mixedbread", email = "support@mixedbread.com" },
]
+
dependencies = [
- "httpx>=0.23.0, <1",
- "pydantic>=1.9.0, <3",
- "typing-extensions>=4.10, <5",
- "anyio>=3.5.0, <5",
- "distro>=1.7.0, <2",
- "sniffio",
+ "httpx>=0.23.0, <1",
+ "pydantic>=1.9.0, <3",
+ "typing-extensions>=4.10, <5",
+ "anyio>=3.5.0, <5",
+ "distro>=1.7.0, <2",
+ "sniffio",
]
+
requires-python = ">= 3.9"
classifiers = [
"Typing :: Typed",
diff --git a/requirements-dev.lock b/requirements-dev.lock
index 21a0482b..fe8d5892 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -12,40 +12,45 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
-aiohttp==3.12.8
+aiohttp==3.13.2
# via httpx-aiohttp
# via mixedbread
-aiosignal==1.3.2
+aiosignal==1.4.0
# via aiohttp
-annotated-types==0.6.0
+annotated-types==0.7.0
# via pydantic
-anyio==4.4.0
+anyio==4.12.0
# via httpx
# via mixedbread
-argcomplete==3.1.2
+argcomplete==3.6.3
# via nox
async-timeout==5.0.1
# via aiohttp
-attrs==25.3.0
+attrs==25.4.0
# via aiohttp
-certifi==2023.7.22
+ # via nox
+backports-asyncio-runner==1.2.0
+ # via pytest-asyncio
+certifi==2025.11.12
# via httpcore
# via httpx
-colorlog==6.7.0
+colorlog==6.10.1
+ # via nox
+dependency-groups==1.3.1
# via nox
-dirty-equals==0.6.0
-distlib==0.3.7
+dirty-equals==0.11
+distlib==0.4.0
# via virtualenv
-distro==1.8.0
+distro==1.9.0
# via mixedbread
-exceptiongroup==1.2.2
+exceptiongroup==1.3.1
# via anyio
# via pytest
-execnet==2.1.1
+execnet==2.1.2
# via pytest-xdist
-filelock==3.12.4
+filelock==3.19.1
# via virtualenv
-frozenlist==1.6.2
+frozenlist==1.8.0
# via aiohttp
# via aiosignal
h11==0.16.0
@@ -58,82 +63,87 @@ httpx==0.28.1
# via respx
httpx-aiohttp==0.1.9
# via mixedbread
-idna==3.4
+humanize==4.13.0
+ # via nox
+idna==3.11
# via anyio
# via httpx
# via yarl
-importlib-metadata==7.0.0
-iniconfig==2.0.0
+importlib-metadata==8.7.0
+iniconfig==2.1.0
# via pytest
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
-multidict==6.4.4
+multidict==6.7.0
# via aiohttp
# via yarl
mypy==1.17.0
-mypy-extensions==1.0.0
+mypy-extensions==1.1.0
# via mypy
-nodeenv==1.8.0
+nodeenv==1.9.1
# via pyright
-nox==2023.4.22
-packaging==23.2
+nox==2025.11.12
+packaging==25.0
+ # via dependency-groups
# via nox
# via pytest
pathspec==0.12.1
# via mypy
-platformdirs==3.11.0
+platformdirs==4.4.0
# via virtualenv
-pluggy==1.5.0
+pluggy==1.6.0
# via pytest
-propcache==0.3.1
+propcache==0.4.1
# via aiohttp
# via yarl
-pydantic==2.11.9
+pydantic==2.12.5
# via mixedbread
-pydantic-core==2.33.2
+pydantic-core==2.41.5
# via pydantic
-pygments==2.18.0
+pygments==2.19.2
+ # via pytest
# via rich
pyright==1.1.399
-pytest==8.3.3
+pytest==8.4.2
# via pytest-asyncio
# via pytest-xdist
-pytest-asyncio==0.24.0
-pytest-xdist==3.7.0
-python-dateutil==2.8.2
+pytest-asyncio==1.2.0
+pytest-xdist==3.8.0
+python-dateutil==2.9.0.post0
# via time-machine
-pytz==2023.3.post1
- # via dirty-equals
respx==0.22.0
-rich==13.7.1
-ruff==0.9.4
-setuptools==68.2.2
- # via nodeenv
-six==1.16.0
+rich==14.2.0
+ruff==0.14.7
+six==1.17.0
# via python-dateutil
-sniffio==1.3.0
- # via anyio
+sniffio==1.3.1
# via mixedbread
-time-machine==2.9.0
-tomli==2.0.2
+time-machine==2.19.0
+tomli==2.3.0
+ # via dependency-groups
# via mypy
+ # via nox
# via pytest
-typing-extensions==4.12.2
+typing-extensions==4.15.0
+ # via aiosignal
# via anyio
+ # via exceptiongroup
# via mixedbread
# via multidict
# via mypy
# via pydantic
# via pydantic-core
# via pyright
+ # via pytest-asyncio
# via typing-inspection
-typing-inspection==0.4.1
+ # via virtualenv
+typing-inspection==0.4.2
# via pydantic
-virtualenv==20.24.5
+virtualenv==20.35.4
# via nox
-yarl==1.20.0
+yarl==1.22.0
# via aiohttp
-zipp==3.17.0
+zipp==3.23.0
# via importlib-metadata
diff --git a/requirements.lock b/requirements.lock
index 4bbda835..1161d859 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -12,28 +12,28 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
-aiohttp==3.12.8
+aiohttp==3.13.2
# via httpx-aiohttp
# via mixedbread
-aiosignal==1.3.2
+aiosignal==1.4.0
# via aiohttp
-annotated-types==0.6.0
+annotated-types==0.7.0
# via pydantic
-anyio==4.4.0
+anyio==4.12.0
# via httpx
# via mixedbread
async-timeout==5.0.1
# via aiohttp
-attrs==25.3.0
+attrs==25.4.0
# via aiohttp
-certifi==2023.7.22
+certifi==2025.11.12
# via httpcore
# via httpx
-distro==1.8.0
+distro==1.9.0
# via mixedbread
-exceptiongroup==1.2.2
+exceptiongroup==1.3.1
# via anyio
-frozenlist==1.6.2
+frozenlist==1.8.0
# via aiohttp
# via aiosignal
h11==0.16.0
@@ -45,25 +45,26 @@ httpx==0.28.1
# via mixedbread
httpx-aiohttp==0.1.9
# via mixedbread
-idna==3.4
+idna==3.11
# via anyio
# via httpx
# via yarl
-multidict==6.4.4
+multidict==6.7.0
# via aiohttp
# via yarl
-propcache==0.3.1
+propcache==0.4.1
# via aiohttp
# via yarl
pydantic==2.12.5
# via mixedbread
pydantic-core==2.41.5
# via pydantic
-sniffio==1.3.0
- # via anyio
+sniffio==1.3.1
# via mixedbread
typing-extensions==4.15.0
+ # via aiosignal
# via anyio
+ # via exceptiongroup
# via mixedbread
# via multidict
# via pydantic
@@ -71,5 +72,5 @@ typing-extensions==4.15.0
# via typing-inspection
typing-inspection==0.4.2
# via pydantic
-yarl==1.20.0
+yarl==1.22.0
# via aiohttp
From 75245b5d3b61ae1f2def1b14302e309481fded8a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 3 Dec 2025 07:53:20 +0000
Subject: [PATCH 328/375] chore(docs): use environment variables for
authentication in code snippets
---
README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index fc0e2f30..33fcbd13 100644
--- a/README.md
+++ b/README.md
@@ -83,6 +83,7 @@ pip install mixedbread[aiohttp]
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
```python
+import os
import asyncio
from mixedbread import DefaultAioHttpClient
from mixedbread import AsyncMixedbread
@@ -90,7 +91,7 @@ from mixedbread import AsyncMixedbread
async def main() -> None:
async with AsyncMixedbread(
- api_key="My API Key",
+ api_key=os.environ.get("MXBAI_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
store = await client.stores.create()
From d5332730d1502eb2867b2872d5081bba51faaa6b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 6 Dec 2025 16:28:25 +0000
Subject: [PATCH 329/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/stores/files.py | 8 ++++++++
src/mixedbread/types/parsing/element_type.py | 16 ++++++++--------
src/mixedbread/types/store.py | 3 +++
src/mixedbread/types/stores/file_list_params.py | 3 +++
src/mixedbread/types/stores/scored_store_file.py | 3 +++
src/mixedbread/types/stores/store_file.py | 3 +++
tests/api_resources/parsing/test_jobs.py | 4 ++--
tests/api_resources/stores/test_files.py | 2 ++
9 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e293ab94..e1032ca6 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-2f025280572fdb5ba0f4a511b7d9c231620a50fbcee2d256eebabf6ffa71af67.yml
-openapi_spec_hash: d205f6a69f62e98c326301a586c22fb9
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-bc57b04eacad32c8e89b4d6eac2a369fd0b013bb7be49b698a3372d6393753f7.yml
+openapi_spec_hash: 2591884e7b1b6c328cb5a88449282ccd
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index ec5d311b..ad26919f 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -181,6 +181,7 @@ def list(
include_total: bool | Omit = omit,
statuses: Optional[List[StoreFileStatus]] | Omit = omit,
metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
+ q: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -213,6 +214,8 @@ def list(
metadata_filter: Metadata filter to apply to the query
+ q: Search query for fuzzy matching over name and description fields
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -233,6 +236,7 @@ def list(
"include_total": include_total,
"statuses": statuses,
"metadata_filter": metadata_filter,
+ "q": q,
},
file_list_params.FileListParams,
),
@@ -510,6 +514,7 @@ async def list(
include_total: bool | Omit = omit,
statuses: Optional[List[StoreFileStatus]] | Omit = omit,
metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
+ q: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -542,6 +547,8 @@ async def list(
metadata_filter: Metadata filter to apply to the query
+ q: Search query for fuzzy matching over name and description fields
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -562,6 +569,7 @@ async def list(
"include_total": include_total,
"statuses": statuses,
"metadata_filter": metadata_filter,
+ "q": q,
},
file_list_params.FileListParams,
),
diff --git a/src/mixedbread/types/parsing/element_type.py b/src/mixedbread/types/parsing/element_type.py
index 011208d8..e655f0b3 100644
--- a/src/mixedbread/types/parsing/element_type.py
+++ b/src/mixedbread/types/parsing/element_type.py
@@ -5,15 +5,15 @@
__all__ = ["ElementType"]
ElementType: TypeAlias = Literal[
- "caption",
- "footnote",
- "formula",
- "list-item",
- "page-footer",
- "page-header",
- "picture",
+ "header",
+ "footer",
+ "title",
"section-header",
+ "page-number",
+ "list-item",
+ "figure",
"table",
+ "form",
"text",
- "title",
+ "footnote",
]
diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py
index c380b69f..eac4354e 100644
--- a/src/mixedbread/types/store.py
+++ b/src/mixedbread/types/store.py
@@ -88,6 +88,9 @@ class Store(BaseModel):
usage_bytes: Optional[int] = None
"""Total storage usage in bytes"""
+ usage_tokens: Optional[int] = None
+ """Total storage usage in tokens"""
+
expires_at: Optional[datetime] = None
"""Optional expiration timestamp for the store"""
diff --git a/src/mixedbread/types/stores/file_list_params.py b/src/mixedbread/types/stores/file_list_params.py
index 27edd05e..2782573a 100644
--- a/src/mixedbread/types/stores/file_list_params.py
+++ b/src/mixedbread/types/stores/file_list_params.py
@@ -36,6 +36,9 @@ class FileListParams(TypedDict, total=False):
metadata_filter: Optional[MetadataFilter]
"""Metadata filter to apply to the query"""
+ q: Optional[str]
+ """Search query for fuzzy matching over name and description fields"""
+
MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
diff --git a/src/mixedbread/types/stores/scored_store_file.py b/src/mixedbread/types/stores/scored_store_file.py
index 3d8a3c02..1b9b1ae2 100644
--- a/src/mixedbread/types/stores/scored_store_file.py
+++ b/src/mixedbread/types/stores/scored_store_file.py
@@ -57,6 +57,9 @@ class ScoredStoreFile(BaseModel):
usage_bytes: Optional[int] = None
"""Storage usage in bytes"""
+ usage_tokens: Optional[int] = None
+ """Storage usage in tokens"""
+
config: Optional[Config] = None
"""Configuration for a file."""
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index dccbbe40..6af29e73 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -888,6 +888,9 @@ class StoreFile(BaseModel):
usage_bytes: Optional[int] = None
"""Storage usage in bytes"""
+ usage_tokens: Optional[int] = None
+ """Storage usage in tokens"""
+
config: Optional[Config] = None
"""Configuration for a file."""
diff --git a/tests/api_resources/parsing/test_jobs.py b/tests/api_resources/parsing/test_jobs.py
index 7ffccb59..50842fb3 100644
--- a/tests/api_resources/parsing/test_jobs.py
+++ b/tests/api_resources/parsing/test_jobs.py
@@ -33,7 +33,7 @@ def test_method_create(self, client: Mixedbread) -> None:
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
job = client.parsing.jobs.create(
file_id="file_id",
- element_types=["caption"],
+ element_types=["header"],
chunking_strategy="page",
return_format="html",
mode="fast",
@@ -232,7 +232,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
job = await async_client.parsing.jobs.create(
file_id="file_id",
- element_types=["caption"],
+ element_types=["header"],
chunking_strategy="page",
return_format="html",
mode="fast",
diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py
index 97ac0e9e..67a4d8e5 100644
--- a/tests/api_resources/stores/test_files.py
+++ b/tests/api_resources/stores/test_files.py
@@ -188,6 +188,7 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
},
],
},
+ q="x",
)
assert_matches_type(FileListResponse, file, path=["response"])
@@ -533,6 +534,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
},
],
},
+ q="x",
)
assert_matches_type(FileListResponse, file, path=["response"])
From 13fcdf1f2434308af54ea650bc29158d61dfd95f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 9 Dec 2025 05:38:58 +0000
Subject: [PATCH 330/375] fix(types): allow pyright to infer TypedDict types
within SequenceNotStr
---
src/mixedbread/_types.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_types.py b/src/mixedbread/_types.py
index 97471b6c..78d87ade 100644
--- a/src/mixedbread/_types.py
+++ b/src/mixedbread/_types.py
@@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False):
if TYPE_CHECKING:
# This works because str.__contains__ does not accept object (either in typeshed or at runtime)
# https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
+ #
+ # Note: index() and count() methods are intentionally omitted to allow pyright to properly
+ # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr.
class SequenceNotStr(Protocol[_T_co]):
@overload
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
@@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ...
def __contains__(self, value: object, /) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T_co]: ...
- def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
- def count(self, value: Any, /) -> int: ...
def __reversed__(self) -> Iterator[_T_co]: ...
else:
# just point this to a normal `Sequence` at runtime to avoid having to special case
From da2dc744d3b5b2033e1f3ecdead8e133091bfa60 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 9 Dec 2025 05:40:36 +0000
Subject: [PATCH 331/375] chore: add missing docstrings
---
src/mixedbread/types/api_key.py | 2 ++
src/mixedbread/types/api_key_created.py | 2 ++
src/mixedbread/types/api_key_delete_response.py | 2 ++
src/mixedbread/types/data_source.py | 4 ++++
.../types/data_source_create_params.py | 2 ++
.../types/data_source_delete_response.py | 2 ++
.../types/data_source_oauth2_params.py | 2 ++
.../types/data_source_update_params.py | 2 ++
.../data_sources/connector_delete_response.py | 2 ++
.../types/data_sources/data_source_connector.py | 2 ++
src/mixedbread/types/expires_after.py | 2 ++
src/mixedbread/types/expires_after_param.py | 2 ++
.../types/extractions/created_json_schema.py | 2 ++
.../types/extractions/enhanced_json_schema.py | 2 ++
.../types/extractions/extraction_job.py | 2 ++
.../types/extractions/extraction_result.py | 2 ++
.../types/extractions/image_url_input_param.py | 4 ++++
.../types/extractions/text_input_param.py | 7 +++++++
.../types/extractions/validated_json_schema.py | 2 ++
src/mixedbread/types/file_object.py | 6 ++++++
src/mixedbread/types/info_response.py | 2 ++
src/mixedbread/types/linear_data_source_param.py | 2 ++
src/mixedbread/types/multi_encoding_embedding.py | 4 ++++
src/mixedbread/types/notion_data_source_param.py | 4 ++++
src/mixedbread/types/oauth2_params.py | 2 ++
src/mixedbread/types/pagination_with_total.py | 2 ++
.../types/parsing/job_delete_response.py | 2 ++
.../types/parsing/job_list_response.py | 2 ++
src/mixedbread/types/parsing/parsing_job.py | 8 ++++++++
.../types/scored_audio_url_input_chunk.py | 2 ++
.../types/scored_image_url_input_chunk.py | 2 ++
.../types/scored_video_url_input_chunk.py | 2 ++
src/mixedbread/types/shared/search_filter.py | 2 ++
.../types/shared/search_filter_condition.py | 2 ++
.../types/shared_params/search_filter.py | 2 ++
.../shared_params/search_filter_condition.py | 2 ++
src/mixedbread/types/store.py | 6 ++++++
.../types/store_chunk_search_options_param.py | 2 ++
src/mixedbread/types/store_create_params.py | 2 ++
src/mixedbread/types/store_delete_response.py | 2 ++
.../types/store_metadata_facets_response.py | 2 ++
.../types/store_question_answering_params.py | 2 ++
.../types/store_question_answering_response.py | 2 ++
.../types/stores/file_create_params.py | 4 ++++
.../types/stores/file_delete_response.py | 2 ++
.../types/stores/file_list_response.py | 2 ++
.../types/stores/file_search_params.py | 2 ++
src/mixedbread/types/stores/scored_store_file.py | 4 ++++
src/mixedbread/types/stores/store_file.py | 10 ++++++++++
src/mixedbread/types/vector_store.py | 4 ++++
.../vector_store_chunk_search_options_param.py | 2 ++
.../types/vector_store_delete_response.py | 2 ++
.../vector_store_question_answering_params.py | 2 ++
.../vector_store_question_answering_response.py | 16 ++++++++++++++++
.../types/vector_store_search_response.py | 14 ++++++++++++++
.../types/vector_stores/file_create_params.py | 4 ++++
.../types/vector_stores/file_delete_response.py | 2 ++
.../types/vector_stores/file_list_response.py | 4 ++++
.../types/vector_stores/file_search_params.py | 2 ++
.../types/vector_stores/file_search_response.py | 2 ++
.../types/vector_stores/rerank_config_param.py | 2 ++
.../vector_stores/scored_vector_store_file.py | 16 ++++++++++++++++
.../types/vector_stores/vector_store_file.py | 8 ++++++++
63 files changed, 217 insertions(+)
diff --git a/src/mixedbread/types/api_key.py b/src/mixedbread/types/api_key.py
index 87a23797..f3238c19 100644
--- a/src/mixedbread/types/api_key.py
+++ b/src/mixedbread/types/api_key.py
@@ -18,6 +18,8 @@ class Scope(BaseModel):
class APIKey(BaseModel):
+ """Response model for an API key."""
+
id: str
"""The ID of the API key"""
diff --git a/src/mixedbread/types/api_key_created.py b/src/mixedbread/types/api_key_created.py
index 08f16806..ae748920 100644
--- a/src/mixedbread/types/api_key_created.py
+++ b/src/mixedbread/types/api_key_created.py
@@ -18,6 +18,8 @@ class Scope(BaseModel):
class APIKeyCreated(BaseModel):
+ """Response model for creating an API key."""
+
id: str
"""The ID of the API key"""
diff --git a/src/mixedbread/types/api_key_delete_response.py b/src/mixedbread/types/api_key_delete_response.py
index e3fc0590..31e87669 100644
--- a/src/mixedbread/types/api_key_delete_response.py
+++ b/src/mixedbread/types/api_key_delete_response.py
@@ -9,6 +9,8 @@
class APIKeyDeleteResponse(BaseModel):
+ """Response model for deleting an API key."""
+
id: str
"""The ID of the deleted API key"""
diff --git a/src/mixedbread/types/data_source.py b/src/mixedbread/types/data_source.py
index eefb4d3d..d219ef28 100644
--- a/src/mixedbread/types/data_source.py
+++ b/src/mixedbread/types/data_source.py
@@ -13,6 +13,8 @@
class AuthParamsDataSourceAPIKeyParams(BaseModel):
+ """Authentication parameters for a API key data source."""
+
type: Optional[Literal["api_key"]] = None
api_key: str
@@ -25,6 +27,8 @@ class AuthParamsDataSourceAPIKeyParams(BaseModel):
class DataSource(BaseModel):
+ """Service-level representation of a data source."""
+
id: str
"""The ID of the data source"""
diff --git a/src/mixedbread/types/data_source_create_params.py b/src/mixedbread/types/data_source_create_params.py
index 9cc9738a..9424a1de 100644
--- a/src/mixedbread/types/data_source_create_params.py
+++ b/src/mixedbread/types/data_source_create_params.py
@@ -34,6 +34,8 @@ class NotionDataSource(TypedDict, total=False):
class NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
+ """Base class for API key create or update parameters."""
+
type: Literal["api_key"]
api_key: Required[str]
diff --git a/src/mixedbread/types/data_source_delete_response.py b/src/mixedbread/types/data_source_delete_response.py
index 6fe26744..98a38e0c 100644
--- a/src/mixedbread/types/data_source_delete_response.py
+++ b/src/mixedbread/types/data_source_delete_response.py
@@ -9,6 +9,8 @@
class DataSourceDeleteResponse(BaseModel):
+ """Deleted data source."""
+
id: str
"""The ID of the data source"""
diff --git a/src/mixedbread/types/data_source_oauth2_params.py b/src/mixedbread/types/data_source_oauth2_params.py
index 3e9c8a90..b19f4a83 100644
--- a/src/mixedbread/types/data_source_oauth2_params.py
+++ b/src/mixedbread/types/data_source_oauth2_params.py
@@ -10,6 +10,8 @@
class DataSourceOauth2Params(BaseModel):
+ """Authentication parameters for a OAuth data source."""
+
type: Optional[Literal["oauth2"]] = None
created_at: Optional[datetime] = None
diff --git a/src/mixedbread/types/data_source_update_params.py b/src/mixedbread/types/data_source_update_params.py
index 9aa8872b..96880db4 100644
--- a/src/mixedbread/types/data_source_update_params.py
+++ b/src/mixedbread/types/data_source_update_params.py
@@ -34,6 +34,8 @@ class NotionDataSource(TypedDict, total=False):
class NotionDataSourceAuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
+ """Base class for API key create or update parameters."""
+
type: Literal["api_key"]
api_key: Required[str]
diff --git a/src/mixedbread/types/data_sources/connector_delete_response.py b/src/mixedbread/types/data_sources/connector_delete_response.py
index 1f320d3e..079ccf7f 100644
--- a/src/mixedbread/types/data_sources/connector_delete_response.py
+++ b/src/mixedbread/types/data_sources/connector_delete_response.py
@@ -9,6 +9,8 @@
class ConnectorDeleteResponse(BaseModel):
+ """Deleted connector."""
+
id: str
"""The ID of the connector"""
diff --git a/src/mixedbread/types/data_sources/data_source_connector.py b/src/mixedbread/types/data_sources/data_source_connector.py
index 7534233d..0fc36723 100644
--- a/src/mixedbread/types/data_sources/data_source_connector.py
+++ b/src/mixedbread/types/data_sources/data_source_connector.py
@@ -10,6 +10,8 @@
class DataSourceConnector(BaseModel):
+ """Service-level representation of a connector."""
+
id: str
"""The ID of the connector"""
diff --git a/src/mixedbread/types/expires_after.py b/src/mixedbread/types/expires_after.py
index 66126cb9..4c3843e1 100644
--- a/src/mixedbread/types/expires_after.py
+++ b/src/mixedbread/types/expires_after.py
@@ -9,6 +9,8 @@
class ExpiresAfter(BaseModel):
+ """Represents an expiration policy for a store."""
+
anchor: Optional[Literal["last_active_at"]] = None
"""Anchor date for the expiration policy"""
diff --git a/src/mixedbread/types/expires_after_param.py b/src/mixedbread/types/expires_after_param.py
index 432f29d7..1715aacf 100644
--- a/src/mixedbread/types/expires_after_param.py
+++ b/src/mixedbread/types/expires_after_param.py
@@ -8,6 +8,8 @@
class ExpiresAfterParam(TypedDict, total=False):
+ """Represents an expiration policy for a store."""
+
anchor: Literal["last_active_at"]
"""Anchor date for the expiration policy"""
diff --git a/src/mixedbread/types/extractions/created_json_schema.py b/src/mixedbread/types/extractions/created_json_schema.py
index 7208722b..dec87e18 100644
--- a/src/mixedbread/types/extractions/created_json_schema.py
+++ b/src/mixedbread/types/extractions/created_json_schema.py
@@ -8,5 +8,7 @@
class CreatedJsonSchema(BaseModel):
+ """Result of creating a JSON schema."""
+
json_schema: Dict[str, object]
"""The created JSON schema"""
diff --git a/src/mixedbread/types/extractions/enhanced_json_schema.py b/src/mixedbread/types/extractions/enhanced_json_schema.py
index f555a7c0..2e789cce 100644
--- a/src/mixedbread/types/extractions/enhanced_json_schema.py
+++ b/src/mixedbread/types/extractions/enhanced_json_schema.py
@@ -8,5 +8,7 @@
class EnhancedJsonSchema(BaseModel):
+ """Result of enhancing a JSON schema."""
+
json_schema: Dict[str, object]
"""The enhanced JSON schema"""
diff --git a/src/mixedbread/types/extractions/extraction_job.py b/src/mixedbread/types/extractions/extraction_job.py
index 9c6114e3..b3bececf 100644
--- a/src/mixedbread/types/extractions/extraction_job.py
+++ b/src/mixedbread/types/extractions/extraction_job.py
@@ -11,6 +11,8 @@
class ExtractionJob(BaseModel):
+ """A job for extracting structured data from documents."""
+
id: str
"""Unique identifier for the extraction job"""
diff --git a/src/mixedbread/types/extractions/extraction_result.py b/src/mixedbread/types/extractions/extraction_result.py
index b5206a09..fdf23e83 100644
--- a/src/mixedbread/types/extractions/extraction_result.py
+++ b/src/mixedbread/types/extractions/extraction_result.py
@@ -8,6 +8,8 @@
class ExtractionResult(BaseModel):
+ """The result of an extraction job."""
+
data: Dict[str, object]
warnings: List[str]
diff --git a/src/mixedbread/types/extractions/image_url_input_param.py b/src/mixedbread/types/extractions/image_url_input_param.py
index a4480f76..cb631e56 100644
--- a/src/mixedbread/types/extractions/image_url_input_param.py
+++ b/src/mixedbread/types/extractions/image_url_input_param.py
@@ -8,6 +8,8 @@
class ImageURL(TypedDict, total=False):
+ """The image input specification."""
+
url: Required[str]
"""The image URL. Can be either a URL or a Data URI."""
@@ -16,6 +18,8 @@ class ImageURL(TypedDict, total=False):
class ImageURLInputParam(TypedDict, total=False):
+ """Model for image input validation."""
+
type: Literal["image_url"]
"""Input type identifier"""
diff --git a/src/mixedbread/types/extractions/text_input_param.py b/src/mixedbread/types/extractions/text_input_param.py
index d8829079..9b459cf5 100644
--- a/src/mixedbread/types/extractions/text_input_param.py
+++ b/src/mixedbread/types/extractions/text_input_param.py
@@ -8,6 +8,13 @@
class TextInputParam(TypedDict, total=False):
+ """Model for text input validation.
+
+ Attributes:
+ type: Input type identifier, always "text"
+ text: The actual text content, with length and whitespace constraints
+ """
+
type: Literal["text"]
"""Input type identifier"""
diff --git a/src/mixedbread/types/extractions/validated_json_schema.py b/src/mixedbread/types/extractions/validated_json_schema.py
index 784c4983..79b2dff5 100644
--- a/src/mixedbread/types/extractions/validated_json_schema.py
+++ b/src/mixedbread/types/extractions/validated_json_schema.py
@@ -8,6 +8,8 @@
class ValidatedJsonSchema(BaseModel):
+ """Result of validating a JSON schema."""
+
is_valid: bool
"""Whether the schema is valid"""
diff --git a/src/mixedbread/types/file_object.py b/src/mixedbread/types/file_object.py
index a237cc0d..f677bd7f 100644
--- a/src/mixedbread/types/file_object.py
+++ b/src/mixedbread/types/file_object.py
@@ -8,6 +8,12 @@
class FileObject(BaseModel):
+ """A model representing a file object in the system.
+
+ This model contains metadata about files stored in the system, including
+ identifiers, size information, and timestamps.
+ """
+
id: str
"""Unique identifier for the file"""
diff --git a/src/mixedbread/types/info_response.py b/src/mixedbread/types/info_response.py
index a7184bcf..20844293 100644
--- a/src/mixedbread/types/info_response.py
+++ b/src/mixedbread/types/info_response.py
@@ -6,6 +6,8 @@
class InfoResponse(BaseModel):
+ """Info Pydantic Response Service Message"""
+
name: str
version: str
diff --git a/src/mixedbread/types/linear_data_source_param.py b/src/mixedbread/types/linear_data_source_param.py
index 8956d2e3..69c2b431 100644
--- a/src/mixedbread/types/linear_data_source_param.py
+++ b/src/mixedbread/types/linear_data_source_param.py
@@ -11,6 +11,8 @@
class LinearDataSourceParam(TypedDict, total=False):
+ """Parameters for creating or updating a Linear data source."""
+
type: Literal["linear"]
"""The type of data source to create"""
diff --git a/src/mixedbread/types/multi_encoding_embedding.py b/src/mixedbread/types/multi_encoding_embedding.py
index 8a7b3ca3..1d73d05c 100644
--- a/src/mixedbread/types/multi_encoding_embedding.py
+++ b/src/mixedbread/types/multi_encoding_embedding.py
@@ -10,6 +10,10 @@
class Embedding(BaseModel):
+ """
+ The encoded embedding data by encoding format.Returned, if more than one encoding format is used.
+ """
+
float: Optional[List[builtins.float]] = None
int8: Optional[List[int]] = None
diff --git a/src/mixedbread/types/notion_data_source_param.py b/src/mixedbread/types/notion_data_source_param.py
index 65d12b2e..12409ef6 100644
--- a/src/mixedbread/types/notion_data_source_param.py
+++ b/src/mixedbread/types/notion_data_source_param.py
@@ -11,6 +11,8 @@
class AuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
+ """Base class for API key create or update parameters."""
+
type: Literal["api_key"]
api_key: Required[str]
@@ -21,6 +23,8 @@ class AuthParamsAPIKeyCreateOrUpdateParams(TypedDict, total=False):
class NotionDataSourceParam(TypedDict, total=False):
+ """Parameters for creating or updating a Notion data source."""
+
type: Literal["notion"]
"""The type of data source to create"""
diff --git a/src/mixedbread/types/oauth2_params.py b/src/mixedbread/types/oauth2_params.py
index 6b0e2fa8..4bbc79f6 100644
--- a/src/mixedbread/types/oauth2_params.py
+++ b/src/mixedbread/types/oauth2_params.py
@@ -8,4 +8,6 @@
class Oauth2Params(TypedDict, total=False):
+ """Base class for OAuth2 create or update parameters."""
+
type: Literal["oauth2"]
diff --git a/src/mixedbread/types/pagination_with_total.py b/src/mixedbread/types/pagination_with_total.py
index 2e6bd456..07ad8fb0 100644
--- a/src/mixedbread/types/pagination_with_total.py
+++ b/src/mixedbread/types/pagination_with_total.py
@@ -8,6 +8,8 @@
class PaginationWithTotal(BaseModel):
+ """Pagination model that includes total count of items."""
+
limit: Optional[int] = None
"""Maximum number of items to return per page"""
diff --git a/src/mixedbread/types/parsing/job_delete_response.py b/src/mixedbread/types/parsing/job_delete_response.py
index a6fcab70..3f2cccf9 100644
--- a/src/mixedbread/types/parsing/job_delete_response.py
+++ b/src/mixedbread/types/parsing/job_delete_response.py
@@ -9,6 +9,8 @@
class JobDeleteResponse(BaseModel):
+ """A deleted parsing job."""
+
id: str
"""The ID of the deleted job"""
diff --git a/src/mixedbread/types/parsing/job_list_response.py b/src/mixedbread/types/parsing/job_list_response.py
index 14b52eb4..0ba5cd73 100644
--- a/src/mixedbread/types/parsing/job_list_response.py
+++ b/src/mixedbread/types/parsing/job_list_response.py
@@ -11,6 +11,8 @@
class JobListResponse(BaseModel):
+ """A parsing job item for list responses, omitting result and error fields."""
+
id: str
"""The ID of the job"""
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index 7eaa134d..ab447ff8 100644
--- a/src/mixedbread/types/parsing/parsing_job.py
+++ b/src/mixedbread/types/parsing/parsing_job.py
@@ -14,6 +14,8 @@
class ResultChunkElement(BaseModel):
+ """Represents an extracted element from a document with its content and metadata."""
+
type: ElementType
"""The type of the extracted element"""
@@ -34,6 +36,8 @@ class ResultChunkElement(BaseModel):
class ResultChunk(BaseModel):
+ """A chunk of text extracted from a document page."""
+
content: Optional[str] = None
"""The full content of the chunk"""
@@ -45,6 +49,8 @@ class ResultChunk(BaseModel):
class Result(BaseModel):
+ """Result of document parsing operation."""
+
chunking_strategy: ChunkingStrategy
"""The strategy used for chunking the document"""
@@ -62,6 +68,8 @@ class Result(BaseModel):
class ParsingJob(BaseModel):
+ """A job for parsing documents with its current state and result."""
+
id: str
"""The ID of the job"""
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 107ae57e..68a8d369 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -186,6 +186,8 @@ def __getattr__(self, attr: str) -> object: ...
class AudioURL(BaseModel):
+ """The audio input specification."""
+
url: str
"""The audio URL. Can be either a URL or a Data URI."""
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index fc929eb4..c142e5c4 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -186,6 +186,8 @@ def __getattr__(self, attr: str) -> object: ...
class ImageURL(BaseModel):
+ """The image input specification."""
+
url: str
"""The image URL. Can be either a URL or a Data URI."""
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index 488f80d0..388c87ce 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -186,6 +186,8 @@ def __getattr__(self, attr: str) -> object: ...
class VideoURL(BaseModel):
+ """The video input specification."""
+
url: str
"""The video URL. Can be either a URL or a Data URI."""
diff --git a/src/mixedbread/types/shared/search_filter.py b/src/mixedbread/types/shared/search_filter.py
index 45e367a5..c502e6db 100644
--- a/src/mixedbread/types/shared/search_filter.py
+++ b/src/mixedbread/types/shared/search_filter.py
@@ -28,6 +28,8 @@
class SearchFilter(BaseModel):
+ """Represents a filter with AND, OR, and NOT conditions."""
+
all: Optional[List[All]] = None
"""List of conditions or filters to be ANDed together"""
diff --git a/src/mixedbread/types/shared/search_filter_condition.py b/src/mixedbread/types/shared/search_filter_condition.py
index 9ba20f6d..f50a91e1 100644
--- a/src/mixedbread/types/shared/search_filter_condition.py
+++ b/src/mixedbread/types/shared/search_filter_condition.py
@@ -8,6 +8,8 @@
class SearchFilterCondition(BaseModel):
+ """Represents a condition with a field, operator, and value."""
+
key: str
"""The field to apply the condition on"""
diff --git a/src/mixedbread/types/shared_params/search_filter.py b/src/mixedbread/types/shared_params/search_filter.py
index 02870e0e..fd468f38 100644
--- a/src/mixedbread/types/shared_params/search_filter.py
+++ b/src/mixedbread/types/shared_params/search_filter.py
@@ -27,6 +27,8 @@
class SearchFilter(TypedDict, total=False):
+ """Represents a filter with AND, OR, and NOT conditions."""
+
all: Optional[Iterable[All]]
"""List of conditions or filters to be ANDed together"""
diff --git a/src/mixedbread/types/shared_params/search_filter_condition.py b/src/mixedbread/types/shared_params/search_filter_condition.py
index b7ba328c..86efe345 100644
--- a/src/mixedbread/types/shared_params/search_filter_condition.py
+++ b/src/mixedbread/types/shared_params/search_filter_condition.py
@@ -8,6 +8,8 @@
class SearchFilterCondition(TypedDict, total=False):
+ """Represents a condition with a field, operator, and value."""
+
key: Required[str]
"""The field to apply the condition on"""
diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py
index eac4354e..03c809d4 100644
--- a/src/mixedbread/types/store.py
+++ b/src/mixedbread/types/store.py
@@ -24,11 +24,15 @@ class ConfigContextualizationContextualizationConfig(BaseModel):
class Config(BaseModel):
+ """Configuration for a store."""
+
contextualization: Optional[ConfigContextualization] = None
"""Contextualize files with metadata"""
class FileCounts(BaseModel):
+ """Counts of files in different states"""
+
pending: Optional[int] = None
"""Number of files waiting to be processed"""
@@ -49,6 +53,8 @@ class FileCounts(BaseModel):
class Store(BaseModel):
+ """Model representing a store with its metadata and timestamps."""
+
id: str
"""Unique identifier for the store"""
diff --git a/src/mixedbread/types/store_chunk_search_options_param.py b/src/mixedbread/types/store_chunk_search_options_param.py
index 89c64712..1b472ea1 100644
--- a/src/mixedbread/types/store_chunk_search_options_param.py
+++ b/src/mixedbread/types/store_chunk_search_options_param.py
@@ -13,6 +13,8 @@
class StoreChunkSearchOptionsParam(TypedDict, total=False):
+ """Options for configuring store chunk searches."""
+
score_threshold: float
"""Minimum similarity score threshold"""
diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py
index 92cece44..1c60761d 100644
--- a/src/mixedbread/types/store_create_params.py
+++ b/src/mixedbread/types/store_create_params.py
@@ -48,5 +48,7 @@ class ConfigContextualizationContextualizationConfig(TypedDict, total=False):
class Config(TypedDict, total=False):
+ """Configuration for a store."""
+
contextualization: ConfigContextualization
"""Contextualize files with metadata"""
diff --git a/src/mixedbread/types/store_delete_response.py b/src/mixedbread/types/store_delete_response.py
index c35970ab..5a57079e 100644
--- a/src/mixedbread/types/store_delete_response.py
+++ b/src/mixedbread/types/store_delete_response.py
@@ -9,6 +9,8 @@
class StoreDeleteResponse(BaseModel):
+ """Response model for store deletion."""
+
id: str
"""ID of the deleted store"""
diff --git a/src/mixedbread/types/store_metadata_facets_response.py b/src/mixedbread/types/store_metadata_facets_response.py
index 989562c4..6b993206 100644
--- a/src/mixedbread/types/store_metadata_facets_response.py
+++ b/src/mixedbread/types/store_metadata_facets_response.py
@@ -8,5 +8,7 @@
class StoreMetadataFacetsResponse(BaseModel):
+ """Represents metadata facets for a store."""
+
facets: Dict[str, Dict[str, object]]
"""Metadata facets"""
diff --git a/src/mixedbread/types/store_question_answering_params.py b/src/mixedbread/types/store_question_answering_params.py
index 37366a6f..26abbb4e 100644
--- a/src/mixedbread/types/store_question_answering_params.py
+++ b/src/mixedbread/types/store_question_answering_params.py
@@ -47,6 +47,8 @@ class StoreQuestionAnsweringParams(TypedDict, total=False):
class QaOptions(TypedDict, total=False):
+ """Question answering configuration options"""
+
cite: bool
"""Whether to use citations"""
diff --git a/src/mixedbread/types/store_question_answering_response.py b/src/mixedbread/types/store_question_answering_response.py
index f47f71b3..dd726f24 100644
--- a/src/mixedbread/types/store_question_answering_response.py
+++ b/src/mixedbread/types/store_question_answering_response.py
@@ -19,6 +19,8 @@
class StoreQuestionAnsweringResponse(BaseModel):
+ """Results from a question answering operation."""
+
answer: str
"""The answer generated by the LLM"""
diff --git a/src/mixedbread/types/stores/file_create_params.py b/src/mixedbread/types/stores/file_create_params.py
index 76441bf9..c776ea33 100644
--- a/src/mixedbread/types/stores/file_create_params.py
+++ b/src/mixedbread/types/stores/file_create_params.py
@@ -29,10 +29,14 @@ class FileCreateParams(TypedDict, total=False):
class Config(TypedDict, total=False):
+ """Configuration for adding the file"""
+
parsing_strategy: Literal["fast", "high_quality"]
"""Strategy for adding the file, this overrides the store-level default"""
class Experimental(TypedDict, total=False):
+ """Configuration for a file."""
+
parsing_strategy: Literal["fast", "high_quality"]
"""Strategy for adding the file, this overrides the store-level default"""
diff --git a/src/mixedbread/types/stores/file_delete_response.py b/src/mixedbread/types/stores/file_delete_response.py
index ada45e9c..5788f3f8 100644
--- a/src/mixedbread/types/stores/file_delete_response.py
+++ b/src/mixedbread/types/stores/file_delete_response.py
@@ -9,6 +9,8 @@
class FileDeleteResponse(BaseModel):
+ """Response model for file deletion."""
+
id: str
"""ID of the deleted file"""
diff --git a/src/mixedbread/types/stores/file_list_response.py b/src/mixedbread/types/stores/file_list_response.py
index 2d47abcc..6ddaf8f1 100644
--- a/src/mixedbread/types/stores/file_list_response.py
+++ b/src/mixedbread/types/stores/file_list_response.py
@@ -10,6 +10,8 @@
class Pagination(BaseModel):
+ """Response model for cursor-based pagination."""
+
has_more: bool
"""
Contextual direction-aware flag: True if more items exist in the requested
diff --git a/src/mixedbread/types/stores/file_search_params.py b/src/mixedbread/types/stores/file_search_params.py
index 8558e0c8..a5d16ed2 100644
--- a/src/mixedbread/types/stores/file_search_params.py
+++ b/src/mixedbread/types/stores/file_search_params.py
@@ -40,6 +40,8 @@ class FileSearchParams(TypedDict, total=False):
class SearchOptions(TypedDict, total=False):
+ """Search configuration options"""
+
score_threshold: float
"""Minimum similarity score threshold"""
diff --git a/src/mixedbread/types/stores/scored_store_file.py b/src/mixedbread/types/stores/scored_store_file.py
index 1b9b1ae2..87483138 100644
--- a/src/mixedbread/types/stores/scored_store_file.py
+++ b/src/mixedbread/types/stores/scored_store_file.py
@@ -16,6 +16,8 @@
class Config(BaseModel):
+ """Configuration for a file."""
+
parsing_strategy: Optional[Literal["fast", "high_quality"]] = None
"""Strategy for adding the file, this overrides the store-level default"""
@@ -27,6 +29,8 @@ class Config(BaseModel):
class ScoredStoreFile(BaseModel):
+ """Represents a scored store file."""
+
id: str
"""Unique identifier for the file"""
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index 6af29e73..133f054e 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -57,6 +57,8 @@
class Config(BaseModel):
+ """Configuration for a file."""
+
parsing_strategy: Optional[Literal["fast", "high_quality"]] = None
"""Strategy for adding the file, this overrides the store-level default"""
@@ -419,6 +421,8 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkImageURLInputChunkImageURL(BaseModel):
+ """The image input specification."""
+
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -620,6 +624,8 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkAudioURLInputChunkAudioURL(BaseModel):
+ """The audio input specification."""
+
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -821,6 +827,8 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkVideoURLInputChunkVideoURL(BaseModel):
+ """The video input specification."""
+
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -858,6 +866,8 @@ class ChunkVideoURLInputChunk(BaseModel):
class StoreFile(BaseModel):
+ """Represents a file stored in a store."""
+
id: str
"""Unique identifier for the file"""
diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py
index cbdeeeb8..d24802cb 100644
--- a/src/mixedbread/types/vector_store.py
+++ b/src/mixedbread/types/vector_store.py
@@ -11,6 +11,8 @@
class FileCounts(BaseModel):
+ """Counts of files in different states"""
+
pending: Optional[int] = None
"""Number of files waiting to be processed"""
@@ -31,6 +33,8 @@ class FileCounts(BaseModel):
class VectorStore(BaseModel):
+ """Model representing a vector store with its metadata and timestamps."""
+
id: str
"""Unique identifier for the vector store"""
diff --git a/src/mixedbread/types/vector_store_chunk_search_options_param.py b/src/mixedbread/types/vector_store_chunk_search_options_param.py
index f6ed0aad..bd6f1e65 100644
--- a/src/mixedbread/types/vector_store_chunk_search_options_param.py
+++ b/src/mixedbread/types/vector_store_chunk_search_options_param.py
@@ -13,6 +13,8 @@
class VectorStoreChunkSearchOptionsParam(TypedDict, total=False):
+ """Options for configuring vector store chunk searches."""
+
score_threshold: float
"""Minimum similarity score threshold"""
diff --git a/src/mixedbread/types/vector_store_delete_response.py b/src/mixedbread/types/vector_store_delete_response.py
index 6643d44b..27af8ee3 100644
--- a/src/mixedbread/types/vector_store_delete_response.py
+++ b/src/mixedbread/types/vector_store_delete_response.py
@@ -9,6 +9,8 @@
class VectorStoreDeleteResponse(BaseModel):
+ """Response model for vector store deletion."""
+
id: str
"""ID of the deleted vector store"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
index f8c3bba3..295a761b 100644
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ b/src/mixedbread/types/vector_store_question_answering_params.py
@@ -47,6 +47,8 @@ class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
class QaOptions(TypedDict, total=False):
+ """Question answering configuration options"""
+
cite: bool
"""Whether to use citations"""
diff --git a/src/mixedbread/types/vector_store_question_answering_response.py b/src/mixedbread/types/vector_store_question_answering_response.py
index 6f1d5a9b..6aec7bbc 100644
--- a/src/mixedbread/types/vector_store_question_answering_response.py
+++ b/src/mixedbread/types/vector_store_question_answering_response.py
@@ -239,6 +239,8 @@ def __getattr__(self, attr: str) -> object: ...
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel):
+ """Scored text chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -464,6 +466,8 @@ def __getattr__(self, attr: str) -> object: ...
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
+ """The image input specification."""
+
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -472,6 +476,8 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputC
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel):
+ """Scored image chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -700,11 +706,15 @@ def __getattr__(self, attr: str) -> object: ...
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
+ """The audio input specification."""
+
url: str
"""The audio URL. Can be either a URL or a Data URI."""
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel):
+ """Scored audio chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -936,11 +946,15 @@ def __getattr__(self, attr: str) -> object: ...
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
+ """The video input specification."""
+
url: str
"""The video URL. Can be either a URL or a Data URI."""
class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel):
+ """Scored video chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -995,6 +1009,8 @@ class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputC
class VectorStoreQuestionAnsweringResponse(BaseModel):
+ """Results from a question answering operation."""
+
answer: str
"""The answer generated by the LLM"""
diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py
index dd5c4f2c..8e46feb8 100644
--- a/src/mixedbread/types/vector_store_search_response.py
+++ b/src/mixedbread/types/vector_store_search_response.py
@@ -239,6 +239,8 @@ def __getattr__(self, attr: str) -> object: ...
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel):
+ """Scored text chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -464,6 +466,8 @@ def __getattr__(self, attr: str) -> object: ...
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
+ """The image input specification."""
+
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -472,6 +476,8 @@ class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChu
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel):
+ """Scored image chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -700,11 +706,15 @@ def __getattr__(self, attr: str) -> object: ...
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
+ """The audio input specification."""
+
url: str
"""The audio URL. Can be either a URL or a Data URI."""
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel):
+ """Scored audio chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -936,11 +946,15 @@ def __getattr__(self, attr: str) -> object: ...
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
+ """The video input specification."""
+
url: str
"""The video URL. Can be either a URL or a Data URI."""
class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel):
+ """Scored video chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
index 76441bf9..c776ea33 100644
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ b/src/mixedbread/types/vector_stores/file_create_params.py
@@ -29,10 +29,14 @@ class FileCreateParams(TypedDict, total=False):
class Config(TypedDict, total=False):
+ """Configuration for adding the file"""
+
parsing_strategy: Literal["fast", "high_quality"]
"""Strategy for adding the file, this overrides the store-level default"""
class Experimental(TypedDict, total=False):
+ """Configuration for a file."""
+
parsing_strategy: Literal["fast", "high_quality"]
"""Strategy for adding the file, this overrides the store-level default"""
diff --git a/src/mixedbread/types/vector_stores/file_delete_response.py b/src/mixedbread/types/vector_stores/file_delete_response.py
index c56ec7b4..191203c4 100644
--- a/src/mixedbread/types/vector_stores/file_delete_response.py
+++ b/src/mixedbread/types/vector_stores/file_delete_response.py
@@ -9,6 +9,8 @@
class FileDeleteResponse(BaseModel):
+ """Response model for file deletion."""
+
id: str
"""ID of the deleted file"""
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
index afdcc55d..9b20d19f 100644
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ b/src/mixedbread/types/vector_stores/file_list_response.py
@@ -10,6 +10,8 @@
class Pagination(BaseModel):
+ """Response model for cursor-based pagination."""
+
has_more: bool
"""
Contextual direction-aware flag: True if more items exist in the requested
@@ -38,6 +40,8 @@ class Pagination(BaseModel):
class FileListResponse(BaseModel):
+ """List response wrapper for vector store files."""
+
pagination: Pagination
"""Response model for cursor-based pagination."""
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
index c29be236..86780311 100644
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ b/src/mixedbread/types/vector_stores/file_search_params.py
@@ -40,6 +40,8 @@ class FileSearchParams(TypedDict, total=False):
class SearchOptions(TypedDict, total=False):
+ """Search configuration options"""
+
score_threshold: float
"""Minimum similarity score threshold"""
diff --git a/src/mixedbread/types/vector_stores/file_search_response.py b/src/mixedbread/types/vector_stores/file_search_response.py
index a7432675..04e14d9b 100644
--- a/src/mixedbread/types/vector_stores/file_search_response.py
+++ b/src/mixedbread/types/vector_stores/file_search_response.py
@@ -10,6 +10,8 @@
class FileSearchResponse(BaseModel):
+ """Search response wrapper for vector store files."""
+
object: Optional[Literal["list"]] = None
"""The object type of the response"""
diff --git a/src/mixedbread/types/vector_stores/rerank_config_param.py b/src/mixedbread/types/vector_stores/rerank_config_param.py
index 9b13ef7b..392bc60a 100644
--- a/src/mixedbread/types/vector_stores/rerank_config_param.py
+++ b/src/mixedbread/types/vector_stores/rerank_config_param.py
@@ -11,6 +11,8 @@
class RerankConfigParam(TypedDict, total=False):
+ """Represents a reranking configuration."""
+
model: str
"""The name of the reranking model"""
diff --git a/src/mixedbread/types/vector_stores/scored_vector_store_file.py b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
index 55e1ed55..bc42fc2c 100644
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
@@ -241,6 +241,8 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel):
+ """Scored text chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -466,6 +468,8 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
+ """The image input specification."""
+
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -474,6 +478,8 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputCh
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel):
+ """Scored image chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -702,11 +708,15 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
+ """The audio input specification."""
+
url: str
"""The audio URL. Can be either a URL or a Data URI."""
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel):
+ """Scored audio chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -938,11 +948,15 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
+ """The video input specification."""
+
url: str
"""The video URL. Can be either a URL or a Data URI."""
class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel):
+ """Scored video chunk for deprecated API."""
+
chunk_index: int
"""position of the chunk in a file"""
@@ -997,6 +1011,8 @@ class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputCh
class ScoredVectorStoreFile(BaseModel):
+ """Represents a scored store file."""
+
id: str
"""Unique identifier for the file"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
index 02f8f31a..51bb8fa3 100644
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ b/src/mixedbread/types/vector_stores/vector_store_file.py
@@ -413,6 +413,8 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkImageURLInputChunkImageURL(BaseModel):
+ """The image input specification."""
+
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -614,6 +616,8 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkAudioURLInputChunkAudioURL(BaseModel):
+ """The audio input specification."""
+
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -815,6 +819,8 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkVideoURLInputChunkVideoURL(BaseModel):
+ """The video input specification."""
+
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -852,6 +858,8 @@ class ChunkVideoURLInputChunk(BaseModel):
class VectorStoreFile(BaseModel):
+ """Represents a file stored in a store."""
+
id: str
"""Unique identifier for the file"""
From 690d928d199309f311f0b184101828ca5a050fa6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 10 Dec 2025 10:39:30 +0000
Subject: [PATCH 332/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index ea2682c3..52afe059 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.41.0"
+ ".": "0.42.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index eec1566d..110a7d5b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.41.0"
+version = "0.42.0"
description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
diff --git a/src/mixedbread/_version.py b/src/mixedbread/_version.py
index 5f340587..6f179c9f 100644
--- a/src/mixedbread/_version.py
+++ b/src/mixedbread/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "mixedbread"
-__version__ = "0.41.0" # x-release-please-version
+__version__ = "0.42.0" # x-release-please-version
From a668267c8d9c2b9a52e74b1b9ff3ba8f31cd481c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 10 Dec 2025 18:28:29 +0000
Subject: [PATCH 333/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/stores/stores.py | 12 ++++++++----
src/mixedbread/types/api_key.py | 2 +-
src/mixedbread/types/api_key_create_params.py | 2 +-
src/mixedbread/types/api_key_created.py | 2 +-
src/mixedbread/types/store_create_params.py | 5 ++++-
src/mixedbread/types/store_update_params.py | 5 ++++-
tests/api_resources/test_stores.py | 4 ++--
8 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e1032ca6..7d30d894 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-bc57b04eacad32c8e89b4d6eac2a369fd0b013bb7be49b698a3372d6393753f7.yml
-openapi_spec_hash: 2591884e7b1b6c328cb5a88449282ccd
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-279da467a40222dd1370f715780778c6465e95530361804843578aa87a25b0df.yml
+openapi_spec_hash: 6b638cc6a04d868f8c9247b2b34de83b
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
diff --git a/src/mixedbread/resources/stores/stores.py b/src/mixedbread/resources/stores/stores.py
index 2ac5c027..5f93cc6b 100644
--- a/src/mixedbread/resources/stores/stores.py
+++ b/src/mixedbread/resources/stores/stores.py
@@ -95,7 +95,8 @@ def create(
Returns: VectorStore: The response containing the created vector store details.
Args:
- name: Name for the new store
+ name: Name for the new store. Can only contain lowercase letters, numbers, periods
+ (.), and hyphens (-).
description: Description of the store
@@ -203,7 +204,8 @@ def update(
Args:
store_identifier: The ID or name of the store
- name: New name for the store
+ name: New name for the store. Can only contain lowercase letters, numbers, periods
+ (.), and hyphens (-).
description: New description
@@ -605,7 +607,8 @@ async def create(
Returns: VectorStore: The response containing the created vector store details.
Args:
- name: Name for the new store
+ name: Name for the new store. Can only contain lowercase letters, numbers, periods
+ (.), and hyphens (-).
description: Description of the store
@@ -713,7 +716,8 @@ async def update(
Args:
store_identifier: The ID or name of the store
- name: New name for the store
+ name: New name for the store. Can only contain lowercase letters, numbers, periods
+ (.), and hyphens (-).
description: New description
diff --git a/src/mixedbread/types/api_key.py b/src/mixedbread/types/api_key.py
index f3238c19..ab7b375d 100644
--- a/src/mixedbread/types/api_key.py
+++ b/src/mixedbread/types/api_key.py
@@ -10,7 +10,7 @@
class Scope(BaseModel):
- method: Literal["read", "write", "delete", "list", "create"]
+ method: Literal["read", "write", "delete", "list", "create", "search"]
resource_type: Optional[Literal["store"]] = None
diff --git a/src/mixedbread/types/api_key_create_params.py b/src/mixedbread/types/api_key_create_params.py
index a7687543..829cd517 100644
--- a/src/mixedbread/types/api_key_create_params.py
+++ b/src/mixedbread/types/api_key_create_params.py
@@ -23,7 +23,7 @@ class APIKeyCreateParams(TypedDict, total=False):
class Scope(TypedDict, total=False):
- method: Required[Literal["read", "write", "delete", "list", "create"]]
+ method: Required[Literal["read", "write", "delete", "list", "create", "search"]]
resource_type: Optional[Literal["store"]]
diff --git a/src/mixedbread/types/api_key_created.py b/src/mixedbread/types/api_key_created.py
index ae748920..3efdb33a 100644
--- a/src/mixedbread/types/api_key_created.py
+++ b/src/mixedbread/types/api_key_created.py
@@ -10,7 +10,7 @@
class Scope(BaseModel):
- method: Literal["read", "write", "delete", "list", "create"]
+ method: Literal["read", "write", "delete", "list", "create", "search"]
resource_type: Optional[Literal["store"]] = None
diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py
index 1c60761d..0edfa42b 100644
--- a/src/mixedbread/types/store_create_params.py
+++ b/src/mixedbread/types/store_create_params.py
@@ -13,7 +13,10 @@
class StoreCreateParams(TypedDict, total=False):
name: Optional[str]
- """Name for the new store"""
+ """Name for the new store.
+
+ Can only contain lowercase letters, numbers, periods (.), and hyphens (-).
+ """
description: Optional[str]
"""Description of the store"""
diff --git a/src/mixedbread/types/store_update_params.py b/src/mixedbread/types/store_update_params.py
index 6133eb5c..e06bbf9d 100644
--- a/src/mixedbread/types/store_update_params.py
+++ b/src/mixedbread/types/store_update_params.py
@@ -12,7 +12,10 @@
class StoreUpdateParams(TypedDict, total=False):
name: Optional[str]
- """New name for the store"""
+ """New name for the store.
+
+ Can only contain lowercase letters, numbers, periods (.), and hyphens (-).
+ """
description: Optional[str]
"""New description"""
diff --git a/tests/api_resources/test_stores.py b/tests/api_resources/test_stores.py
index 47710508..bd172372 100644
--- a/tests/api_resources/test_stores.py
+++ b/tests/api_resources/test_stores.py
@@ -32,7 +32,7 @@ def test_method_create(self, client: Mixedbread) -> None:
@parametrize
def test_method_create_with_all_params(self, client: Mixedbread) -> None:
store = client.stores.create(
- name="Technical Documentation",
+ name="technical-documentation",
description="Contains technical specifications and guides",
is_public=False,
expires_after={
@@ -511,7 +511,7 @@ async def test_method_create(self, async_client: AsyncMixedbread) -> None:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
store = await async_client.stores.create(
- name="Technical Documentation",
+ name="technical-documentation",
description="Contains technical specifications and guides",
is_public=False,
expires_after={
From a93fd14cd1e864b8a81b709bdbbf23f960067caa Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 11 Dec 2025 11:28:29 +0000
Subject: [PATCH 334/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/stores/stores.py | 8 ++++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 7d30d894..21258d27 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-279da467a40222dd1370f715780778c6465e95530361804843578aa87a25b0df.yml
-openapi_spec_hash: 6b638cc6a04d868f8c9247b2b34de83b
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-f45579e46f468141c6e44bc1467a36da222ab712bbd4e1ed1b329f4691a0cb28.yml
+openapi_spec_hash: c71b2dcd10bde03dc38409f0b6f9cbc2
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
diff --git a/src/mixedbread/resources/stores/stores.py b/src/mixedbread/resources/stores/stores.py
index 5f93cc6b..66a55d84 100644
--- a/src/mixedbread/resources/stores/stores.py
+++ b/src/mixedbread/resources/stores/stores.py
@@ -504,6 +504,10 @@ def search(
It supports complex search queries with filters and returns relevance-scored
results.
+ For the special 'mixedbread/web' store, this endpoint performs web search using
+ a mixture of different providers instead of semantic search. Web search results
+ are always reranked for consistent scoring.
+
Args: search_params: Search configuration including: - query text or
embeddings - store_identifiers: List of store identifiers to search - file_ids:
Optional list of file IDs to filter chunks by (or tuple of list and condition
@@ -1016,6 +1020,10 @@ async def search(
It supports complex search queries with filters and returns relevance-scored
results.
+ For the special 'mixedbread/web' store, this endpoint performs web search using
+ a mixture of different providers instead of semantic search. Web search results
+ are always reranked for consistent scoring.
+
Args: search_params: Search configuration including: - query text or
embeddings - store_identifiers: List of store identifiers to search - file_ids:
Optional list of file IDs to filter chunks by (or tuple of list and condition
From 7f5397e18dd9210bc9130a0d6d60c846b795021f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 12 Dec 2025 05:53:05 +0000
Subject: [PATCH 335/375] fix(docs): remove extraneous example object fields
---
tests/api_resources/stores/test_files.py | 156 +-----------
tests/api_resources/test_stores.py | 234 ++----------------
tests/api_resources/test_vector_stores.py | 156 +-----------
.../api_resources/vector_stores/test_files.py | 156 +-----------
4 files changed, 54 insertions(+), 648 deletions(-)
diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py
index 67a4d8e5..16f130cf 100644
--- a/tests/api_resources/stores/test_files.py
+++ b/tests/api_resources/stores/test_files.py
@@ -151,42 +151,9 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
include_total=False,
statuses=["pending"],
metadata_filter={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
q="x",
)
@@ -286,42 +253,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -497,42 +431,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
include_total=False,
statuses=["pending"],
metadata_filter={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
q="x",
)
@@ -632,42 +533,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
diff --git a/tests/api_resources/test_stores.py b/tests/api_resources/test_stores.py
index bd172372..f0d51069 100644
--- a/tests/api_resources/test_stores.py
+++ b/tests/api_resources/test_stores.py
@@ -244,42 +244,9 @@ def test_method_metadata_facets_with_all_params(self, client: Mixedbread) -> Non
store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -331,42 +298,9 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -423,42 +357,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -723,42 +624,9 @@ async def test_method_metadata_facets_with_all_params(self, async_client: AsyncM
store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -810,42 +678,9 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -902,42 +737,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
index 5b0c443a..bfff5729 100644
--- a/tests/api_resources/test_vector_stores.py
+++ b/tests/api_resources/test_vector_stores.py
@@ -282,42 +282,9 @@ def test_method_question_answering_with_all_params(self, client: Mixedbread) ->
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -380,42 +347,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -720,42 +654,9 @@ async def test_method_question_answering_with_all_params(self, async_client: Asy
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -818,42 +719,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
index ab709026..3e1acfd0 100644
--- a/tests/api_resources/vector_stores/test_files.py
+++ b/tests/api_resources/vector_stores/test_files.py
@@ -174,42 +174,9 @@ def test_method_list_with_all_params(self, client: Mixedbread) -> None:
include_total=False,
statuses=["pending"],
metadata_filter={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
)
@@ -324,42 +291,9 @@ def test_method_search_with_all_params(self, client: Mixedbread) -> None:
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
@@ -559,42 +493,9 @@ async def test_method_list_with_all_params(self, async_client: AsyncMixedbread)
include_total=False,
statuses=["pending"],
metadata_filter={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
)
@@ -709,42 +610,9 @@ async def test_method_search_with_all_params(self, async_client: AsyncMixedbread
vector_store_identifiers=["string"],
top_k=1,
filters={
- "all": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "any": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
- "none": [
- {
- "key": "price",
- "value": "100",
- "operator": "gt",
- },
- {
- "key": "color",
- "value": "red",
- "operator": "eq",
- },
- ],
+ "all": [{}, {}],
+ "any": [{}, {}],
+ "none": [{}, {}],
},
file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
search_options={
From 0a9d1b90a8eb1335c07da014e577222a96b8b211 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 12 Dec 2025 13:28:28 +0000
Subject: [PATCH 336/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 21258d27..956447d6 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-f45579e46f468141c6e44bc1467a36da222ab712bbd4e1ed1b329f4691a0cb28.yml
-openapi_spec_hash: c71b2dcd10bde03dc38409f0b6f9cbc2
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-165588f2766fcd302a3d3e0a585ffeb2baef966ee18b2f34782390993cee4ffe.yml
+openapi_spec_hash: 00a8d8d646f831fd1e6c886158f045dd
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
From e2f29201e7080fd2f92b7e0d83e7453c3c32e74a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 13 Dec 2025 11:28:28 +0000
Subject: [PATCH 337/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 956447d6..423566cc 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-165588f2766fcd302a3d3e0a585ffeb2baef966ee18b2f34782390993cee4ffe.yml
-openapi_spec_hash: 00a8d8d646f831fd1e6c886158f045dd
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-d2ce5c8d9c8ebfbc66565825daf31b71268d1d0020bbf0eb5d78d17ea2c9b535.yml
+openapi_spec_hash: 8b1f803af02667896645042d6c3bab0f
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
From 9d721ea3659eca50be1b940163a0d3797d005ad0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 16 Dec 2025 05:17:56 +0000
Subject: [PATCH 338/375] chore(internal): add missing files argument to base
client
---
src/mixedbread/_base_client.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 69fd970e..9a49fde0 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -1247,9 +1247,12 @@ def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
- opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
+ opts = FinalRequestOptions.construct(
+ method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
+ )
return self.request(cast_to, opts)
def put(
@@ -1767,9 +1770,12 @@ async def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
- opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
+ opts = FinalRequestOptions.construct(
+ method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
+ )
return await self.request(cast_to, opts)
async def put(
From 8acdcd877d5ee1b5f1920817ec690f26a81ef219 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 16 Dec 2025 18:28:34 +0000
Subject: [PATCH 339/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 423566cc..80816b46 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 62
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-d2ce5c8d9c8ebfbc66565825daf31b71268d1d0020bbf0eb5d78d17ea2c9b535.yml
-openapi_spec_hash: 8b1f803af02667896645042d6c3bab0f
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-8a9abf45fe3e0db8c9ba59803ff9ef4ce5d0bb780765d3c1a9587dde2a8d6c93.yml
+openapi_spec_hash: 0f3af27e4fc27bcbfbb17f0a2c45c060
config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
From defa03efff187fca47841c49fe1d8d9b1d3b906d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 08:01:17 +0000
Subject: [PATCH 340/375] chore: speedup initial import
---
src/mixedbread/_client.py | 453 ++++++++++++++++++++++++++++++--------
1 file changed, 364 insertions(+), 89 deletions(-)
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index 0a01cdd2..a70709d3 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -3,7 +3,7 @@
from __future__ import annotations
import os
-from typing import Any, Dict, List, Union, Mapping, Iterable, Optional, cast
+from typing import TYPE_CHECKING, Any, Dict, List, Union, Mapping, Iterable, Optional, cast
from typing_extensions import Self, Literal, override
import httpx
@@ -31,6 +31,7 @@
get_async_library,
async_maybe_transform,
)
+from ._compat import cached_property
from ._version import __version__
from ._response import (
to_raw_response_wrapper,
@@ -38,7 +39,6 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from .resources import chat, files, api_keys, embeddings
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError, MixedbreadError
from ._base_client import (
@@ -47,16 +47,23 @@
AsyncAPIClient,
make_request_options,
)
-from .resources.stores import stores
-from .resources.parsing import parsing
from .types.info_response import InfoResponse
-from .resources.extractions import extractions
from .types.encoding_format import EncodingFormat
from .types.rerank_response import RerankResponse
-from .resources.data_sources import data_sources
-from .resources.vector_stores import vector_stores
from .types.embedding_create_response import EmbeddingCreateResponse
+if TYPE_CHECKING:
+ from .resources import chat, files, stores, parsing, api_keys, embeddings, extractions, data_sources, vector_stores
+ from .resources.chat import ChatResource, AsyncChatResource
+ from .resources.files import FilesResource, AsyncFilesResource
+ from .resources.api_keys import APIKeysResource, AsyncAPIKeysResource
+ from .resources.embeddings import EmbeddingsResource, AsyncEmbeddingsResource
+ from .resources.stores.stores import StoresResource, AsyncStoresResource
+ from .resources.parsing.parsing import ParsingResource, AsyncParsingResource
+ from .resources.extractions.extractions import ExtractionsResource, AsyncExtractionsResource
+ from .resources.data_sources.data_sources import DataSourcesResource, AsyncDataSourcesResource
+ from .resources.vector_stores.vector_stores import VectorStoresResource, AsyncVectorStoresResource
+
__all__ = [
"ENVIRONMENTS",
"Timeout",
@@ -77,18 +84,6 @@
class Mixedbread(SyncAPIClient):
- vector_stores: vector_stores.VectorStoresResource
- stores: stores.StoresResource
- parsing: parsing.ParsingResource
- files: files.FilesResource
- extractions: extractions.ExtractionsResource
- embeddings: embeddings.EmbeddingsResource
- data_sources: data_sources.DataSourcesResource
- api_keys: api_keys.APIKeysResource
- chat: chat.ChatResource
- with_raw_response: MixedbreadWithRawResponse
- with_streaming_response: MixedbreadWithStreamedResponse
-
# client options
api_key: str
@@ -167,17 +162,67 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.vector_stores = vector_stores.VectorStoresResource(self)
- self.stores = stores.StoresResource(self)
- self.parsing = parsing.ParsingResource(self)
- self.files = files.FilesResource(self)
- self.extractions = extractions.ExtractionsResource(self)
- self.embeddings = embeddings.EmbeddingsResource(self)
- self.data_sources = data_sources.DataSourcesResource(self)
- self.api_keys = api_keys.APIKeysResource(self)
- self.chat = chat.ChatResource(self)
- self.with_raw_response = MixedbreadWithRawResponse(self)
- self.with_streaming_response = MixedbreadWithStreamedResponse(self)
+ @cached_property
+ def vector_stores(self) -> VectorStoresResource:
+ from .resources.vector_stores import VectorStoresResource
+
+ return VectorStoresResource(self)
+
+ @cached_property
+ def stores(self) -> StoresResource:
+ from .resources.stores import StoresResource
+
+ return StoresResource(self)
+
+ @cached_property
+ def parsing(self) -> ParsingResource:
+ from .resources.parsing import ParsingResource
+
+ return ParsingResource(self)
+
+ @cached_property
+ def files(self) -> FilesResource:
+ from .resources.files import FilesResource
+
+ return FilesResource(self)
+
+ @cached_property
+ def extractions(self) -> ExtractionsResource:
+ from .resources.extractions import ExtractionsResource
+
+ return ExtractionsResource(self)
+
+ @cached_property
+ def embeddings(self) -> EmbeddingsResource:
+ from .resources.embeddings import EmbeddingsResource
+
+ return EmbeddingsResource(self)
+
+ @cached_property
+ def data_sources(self) -> DataSourcesResource:
+ from .resources.data_sources import DataSourcesResource
+
+ return DataSourcesResource(self)
+
+ @cached_property
+ def api_keys(self) -> APIKeysResource:
+ from .resources.api_keys import APIKeysResource
+
+ return APIKeysResource(self)
+
+ @cached_property
+ def chat(self) -> ChatResource:
+ from .resources.chat import ChatResource
+
+ return ChatResource(self)
+
+ @cached_property
+ def with_raw_response(self) -> MixedbreadWithRawResponse:
+ return MixedbreadWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> MixedbreadWithStreamedResponse:
+ return MixedbreadWithStreamedResponse(self)
@property
@override
@@ -442,18 +487,6 @@ def _make_status_error(
class AsyncMixedbread(AsyncAPIClient):
- vector_stores: vector_stores.AsyncVectorStoresResource
- stores: stores.AsyncStoresResource
- parsing: parsing.AsyncParsingResource
- files: files.AsyncFilesResource
- extractions: extractions.AsyncExtractionsResource
- embeddings: embeddings.AsyncEmbeddingsResource
- data_sources: data_sources.AsyncDataSourcesResource
- api_keys: api_keys.AsyncAPIKeysResource
- chat: chat.AsyncChatResource
- with_raw_response: AsyncMixedbreadWithRawResponse
- with_streaming_response: AsyncMixedbreadWithStreamedResponse
-
# client options
api_key: str
@@ -532,17 +565,67 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- self.vector_stores = vector_stores.AsyncVectorStoresResource(self)
- self.stores = stores.AsyncStoresResource(self)
- self.parsing = parsing.AsyncParsingResource(self)
- self.files = files.AsyncFilesResource(self)
- self.extractions = extractions.AsyncExtractionsResource(self)
- self.embeddings = embeddings.AsyncEmbeddingsResource(self)
- self.data_sources = data_sources.AsyncDataSourcesResource(self)
- self.api_keys = api_keys.AsyncAPIKeysResource(self)
- self.chat = chat.AsyncChatResource(self)
- self.with_raw_response = AsyncMixedbreadWithRawResponse(self)
- self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)
+ @cached_property
+ def vector_stores(self) -> AsyncVectorStoresResource:
+ from .resources.vector_stores import AsyncVectorStoresResource
+
+ return AsyncVectorStoresResource(self)
+
+ @cached_property
+ def stores(self) -> AsyncStoresResource:
+ from .resources.stores import AsyncStoresResource
+
+ return AsyncStoresResource(self)
+
+ @cached_property
+ def parsing(self) -> AsyncParsingResource:
+ from .resources.parsing import AsyncParsingResource
+
+ return AsyncParsingResource(self)
+
+ @cached_property
+ def files(self) -> AsyncFilesResource:
+ from .resources.files import AsyncFilesResource
+
+ return AsyncFilesResource(self)
+
+ @cached_property
+ def extractions(self) -> AsyncExtractionsResource:
+ from .resources.extractions import AsyncExtractionsResource
+
+ return AsyncExtractionsResource(self)
+
+ @cached_property
+ def embeddings(self) -> AsyncEmbeddingsResource:
+ from .resources.embeddings import AsyncEmbeddingsResource
+
+ return AsyncEmbeddingsResource(self)
+
+ @cached_property
+ def data_sources(self) -> AsyncDataSourcesResource:
+ from .resources.data_sources import AsyncDataSourcesResource
+
+ return AsyncDataSourcesResource(self)
+
+ @cached_property
+ def api_keys(self) -> AsyncAPIKeysResource:
+ from .resources.api_keys import AsyncAPIKeysResource
+
+ return AsyncAPIKeysResource(self)
+
+ @cached_property
+ def chat(self) -> AsyncChatResource:
+ from .resources.chat import AsyncChatResource
+
+ return AsyncChatResource(self)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncMixedbreadWithRawResponse:
+ return AsyncMixedbreadWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncMixedbreadWithStreamedResponse:
+ return AsyncMixedbreadWithStreamedResponse(self)
@property
@override
@@ -807,16 +890,10 @@ def _make_status_error(
class MixedbreadWithRawResponse:
+ _client: Mixedbread
+
def __init__(self, client: Mixedbread) -> None:
- self.vector_stores = vector_stores.VectorStoresResourceWithRawResponse(client.vector_stores)
- self.stores = stores.StoresResourceWithRawResponse(client.stores)
- self.parsing = parsing.ParsingResourceWithRawResponse(client.parsing)
- self.files = files.FilesResourceWithRawResponse(client.files)
- self.extractions = extractions.ExtractionsResourceWithRawResponse(client.extractions)
- self.embeddings = embeddings.EmbeddingsResourceWithRawResponse(client.embeddings)
- self.data_sources = data_sources.DataSourcesResourceWithRawResponse(client.data_sources)
- self.api_keys = api_keys.APIKeysResourceWithRawResponse(client.api_keys)
- self.chat = chat.ChatResourceWithRawResponse(client.chat)
+ self._client = client
self.embed = to_raw_response_wrapper(
client.embed,
@@ -828,18 +905,66 @@ def __init__(self, client: Mixedbread) -> None:
client.rerank,
)
+ @cached_property
+ def vector_stores(self) -> vector_stores.VectorStoresResourceWithRawResponse:
+ from .resources.vector_stores import VectorStoresResourceWithRawResponse
+
+ return VectorStoresResourceWithRawResponse(self._client.vector_stores)
+
+ @cached_property
+ def stores(self) -> stores.StoresResourceWithRawResponse:
+ from .resources.stores import StoresResourceWithRawResponse
+
+ return StoresResourceWithRawResponse(self._client.stores)
+
+ @cached_property
+ def parsing(self) -> parsing.ParsingResourceWithRawResponse:
+ from .resources.parsing import ParsingResourceWithRawResponse
+
+ return ParsingResourceWithRawResponse(self._client.parsing)
+
+ @cached_property
+ def files(self) -> files.FilesResourceWithRawResponse:
+ from .resources.files import FilesResourceWithRawResponse
+
+ return FilesResourceWithRawResponse(self._client.files)
+
+ @cached_property
+ def extractions(self) -> extractions.ExtractionsResourceWithRawResponse:
+ from .resources.extractions import ExtractionsResourceWithRawResponse
+
+ return ExtractionsResourceWithRawResponse(self._client.extractions)
+
+ @cached_property
+ def embeddings(self) -> embeddings.EmbeddingsResourceWithRawResponse:
+ from .resources.embeddings import EmbeddingsResourceWithRawResponse
+
+ return EmbeddingsResourceWithRawResponse(self._client.embeddings)
+
+ @cached_property
+ def data_sources(self) -> data_sources.DataSourcesResourceWithRawResponse:
+ from .resources.data_sources import DataSourcesResourceWithRawResponse
+
+ return DataSourcesResourceWithRawResponse(self._client.data_sources)
+
+ @cached_property
+ def api_keys(self) -> api_keys.APIKeysResourceWithRawResponse:
+ from .resources.api_keys import APIKeysResourceWithRawResponse
+
+ return APIKeysResourceWithRawResponse(self._client.api_keys)
+
+ @cached_property
+ def chat(self) -> chat.ChatResourceWithRawResponse:
+ from .resources.chat import ChatResourceWithRawResponse
+
+ return ChatResourceWithRawResponse(self._client.chat)
+
class AsyncMixedbreadWithRawResponse:
+ _client: AsyncMixedbread
+
def __init__(self, client: AsyncMixedbread) -> None:
- self.vector_stores = vector_stores.AsyncVectorStoresResourceWithRawResponse(client.vector_stores)
- self.stores = stores.AsyncStoresResourceWithRawResponse(client.stores)
- self.parsing = parsing.AsyncParsingResourceWithRawResponse(client.parsing)
- self.files = files.AsyncFilesResourceWithRawResponse(client.files)
- self.extractions = extractions.AsyncExtractionsResourceWithRawResponse(client.extractions)
- self.embeddings = embeddings.AsyncEmbeddingsResourceWithRawResponse(client.embeddings)
- self.data_sources = data_sources.AsyncDataSourcesResourceWithRawResponse(client.data_sources)
- self.api_keys = api_keys.AsyncAPIKeysResourceWithRawResponse(client.api_keys)
- self.chat = chat.AsyncChatResourceWithRawResponse(client.chat)
+ self._client = client
self.embed = async_to_raw_response_wrapper(
client.embed,
@@ -851,18 +976,66 @@ def __init__(self, client: AsyncMixedbread) -> None:
client.rerank,
)
+ @cached_property
+ def vector_stores(self) -> vector_stores.AsyncVectorStoresResourceWithRawResponse:
+ from .resources.vector_stores import AsyncVectorStoresResourceWithRawResponse
+
+ return AsyncVectorStoresResourceWithRawResponse(self._client.vector_stores)
+
+ @cached_property
+ def stores(self) -> stores.AsyncStoresResourceWithRawResponse:
+ from .resources.stores import AsyncStoresResourceWithRawResponse
+
+ return AsyncStoresResourceWithRawResponse(self._client.stores)
+
+ @cached_property
+ def parsing(self) -> parsing.AsyncParsingResourceWithRawResponse:
+ from .resources.parsing import AsyncParsingResourceWithRawResponse
+
+ return AsyncParsingResourceWithRawResponse(self._client.parsing)
+
+ @cached_property
+ def files(self) -> files.AsyncFilesResourceWithRawResponse:
+ from .resources.files import AsyncFilesResourceWithRawResponse
+
+ return AsyncFilesResourceWithRawResponse(self._client.files)
+
+ @cached_property
+ def extractions(self) -> extractions.AsyncExtractionsResourceWithRawResponse:
+ from .resources.extractions import AsyncExtractionsResourceWithRawResponse
+
+ return AsyncExtractionsResourceWithRawResponse(self._client.extractions)
+
+ @cached_property
+ def embeddings(self) -> embeddings.AsyncEmbeddingsResourceWithRawResponse:
+ from .resources.embeddings import AsyncEmbeddingsResourceWithRawResponse
+
+ return AsyncEmbeddingsResourceWithRawResponse(self._client.embeddings)
+
+ @cached_property
+ def data_sources(self) -> data_sources.AsyncDataSourcesResourceWithRawResponse:
+ from .resources.data_sources import AsyncDataSourcesResourceWithRawResponse
+
+ return AsyncDataSourcesResourceWithRawResponse(self._client.data_sources)
+
+ @cached_property
+ def api_keys(self) -> api_keys.AsyncAPIKeysResourceWithRawResponse:
+ from .resources.api_keys import AsyncAPIKeysResourceWithRawResponse
+
+ return AsyncAPIKeysResourceWithRawResponse(self._client.api_keys)
+
+ @cached_property
+ def chat(self) -> chat.AsyncChatResourceWithRawResponse:
+ from .resources.chat import AsyncChatResourceWithRawResponse
+
+ return AsyncChatResourceWithRawResponse(self._client.chat)
+
class MixedbreadWithStreamedResponse:
+ _client: Mixedbread
+
def __init__(self, client: Mixedbread) -> None:
- self.vector_stores = vector_stores.VectorStoresResourceWithStreamingResponse(client.vector_stores)
- self.stores = stores.StoresResourceWithStreamingResponse(client.stores)
- self.parsing = parsing.ParsingResourceWithStreamingResponse(client.parsing)
- self.files = files.FilesResourceWithStreamingResponse(client.files)
- self.extractions = extractions.ExtractionsResourceWithStreamingResponse(client.extractions)
- self.embeddings = embeddings.EmbeddingsResourceWithStreamingResponse(client.embeddings)
- self.data_sources = data_sources.DataSourcesResourceWithStreamingResponse(client.data_sources)
- self.api_keys = api_keys.APIKeysResourceWithStreamingResponse(client.api_keys)
- self.chat = chat.ChatResourceWithStreamingResponse(client.chat)
+ self._client = client
self.embed = to_streamed_response_wrapper(
client.embed,
@@ -874,18 +1047,66 @@ def __init__(self, client: Mixedbread) -> None:
client.rerank,
)
+ @cached_property
+ def vector_stores(self) -> vector_stores.VectorStoresResourceWithStreamingResponse:
+ from .resources.vector_stores import VectorStoresResourceWithStreamingResponse
+
+ return VectorStoresResourceWithStreamingResponse(self._client.vector_stores)
+
+ @cached_property
+ def stores(self) -> stores.StoresResourceWithStreamingResponse:
+ from .resources.stores import StoresResourceWithStreamingResponse
+
+ return StoresResourceWithStreamingResponse(self._client.stores)
+
+ @cached_property
+ def parsing(self) -> parsing.ParsingResourceWithStreamingResponse:
+ from .resources.parsing import ParsingResourceWithStreamingResponse
+
+ return ParsingResourceWithStreamingResponse(self._client.parsing)
+
+ @cached_property
+ def files(self) -> files.FilesResourceWithStreamingResponse:
+ from .resources.files import FilesResourceWithStreamingResponse
+
+ return FilesResourceWithStreamingResponse(self._client.files)
+
+ @cached_property
+ def extractions(self) -> extractions.ExtractionsResourceWithStreamingResponse:
+ from .resources.extractions import ExtractionsResourceWithStreamingResponse
+
+ return ExtractionsResourceWithStreamingResponse(self._client.extractions)
+
+ @cached_property
+ def embeddings(self) -> embeddings.EmbeddingsResourceWithStreamingResponse:
+ from .resources.embeddings import EmbeddingsResourceWithStreamingResponse
+
+ return EmbeddingsResourceWithStreamingResponse(self._client.embeddings)
+
+ @cached_property
+ def data_sources(self) -> data_sources.DataSourcesResourceWithStreamingResponse:
+ from .resources.data_sources import DataSourcesResourceWithStreamingResponse
+
+ return DataSourcesResourceWithStreamingResponse(self._client.data_sources)
+
+ @cached_property
+ def api_keys(self) -> api_keys.APIKeysResourceWithStreamingResponse:
+ from .resources.api_keys import APIKeysResourceWithStreamingResponse
+
+ return APIKeysResourceWithStreamingResponse(self._client.api_keys)
+
+ @cached_property
+ def chat(self) -> chat.ChatResourceWithStreamingResponse:
+ from .resources.chat import ChatResourceWithStreamingResponse
+
+ return ChatResourceWithStreamingResponse(self._client.chat)
+
class AsyncMixedbreadWithStreamedResponse:
+ _client: AsyncMixedbread
+
def __init__(self, client: AsyncMixedbread) -> None:
- self.vector_stores = vector_stores.AsyncVectorStoresResourceWithStreamingResponse(client.vector_stores)
- self.stores = stores.AsyncStoresResourceWithStreamingResponse(client.stores)
- self.parsing = parsing.AsyncParsingResourceWithStreamingResponse(client.parsing)
- self.files = files.AsyncFilesResourceWithStreamingResponse(client.files)
- self.extractions = extractions.AsyncExtractionsResourceWithStreamingResponse(client.extractions)
- self.embeddings = embeddings.AsyncEmbeddingsResourceWithStreamingResponse(client.embeddings)
- self.data_sources = data_sources.AsyncDataSourcesResourceWithStreamingResponse(client.data_sources)
- self.api_keys = api_keys.AsyncAPIKeysResourceWithStreamingResponse(client.api_keys)
- self.chat = chat.AsyncChatResourceWithStreamingResponse(client.chat)
+ self._client = client
self.embed = async_to_streamed_response_wrapper(
client.embed,
@@ -897,6 +1118,60 @@ def __init__(self, client: AsyncMixedbread) -> None:
client.rerank,
)
+ @cached_property
+ def vector_stores(self) -> vector_stores.AsyncVectorStoresResourceWithStreamingResponse:
+ from .resources.vector_stores import AsyncVectorStoresResourceWithStreamingResponse
+
+ return AsyncVectorStoresResourceWithStreamingResponse(self._client.vector_stores)
+
+ @cached_property
+ def stores(self) -> stores.AsyncStoresResourceWithStreamingResponse:
+ from .resources.stores import AsyncStoresResourceWithStreamingResponse
+
+ return AsyncStoresResourceWithStreamingResponse(self._client.stores)
+
+ @cached_property
+ def parsing(self) -> parsing.AsyncParsingResourceWithStreamingResponse:
+ from .resources.parsing import AsyncParsingResourceWithStreamingResponse
+
+ return AsyncParsingResourceWithStreamingResponse(self._client.parsing)
+
+ @cached_property
+ def files(self) -> files.AsyncFilesResourceWithStreamingResponse:
+ from .resources.files import AsyncFilesResourceWithStreamingResponse
+
+ return AsyncFilesResourceWithStreamingResponse(self._client.files)
+
+ @cached_property
+ def extractions(self) -> extractions.AsyncExtractionsResourceWithStreamingResponse:
+ from .resources.extractions import AsyncExtractionsResourceWithStreamingResponse
+
+ return AsyncExtractionsResourceWithStreamingResponse(self._client.extractions)
+
+ @cached_property
+ def embeddings(self) -> embeddings.AsyncEmbeddingsResourceWithStreamingResponse:
+ from .resources.embeddings import AsyncEmbeddingsResourceWithStreamingResponse
+
+ return AsyncEmbeddingsResourceWithStreamingResponse(self._client.embeddings)
+
+ @cached_property
+ def data_sources(self) -> data_sources.AsyncDataSourcesResourceWithStreamingResponse:
+ from .resources.data_sources import AsyncDataSourcesResourceWithStreamingResponse
+
+ return AsyncDataSourcesResourceWithStreamingResponse(self._client.data_sources)
+
+ @cached_property
+ def api_keys(self) -> api_keys.AsyncAPIKeysResourceWithStreamingResponse:
+ from .resources.api_keys import AsyncAPIKeysResourceWithStreamingResponse
+
+ return AsyncAPIKeysResourceWithStreamingResponse(self._client.api_keys)
+
+ @cached_property
+ def chat(self) -> chat.AsyncChatResourceWithStreamingResponse:
+ from .resources.chat import AsyncChatResourceWithStreamingResponse
+
+ return AsyncChatResourceWithStreamingResponse(self._client.chat)
+
Client = Mixedbread
From 48e81d0149911cdc58c451cd924a468a3006848a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 08:26:48 +0000
Subject: [PATCH 341/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 52afe059..fe87cd91 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.42.0"
+ ".": "0.43.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 110a7d5b..00a3fb3a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.42.0"
+version = "0.43.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 6f179c9f..3f42a5c2 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.42.0" # x-release-please-version
+__version__ = "0.43.0" # x-release-please-version
From b904368e68d6f168938142acdca528b556261026 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 08:50:30 +0000
Subject: [PATCH 342/375] feat(api): manual updates
---
.stats.yml | 4 +-
api.md | 1 +
src/mixedbread/resources/stores/files.py | 120 +++++++++++++++++-
src/mixedbread/types/stores/__init__.py | 1 +
.../types/stores/file_update_params.py | 16 +++
tests/api_resources/stores/test_files.py | 114 +++++++++++++++++
6 files changed, 252 insertions(+), 4 deletions(-)
create mode 100644 src/mixedbread/types/stores/file_update_params.py
diff --git a/.stats.yml b/.stats.yml
index 80816b46..026befc1 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 62
+configured_endpoints: 63
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-8a9abf45fe3e0db8c9ba59803ff9ef4ce5d0bb780765d3c1a9587dde2a8d6c93.yml
openapi_spec_hash: 0f3af27e4fc27bcbfbb17f0a2c45c060
-config_hash: 6fa04d08d4e1a3a45f562e37fab0ea71
+config_hash: 557219db19e51f791a1727eac53d506c
diff --git a/api.md b/api.md
index 4332059c..090bbc6c 100644
--- a/api.md
+++ b/api.md
@@ -122,6 +122,7 @@ Methods:
- client.stores.files.create(store_identifier, \*\*params) -> StoreFile
- client.stores.files.retrieve(file_identifier, \*, store_identifier, \*\*params) -> StoreFile
+- client.stores.files.update(file_identifier, \*, store_identifier, \*\*params) -> StoreFile
- client.stores.files.list(store_identifier, \*\*params) -> FileListResponse
- client.stores.files.delete(file_identifier, \*, store_identifier) -> FileDeleteResponse
- client.stores.files.search(\*\*params) -> FileSearchResponse
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index ad26919f..c84236e2 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import List, Union, Iterable, Optional
+from typing import Dict, List, Union, Iterable, Optional
import httpx
@@ -17,7 +17,13 @@
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
-from ...types.stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
+from ...types.stores import (
+ file_list_params,
+ file_create_params,
+ file_search_params,
+ file_update_params,
+ file_retrieve_params,
+)
from ...types.stores.store_file import StoreFile
from ...types.stores.store_file_status import StoreFileStatus
from ...types.stores.file_list_response import FileListResponse
@@ -171,6 +177,55 @@ def retrieve(
cast_to=StoreFile,
)
+ def update(
+ self,
+ file_identifier: str,
+ *,
+ store_identifier: str,
+ metadata: Optional[Dict[str, object]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreFile:
+ """
+ Update metadata on a file within a store.
+
+ Args: store_identifier: The ID or name of the store. file_identifier: The ID or
+ name of the file to update. update_params: Metadata update payload.
+
+ Returns: StoreFile: The updated file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_identifier: The ID or name of the file to update
+
+ metadata: Updated metadata for the file
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_identifier:
+ raise ValueError(f"Expected a non-empty value for `file_identifier` but received {file_identifier!r}")
+ return self._patch(
+ f"/v1/stores/{store_identifier}/files/{file_identifier}",
+ body=maybe_transform({"metadata": metadata}, file_update_params.FileUpdateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreFile,
+ )
+
def list(
self,
store_identifier: str,
@@ -504,6 +559,55 @@ async def retrieve(
cast_to=StoreFile,
)
+ async def update(
+ self,
+ file_identifier: str,
+ *,
+ store_identifier: str,
+ metadata: Optional[Dict[str, object]] | Omit = omit,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> StoreFile:
+ """
+ Update metadata on a file within a store.
+
+ Args: store_identifier: The ID or name of the store. file_identifier: The ID or
+ name of the file to update. update_params: Metadata update payload.
+
+ Returns: StoreFile: The updated file details.
+
+ Args:
+ store_identifier: The ID or name of the store
+
+ file_identifier: The ID or name of the file to update
+
+ metadata: Updated metadata for the file
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not store_identifier:
+ raise ValueError(f"Expected a non-empty value for `store_identifier` but received {store_identifier!r}")
+ if not file_identifier:
+ raise ValueError(f"Expected a non-empty value for `file_identifier` but received {file_identifier!r}")
+ return await self._patch(
+ f"/v1/stores/{store_identifier}/files/{file_identifier}",
+ body=await async_maybe_transform({"metadata": metadata}, file_update_params.FileUpdateParams),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=StoreFile,
+ )
+
async def list(
self,
store_identifier: str,
@@ -701,6 +805,9 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_raw_response_wrapper(
files.retrieve,
)
+ self.update = to_raw_response_wrapper(
+ files.update,
+ )
self.list = to_raw_response_wrapper(
files.list,
)
@@ -722,6 +829,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_raw_response_wrapper(
files.retrieve,
)
+ self.update = async_to_raw_response_wrapper(
+ files.update,
+ )
self.list = async_to_raw_response_wrapper(
files.list,
)
@@ -743,6 +853,9 @@ def __init__(self, files: FilesResource) -> None:
self.retrieve = to_streamed_response_wrapper(
files.retrieve,
)
+ self.update = to_streamed_response_wrapper(
+ files.update,
+ )
self.list = to_streamed_response_wrapper(
files.list,
)
@@ -764,6 +877,9 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.retrieve = async_to_streamed_response_wrapper(
files.retrieve,
)
+ self.update = async_to_streamed_response_wrapper(
+ files.update,
+ )
self.list = async_to_streamed_response_wrapper(
files.list,
)
diff --git a/src/mixedbread/types/stores/__init__.py b/src/mixedbread/types/stores/__init__.py
index 3dee7dac..50862586 100644
--- a/src/mixedbread/types/stores/__init__.py
+++ b/src/mixedbread/types/stores/__init__.py
@@ -9,6 +9,7 @@
from .file_create_params import FileCreateParams as FileCreateParams
from .file_list_response import FileListResponse as FileListResponse
from .file_search_params import FileSearchParams as FileSearchParams
+from .file_update_params import FileUpdateParams as FileUpdateParams
from .file_delete_response import FileDeleteResponse as FileDeleteResponse
from .file_retrieve_params import FileRetrieveParams as FileRetrieveParams
from .file_search_response import FileSearchResponse as FileSearchResponse
diff --git a/src/mixedbread/types/stores/file_update_params.py b/src/mixedbread/types/stores/file_update_params.py
new file mode 100644
index 00000000..d8dc45e7
--- /dev/null
+++ b/src/mixedbread/types/stores/file_update_params.py
@@ -0,0 +1,16 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Dict, Optional
+from typing_extensions import Required, TypedDict
+
+__all__ = ["FileUpdateParams"]
+
+
+class FileUpdateParams(TypedDict, total=False):
+ store_identifier: Required[str]
+ """The ID or name of the store"""
+
+ metadata: Optional[Dict[str, object]]
+ """Updated metadata for the file"""
diff --git a/tests/api_resources/stores/test_files.py b/tests/api_resources/stores/test_files.py
index 16f130cf..df1c6598 100644
--- a/tests/api_resources/stores/test_files.py
+++ b/tests/api_resources/stores/test_files.py
@@ -134,6 +134,63 @@ def test_path_params_retrieve(self, client: Mixedbread) -> None:
store_identifier="store_identifier",
)
+ @parametrize
+ def test_method_update(self, client: Mixedbread) -> None:
+ file = client.stores.files.update(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_method_update_with_all_params(self, client: Mixedbread) -> None:
+ file = client.stores.files.update(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ metadata={"foo": "bar"},
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_raw_response_update(self, client: Mixedbread) -> None:
+ response = client.stores.files.with_raw_response.update(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ def test_streaming_response_update(self, client: Mixedbread) -> None:
+ with client.stores.files.with_streaming_response.update(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_update(self, client: Mixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ client.stores.files.with_raw_response.update(
+ file_identifier="file_identifier",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_identifier` but received ''"):
+ client.stores.files.with_raw_response.update(
+ file_identifier="",
+ store_identifier="store_identifier",
+ )
+
@parametrize
def test_method_list(self, client: Mixedbread) -> None:
file = client.stores.files.list(
@@ -414,6 +471,63 @@ async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None
store_identifier="store_identifier",
)
+ @parametrize
+ async def test_method_update(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.update(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
+ file = await async_client.stores.files.update(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ metadata={"foo": "bar"},
+ )
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
+ response = await async_client.stores.files.with_raw_response.update(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ file = await response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
+ async with async_client.stores.files.with_streaming_response.update(
+ file_identifier="file_identifier",
+ store_identifier="store_identifier",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ file = await response.parse()
+ assert_matches_type(StoreFile, file, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `store_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.update(
+ file_identifier="file_identifier",
+ store_identifier="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_identifier` but received ''"):
+ await async_client.stores.files.with_raw_response.update(
+ file_identifier="",
+ store_identifier="store_identifier",
+ )
+
@parametrize
async def test_method_list(self, async_client: AsyncMixedbread) -> None:
file = await async_client.stores.files.list(
From 3af001dc011f0422fed8e3d8f32aae503fbbe957 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 17 Dec 2025 08:51:53 +0000
Subject: [PATCH 343/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index fe87cd91..cc51f6f8 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.43.0"
+ ".": "0.44.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 00a3fb3a..2cba3dd8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.43.0"
+version = "0.44.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 3f42a5c2..1e202f99 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.43.0" # x-release-please-version
+__version__ = "0.44.0" # x-release-please-version
From 454e6f058db7e4fe768964519c495e323137df8f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 18 Dec 2025 09:24:45 +0000
Subject: [PATCH 344/375] fix: use async_to_httpx_files in patch method
---
src/mixedbread/_base_client.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)
From 82e1151e786430e35e9239916606638ab25dc10e Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 19 Dec 2025 07:58:53 +0000
Subject: [PATCH 345/375] chore(internal): add `--fix` argument to lint script
---
scripts/lint | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
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'
From 18f390c9e5cdc8dd00a6b2643d85395156ff8c3b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 23 Dec 2025 19:28:17 +0000
Subject: [PATCH 346/375] feat(api): api update
---
.stats.yml | 4 +-
.../types/parsing/job_list_response.py | 7 +++-
src/mixedbread/types/parsing/parsing_job.py | 4 +-
.../types/store_chunk_search_options_param.py | 34 +++++++++++++--
.../types/stores/file_search_params.py | 42 +++++++++++++++++--
...vector_store_chunk_search_options_param.py | 34 +++++++++++++--
.../types/vector_stores/file_search_params.py | 42 +++++++++++++++++--
tests/api_resources/stores/test_files.py | 2 +
tests/api_resources/test_stores.py | 6 +++
tests/api_resources/test_vector_stores.py | 4 ++
.../api_resources/vector_stores/test_files.py | 2 +
11 files changed, 163 insertions(+), 18 deletions(-)
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/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,
From 212767651ea4a062d5a3fb3f52cba7e9745f5b33 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 5 Jan 2026 15:27:49 +0000
Subject: [PATCH 347/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
LICENSE | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
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/LICENSE b/LICENSE
index 16abae3f..4c96cdcc 100644
--- a/LICENSE
+++ b/LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright 2025 Mixedbread
+ Copyright 2026 Mixedbread
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
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/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
From 7f8448c863c134bbcb82f6eedb7ad1acbd92892b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 8 Jan 2026 11:28:42 +0000
Subject: [PATCH 348/375] codegen metadata
---
.stats.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.stats.yml b/.stats.yml
index 59342609..14e62078 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-5ad16eef3948ad48d494f6c0bf0b7da1063e177df5b8deaeedb53502101026d7.yml
openapi_spec_hash: 631634e0b03b231050e790e28377e51f
-config_hash: 557219db19e51f791a1727eac53d506c
+config_hash: 9e3a32dc554db9ce76299ea928123b75
From 42889bddaf49c5e34a7d4dd691be2827b3e538ce Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 14 Jan 2026 10:19:39 +0000
Subject: [PATCH 349/375] feat(client): add support for binary request
streaming
---
src/mixedbread/_base_client.py | 145 +++++++++++++++++++++++--
src/mixedbread/_models.py | 17 ++-
src/mixedbread/_types.py | 9 ++
tests/test_client.py | 187 ++++++++++++++++++++++++++++++++-
4 files changed, 344 insertions(+), 14 deletions(-)
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 9f052005..8da2f693 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -9,6 +9,7 @@
import inspect
import logging
import platform
+import warnings
import email.utils
from types import TracebackType
from random import random
@@ -51,9 +52,11 @@
ResponseT,
AnyMapping,
PostParser,
+ BinaryTypes,
RequestFiles,
HttpxSendArgs,
RequestOptions,
+ AsyncBinaryTypes,
HttpxRequestFiles,
ModelBuilderProtocol,
not_given,
@@ -477,8 +480,19 @@ def _build_request(
retries_taken: int = 0,
) -> httpx.Request:
if log.isEnabledFor(logging.DEBUG):
- log.debug("Request options: %s", model_dump(options, exclude_unset=True))
-
+ log.debug(
+ "Request options: %s",
+ model_dump(
+ options,
+ exclude_unset=True,
+ # Pydantic v1 can't dump every type we support in content, so we exclude it for now.
+ exclude={
+ "content",
+ }
+ if PYDANTIC_V1
+ else {},
+ ),
+ )
kwargs: dict[str, Any] = {}
json_data = options.json_data
@@ -532,7 +546,13 @@ def _build_request(
is_body_allowed = options.method.lower() != "get"
if is_body_allowed:
- if isinstance(json_data, bytes):
+ if options.content is not None and json_data is not None:
+ raise TypeError("Passing both `content` and `json_data` is not supported")
+ if options.content is not None and files is not None:
+ raise TypeError("Passing both `content` and `files` is not supported")
+ if options.content is not None:
+ kwargs["content"] = options.content
+ elif isinstance(json_data, bytes):
kwargs["content"] = json_data
else:
kwargs["json"] = json_data if is_given(json_data) else None
@@ -1194,6 +1214,7 @@ def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: BinaryTypes | None = None,
options: RequestOptions = {},
files: RequestFiles | None = None,
stream: Literal[False] = False,
@@ -1206,6 +1227,7 @@ def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: BinaryTypes | None = None,
options: RequestOptions = {},
files: RequestFiles | None = None,
stream: Literal[True],
@@ -1219,6 +1241,7 @@ def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: BinaryTypes | None = None,
options: RequestOptions = {},
files: RequestFiles | None = None,
stream: bool,
@@ -1231,13 +1254,25 @@ def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: BinaryTypes | None = None,
options: RequestOptions = {},
files: RequestFiles | None = None,
stream: bool = False,
stream_cls: type[_StreamT] | None = None,
) -> ResponseT | _StreamT:
+ if body is not None and content is not None:
+ raise TypeError("Passing both `body` and `content` is not supported")
+ if files is not None and content is not None:
+ raise TypeError("Passing both `files` and `content` is not supported")
+ if isinstance(body, bytes):
+ warnings.warn(
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
+ "Please pass raw bytes via the `content` parameter instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
opts = FinalRequestOptions.construct(
- method="post", url=path, json_data=body, files=to_httpx_files(files), **options
+ method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
)
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
@@ -1247,11 +1282,23 @@ def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: BinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
+ if body is not None and content is not None:
+ raise TypeError("Passing both `body` and `content` is not supported")
+ if files is not None and content is not None:
+ raise TypeError("Passing both `files` and `content` is not supported")
+ if isinstance(body, bytes):
+ warnings.warn(
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
+ "Please pass raw bytes via the `content` parameter instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
opts = FinalRequestOptions.construct(
- method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
+ method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
)
return self.request(cast_to, opts)
@@ -1261,11 +1308,23 @@ def put(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: BinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
+ if body is not None and content is not None:
+ raise TypeError("Passing both `body` and `content` is not supported")
+ if files is not None and content is not None:
+ raise TypeError("Passing both `files` and `content` is not supported")
+ if isinstance(body, bytes):
+ warnings.warn(
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
+ "Please pass raw bytes via the `content` parameter instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
opts = FinalRequestOptions.construct(
- method="put", url=path, json_data=body, files=to_httpx_files(files), **options
+ method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
)
return self.request(cast_to, opts)
@@ -1275,9 +1334,19 @@ def delete(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: BinaryTypes | None = None,
options: RequestOptions = {},
) -> ResponseT:
- opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
+ if body is not None and content is not None:
+ raise TypeError("Passing both `body` and `content` is not supported")
+ if isinstance(body, bytes):
+ warnings.warn(
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
+ "Please pass raw bytes via the `content` parameter instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
return self.request(cast_to, opts)
def get_api_list(
@@ -1717,6 +1786,7 @@ async def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
stream: Literal[False] = False,
@@ -1729,6 +1799,7 @@ async def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
stream: Literal[True],
@@ -1742,6 +1813,7 @@ async def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
stream: bool,
@@ -1754,13 +1826,25 @@ async def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
stream: bool = False,
stream_cls: type[_AsyncStreamT] | None = None,
) -> ResponseT | _AsyncStreamT:
+ if body is not None and content is not None:
+ raise TypeError("Passing both `body` and `content` is not supported")
+ if files is not None and content is not None:
+ raise TypeError("Passing both `files` and `content` is not supported")
+ if isinstance(body, bytes):
+ warnings.warn(
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
+ "Please pass raw bytes via the `content` parameter instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
opts = FinalRequestOptions.construct(
- method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options
+ method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
)
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
@@ -1770,11 +1854,28 @@ async def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
+ if body is not None and content is not None:
+ raise TypeError("Passing both `body` and `content` is not supported")
+ if files is not None and content is not None:
+ raise TypeError("Passing both `files` and `content` is not supported")
+ if isinstance(body, bytes):
+ warnings.warn(
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
+ "Please pass raw bytes via the `content` parameter instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
opts = FinalRequestOptions.construct(
- method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options
+ method="patch",
+ url=path,
+ json_data=body,
+ content=content,
+ files=await async_to_httpx_files(files),
+ **options,
)
return await self.request(cast_to, opts)
@@ -1784,11 +1885,23 @@ async def put(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
+ if body is not None and content is not None:
+ raise TypeError("Passing both `body` and `content` is not supported")
+ if files is not None and content is not None:
+ raise TypeError("Passing both `files` and `content` is not supported")
+ if isinstance(body, bytes):
+ warnings.warn(
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
+ "Please pass raw bytes via the `content` parameter instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
opts = FinalRequestOptions.construct(
- method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options
+ method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
)
return await self.request(cast_to, opts)
@@ -1798,9 +1911,19 @@ async def delete(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
+ content: AsyncBinaryTypes | None = None,
options: RequestOptions = {},
) -> ResponseT:
- opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
+ if body is not None and content is not None:
+ raise TypeError("Passing both `body` and `content` is not supported")
+ if isinstance(body, bytes):
+ warnings.warn(
+ "Passing raw bytes as `body` is deprecated and will be removed in a future version. "
+ "Please pass raw bytes via the `content` parameter instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
return await self.request(cast_to, opts)
def get_api_list(
diff --git a/src/mixedbread/_models.py b/src/mixedbread/_models.py
index ca9500b2..29070e05 100644
--- a/src/mixedbread/_models.py
+++ b/src/mixedbread/_models.py
@@ -3,7 +3,20 @@
import os
import inspect
import weakref
-from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
+from typing import (
+ IO,
+ TYPE_CHECKING,
+ Any,
+ Type,
+ Union,
+ Generic,
+ TypeVar,
+ Callable,
+ Iterable,
+ Optional,
+ AsyncIterable,
+ cast,
+)
from datetime import date, datetime
from typing_extensions import (
List,
@@ -787,6 +800,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
timeout: float | Timeout | None
files: HttpxRequestFiles | None
idempotency_key: str
+ content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None]
json_data: Body
extra_json: AnyMapping
follow_redirects: bool
@@ -805,6 +819,7 @@ class FinalRequestOptions(pydantic.BaseModel):
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
follow_redirects: Union[bool, None] = None
+ content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] = None
# It should be noted that we cannot use `json` here as that would override
# a BaseModel method in an incompatible fashion.
json_data: Union[Body, None] = None
diff --git a/src/mixedbread/_types.py b/src/mixedbread/_types.py
index 78d87ade..fa2086c9 100644
--- a/src/mixedbread/_types.py
+++ b/src/mixedbread/_types.py
@@ -13,9 +13,11 @@
Mapping,
TypeVar,
Callable,
+ Iterable,
Iterator,
Optional,
Sequence,
+ AsyncIterable,
)
from typing_extensions import (
Set,
@@ -56,6 +58,13 @@
else:
Base64FileInput = Union[IO[bytes], PathLike]
FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8.
+
+
+# Used for sending raw binary data / streaming data in request bodies
+# e.g. for file uploads without multipart encoding
+BinaryTypes = Union[bytes, bytearray, IO[bytes], Iterable[bytes]]
+AsyncBinaryTypes = Union[bytes, bytearray, IO[bytes], AsyncIterable[bytes]]
+
FileTypes = Union[
# file (or bytes)
FileContent,
diff --git a/tests/test_client.py b/tests/test_client.py
index 831e0224..6696b539 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -8,10 +8,11 @@
import json
import asyncio
import inspect
+import dataclasses
import tracemalloc
-from typing import Any, Union, cast
+from typing import Any, Union, TypeVar, Callable, Iterable, Iterator, Optional, Coroutine, cast
from unittest import mock
-from typing_extensions import Literal
+from typing_extensions import Literal, AsyncIterator, override
import httpx
import pytest
@@ -36,6 +37,7 @@
from .utils import update_env
+T = TypeVar("T")
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
api_key = "My API Key"
@@ -50,6 +52,57 @@ def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float:
return 0.1
+def mirror_request_content(request: httpx.Request) -> httpx.Response:
+ return httpx.Response(200, content=request.content)
+
+
+# note: we can't use the httpx.MockTransport class as it consumes the request
+# body itself, which means we can't test that the body is read lazily
+class MockTransport(httpx.BaseTransport, httpx.AsyncBaseTransport):
+ def __init__(
+ self,
+ handler: Callable[[httpx.Request], httpx.Response]
+ | Callable[[httpx.Request], Coroutine[Any, Any, httpx.Response]],
+ ) -> None:
+ self.handler = handler
+
+ @override
+ def handle_request(
+ self,
+ request: httpx.Request,
+ ) -> httpx.Response:
+ assert not inspect.iscoroutinefunction(self.handler), "handler must not be a coroutine function"
+ assert inspect.isfunction(self.handler), "handler must be a function"
+ return self.handler(request)
+
+ @override
+ async def handle_async_request(
+ self,
+ request: httpx.Request,
+ ) -> httpx.Response:
+ assert inspect.iscoroutinefunction(self.handler), "handler must be a coroutine function"
+ return await self.handler(request)
+
+
+@dataclasses.dataclass
+class Counter:
+ value: int = 0
+
+
+def _make_sync_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> Iterator[T]:
+ for item in iterable:
+ if counter:
+ counter.value += 1
+ yield item
+
+
+async def _make_async_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> AsyncIterator[T]:
+ for item in iterable:
+ if counter:
+ counter.value += 1
+ yield item
+
+
def _get_open_connections(client: Mixedbread | AsyncMixedbread) -> int:
transport = client._client._transport
assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport)
@@ -502,6 +555,70 @@ def test_multipart_repeating_array(self, client: Mixedbread) -> None:
b"",
]
+ @pytest.mark.respx(base_url=base_url)
+ def test_binary_content_upload(self, respx_mock: MockRouter, client: Mixedbread) -> None:
+ respx_mock.post("/upload").mock(side_effect=mirror_request_content)
+
+ file_content = b"Hello, this is a test file."
+
+ response = client.post(
+ "/upload",
+ content=file_content,
+ cast_to=httpx.Response,
+ options={"headers": {"Content-Type": "application/octet-stream"}},
+ )
+
+ assert response.status_code == 200
+ assert response.request.headers["Content-Type"] == "application/octet-stream"
+ assert response.content == file_content
+
+ def test_binary_content_upload_with_iterator(self) -> None:
+ file_content = b"Hello, this is a test file."
+ counter = Counter()
+ iterator = _make_sync_iterator([file_content], counter=counter)
+
+ def mock_handler(request: httpx.Request) -> httpx.Response:
+ assert counter.value == 0, "the request body should not have been read"
+ return httpx.Response(200, content=request.read())
+
+ with Mixedbread(
+ base_url=base_url,
+ api_key=api_key,
+ _strict_response_validation=True,
+ http_client=httpx.Client(transport=MockTransport(handler=mock_handler)),
+ ) as client:
+ response = client.post(
+ "/upload",
+ content=iterator,
+ cast_to=httpx.Response,
+ options={"headers": {"Content-Type": "application/octet-stream"}},
+ )
+
+ assert response.status_code == 200
+ assert response.request.headers["Content-Type"] == "application/octet-stream"
+ assert response.content == file_content
+ assert counter.value == 1
+
+ @pytest.mark.respx(base_url=base_url)
+ def test_binary_content_upload_with_body_is_deprecated(self, respx_mock: MockRouter, client: Mixedbread) -> None:
+ respx_mock.post("/upload").mock(side_effect=mirror_request_content)
+
+ file_content = b"Hello, this is a test file."
+
+ with pytest.deprecated_call(
+ match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead."
+ ):
+ response = client.post(
+ "/upload",
+ body=file_content,
+ cast_to=httpx.Response,
+ options={"headers": {"Content-Type": "application/octet-stream"}},
+ )
+
+ assert response.status_code == 200
+ assert response.request.headers["Content-Type"] == "application/octet-stream"
+ assert response.content == file_content
+
@pytest.mark.respx(base_url=base_url)
def test_basic_union_response(self, respx_mock: MockRouter, client: Mixedbread) -> None:
class Model1(BaseModel):
@@ -1341,6 +1458,72 @@ def test_multipart_repeating_array(self, async_client: AsyncMixedbread) -> None:
b"",
]
+ @pytest.mark.respx(base_url=base_url)
+ async def test_binary_content_upload(self, respx_mock: MockRouter, async_client: AsyncMixedbread) -> None:
+ respx_mock.post("/upload").mock(side_effect=mirror_request_content)
+
+ file_content = b"Hello, this is a test file."
+
+ response = await async_client.post(
+ "/upload",
+ content=file_content,
+ cast_to=httpx.Response,
+ options={"headers": {"Content-Type": "application/octet-stream"}},
+ )
+
+ assert response.status_code == 200
+ assert response.request.headers["Content-Type"] == "application/octet-stream"
+ assert response.content == file_content
+
+ async def test_binary_content_upload_with_asynciterator(self) -> None:
+ file_content = b"Hello, this is a test file."
+ counter = Counter()
+ iterator = _make_async_iterator([file_content], counter=counter)
+
+ async def mock_handler(request: httpx.Request) -> httpx.Response:
+ assert counter.value == 0, "the request body should not have been read"
+ return httpx.Response(200, content=await request.aread())
+
+ async with AsyncMixedbread(
+ base_url=base_url,
+ api_key=api_key,
+ _strict_response_validation=True,
+ http_client=httpx.AsyncClient(transport=MockTransport(handler=mock_handler)),
+ ) as client:
+ response = await client.post(
+ "/upload",
+ content=iterator,
+ cast_to=httpx.Response,
+ options={"headers": {"Content-Type": "application/octet-stream"}},
+ )
+
+ assert response.status_code == 200
+ assert response.request.headers["Content-Type"] == "application/octet-stream"
+ assert response.content == file_content
+ assert counter.value == 1
+
+ @pytest.mark.respx(base_url=base_url)
+ async def test_binary_content_upload_with_body_is_deprecated(
+ self, respx_mock: MockRouter, async_client: AsyncMixedbread
+ ) -> None:
+ respx_mock.post("/upload").mock(side_effect=mirror_request_content)
+
+ file_content = b"Hello, this is a test file."
+
+ with pytest.deprecated_call(
+ match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead."
+ ):
+ response = await async_client.post(
+ "/upload",
+ body=file_content,
+ cast_to=httpx.Response,
+ options={"headers": {"Content-Type": "application/octet-stream"}},
+ )
+
+ assert response.status_code == 200
+ assert response.request.headers["Content-Type"] == "application/octet-stream"
+ assert response.content == file_content
+
@pytest.mark.respx(base_url=base_url)
async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncMixedbread) -> None:
class Model1(BaseModel):
From a8ca791d46f3d4bb3a284e0705c1e50cc556f4d0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 17 Jan 2026 07:25:44 +0000
Subject: [PATCH 350/375] chore(internal): update `actions/checkout` version
---
.github/workflows/ci.yml | 6 +++---
.github/workflows/publish-pypi.yml | 2 +-
.github/workflows/release-doctor.yml | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 592b71b4..663f950e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,7 +19,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Install Rye
run: |
@@ -44,7 +44,7 @@ jobs:
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Install Rye
run: |
@@ -81,7 +81,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/mixedbread-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Install Rye
run: |
diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml
index 1198ae86..4bed0df6 100644
--- a/.github/workflows/publish-pypi.yml
+++ b/.github/workflows/publish-pypi.yml
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Install Rye
run: |
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index f49b8bb9..5f4defaf 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -12,7 +12,7 @@ jobs:
if: github.repository == 'mixedbread-ai/mixedbread-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v6
- name: Check release environment
run: |
From e91508b88e4238f66d7440489ae9357580ec981c Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 20 Jan 2026 14:44:17 +0000
Subject: [PATCH 351/375] feat(api): manual updates
---
.stats.yml | 4 +-
api.md | 50 +-
src/mixedbread/_client.py | 39 +-
src/mixedbread/resources/__init__.py | 14 -
.../resources/vector_stores/__init__.py | 33 -
.../resources/vector_stores/files.py | 774 ------------
.../resources/vector_stores/vector_stores.py | 1054 -----------------
src/mixedbread/types/__init__.py | 16 -
.../types/store_chunk_search_options_param.py | 23 +-
.../types/stores/file_search_params.py | 21 +-
src/mixedbread/types/vector_store.py | 78 --
...vector_store_chunk_search_options_param.py | 59 -
.../types/vector_store_create_params.py | 31 -
.../types/vector_store_delete_response.py | 21 -
.../types/vector_store_list_params.py | 31 -
.../vector_store_question_answering_params.py | 59 -
...ector_store_question_answering_response.py | 1018 ----------------
.../types/vector_store_search_params.py | 39 -
.../types/vector_store_search_response.py | 1016 ----------------
.../types/vector_store_update_params.py | 27 -
.../types/vector_stores/__init__.py | 15 -
.../types/vector_stores/file_create_params.py | 42 -
.../vector_stores/file_delete_response.py | 21 -
.../types/vector_stores/file_list_params.py | 44 -
.../types/vector_stores/file_list_response.py | 52 -
.../vector_stores/file_retrieve_params.py | 15 -
.../types/vector_stores/file_search_params.py | 103 --
.../vector_stores/file_search_response.py | 19 -
.../vector_stores/rerank_config_param.py | 26 -
.../vector_stores/scored_vector_store_file.py | 1050 ----------------
.../types/vector_stores/vector_store_file.py | 894 --------------
.../vector_stores/vector_store_file_status.py | 7 -
tests/api_resources/test_vector_stores.py | 768 ------------
tests/api_resources/vector_stores/__init__.py | 1 -
.../api_resources/vector_stores/test_files.py | 659 -----------
35 files changed, 43 insertions(+), 8080 deletions(-)
delete mode 100644 src/mixedbread/resources/vector_stores/__init__.py
delete mode 100644 src/mixedbread/resources/vector_stores/files.py
delete mode 100644 src/mixedbread/resources/vector_stores/vector_stores.py
delete mode 100644 src/mixedbread/types/vector_store.py
delete mode 100644 src/mixedbread/types/vector_store_chunk_search_options_param.py
delete mode 100644 src/mixedbread/types/vector_store_create_params.py
delete mode 100644 src/mixedbread/types/vector_store_delete_response.py
delete mode 100644 src/mixedbread/types/vector_store_list_params.py
delete mode 100644 src/mixedbread/types/vector_store_question_answering_params.py
delete mode 100644 src/mixedbread/types/vector_store_question_answering_response.py
delete mode 100644 src/mixedbread/types/vector_store_search_params.py
delete mode 100644 src/mixedbread/types/vector_store_search_response.py
delete mode 100644 src/mixedbread/types/vector_store_update_params.py
delete mode 100644 src/mixedbread/types/vector_stores/__init__.py
delete mode 100644 src/mixedbread/types/vector_stores/file_create_params.py
delete mode 100644 src/mixedbread/types/vector_stores/file_delete_response.py
delete mode 100644 src/mixedbread/types/vector_stores/file_list_params.py
delete mode 100644 src/mixedbread/types/vector_stores/file_list_response.py
delete mode 100644 src/mixedbread/types/vector_stores/file_retrieve_params.py
delete mode 100644 src/mixedbread/types/vector_stores/file_search_params.py
delete mode 100644 src/mixedbread/types/vector_stores/file_search_response.py
delete mode 100644 src/mixedbread/types/vector_stores/rerank_config_param.py
delete mode 100644 src/mixedbread/types/vector_stores/scored_vector_store_file.py
delete mode 100644 src/mixedbread/types/vector_stores/vector_store_file.py
delete mode 100644 src/mixedbread/types/vector_stores/vector_store_file_status.py
delete mode 100644 tests/api_resources/test_vector_stores.py
delete mode 100644 tests/api_resources/vector_stores/__init__.py
delete mode 100644 tests/api_resources/vector_stores/test_files.py
diff --git a/.stats.yml b/.stats.yml
index 14e62078..80b8735a 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 63
+configured_endpoints: 51
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-5ad16eef3948ad48d494f6c0bf0b7da1063e177df5b8deaeedb53502101026d7.yml
openapi_spec_hash: 631634e0b03b231050e790e28377e51f
-config_hash: 9e3a32dc554db9ce76299ea928123b75
+config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/api.md b/api.md
index 090bbc6c..f42e0be4 100644
--- a/api.md
+++ b/api.md
@@ -24,7 +24,7 @@ Methods:
- client.info() -> InfoResponse
- client.rerank(\*\*params) -> RerankResponse
-# VectorStores
+# Stores
Types:
@@ -35,54 +35,6 @@ from mixedbread.types import (
ScoredImageURLInputChunk,
ScoredTextInputChunk,
ScoredVideoURLInputChunk,
- VectorStore,
- VectorStoreChunkSearchOptions,
- VectorStoreDeleteResponse,
- VectorStoreQuestionAnsweringResponse,
- VectorStoreSearchResponse,
-)
-```
-
-Methods:
-
-- client.vector_stores.create(\*\*params) -> VectorStore
-- client.vector_stores.retrieve(vector_store_identifier) -> VectorStore
-- client.vector_stores.update(vector_store_identifier, \*\*params) -> VectorStore
-- client.vector_stores.list(\*\*params) -> SyncCursor[VectorStore]
-- client.vector_stores.delete(vector_store_identifier) -> VectorStoreDeleteResponse
-- client.vector_stores.question_answering(\*\*params) -> VectorStoreQuestionAnsweringResponse
-- client.vector_stores.search(\*\*params) -> VectorStoreSearchResponse
-
-## Files
-
-Types:
-
-```python
-from mixedbread.types.vector_stores import (
- RerankConfig,
- ScoredVectorStoreFile,
- VectorStoreFileStatus,
- VectorStoreFile,
- FileListResponse,
- FileDeleteResponse,
- FileSearchResponse,
-)
-```
-
-Methods:
-
-- client.vector_stores.files.create(vector_store_identifier, \*\*params) -> VectorStoreFile
-- client.vector_stores.files.retrieve(file_id, \*, vector_store_identifier, \*\*params) -> VectorStoreFile
-- client.vector_stores.files.list(vector_store_identifier, \*\*params) -> FileListResponse
-- client.vector_stores.files.delete(file_id, \*, vector_store_identifier) -> FileDeleteResponse
-- client.vector_stores.files.search(\*\*params) -> FileSearchResponse
-
-# Stores
-
-Types:
-
-```python
-from mixedbread.types import (
Store,
StoreChunkSearchOptions,
StoreDeleteResponse,
diff --git a/src/mixedbread/_client.py b/src/mixedbread/_client.py
index a70709d3..3982ee4e 100644
--- a/src/mixedbread/_client.py
+++ b/src/mixedbread/_client.py
@@ -53,7 +53,7 @@
from .types.embedding_create_response import EmbeddingCreateResponse
if TYPE_CHECKING:
- from .resources import chat, files, stores, parsing, api_keys, embeddings, extractions, data_sources, vector_stores
+ from .resources import chat, files, stores, parsing, api_keys, embeddings, extractions, data_sources
from .resources.chat import ChatResource, AsyncChatResource
from .resources.files import FilesResource, AsyncFilesResource
from .resources.api_keys import APIKeysResource, AsyncAPIKeysResource
@@ -62,7 +62,6 @@
from .resources.parsing.parsing import ParsingResource, AsyncParsingResource
from .resources.extractions.extractions import ExtractionsResource, AsyncExtractionsResource
from .resources.data_sources.data_sources import DataSourcesResource, AsyncDataSourcesResource
- from .resources.vector_stores.vector_stores import VectorStoresResource, AsyncVectorStoresResource
__all__ = [
"ENVIRONMENTS",
@@ -162,12 +161,6 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- @cached_property
- def vector_stores(self) -> VectorStoresResource:
- from .resources.vector_stores import VectorStoresResource
-
- return VectorStoresResource(self)
-
@cached_property
def stores(self) -> StoresResource:
from .resources.stores import StoresResource
@@ -565,12 +558,6 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)
- @cached_property
- def vector_stores(self) -> AsyncVectorStoresResource:
- from .resources.vector_stores import AsyncVectorStoresResource
-
- return AsyncVectorStoresResource(self)
-
@cached_property
def stores(self) -> AsyncStoresResource:
from .resources.stores import AsyncStoresResource
@@ -905,12 +892,6 @@ def __init__(self, client: Mixedbread) -> None:
client.rerank,
)
- @cached_property
- def vector_stores(self) -> vector_stores.VectorStoresResourceWithRawResponse:
- from .resources.vector_stores import VectorStoresResourceWithRawResponse
-
- return VectorStoresResourceWithRawResponse(self._client.vector_stores)
-
@cached_property
def stores(self) -> stores.StoresResourceWithRawResponse:
from .resources.stores import StoresResourceWithRawResponse
@@ -976,12 +957,6 @@ def __init__(self, client: AsyncMixedbread) -> None:
client.rerank,
)
- @cached_property
- def vector_stores(self) -> vector_stores.AsyncVectorStoresResourceWithRawResponse:
- from .resources.vector_stores import AsyncVectorStoresResourceWithRawResponse
-
- return AsyncVectorStoresResourceWithRawResponse(self._client.vector_stores)
-
@cached_property
def stores(self) -> stores.AsyncStoresResourceWithRawResponse:
from .resources.stores import AsyncStoresResourceWithRawResponse
@@ -1047,12 +1022,6 @@ def __init__(self, client: Mixedbread) -> None:
client.rerank,
)
- @cached_property
- def vector_stores(self) -> vector_stores.VectorStoresResourceWithStreamingResponse:
- from .resources.vector_stores import VectorStoresResourceWithStreamingResponse
-
- return VectorStoresResourceWithStreamingResponse(self._client.vector_stores)
-
@cached_property
def stores(self) -> stores.StoresResourceWithStreamingResponse:
from .resources.stores import StoresResourceWithStreamingResponse
@@ -1118,12 +1087,6 @@ def __init__(self, client: AsyncMixedbread) -> None:
client.rerank,
)
- @cached_property
- def vector_stores(self) -> vector_stores.AsyncVectorStoresResourceWithStreamingResponse:
- from .resources.vector_stores import AsyncVectorStoresResourceWithStreamingResponse
-
- return AsyncVectorStoresResourceWithStreamingResponse(self._client.vector_stores)
-
@cached_property
def stores(self) -> stores.AsyncStoresResourceWithStreamingResponse:
from .resources.stores import AsyncStoresResourceWithStreamingResponse
diff --git a/src/mixedbread/resources/__init__.py b/src/mixedbread/resources/__init__.py
index 368addbe..a9073d39 100644
--- a/src/mixedbread/resources/__init__.py
+++ b/src/mixedbread/resources/__init__.py
@@ -64,22 +64,8 @@
DataSourcesResourceWithStreamingResponse,
AsyncDataSourcesResourceWithStreamingResponse,
)
-from .vector_stores import (
- VectorStoresResource,
- AsyncVectorStoresResource,
- VectorStoresResourceWithRawResponse,
- AsyncVectorStoresResourceWithRawResponse,
- VectorStoresResourceWithStreamingResponse,
- AsyncVectorStoresResourceWithStreamingResponse,
-)
__all__ = [
- "VectorStoresResource",
- "AsyncVectorStoresResource",
- "VectorStoresResourceWithRawResponse",
- "AsyncVectorStoresResourceWithRawResponse",
- "VectorStoresResourceWithStreamingResponse",
- "AsyncVectorStoresResourceWithStreamingResponse",
"StoresResource",
"AsyncStoresResource",
"StoresResourceWithRawResponse",
diff --git a/src/mixedbread/resources/vector_stores/__init__.py b/src/mixedbread/resources/vector_stores/__init__.py
deleted file mode 100644
index 85d202da..00000000
--- a/src/mixedbread/resources/vector_stores/__init__.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from .files import (
- FilesResource,
- AsyncFilesResource,
- FilesResourceWithRawResponse,
- AsyncFilesResourceWithRawResponse,
- FilesResourceWithStreamingResponse,
- AsyncFilesResourceWithStreamingResponse,
-)
-from .vector_stores import (
- VectorStoresResource,
- AsyncVectorStoresResource,
- VectorStoresResourceWithRawResponse,
- AsyncVectorStoresResourceWithRawResponse,
- VectorStoresResourceWithStreamingResponse,
- AsyncVectorStoresResourceWithStreamingResponse,
-)
-
-__all__ = [
- "FilesResource",
- "AsyncFilesResource",
- "FilesResourceWithRawResponse",
- "AsyncFilesResourceWithRawResponse",
- "FilesResourceWithStreamingResponse",
- "AsyncFilesResourceWithStreamingResponse",
- "VectorStoresResource",
- "AsyncVectorStoresResource",
- "VectorStoresResourceWithRawResponse",
- "AsyncVectorStoresResourceWithRawResponse",
- "VectorStoresResourceWithStreamingResponse",
- "AsyncVectorStoresResourceWithStreamingResponse",
-]
diff --git a/src/mixedbread/resources/vector_stores/files.py b/src/mixedbread/resources/vector_stores/files.py
deleted file mode 100644
index 689c9dca..00000000
--- a/src/mixedbread/resources/vector_stores/files.py
+++ /dev/null
@@ -1,774 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import typing_extensions
-from typing import List, Union, Iterable, Optional
-
-import httpx
-
-from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from ..._base_client import make_request_options
-from ...types.vector_stores import file_list_params, file_create_params, file_search_params, file_retrieve_params
-from ...types.stores.store_file_status import StoreFileStatus
-from ...types.vector_stores.vector_store_file import VectorStoreFile
-from ...types.vector_stores.file_list_response import FileListResponse
-from ...types.vector_stores.file_delete_response import FileDeleteResponse
-from ...types.vector_stores.file_search_response import FileSearchResponse
-
-__all__ = ["FilesResource", "AsyncFilesResource"]
-
-
-class FilesResource(SyncAPIResource):
- @cached_property
- def with_raw_response(self) -> FilesResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return FilesResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> FilesResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return FilesResourceWithStreamingResponse(self)
-
- @typing_extensions.deprecated("Use post stores.files instead")
- def create(
- self,
- vector_store_identifier: str,
- *,
- metadata: object | Omit = omit,
- config: file_create_params.Config | Omit = omit,
- external_id: Optional[str] | Omit = omit,
- overwrite: bool | Omit = omit,
- file_id: str,
- experimental: Optional[file_create_params.Experimental] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreFile:
- """
- DEPRECATED: Use POST /stores/{store_identifier}/files instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- metadata: Optional metadata for the file
-
- config: Configuration for adding the file
-
- external_id: External identifier for this file in the store
-
- overwrite: If true, overwrite an existing file with the same external_id
-
- file_id: ID of the file to add
-
- experimental: Configuration for a file.
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return self._post(
- f"/v1/vector_stores/{vector_store_identifier}/files",
- body=maybe_transform(
- {
- "metadata": metadata,
- "config": config,
- "external_id": external_id,
- "overwrite": overwrite,
- "file_id": file_id,
- "experimental": experimental,
- },
- file_create_params.FileCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreFile,
- )
-
- @typing_extensions.deprecated("Use stores.files instead")
- def retrieve(
- self,
- file_id: str,
- *,
- vector_store_identifier: str,
- return_chunks: bool | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreFile:
- """
- DEPRECATED: Use GET /stores/{store_identifier}/files/{file_id} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- file_id: The ID or name 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
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- 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,
- query=maybe_transform({"return_chunks": return_chunks}, file_retrieve_params.FileRetrieveParams),
- ),
- cast_to=VectorStoreFile,
- )
-
- @typing_extensions.deprecated("Use post stores.files.list instead")
- def list(
- self,
- vector_store_identifier: str,
- *,
- limit: int | Omit = omit,
- after: Optional[str] | Omit = omit,
- before: Optional[str] | Omit = omit,
- include_total: bool | Omit = omit,
- statuses: Optional[List[StoreFileStatus]] | Omit = omit,
- metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> FileListResponse:
- """
- DEPRECATED: Use POST /stores/{store_identifier}/files/list instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- statuses: Status to filter by
-
- metadata_filter: Metadata filter to apply to the query
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return self._post(
- f"/v1/vector_stores/{vector_store_identifier}/files/list",
- body=maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "statuses": statuses,
- "metadata_filter": metadata_filter,
- },
- file_list_params.FileListParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileListResponse,
- )
-
- @typing_extensions.deprecated("Use stores.files instead")
- def delete(
- self,
- file_id: str,
- *,
- vector_store_identifier: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> FileDeleteResponse:
- """
- DEPRECATED: Use DELETE /stores/{store_identifier}/files/{file_id} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- file_id: The ID or name of the file to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return self._delete(
- 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
- ),
- cast_to=FileDeleteResponse,
- )
-
- @typing_extensions.deprecated("Use stores.files.search instead")
- def search(
- self,
- *,
- query: str,
- vector_store_identifiers: SequenceNotStr[str],
- top_k: int | Omit = omit,
- filters: Optional[file_search_params.Filters] | Omit = omit,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
- search_options: file_search_params.SearchOptions | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> FileSearchResponse:
- """
- DEPRECATED: Use POST /stores/{store_identifier}/files/search instead
-
- Args:
- query: Search query text
-
- vector_store_identifiers: IDs or names of vector stores to search
-
- top_k: Number of results to return
-
- filters: Optional filter conditions
-
- file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
-
- search_options: Search configuration options
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/vector_stores/files/search",
- body=maybe_transform(
- {
- "query": query,
- "vector_store_identifiers": vector_store_identifiers,
- "top_k": top_k,
- "filters": filters,
- "file_ids": file_ids,
- "search_options": search_options,
- },
- file_search_params.FileSearchParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileSearchResponse,
- )
-
-
-class AsyncFilesResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncFilesResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncFilesResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncFilesResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncFilesResourceWithStreamingResponse(self)
-
- @typing_extensions.deprecated("Use post stores.files instead")
- async def create(
- self,
- vector_store_identifier: str,
- *,
- metadata: object | Omit = omit,
- config: file_create_params.Config | Omit = omit,
- external_id: Optional[str] | Omit = omit,
- overwrite: bool | Omit = omit,
- file_id: str,
- experimental: Optional[file_create_params.Experimental] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreFile:
- """
- DEPRECATED: Use POST /stores/{store_identifier}/files instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- metadata: Optional metadata for the file
-
- config: Configuration for adding the file
-
- external_id: External identifier for this file in the store
-
- overwrite: If true, overwrite an existing file with the same external_id
-
- file_id: ID of the file to add
-
- experimental: Configuration for a file.
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return await self._post(
- f"/v1/vector_stores/{vector_store_identifier}/files",
- body=await async_maybe_transform(
- {
- "metadata": metadata,
- "config": config,
- "external_id": external_id,
- "overwrite": overwrite,
- "file_id": file_id,
- "experimental": experimental,
- },
- file_create_params.FileCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreFile,
- )
-
- @typing_extensions.deprecated("Use stores.files instead")
- async def retrieve(
- self,
- file_id: str,
- *,
- vector_store_identifier: str,
- return_chunks: bool | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreFile:
- """
- DEPRECATED: Use GET /stores/{store_identifier}/files/{file_id} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- file_id: The ID or name 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
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- 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,
- query=await async_maybe_transform(
- {"return_chunks": return_chunks}, file_retrieve_params.FileRetrieveParams
- ),
- ),
- cast_to=VectorStoreFile,
- )
-
- @typing_extensions.deprecated("Use post stores.files.list instead")
- async def list(
- self,
- vector_store_identifier: str,
- *,
- limit: int | Omit = omit,
- after: Optional[str] | Omit = omit,
- before: Optional[str] | Omit = omit,
- include_total: bool | Omit = omit,
- statuses: Optional[List[StoreFileStatus]] | Omit = omit,
- metadata_filter: Optional[file_list_params.MetadataFilter] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> FileListResponse:
- """
- DEPRECATED: Use POST /stores/{store_identifier}/files/list instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- statuses: Status to filter by
-
- metadata_filter: Metadata filter to apply to the query
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return await self._post(
- f"/v1/vector_stores/{vector_store_identifier}/files/list",
- body=await async_maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "statuses": statuses,
- "metadata_filter": metadata_filter,
- },
- file_list_params.FileListParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileListResponse,
- )
-
- @typing_extensions.deprecated("Use stores.files instead")
- async def delete(
- self,
- file_id: str,
- *,
- vector_store_identifier: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> FileDeleteResponse:
- """
- DEPRECATED: Use DELETE /stores/{store_identifier}/files/{file_id} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- file_id: The ID or name of the file to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- if not file_id:
- raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
- return await self._delete(
- 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
- ),
- cast_to=FileDeleteResponse,
- )
-
- @typing_extensions.deprecated("Use stores.files.search instead")
- async def search(
- self,
- *,
- query: str,
- vector_store_identifiers: SequenceNotStr[str],
- top_k: int | Omit = omit,
- filters: Optional[file_search_params.Filters] | Omit = omit,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
- search_options: file_search_params.SearchOptions | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> FileSearchResponse:
- """
- DEPRECATED: Use POST /stores/{store_identifier}/files/search instead
-
- Args:
- query: Search query text
-
- vector_store_identifiers: IDs or names of vector stores to search
-
- top_k: Number of results to return
-
- filters: Optional filter conditions
-
- file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
-
- search_options: Search configuration options
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/vector_stores/files/search",
- body=await async_maybe_transform(
- {
- "query": query,
- "vector_store_identifiers": vector_store_identifiers,
- "top_k": top_k,
- "filters": filters,
- "file_ids": file_ids,
- "search_options": search_options,
- },
- file_search_params.FileSearchParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=FileSearchResponse,
- )
-
-
-class FilesResourceWithRawResponse:
- def __init__(self, files: FilesResource) -> None:
- self._files = files
-
- self.create = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- files.create, # pyright: ignore[reportDeprecated],
- )
- )
- self.retrieve = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- files.retrieve, # pyright: ignore[reportDeprecated],
- )
- )
- self.list = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- files.list, # pyright: ignore[reportDeprecated],
- )
- )
- self.delete = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- files.delete, # pyright: ignore[reportDeprecated],
- )
- )
- self.search = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- files.search, # pyright: ignore[reportDeprecated],
- )
- )
-
-
-class AsyncFilesResourceWithRawResponse:
- def __init__(self, files: AsyncFilesResource) -> None:
- self._files = files
-
- self.create = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- files.create, # pyright: ignore[reportDeprecated],
- )
- )
- self.retrieve = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- files.retrieve, # pyright: ignore[reportDeprecated],
- )
- )
- self.list = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- files.list, # pyright: ignore[reportDeprecated],
- )
- )
- self.delete = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- files.delete, # pyright: ignore[reportDeprecated],
- )
- )
- self.search = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- files.search, # pyright: ignore[reportDeprecated],
- )
- )
-
-
-class FilesResourceWithStreamingResponse:
- def __init__(self, files: FilesResource) -> None:
- self._files = files
-
- self.create = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- files.create, # pyright: ignore[reportDeprecated],
- )
- )
- self.retrieve = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- files.retrieve, # pyright: ignore[reportDeprecated],
- )
- )
- self.list = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- files.list, # pyright: ignore[reportDeprecated],
- )
- )
- self.delete = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- files.delete, # pyright: ignore[reportDeprecated],
- )
- )
- self.search = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- files.search, # pyright: ignore[reportDeprecated],
- )
- )
-
-
-class AsyncFilesResourceWithStreamingResponse:
- def __init__(self, files: AsyncFilesResource) -> None:
- self._files = files
-
- self.create = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- files.create, # pyright: ignore[reportDeprecated],
- )
- )
- self.retrieve = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- files.retrieve, # pyright: ignore[reportDeprecated],
- )
- )
- self.list = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- files.list, # pyright: ignore[reportDeprecated],
- )
- )
- self.delete = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- files.delete, # pyright: ignore[reportDeprecated],
- )
- )
- self.search = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- files.search, # pyright: ignore[reportDeprecated],
- )
- )
diff --git a/src/mixedbread/resources/vector_stores/vector_stores.py b/src/mixedbread/resources/vector_stores/vector_stores.py
deleted file mode 100644
index b8e3dd13..00000000
--- a/src/mixedbread/resources/vector_stores/vector_stores.py
+++ /dev/null
@@ -1,1054 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import typing_extensions
-from typing import Union, Iterable, Optional
-
-import httpx
-
-from .files import (
- FilesResource,
- AsyncFilesResource,
- FilesResourceWithRawResponse,
- AsyncFilesResourceWithRawResponse,
- FilesResourceWithStreamingResponse,
- AsyncFilesResourceWithStreamingResponse,
-)
-from ...types import (
- vector_store_list_params,
- vector_store_create_params,
- vector_store_search_params,
- vector_store_update_params,
- vector_store_question_answering_params,
-)
-from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ..._utils import maybe_transform, async_maybe_transform
-from ..._compat import cached_property
-from ..._resource import SyncAPIResource, AsyncAPIResource
-from ..._response import (
- to_raw_response_wrapper,
- to_streamed_response_wrapper,
- async_to_raw_response_wrapper,
- async_to_streamed_response_wrapper,
-)
-from ...pagination import SyncCursor, AsyncCursor
-from ..._base_client import AsyncPaginator, make_request_options
-from ...types.vector_store import VectorStore
-from ...types.expires_after_param import ExpiresAfterParam
-from ...types.vector_store_delete_response import VectorStoreDeleteResponse
-from ...types.vector_store_search_response import VectorStoreSearchResponse
-from ...types.vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-from ...types.vector_store_question_answering_response import VectorStoreQuestionAnsweringResponse
-
-__all__ = ["VectorStoresResource", "AsyncVectorStoresResource"]
-
-
-class VectorStoresResource(SyncAPIResource):
- @cached_property
- def files(self) -> FilesResource:
- return FilesResource(self._client)
-
- @cached_property
- def with_raw_response(self) -> VectorStoresResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return VectorStoresResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> VectorStoresResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return VectorStoresResourceWithStreamingResponse(self)
-
- @typing_extensions.deprecated("Use stores instead")
- def create(
- self,
- *,
- name: Optional[str] | Omit = omit,
- description: Optional[str] | Omit = omit,
- is_public: bool | Omit = omit,
- expires_after: Optional[ExpiresAfterParam] | Omit = omit,
- metadata: object | Omit = omit,
- file_ids: Optional[SequenceNotStr[str]] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStore:
- """
- DEPRECATED: Use POST /stores instead
-
- Args:
- name: Name for the new vector store
-
- description: Description of the vector store
-
- is_public: Whether the vector store can be accessed by anyone with valid login credentials
-
- expires_after: Represents an expiration policy for a store.
-
- metadata: Optional metadata key-value pairs
-
- file_ids: Optional list of file IDs
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/vector_stores",
- body=maybe_transform(
- {
- "name": name,
- "description": description,
- "is_public": is_public,
- "expires_after": expires_after,
- "metadata": metadata,
- "file_ids": file_ids,
- },
- vector_store_create_params.VectorStoreCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
- @typing_extensions.deprecated("Use stores instead")
- def retrieve(
- self,
- vector_store_identifier: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStore:
- """
- DEPRECATED: Use GET /stores/{store_identifier} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return self._get(
- f"/v1/vector_stores/{vector_store_identifier}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
- @typing_extensions.deprecated("Use stores instead")
- def update(
- self,
- vector_store_identifier: str,
- *,
- name: Optional[str] | Omit = omit,
- description: Optional[str] | Omit = omit,
- is_public: Optional[bool] | Omit = omit,
- expires_after: Optional[ExpiresAfterParam] | Omit = omit,
- metadata: object | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStore:
- """
- DEPRECATED: Use PUT /stores/{store_identifier} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- name: New name for the store
-
- description: New description
-
- is_public: Whether the vector store can be accessed by anyone with valid login credentials
-
- expires_after: Represents an expiration policy for a store.
-
- metadata: Optional metadata key-value pairs
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return self._put(
- f"/v1/vector_stores/{vector_store_identifier}",
- body=maybe_transform(
- {
- "name": name,
- "description": description,
- "is_public": is_public,
- "expires_after": expires_after,
- "metadata": metadata,
- },
- vector_store_update_params.VectorStoreUpdateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
- @typing_extensions.deprecated("Use stores instead")
- def list(
- self,
- *,
- limit: int | Omit = omit,
- after: Optional[str] | Omit = omit,
- before: Optional[str] | Omit = omit,
- include_total: bool | Omit = omit,
- q: Optional[str] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> SyncCursor[VectorStore]:
- """
- DEPRECATED: Use GET /stores instead
-
- Args:
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- q: Search query for fuzzy matching over name and description fields
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._get_api_list(
- "/v1/vector_stores",
- page=SyncCursor[VectorStore],
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "q": q,
- },
- vector_store_list_params.VectorStoreListParams,
- ),
- ),
- model=VectorStore,
- )
-
- @typing_extensions.deprecated("Use stores instead")
- def delete(
- self,
- vector_store_identifier: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreDeleteResponse:
- """
- DEPRECATED: Use DELETE /stores/{store_identifier} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return self._delete(
- f"/v1/vector_stores/{vector_store_identifier}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreDeleteResponse,
- )
-
- @typing_extensions.deprecated("Use stores.question_answering instead")
- def question_answering(
- self,
- *,
- query: str | Omit = omit,
- vector_store_identifiers: SequenceNotStr[str],
- top_k: int | Omit = omit,
- filters: Optional[vector_store_question_answering_params.Filters] | Omit = omit,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
- search_options: VectorStoreChunkSearchOptionsParam | Omit = omit,
- stream: bool | Omit = omit,
- qa_options: vector_store_question_answering_params.QaOptions | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreQuestionAnsweringResponse:
- """
- DEPRECATED: Use POST /stores/question-answering instead
-
- Args:
- query: Question to answer. If not provided, the question will be extracted from the
- passed messages.
-
- vector_store_identifiers: IDs or names of vector stores to search
-
- top_k: Number of results to return
-
- filters: Optional filter conditions
-
- file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
-
- search_options: Search configuration options
-
- stream: Whether to stream the answer
-
- qa_options: Question answering configuration options
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/vector_stores/question-answering",
- body=maybe_transform(
- {
- "query": query,
- "vector_store_identifiers": vector_store_identifiers,
- "top_k": top_k,
- "filters": filters,
- "file_ids": file_ids,
- "search_options": search_options,
- "stream": stream,
- "qa_options": qa_options,
- },
- vector_store_question_answering_params.VectorStoreQuestionAnsweringParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreQuestionAnsweringResponse,
- )
-
- @typing_extensions.deprecated("Use stores.search instead")
- def search(
- self,
- *,
- query: str,
- vector_store_identifiers: SequenceNotStr[str],
- top_k: int | Omit = omit,
- filters: Optional[vector_store_search_params.Filters] | Omit = omit,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
- search_options: VectorStoreChunkSearchOptionsParam | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreSearchResponse:
- """
- DEPRECATED: Use POST /stores/search instead
-
- Args:
- query: Search query text
-
- vector_store_identifiers: IDs or names of vector stores to search
-
- top_k: Number of results to return
-
- filters: Optional filter conditions
-
- file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
-
- search_options: Search configuration options
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._post(
- "/v1/vector_stores/search",
- body=maybe_transform(
- {
- "query": query,
- "vector_store_identifiers": vector_store_identifiers,
- "top_k": top_k,
- "filters": filters,
- "file_ids": file_ids,
- "search_options": search_options,
- },
- vector_store_search_params.VectorStoreSearchParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreSearchResponse,
- )
-
-
-class AsyncVectorStoresResource(AsyncAPIResource):
- @cached_property
- def files(self) -> AsyncFilesResource:
- return AsyncFilesResource(self._client)
-
- @cached_property
- def with_raw_response(self) -> AsyncVectorStoresResourceWithRawResponse:
- """
- This property can be used as a prefix for any HTTP method call to return
- the raw response object instead of the parsed content.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#accessing-raw-response-data-eg-headers
- """
- return AsyncVectorStoresResourceWithRawResponse(self)
-
- @cached_property
- def with_streaming_response(self) -> AsyncVectorStoresResourceWithStreamingResponse:
- """
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
-
- For more information, see https://www.github.com/mixedbread-ai/mixedbread-python#with_streaming_response
- """
- return AsyncVectorStoresResourceWithStreamingResponse(self)
-
- @typing_extensions.deprecated("Use stores instead")
- async def create(
- self,
- *,
- name: Optional[str] | Omit = omit,
- description: Optional[str] | Omit = omit,
- is_public: bool | Omit = omit,
- expires_after: Optional[ExpiresAfterParam] | Omit = omit,
- metadata: object | Omit = omit,
- file_ids: Optional[SequenceNotStr[str]] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStore:
- """
- DEPRECATED: Use POST /stores instead
-
- Args:
- name: Name for the new vector store
-
- description: Description of the vector store
-
- is_public: Whether the vector store can be accessed by anyone with valid login credentials
-
- expires_after: Represents an expiration policy for a store.
-
- metadata: Optional metadata key-value pairs
-
- file_ids: Optional list of file IDs
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/vector_stores",
- body=await async_maybe_transform(
- {
- "name": name,
- "description": description,
- "is_public": is_public,
- "expires_after": expires_after,
- "metadata": metadata,
- "file_ids": file_ids,
- },
- vector_store_create_params.VectorStoreCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
- @typing_extensions.deprecated("Use stores instead")
- async def retrieve(
- self,
- vector_store_identifier: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStore:
- """
- DEPRECATED: Use GET /stores/{store_identifier} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return await self._get(
- f"/v1/vector_stores/{vector_store_identifier}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
- @typing_extensions.deprecated("Use stores instead")
- async def update(
- self,
- vector_store_identifier: str,
- *,
- name: Optional[str] | Omit = omit,
- description: Optional[str] | Omit = omit,
- is_public: Optional[bool] | Omit = omit,
- expires_after: Optional[ExpiresAfterParam] | Omit = omit,
- metadata: object | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStore:
- """
- DEPRECATED: Use PUT /stores/{store_identifier} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store
-
- name: New name for the store
-
- description: New description
-
- is_public: Whether the vector store can be accessed by anyone with valid login credentials
-
- expires_after: Represents an expiration policy for a store.
-
- metadata: Optional metadata key-value pairs
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return await self._put(
- f"/v1/vector_stores/{vector_store_identifier}",
- body=await async_maybe_transform(
- {
- "name": name,
- "description": description,
- "is_public": is_public,
- "expires_after": expires_after,
- "metadata": metadata,
- },
- vector_store_update_params.VectorStoreUpdateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStore,
- )
-
- @typing_extensions.deprecated("Use stores instead")
- def list(
- self,
- *,
- limit: int | Omit = omit,
- after: Optional[str] | Omit = omit,
- before: Optional[str] | Omit = omit,
- include_total: bool | Omit = omit,
- q: Optional[str] | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AsyncPaginator[VectorStore, AsyncCursor[VectorStore]]:
- """
- DEPRECATED: Use GET /stores instead
-
- Args:
- limit: Maximum number of items to return per page (1-100)
-
- after: Cursor for forward pagination - get items after this position. Use last_cursor
- from previous response.
-
- before: Cursor for backward pagination - get items before this position. Use
- first_cursor from previous response.
-
- include_total: Whether to include total count in response (expensive operation)
-
- q: Search query for fuzzy matching over name and description fields
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return self._get_api_list(
- "/v1/vector_stores",
- page=AsyncCursor[VectorStore],
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=maybe_transform(
- {
- "limit": limit,
- "after": after,
- "before": before,
- "include_total": include_total,
- "q": q,
- },
- vector_store_list_params.VectorStoreListParams,
- ),
- ),
- model=VectorStore,
- )
-
- @typing_extensions.deprecated("Use stores instead")
- async def delete(
- self,
- vector_store_identifier: str,
- *,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreDeleteResponse:
- """
- DEPRECATED: Use DELETE /stores/{store_identifier} instead
-
- Args:
- vector_store_identifier: The ID or name of the vector store to delete
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not vector_store_identifier:
- raise ValueError(
- f"Expected a non-empty value for `vector_store_identifier` but received {vector_store_identifier!r}"
- )
- return await self._delete(
- f"/v1/vector_stores/{vector_store_identifier}",
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreDeleteResponse,
- )
-
- @typing_extensions.deprecated("Use stores.question_answering instead")
- async def question_answering(
- self,
- *,
- query: str | Omit = omit,
- vector_store_identifiers: SequenceNotStr[str],
- top_k: int | Omit = omit,
- filters: Optional[vector_store_question_answering_params.Filters] | Omit = omit,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
- search_options: VectorStoreChunkSearchOptionsParam | Omit = omit,
- stream: bool | Omit = omit,
- qa_options: vector_store_question_answering_params.QaOptions | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreQuestionAnsweringResponse:
- """
- DEPRECATED: Use POST /stores/question-answering instead
-
- Args:
- query: Question to answer. If not provided, the question will be extracted from the
- passed messages.
-
- vector_store_identifiers: IDs or names of vector stores to search
-
- top_k: Number of results to return
-
- filters: Optional filter conditions
-
- file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
-
- search_options: Search configuration options
-
- stream: Whether to stream the answer
-
- qa_options: Question answering configuration options
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/vector_stores/question-answering",
- body=await async_maybe_transform(
- {
- "query": query,
- "vector_store_identifiers": vector_store_identifiers,
- "top_k": top_k,
- "filters": filters,
- "file_ids": file_ids,
- "search_options": search_options,
- "stream": stream,
- "qa_options": qa_options,
- },
- vector_store_question_answering_params.VectorStoreQuestionAnsweringParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreQuestionAnsweringResponse,
- )
-
- @typing_extensions.deprecated("Use stores.search instead")
- async def search(
- self,
- *,
- query: str,
- vector_store_identifiers: SequenceNotStr[str],
- top_k: int | Omit = omit,
- filters: Optional[vector_store_search_params.Filters] | Omit = omit,
- file_ids: Union[Iterable[object], SequenceNotStr[str], None] | Omit = omit,
- search_options: VectorStoreChunkSearchOptionsParam | Omit = omit,
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
- # The extra values given here take precedence over values defined on the client or passed to this method.
- extra_headers: Headers | None = None,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> VectorStoreSearchResponse:
- """
- DEPRECATED: Use POST /stores/search instead
-
- Args:
- query: Search query text
-
- vector_store_identifiers: IDs or names of vector stores to search
-
- top_k: Number of results to return
-
- filters: Optional filter conditions
-
- file_ids: Optional list of file IDs to filter chunks by (inclusion filter)
-
- search_options: Search configuration options
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- return await self._post(
- "/v1/vector_stores/search",
- body=await async_maybe_transform(
- {
- "query": query,
- "vector_store_identifiers": vector_store_identifiers,
- "top_k": top_k,
- "filters": filters,
- "file_ids": file_ids,
- "search_options": search_options,
- },
- vector_store_search_params.VectorStoreSearchParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- cast_to=VectorStoreSearchResponse,
- )
-
-
-class VectorStoresResourceWithRawResponse:
- def __init__(self, vector_stores: VectorStoresResource) -> None:
- self._vector_stores = vector_stores
-
- self.create = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- vector_stores.create, # pyright: ignore[reportDeprecated],
- )
- )
- self.retrieve = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- vector_stores.retrieve, # pyright: ignore[reportDeprecated],
- )
- )
- self.update = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- vector_stores.update, # pyright: ignore[reportDeprecated],
- )
- )
- self.list = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- vector_stores.list, # pyright: ignore[reportDeprecated],
- )
- )
- self.delete = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- vector_stores.delete, # pyright: ignore[reportDeprecated],
- )
- )
- self.question_answering = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- vector_stores.question_answering, # pyright: ignore[reportDeprecated],
- )
- )
- self.search = ( # pyright: ignore[reportDeprecated]
- to_raw_response_wrapper(
- vector_stores.search, # pyright: ignore[reportDeprecated],
- )
- )
-
- @cached_property
- def files(self) -> FilesResourceWithRawResponse:
- return FilesResourceWithRawResponse(self._vector_stores.files)
-
-
-class AsyncVectorStoresResourceWithRawResponse:
- def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
- self._vector_stores = vector_stores
-
- self.create = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- vector_stores.create, # pyright: ignore[reportDeprecated],
- )
- )
- self.retrieve = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- vector_stores.retrieve, # pyright: ignore[reportDeprecated],
- )
- )
- self.update = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- vector_stores.update, # pyright: ignore[reportDeprecated],
- )
- )
- self.list = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- vector_stores.list, # pyright: ignore[reportDeprecated],
- )
- )
- self.delete = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- vector_stores.delete, # pyright: ignore[reportDeprecated],
- )
- )
- self.question_answering = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- vector_stores.question_answering, # pyright: ignore[reportDeprecated],
- )
- )
- self.search = ( # pyright: ignore[reportDeprecated]
- async_to_raw_response_wrapper(
- vector_stores.search, # pyright: ignore[reportDeprecated],
- )
- )
-
- @cached_property
- def files(self) -> AsyncFilesResourceWithRawResponse:
- return AsyncFilesResourceWithRawResponse(self._vector_stores.files)
-
-
-class VectorStoresResourceWithStreamingResponse:
- def __init__(self, vector_stores: VectorStoresResource) -> None:
- self._vector_stores = vector_stores
-
- self.create = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- vector_stores.create, # pyright: ignore[reportDeprecated],
- )
- )
- self.retrieve = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- vector_stores.retrieve, # pyright: ignore[reportDeprecated],
- )
- )
- self.update = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- vector_stores.update, # pyright: ignore[reportDeprecated],
- )
- )
- self.list = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- vector_stores.list, # pyright: ignore[reportDeprecated],
- )
- )
- self.delete = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- vector_stores.delete, # pyright: ignore[reportDeprecated],
- )
- )
- self.question_answering = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- vector_stores.question_answering, # pyright: ignore[reportDeprecated],
- )
- )
- self.search = ( # pyright: ignore[reportDeprecated]
- to_streamed_response_wrapper(
- vector_stores.search, # pyright: ignore[reportDeprecated],
- )
- )
-
- @cached_property
- def files(self) -> FilesResourceWithStreamingResponse:
- return FilesResourceWithStreamingResponse(self._vector_stores.files)
-
-
-class AsyncVectorStoresResourceWithStreamingResponse:
- def __init__(self, vector_stores: AsyncVectorStoresResource) -> None:
- self._vector_stores = vector_stores
-
- self.create = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- vector_stores.create, # pyright: ignore[reportDeprecated],
- )
- )
- self.retrieve = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- vector_stores.retrieve, # pyright: ignore[reportDeprecated],
- )
- )
- self.update = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- vector_stores.update, # pyright: ignore[reportDeprecated],
- )
- )
- self.list = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- vector_stores.list, # pyright: ignore[reportDeprecated],
- )
- )
- self.delete = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- vector_stores.delete, # pyright: ignore[reportDeprecated],
- )
- )
- self.question_answering = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- vector_stores.question_answering, # pyright: ignore[reportDeprecated],
- )
- )
- self.search = ( # pyright: ignore[reportDeprecated]
- async_to_streamed_response_wrapper(
- vector_stores.search, # pyright: ignore[reportDeprecated],
- )
- )
-
- @cached_property
- def files(self) -> AsyncFilesResourceWithStreamingResponse:
- return AsyncFilesResourceWithStreamingResponse(self._vector_stores.files)
diff --git a/src/mixedbread/types/__init__.py b/src/mixedbread/types/__init__.py
index 20bcd899..306c151e 100644
--- a/src/mixedbread/types/__init__.py
+++ b/src/mixedbread/types/__init__.py
@@ -10,7 +10,6 @@
from .embedding import Embedding as Embedding
from .data_source import DataSource as DataSource
from .file_object import FileObject as FileObject
-from .vector_store import VectorStore as VectorStore
from .expires_after import ExpiresAfter as ExpiresAfter
from .info_response import InfoResponse as InfoResponse
from .oauth2_params import Oauth2Params as Oauth2Params
@@ -41,34 +40,19 @@
from .linear_data_source_param import LinearDataSourceParam as LinearDataSourceParam
from .multi_encoding_embedding import MultiEncodingEmbedding as MultiEncodingEmbedding
from .notion_data_source_param import NotionDataSourceParam as NotionDataSourceParam
-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 .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 .store_metadata_facets_params import StoreMetadataFacetsParams as StoreMetadataFacetsParams
-from .vector_store_delete_response import VectorStoreDeleteResponse as VectorStoreDeleteResponse
-from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse
from .store_metadata_facets_response import StoreMetadataFacetsResponse as StoreMetadataFacetsResponse
from .store_question_answering_params import StoreQuestionAnsweringParams as StoreQuestionAnsweringParams
from .store_chunk_search_options_param import StoreChunkSearchOptionsParam as StoreChunkSearchOptionsParam
from .store_question_answering_response import StoreQuestionAnsweringResponse as StoreQuestionAnsweringResponse
-from .vector_store_question_answering_params import (
- VectorStoreQuestionAnsweringParams as VectorStoreQuestionAnsweringParams,
-)
-from .vector_store_chunk_search_options_param import (
- VectorStoreChunkSearchOptionsParam as VectorStoreChunkSearchOptionsParam,
-)
-from .vector_store_question_answering_response import (
- VectorStoreQuestionAnsweringResponse as VectorStoreQuestionAnsweringResponse,
-)
# Rebuild cyclical models only after all modules are imported.
# This ensures that, when building the deferred (due to cyclical references) model schema,
diff --git a/src/mixedbread/types/store_chunk_search_options_param.py b/src/mixedbread/types/store_chunk_search_options_param.py
index 773251c4..12e5f590 100644
--- a/src/mixedbread/types/store_chunk_search_options_param.py
+++ b/src/mixedbread/types/store_chunk_search_options_param.py
@@ -5,11 +5,28 @@
from typing import Union, Optional
from typing_extensions import TypeAlias, TypedDict
-from .vector_stores.rerank_config_param import RerankConfigParam
+from .._types import SequenceNotStr
-__all__ = ["StoreChunkSearchOptionsParam", "Rerank", "Agentic", "AgenticAgenticSearchConfig"]
+__all__ = ["StoreChunkSearchOptionsParam", "Rerank", "RerankRerankConfig", "Agentic", "AgenticAgenticSearchConfig"]
-Rerank: TypeAlias = Union[bool, RerankConfigParam]
+
+class RerankRerankConfig(TypedDict, total=False):
+ """Represents a reranking configuration."""
+
+ model: str
+ """The name of the reranking model"""
+
+ with_metadata: Union[bool, SequenceNotStr[str]]
+ """Whether to include metadata in the reranked results"""
+
+ top_k: Optional[int]
+ """Maximum number of results to return after reranking.
+
+ If None, returns all reranked results.
+ """
+
+
+Rerank: TypeAlias = Union[bool, RerankRerankConfig]
class AgenticAgenticSearchConfig(TypedDict, total=False):
diff --git a/src/mixedbread/types/stores/file_search_params.py b/src/mixedbread/types/stores/file_search_params.py
index 99f27a59..e1a3ae74 100644
--- a/src/mixedbread/types/stores/file_search_params.py
+++ b/src/mixedbread/types/stores/file_search_params.py
@@ -6,7 +6,6 @@
from typing_extensions import Required, TypeAlias, TypedDict
from ..._types import SequenceNotStr
-from ..vector_stores.rerank_config_param import RerankConfigParam
from ..shared_params.search_filter_condition import SearchFilterCondition
__all__ = [
@@ -15,6 +14,7 @@
"FiltersUnionMember2",
"SearchOptions",
"SearchOptionsRerank",
+ "SearchOptionsRerankRerankConfig",
"SearchOptionsAgentic",
"SearchOptionsAgenticAgenticSearchConfig",
]
@@ -44,7 +44,24 @@ class FileSearchParams(TypedDict, total=False):
Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
-SearchOptionsRerank: TypeAlias = Union[bool, RerankConfigParam]
+
+class SearchOptionsRerankRerankConfig(TypedDict, total=False):
+ """Represents a reranking configuration."""
+
+ model: str
+ """The name of the reranking model"""
+
+ with_metadata: Union[bool, SequenceNotStr[str]]
+ """Whether to include metadata in the reranked results"""
+
+ top_k: Optional[int]
+ """Maximum number of results to return after reranking.
+
+ If None, returns all reranked results.
+ """
+
+
+SearchOptionsRerank: TypeAlias = Union[bool, SearchOptionsRerankRerankConfig]
class SearchOptionsAgenticAgenticSearchConfig(TypedDict, total=False):
diff --git a/src/mixedbread/types/vector_store.py b/src/mixedbread/types/vector_store.py
deleted file mode 100644
index d24802cb..00000000
--- a/src/mixedbread/types/vector_store.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import Optional
-from datetime import datetime
-from typing_extensions import Literal
-
-from .._models import BaseModel
-from .expires_after import ExpiresAfter
-
-__all__ = ["VectorStore", "FileCounts"]
-
-
-class FileCounts(BaseModel):
- """Counts of files in different states"""
-
- pending: Optional[int] = None
- """Number of files waiting to be processed"""
-
- 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):
- """Model representing a vector store with its metadata and timestamps."""
-
- id: str
- """Unique identifier for the vector store"""
-
- name: str
- """Name of the vector store"""
-
- description: Optional[str] = None
- """Detailed description of the vector store's purpose and contents"""
-
- is_public: Optional[bool] = None
- """Whether the vector store can be accessed by anyone with valid login credentials"""
-
- metadata: Optional[object] = None
- """Additional metadata associated with the vector store"""
-
- file_counts: Optional[FileCounts] = None
- """Counts of files in different states"""
-
- expires_after: Optional[ExpiresAfter] = None
- """Represents an expiration policy for a store."""
-
- status: Optional[Literal["expired", "in_progress", "completed"]] = None
- """Processing status of the vector store"""
-
- created_at: datetime
- """Timestamp when the vector store was created"""
-
- updated_at: datetime
- """Timestamp when the vector store was last updated"""
-
- last_active_at: Optional[datetime] = None
- """Timestamp when the vector store was last used"""
-
- usage_bytes: Optional[int] = None
- """Total storage usage in bytes"""
-
- expires_at: Optional[datetime] = None
- """Optional expiration timestamp for the vector store"""
-
- object: Optional[Literal["vector_store"]] = None
- """Type of the object"""
diff --git a/src/mixedbread/types/vector_store_chunk_search_options_param.py b/src/mixedbread/types/vector_store_chunk_search_options_param.py
deleted file mode 100644
index b2b2f185..00000000
--- a/src/mixedbread/types/vector_store_chunk_search_options_param.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union, Optional
-from typing_extensions import TypeAlias, TypedDict
-
-from .vector_stores.rerank_config_param import RerankConfigParam
-
-__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."""
-
- score_threshold: float
- """Minimum similarity score threshold"""
-
- rewrite_query: bool
- """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.
-
- 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"""
-
- apply_search_rules: bool
- """Whether to apply search rules"""
diff --git a/src/mixedbread/types/vector_store_create_params.py b/src/mixedbread/types/vector_store_create_params.py
deleted file mode 100644
index 713342a5..00000000
--- a/src/mixedbread/types/vector_store_create_params.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Optional
-from typing_extensions import TypedDict
-
-from .._types import SequenceNotStr
-from .expires_after_param import ExpiresAfterParam
-
-__all__ = ["VectorStoreCreateParams"]
-
-
-class VectorStoreCreateParams(TypedDict, total=False):
- name: Optional[str]
- """Name for the new vector store"""
-
- description: Optional[str]
- """Description of the vector store"""
-
- is_public: bool
- """Whether the vector store can be accessed by anyone with valid login credentials"""
-
- expires_after: Optional[ExpiresAfterParam]
- """Represents an expiration policy for a store."""
-
- metadata: object
- """Optional metadata key-value pairs"""
-
- file_ids: Optional[SequenceNotStr[str]]
- """Optional list of file IDs"""
diff --git a/src/mixedbread/types/vector_store_delete_response.py b/src/mixedbread/types/vector_store_delete_response.py
deleted file mode 100644
index 27af8ee3..00000000
--- a/src/mixedbread/types/vector_store_delete_response.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__ = ["VectorStoreDeleteResponse"]
-
-
-class VectorStoreDeleteResponse(BaseModel):
- """Response model for vector store deletion."""
-
- id: str
- """ID of the deleted vector store"""
-
- deleted: bool
- """Whether the deletion was successful"""
-
- object: Optional[Literal["vector_store"]] = None
- """Type of the deleted object"""
diff --git a/src/mixedbread/types/vector_store_list_params.py b/src/mixedbread/types/vector_store_list_params.py
deleted file mode 100644
index cdad6947..00000000
--- a/src/mixedbread/types/vector_store_list_params.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Optional
-from typing_extensions import TypedDict
-
-__all__ = ["VectorStoreListParams"]
-
-
-class VectorStoreListParams(TypedDict, total=False):
- limit: int
- """Maximum number of items to return per page (1-100)"""
-
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
-
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
-
- include_total: bool
- """Whether to include total count in response (expensive operation)"""
-
- q: Optional[str]
- """Search query for fuzzy matching over name and description fields"""
diff --git a/src/mixedbread/types/vector_store_question_answering_params.py b/src/mixedbread/types/vector_store_question_answering_params.py
deleted file mode 100644
index 295a761b..00000000
--- a/src/mixedbread/types/vector_store_question_answering_params.py
+++ /dev/null
@@ -1,59 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union, Iterable, Optional
-from typing_extensions import Required, TypeAlias, TypedDict
-
-from .._types import SequenceNotStr
-from .shared_params.search_filter_condition import SearchFilterCondition
-from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-
-__all__ = ["VectorStoreQuestionAnsweringParams", "Filters", "FiltersUnionMember2", "QaOptions"]
-
-
-class VectorStoreQuestionAnsweringParams(TypedDict, total=False):
- query: str
- """Question to answer.
-
- If not provided, the question will be extracted from the passed messages.
- """
-
- vector_store_identifiers: Required[SequenceNotStr[str]]
- """IDs or names of vector stores to search"""
-
- top_k: int
- """Number of results to return"""
-
- filters: Optional[Filters]
- """Optional filter conditions"""
-
- file_ids: Union[Iterable[object], SequenceNotStr[str], None]
- """Optional list of file IDs to filter chunks by (inclusion filter)"""
-
- search_options: VectorStoreChunkSearchOptionsParam
- """Search configuration options"""
-
- stream: bool
- """Whether to stream the answer"""
-
- qa_options: QaOptions
- """Question answering configuration options"""
-
-
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
-
-
-class QaOptions(TypedDict, total=False):
- """Question answering configuration options"""
-
- 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
deleted file mode 100644
index 6aec7bbc..00000000
--- a/src/mixedbread/types/vector_store_question_answering_response.py
+++ /dev/null
@@ -1,1018 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import TYPE_CHECKING, Dict, List, Union, Optional
-from typing_extensions import Literal, Annotated, TypeAlias
-
-from pydantic import Field as FieldInfo
-
-from .._utils import PropertyInfo
-from .._models import BaseModel
-
-__all__ = [
- "VectorStoreQuestionAnsweringResponse",
- "Source",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL",
-]
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel):
- """Scored text chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
- """The image input specification."""
-
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
- format: Optional[str] = None
- """The image format/mimetype"""
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel):
- """Scored image chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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"""
-
- image_url: SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL
- """The image input specification."""
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
- """The audio input specification."""
-
- url: str
- """The audio URL. Can be either a URL or a Data URI."""
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel):
- """Scored audio chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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"""
-
- audio_url: SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL
- """The audio input specification."""
-
- sampling_rate: int
- """The sampling rate of the audio."""
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
- """The video input specification."""
-
- url: str
- """The video URL. Can be either a URL or a Data URI."""
-
-
-class SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel):
- """Scored video chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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"""
-
- video_url: SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL
- """The video input specification."""
-
-
-Source: TypeAlias = Annotated[
- Union[
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk,
- SourceMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class VectorStoreQuestionAnsweringResponse(BaseModel):
- """Results from a question answering operation."""
-
- answer: str
- """The answer generated by the LLM"""
-
- sources: Optional[List[Source]] = None
- """Source documents used to generate the answer"""
diff --git a/src/mixedbread/types/vector_store_search_params.py b/src/mixedbread/types/vector_store_search_params.py
deleted file mode 100644
index f5258d95..00000000
--- a/src/mixedbread/types/vector_store_search_params.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union, Iterable, Optional
-from typing_extensions import Required, TypeAlias, TypedDict
-
-from .._types import SequenceNotStr
-from .shared_params.search_filter_condition import SearchFilterCondition
-from .vector_store_chunk_search_options_param import VectorStoreChunkSearchOptionsParam
-
-__all__ = ["VectorStoreSearchParams", "Filters", "FiltersUnionMember2"]
-
-
-class VectorStoreSearchParams(TypedDict, total=False):
- query: Required[str]
- """Search query text"""
-
- vector_store_identifiers: Required[SequenceNotStr[str]]
- """IDs or names of vector stores to search"""
-
- top_k: int
- """Number of results to return"""
-
- filters: Optional[Filters]
- """Optional filter conditions"""
-
- file_ids: Union[Iterable[object], SequenceNotStr[str], None]
- """Optional list of file IDs to filter chunks by (inclusion filter)"""
-
- search_options: VectorStoreChunkSearchOptionsParam
- """Search configuration options"""
-
-
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
-
-from .shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_store_search_response.py b/src/mixedbread/types/vector_store_search_response.py
deleted file mode 100644
index 8e46feb8..00000000
--- a/src/mixedbread/types/vector_store_search_response.py
+++ /dev/null
@@ -1,1016 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import TYPE_CHECKING, Dict, List, Union, Optional
-from typing_extensions import Literal, Annotated, TypeAlias
-
-from pydantic import Field as FieldInfo
-
-from .._utils import PropertyInfo
-from .._models import BaseModel
-
-__all__ = [
- "VectorStoreSearchResponse",
- "Data",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL",
-]
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel):
- """Scored text chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
- """The image input specification."""
-
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
- format: Optional[str] = None
- """The image format/mimetype"""
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel):
- """Scored image chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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"""
-
- image_url: DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL
- """The image input specification."""
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
- """The audio input specification."""
-
- url: str
- """The audio URL. Can be either a URL or a Data URI."""
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel):
- """Scored audio chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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"""
-
- audio_url: DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL
- """The audio input specification."""
-
- sampling_rate: int
- """The sampling rate of the audio."""
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
- """The video input specification."""
-
- url: str
- """The video URL. Can be either a URL or a Data URI."""
-
-
-class DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel):
- """Scored video chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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"""
-
- video_url: DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL
- """The video input specification."""
-
-
-Data: TypeAlias = Annotated[
- Union[
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk,
- DataMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class VectorStoreSearchResponse(BaseModel):
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[Data]
- """The list of scored vector store file chunks"""
diff --git a/src/mixedbread/types/vector_store_update_params.py b/src/mixedbread/types/vector_store_update_params.py
deleted file mode 100644
index 22545d43..00000000
--- a/src/mixedbread/types/vector_store_update_params.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Optional
-from typing_extensions import TypedDict
-
-from .expires_after_param import ExpiresAfterParam
-
-__all__ = ["VectorStoreUpdateParams"]
-
-
-class VectorStoreUpdateParams(TypedDict, total=False):
- name: Optional[str]
- """New name for the store"""
-
- description: Optional[str]
- """New description"""
-
- is_public: Optional[bool]
- """Whether the vector store can be accessed by anyone with valid login credentials"""
-
- expires_after: Optional[ExpiresAfterParam]
- """Represents an expiration policy for a store."""
-
- metadata: object
- """Optional metadata key-value pairs"""
diff --git a/src/mixedbread/types/vector_stores/__init__.py b/src/mixedbread/types/vector_stores/__init__.py
deleted file mode 100644
index dcfaa05b..00000000
--- a/src/mixedbread/types/vector_stores/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from .file_list_params import FileListParams as FileListParams
-from .vector_store_file import VectorStoreFile as VectorStoreFile
-from .file_create_params import FileCreateParams as FileCreateParams
-from .file_list_response import FileListResponse as FileListResponse
-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
diff --git a/src/mixedbread/types/vector_stores/file_create_params.py b/src/mixedbread/types/vector_stores/file_create_params.py
deleted file mode 100644
index c776ea33..00000000
--- a/src/mixedbread/types/vector_stores/file_create_params.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Optional
-from typing_extensions import Literal, Required, TypedDict
-
-__all__ = ["FileCreateParams", "Config", "Experimental"]
-
-
-class FileCreateParams(TypedDict, total=False):
- metadata: object
- """Optional metadata for the file"""
-
- config: Config
- """Configuration for adding the file"""
-
- external_id: Optional[str]
- """External identifier for this file in the store"""
-
- overwrite: bool
- """If true, overwrite an existing file with the same external_id"""
-
- file_id: Required[str]
- """ID of the file to add"""
-
- experimental: Optional[Experimental]
- """Configuration for a file."""
-
-
-class Config(TypedDict, total=False):
- """Configuration for adding the file"""
-
- parsing_strategy: Literal["fast", "high_quality"]
- """Strategy for adding the file, this overrides the store-level default"""
-
-
-class Experimental(TypedDict, total=False):
- """Configuration for a file."""
-
- parsing_strategy: Literal["fast", "high_quality"]
- """Strategy for adding the file, this overrides the store-level default"""
diff --git a/src/mixedbread/types/vector_stores/file_delete_response.py b/src/mixedbread/types/vector_stores/file_delete_response.py
deleted file mode 100644
index 191203c4..00000000
--- a/src/mixedbread/types/vector_stores/file_delete_response.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__ = ["FileDeleteResponse"]
-
-
-class FileDeleteResponse(BaseModel):
- """Response model for file deletion."""
-
- id: str
- """ID of the deleted file"""
-
- deleted: Optional[bool] = None
- """Whether the deletion was successful"""
-
- object: Optional[Literal["vector_store.file"]] = None
- """Type of the deleted object"""
diff --git a/src/mixedbread/types/vector_stores/file_list_params.py b/src/mixedbread/types/vector_stores/file_list_params.py
deleted file mode 100644
index ef2c2848..00000000
--- a/src/mixedbread/types/vector_stores/file_list_params.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import List, Union, Iterable, Optional
-from typing_extensions import TypeAlias, TypedDict
-
-from ..stores.store_file_status import StoreFileStatus
-from ..shared_params.search_filter_condition import SearchFilterCondition
-
-__all__ = ["FileListParams", "MetadataFilter", "MetadataFilterUnionMember2"]
-
-
-class FileListParams(TypedDict, total=False):
- limit: int
- """Maximum number of items to return per page (1-100)"""
-
- after: Optional[str]
- """Cursor for forward pagination - get items after this position.
-
- Use last_cursor from previous response.
- """
-
- before: Optional[str]
- """Cursor for backward pagination - get items before this position.
-
- Use first_cursor from previous response.
- """
-
- include_total: bool
- """Whether to include total count in response (expensive operation)"""
-
- statuses: Optional[List[StoreFileStatus]]
- """Status to filter by"""
-
- metadata_filter: Optional[MetadataFilter]
- """Metadata filter to apply to the query"""
-
-
-MetadataFilterUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-MetadataFilter: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[MetadataFilterUnionMember2]]
-
-from ..shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_list_response.py b/src/mixedbread/types/vector_stores/file_list_response.py
deleted file mode 100644
index 9b20d19f..00000000
--- a/src/mixedbread/types/vector_stores/file_list_response.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .vector_store_file import VectorStoreFile
-
-__all__ = ["FileListResponse", "Pagination"]
-
-
-class Pagination(BaseModel):
- """Response model for cursor-based pagination."""
-
- has_more: bool
- """
- Contextual direction-aware flag: True if more items exist in the requested
- pagination direction. For 'after': more items after this page. For 'before':
- more items before this page.
- """
-
- first_cursor: Optional[str] = None
- """Cursor of the first item in this page.
-
- Use for backward pagination. None if page is empty.
- """
-
- last_cursor: Optional[str] = None
- """Cursor of the last item in this page.
-
- Use for forward pagination. None if page is empty.
- """
-
- total: Optional[int] = None
- """Total number of items available across all pages.
-
- Only included when include_total=true was requested. Expensive operation - use
- sparingly.
- """
-
-
-class FileListResponse(BaseModel):
- """List response wrapper for vector store files."""
-
- pagination: Pagination
- """Response model for cursor-based pagination."""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[VectorStoreFile]
- """The list of vector store files"""
diff --git a/src/mixedbread/types/vector_stores/file_retrieve_params.py b/src/mixedbread/types/vector_stores/file_retrieve_params.py
deleted file mode 100644
index 0bbdedfc..00000000
--- a/src/mixedbread/types/vector_stores/file_retrieve_params.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# 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"""
diff --git a/src/mixedbread/types/vector_stores/file_search_params.py b/src/mixedbread/types/vector_stores/file_search_params.py
deleted file mode 100644
index 617a82f4..00000000
--- a/src/mixedbread/types/vector_stores/file_search_params.py
+++ /dev/null
@@ -1,103 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union, Iterable, Optional
-from typing_extensions import Required, TypeAlias, TypedDict
-
-from ..._types import SequenceNotStr
-from .rerank_config_param import RerankConfigParam
-from ..shared_params.search_filter_condition import SearchFilterCondition
-
-__all__ = [
- "FileSearchParams",
- "Filters",
- "FiltersUnionMember2",
- "SearchOptions",
- "SearchOptionsRerank",
- "SearchOptionsAgentic",
- "SearchOptionsAgenticAgenticSearchConfig",
-]
-
-
-class FileSearchParams(TypedDict, total=False):
- query: Required[str]
- """Search query text"""
-
- vector_store_identifiers: Required[SequenceNotStr[str]]
- """IDs or names of vector stores to search"""
-
- top_k: int
- """Number of results to return"""
-
- filters: Optional[Filters]
- """Optional filter conditions"""
-
- file_ids: Union[Iterable[object], SequenceNotStr[str], None]
- """Optional list of file IDs to filter chunks by (inclusion filter)"""
-
- search_options: SearchOptions
- """Search configuration options"""
-
-
-FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
-
-Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
-
-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"""
-
- score_threshold: float
- """Minimum similarity score threshold"""
-
- rewrite_query: bool
- """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.
-
- 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"""
-
- return_chunks: bool
- """Whether to return matching text chunks"""
-
- chunks_per_file: int
- """Number of chunks to return for each file"""
-
- apply_search_rules: bool
- """Whether to apply search rules"""
-
-
-from ..shared_params.search_filter import SearchFilter
diff --git a/src/mixedbread/types/vector_stores/file_search_response.py b/src/mixedbread/types/vector_stores/file_search_response.py
deleted file mode 100644
index 04e14d9b..00000000
--- a/src/mixedbread/types/vector_stores/file_search_response.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import List, Optional
-from typing_extensions import Literal
-
-from ..._models import BaseModel
-from .scored_vector_store_file import ScoredVectorStoreFile
-
-__all__ = ["FileSearchResponse"]
-
-
-class FileSearchResponse(BaseModel):
- """Search response wrapper for vector store files."""
-
- object: Optional[Literal["list"]] = None
- """The object type of the response"""
-
- data: List[ScoredVectorStoreFile]
- """The list of scored vector store files"""
diff --git a/src/mixedbread/types/vector_stores/rerank_config_param.py b/src/mixedbread/types/vector_stores/rerank_config_param.py
deleted file mode 100644
index 392bc60a..00000000
--- a/src/mixedbread/types/vector_stores/rerank_config_param.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-from typing import Union, Optional
-from typing_extensions import TypedDict
-
-from ..._types import SequenceNotStr
-
-__all__ = ["RerankConfigParam"]
-
-
-class RerankConfigParam(TypedDict, total=False):
- """Represents a reranking configuration."""
-
- model: str
- """The name of the reranking model"""
-
- with_metadata: Union[bool, SequenceNotStr[str]]
- """Whether to include metadata in the reranked results"""
-
- top_k: Optional[int]
- """Maximum number of results to return after reranking.
-
- If None, returns all reranked results.
- """
diff --git a/src/mixedbread/types/vector_stores/scored_vector_store_file.py b/src/mixedbread/types/vector_stores/scored_vector_store_file.py
deleted file mode 100644
index bc42fc2c..00000000
--- a/src/mixedbread/types/vector_stores/scored_vector_store_file.py
+++ /dev/null
@@ -1,1050 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import TYPE_CHECKING, Dict, List, Union, Optional
-from datetime import datetime
-from typing_extensions import Literal, Annotated, TypeAlias
-
-from pydantic import Field as FieldInfo
-
-from ..._utils import PropertyInfo
-from ..._models import BaseModel
-from ..stores.store_file_status import StoreFileStatus
-
-__all__ = [
- "ScoredVectorStoreFile",
- "Chunk",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL",
-]
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk(BaseModel):
- """Scored text chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL(BaseModel):
- """The image input specification."""
-
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
- format: Optional[str] = None
- """The image format/mimetype"""
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk(BaseModel):
- """Scored image chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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"""
-
- image_url: ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunkImageURL
- """The image input specification."""
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL(BaseModel):
- """The audio input specification."""
-
- url: str
- """The audio URL. Can be either a URL or a Data URI."""
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk(BaseModel):
- """Scored audio chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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"""
-
- audio_url: ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunkAudioURL
- """The audio input specification."""
-
- sampling_rate: int
- """The sampling rate of the audio."""
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(
- BaseModel
-):
- level: int
-
- text: str
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading
- ]
- ] = None
-
- heading_context: Optional[
- List[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext
- ]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(
- BaseModel
-):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL(BaseModel):
- """The video input specification."""
-
- url: str
- """The video URL. Can be either a URL or a Data URI."""
-
-
-class ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk(BaseModel):
- """Scored video chunk for deprecated API."""
-
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkGeneratedMetadata
- ] = None
- """metadata 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
- """store id"""
-
- metadata: Optional[object] = None
- """file metadata"""
-
- 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"""
-
- video_url: ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunkVideoURL
- """The video input specification."""
-
-
-Chunk: TypeAlias = Annotated[
- Union[
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredTextInputChunk,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredImageURLInputChunk,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredAudioURLInputChunk,
- ChunkMxbaiOmniAPIRoutesV1DeprecatedVectorStoresModelsScoredVideoURLInputChunk,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class ScoredVectorStoreFile(BaseModel):
- """Represents a scored store file."""
-
- id: str
- """Unique identifier for the file"""
-
- filename: Optional[str] = None
- """Name of the file"""
-
- metadata: Optional[object] = None
- """Optional file metadata"""
-
- status: Optional[StoreFileStatus] = None
- """Processing status of the file"""
-
- last_error: Optional[object] = None
- """Last error message if processing failed"""
-
- vector_store_id: str
- """ID of the containing store"""
-
- created_at: datetime
- """Timestamp of store file creation"""
-
- version: Optional[int] = None
- """Version number of the file"""
-
- usage_bytes: Optional[int] = None
- """Storage usage in bytes"""
-
- object: Optional[Literal["vector_store.file"]] = None
- """Type of the object"""
-
- chunks: Optional[List[Chunk]] = None
- """Array of scored file chunks"""
-
- score: float
- """score of the file"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file.py b/src/mixedbread/types/vector_stores/vector_store_file.py
deleted file mode 100644
index 51bb8fa3..00000000
--- a/src/mixedbread/types/vector_stores/vector_store_file.py
+++ /dev/null
@@ -1,894 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing import TYPE_CHECKING, Dict, List, Union, Optional
-from datetime import datetime
-from typing_extensions import Literal, Annotated, TypeAlias
-
-from pydantic import Field as FieldInfo
-
-from ..._utils import PropertyInfo
-from ..._models import BaseModel
-from ..stores.store_file_status import StoreFileStatus
-
-__all__ = [
- "VectorStoreFile",
- "Chunk",
- "ChunkTextInputChunk",
- "ChunkTextInputChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "ChunkImageURLInputChunk",
- "ChunkImageURLInputChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "ChunkImageURLInputChunkImageURL",
- "ChunkAudioURLInputChunk",
- "ChunkAudioURLInputChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "ChunkAudioURLInputChunkAudioURL",
- "ChunkVideoURLInputChunk",
- "ChunkVideoURLInputChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading",
- "ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext",
- "ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
- "ChunkVideoURLInputChunkVideoURL",
-]
-
-
-class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]] = (
- None
- )
-
- heading_context: Optional[
- List[ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkTextInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-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[ChunkTextInputChunkGeneratedMetadata] = 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 ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
- ] = None
-
- heading_context: Optional[
- List[ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkImageURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class ChunkImageURLInputChunkImageURL(BaseModel):
- """The image input specification."""
-
- url: str
- """The image URL. Can be either a URL or a Data URI."""
-
- format: Optional[str] = None
- """The image format/mimetype"""
-
-
-class ChunkImageURLInputChunk(BaseModel):
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[ChunkImageURLInputChunkGeneratedMetadata] = 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"""
-
- image_url: ChunkImageURLInputChunkImageURL
- """The image input specification."""
-
-
-class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
- ] = None
-
- heading_context: Optional[
- List[ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkAudioURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class ChunkAudioURLInputChunkAudioURL(BaseModel):
- """The audio input specification."""
-
- url: str
- """The audio URL. Can be either a URL or a Data URI."""
-
-
-class ChunkAudioURLInputChunk(BaseModel):
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[ChunkAudioURLInputChunkGeneratedMetadata] = 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"""
-
- audio_url: ChunkAudioURLInputChunkAudioURL
- """The audio input specification."""
-
- sampling_rate: int
- """The sampling rate of the audio."""
-
-
-class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext(BaseModel):
- level: int
-
- text: str
-
-
-class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["markdown"]] = None
-
- file_type: Optional[Literal["text/markdown"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- chunk_headings: Optional[
- List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading]
- ] = None
-
- heading_context: Optional[
- List[ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataHeadingContext]
- ] = None
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["text"]] = None
-
- file_type: Optional[Literal["text/plain"]] = None
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["pdf"]] = None
-
- file_type: Optional[Literal["application/pdf"]] = None
-
- total_pages: int
-
- total_size: int
-
- 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 ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["code"]] = None
-
- file_type: str
-
- language: str
-
- word_count: int
-
- file_size: int
-
- start_line: Optional[int] = None
-
- num_lines: Optional[int] = 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 ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata(BaseModel):
- type: Optional[Literal["audio"]] = None
-
- file_type: str
-
- file_size: int
-
- total_duration_seconds: float
-
- sample_rate: int
-
- channels: int
-
- audio_format: int
-
- 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]
-
-
-ChunkVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
- Union[
- ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
- ChunkVideoURLInputChunkGeneratedMetadataTextChunkGeneratedMetadata,
- ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
- ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
- ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
- None,
- ],
- PropertyInfo(discriminator="type"),
-]
-
-
-class ChunkVideoURLInputChunkVideoURL(BaseModel):
- """The video input specification."""
-
- url: str
- """The video URL. Can be either a URL or a Data URI."""
-
-
-class ChunkVideoURLInputChunk(BaseModel):
- chunk_index: int
- """position of the chunk in a file"""
-
- mime_type: Optional[str] = None
- """mime type of the chunk"""
-
- generated_metadata: Optional[ChunkVideoURLInputChunkGeneratedMetadata] = 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"""
-
- video_url: ChunkVideoURLInputChunkVideoURL
- """The video input specification."""
-
-
-Chunk: TypeAlias = Annotated[
- Union[ChunkTextInputChunk, ChunkImageURLInputChunk, ChunkAudioURLInputChunk, ChunkVideoURLInputChunk],
- PropertyInfo(discriminator="type"),
-]
-
-
-class VectorStoreFile(BaseModel):
- """Represents a file stored in a store."""
-
- id: str
- """Unique identifier for the file"""
-
- filename: Optional[str] = None
- """Name of the file"""
-
- metadata: Optional[object] = None
- """Optional file metadata"""
-
- status: Optional[StoreFileStatus] = None
- """Processing status of the file"""
-
- last_error: Optional[object] = None
- """Last error message if processing failed"""
-
- vector_store_id: str
- """ID of the containing store"""
-
- created_at: datetime
- """Timestamp of store file creation"""
-
- version: Optional[int] = None
- """Version number of the file"""
-
- usage_bytes: Optional[int] = None
- """Storage usage in bytes"""
-
- object: Optional[Literal["vector_store.file"]] = None
- """Type of the object"""
-
- chunks: Optional[List[Chunk]] = None
- """chunks"""
diff --git a/src/mixedbread/types/vector_stores/vector_store_file_status.py b/src/mixedbread/types/vector_stores/vector_store_file_status.py
deleted file mode 100644
index 12e80abd..00000000
--- a/src/mixedbread/types/vector_stores/vector_store_file_status.py
+++ /dev/null
@@ -1,7 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from typing_extensions import Literal, TypeAlias
-
-__all__ = ["VectorStoreFileStatus"]
-
-VectorStoreFileStatus: TypeAlias = Literal["pending", "in_progress", "cancelled", "completed", "failed"]
diff --git a/tests/api_resources/test_vector_stores.py b/tests/api_resources/test_vector_stores.py
deleted file mode 100644
index 5bd08b5a..00000000
--- a/tests/api_resources/test_vector_stores.py
+++ /dev/null
@@ -1,768 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types import (
- VectorStore,
- VectorStoreDeleteResponse,
- VectorStoreSearchResponse,
- VectorStoreQuestionAnsweringResponse,
-)
-from mixedbread.pagination import SyncCursor, AsyncCursor
-
-# pyright: reportDeprecated=false
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestVectorStores:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.create()
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_method_create_with_all_params(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.create(
- name="Technical Documentation",
- description="Contains technical specifications and guides",
- is_public=False,
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.with_raw_response.create()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.with_streaming_response.create() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_method_retrieve(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.retrieve(
- "vector_store_identifier",
- )
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_retrieve(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.with_raw_response.retrieve(
- "vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.with_streaming_response.retrieve(
- "vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.with_raw_response.retrieve(
- "",
- )
-
- @parametrize
- def test_method_update(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.update(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_method_update_with_all_params(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.update(
- vector_store_identifier="vector_store_identifier",
- name="x",
- description="description",
- is_public=True,
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- )
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_update(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.with_raw_response.update(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_update(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.with_streaming_response.update(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_update(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.with_raw_response.update(
- vector_store_identifier="",
- )
-
- @parametrize
- def test_method_list(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.list()
-
- assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
-
- @parametrize
- def test_method_list_with_all_params(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- q="x",
- )
-
- assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_list(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.with_raw_response.list()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_list(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.with_streaming_response.list() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(SyncCursor[VectorStore], vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_method_delete(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.delete(
- "vector_store_identifier",
- )
-
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_delete(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.with_raw_response.delete(
- "vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_delete(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.with_streaming_response.delete(
- "vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_delete(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.with_raw_response.delete(
- "",
- )
-
- @parametrize
- def test_method_question_answering(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.question_answering(
- vector_store_identifiers=["string"],
- )
-
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
-
- @parametrize
- def test_method_question_answering_with_all_params(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.question_answering(
- query="x",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [{}, {}],
- "any": [{}, {}],
- "none": [{}, {}],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "agentic": True,
- "return_metadata": True,
- "apply_search_rules": True,
- },
- stream=True,
- qa_options={
- "cite": True,
- "multimodal": True,
- },
- )
-
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_question_answering(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.with_raw_response.question_answering(
- vector_store_identifiers=["string"],
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_question_answering(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.with_streaming_response.question_answering(
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_method_search(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
-
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
-
- @parametrize
- def test_method_search_with_all_params(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = client.vector_stores.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [{}, {}],
- "any": [{}, {}],
- "none": [{}, {}],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "agentic": True,
- "return_metadata": True,
- "apply_search_rules": True,
- },
- )
-
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
-
- @parametrize
- def test_raw_response_search(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.with_raw_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = response.parse()
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
-
- @parametrize
- def test_streaming_response_search(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.with_streaming_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = response.parse()
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncVectorStores:
- parametrize = pytest.mark.parametrize(
- "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
- )
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.create()
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.create(
- name="Technical Documentation",
- description="Contains technical specifications and guides",
- is_public=False,
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
- )
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.with_raw_response.create()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.with_streaming_response.create() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.retrieve(
- "vector_store_identifier",
- )
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.with_raw_response.retrieve(
- "vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.with_streaming_response.retrieve(
- "vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.with_raw_response.retrieve(
- "",
- )
-
- @parametrize
- async def test_method_update(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.update(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_method_update_with_all_params(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.update(
- vector_store_identifier="vector_store_identifier",
- name="x",
- description="description",
- is_public=True,
- expires_after={
- "anchor": "last_active_at",
- "days": 0,
- },
- metadata={},
- )
-
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_update(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.with_raw_response.update(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_update(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.with_streaming_response.update(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStore, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_update(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.with_raw_response.update(
- vector_store_identifier="",
- )
-
- @parametrize
- async def test_method_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.list()
-
- assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
-
- @parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.list(
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- q="x",
- )
-
- assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.with_raw_response.list()
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.with_streaming_response.list() as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(AsyncCursor[VectorStore], vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.delete(
- "vector_store_identifier",
- )
-
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.with_raw_response.delete(
- "vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.with_streaming_response.delete(
- "vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStoreDeleteResponse, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.with_raw_response.delete(
- "",
- )
-
- @parametrize
- async def test_method_question_answering(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.question_answering(
- vector_store_identifiers=["string"],
- )
-
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_method_question_answering_with_all_params(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.question_answering(
- query="x",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [{}, {}],
- "any": [{}, {}],
- "none": [{}, {}],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "agentic": True,
- "return_metadata": True,
- "apply_search_rules": True,
- },
- stream=True,
- qa_options={
- "cite": True,
- "multimodal": True,
- },
- )
-
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.with_raw_response.question_answering(
- vector_store_identifiers=["string"],
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_question_answering(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.with_streaming_response.question_answering(
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStoreQuestionAnsweringResponse, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_method_search(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
-
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- vector_store = await async_client.vector_stores.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [{}, {}],
- "any": [{}, {}],
- "none": [{}, {}],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "agentic": True,
- "return_metadata": True,
- "apply_search_rules": True,
- },
- )
-
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.with_raw_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- vector_store = await response.parse()
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
-
- @parametrize
- async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.with_streaming_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- vector_store = await response.parse()
- assert_matches_type(VectorStoreSearchResponse, vector_store, path=["response"])
-
- assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/vector_stores/__init__.py b/tests/api_resources/vector_stores/__init__.py
deleted file mode 100644
index fd8019a9..00000000
--- a/tests/api_resources/vector_stores/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
diff --git a/tests/api_resources/vector_stores/test_files.py b/tests/api_resources/vector_stores/test_files.py
deleted file mode 100644
index d893b615..00000000
--- a/tests/api_resources/vector_stores/test_files.py
+++ /dev/null
@@ -1,659 +0,0 @@
-# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-
-from __future__ import annotations
-
-import os
-from typing import Any, cast
-
-import pytest
-
-from mixedbread import Mixedbread, AsyncMixedbread
-from tests.utils import assert_matches_type
-from mixedbread.types.vector_stores import (
- VectorStoreFile,
- FileListResponse,
- FileDeleteResponse,
- FileSearchResponse,
-)
-
-# pyright: reportDeprecated=false
-
-base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
-
-
-class TestFiles:
- parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
-
- @parametrize
- def test_method_create(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = client.vector_stores.files.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- def test_method_create_with_all_params(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = client.vector_stores.files.create(
- vector_store_identifier="vector_store_identifier",
- metadata={},
- config={"parsing_strategy": "fast"},
- external_id="external_id",
- overwrite=False,
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={"parsing_strategy": "fast"},
- )
-
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- def test_raw_response_create(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.files.with_raw_response.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- def test_streaming_response_create(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.files.with_streaming_response.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_create(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.create(
- vector_store_identifier="",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- @parametrize
- def test_method_retrieve(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = client.vector_stores.files.retrieve(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- )
-
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- def test_method_retrieve_with_all_params(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = client.vector_stores.files.retrieve(
- file_id="file_id",
- 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:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.files.with_raw_response.retrieve(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- def test_streaming_response_retrieve(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.files.with_streaming_response.retrieve(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_retrieve(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.retrieve(
- file_id="file_id",
- vector_store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- client.vector_stores.files.with_raw_response.retrieve(
- file_id="",
- vector_store_identifier="vector_store_identifier",
- )
-
- @parametrize
- def test_method_list(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- def test_method_list_with_all_params(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending"],
- metadata_filter={
- "all": [{}, {}],
- "any": [{}, {}],
- "none": [{}, {}],
- },
- )
-
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- def test_raw_response_list(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- def test_streaming_response_list(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.files.with_streaming_response.list(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_list(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="",
- )
-
- @parametrize
- def test_method_delete(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = client.vector_stores.files.delete(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- )
-
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- def test_raw_response_delete(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.files.with_raw_response.delete(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- def test_streaming_response_delete(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.files.with_streaming_response.delete(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- def test_path_params_delete(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- client.vector_stores.files.with_raw_response.delete(
- file_id="file_id",
- vector_store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- client.vector_stores.files.with_raw_response.delete(
- file_id="",
- vector_store_identifier="vector_store_identifier",
- )
-
- @parametrize
- def test_method_search(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = client.vector_stores.files.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
-
- assert_matches_type(FileSearchResponse, file, path=["response"])
-
- @parametrize
- def test_method_search_with_all_params(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = client.vector_stores.files.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [{}, {}],
- "any": [{}, {}],
- "none": [{}, {}],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "agentic": True,
- "return_metadata": True,
- "return_chunks": True,
- "chunks_per_file": 0,
- "apply_search_rules": True,
- },
- )
-
- assert_matches_type(FileSearchResponse, file, path=["response"])
-
- @parametrize
- def test_raw_response_search(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = client.vector_stores.files.with_raw_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = response.parse()
- assert_matches_type(FileSearchResponse, file, path=["response"])
-
- @parametrize
- def test_streaming_response_search(self, client: Mixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with client.vector_stores.files.with_streaming_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = response.parse()
- assert_matches_type(FileSearchResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
-
-class TestAsyncFiles:
- parametrize = pytest.mark.parametrize(
- "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
- )
-
- @parametrize
- async def test_method_create(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = await async_client.vector_stores.files.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- async def test_method_create_with_all_params(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = await async_client.vector_stores.files.create(
- vector_store_identifier="vector_store_identifier",
- metadata={},
- config={"parsing_strategy": "fast"},
- external_id="external_id",
- overwrite=False,
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- experimental={"parsing_strategy": "fast"},
- )
-
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- async def test_raw_response_create(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.files.with_raw_response.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_create(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.files.with_streaming_response.create(
- vector_store_identifier="vector_store_identifier",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_create(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.create(
- vector_store_identifier="",
- file_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
- )
-
- @parametrize
- async def test_method_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = await async_client.vector_stores.files.retrieve(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- )
-
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- async def test_method_retrieve_with_all_params(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = await async_client.vector_stores.files.retrieve(
- file_id="file_id",
- 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:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.files.with_raw_response.retrieve(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.files.with_streaming_response.retrieve(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(VectorStoreFile, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_retrieve(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.retrieve(
- file_id="file_id",
- vector_store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.retrieve(
- file_id="",
- vector_store_identifier="vector_store_identifier",
- )
-
- @parametrize
- async def test_method_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = await async_client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- async def test_method_list_with_all_params(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = await async_client.vector_stores.files.list(
- vector_store_identifier="vector_store_identifier",
- limit=10,
- after="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- before="eyJjcmVhdGVkX2F0IjoiMjAyNC0xMi0zMVQyMzo1OTo1OS4wMDBaIiwiaWQiOiJhYmMxMjMifQ==",
- include_total=False,
- statuses=["pending"],
- metadata_filter={
- "all": [{}, {}],
- "any": [{}, {}],
- "none": [{}, {}],
- },
- )
-
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- async def test_raw_response_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.files.with_streaming_response.list(
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(FileListResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_list(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.list(
- vector_store_identifier="",
- )
-
- @parametrize
- async def test_method_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = await async_client.vector_stores.files.delete(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- )
-
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- async def test_raw_response_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.files.with_raw_response.delete(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.files.with_streaming_response.delete(
- file_id="file_id",
- vector_store_identifier="vector_store_identifier",
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(FileDeleteResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
-
- @parametrize
- async def test_path_params_delete(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- with pytest.raises(
- ValueError, match=r"Expected a non-empty value for `vector_store_identifier` but received ''"
- ):
- await async_client.vector_stores.files.with_raw_response.delete(
- file_id="file_id",
- vector_store_identifier="",
- )
-
- with pytest.raises(ValueError, match=r"Expected a non-empty value for `file_id` but received ''"):
- await async_client.vector_stores.files.with_raw_response.delete(
- file_id="",
- vector_store_identifier="vector_store_identifier",
- )
-
- @parametrize
- async def test_method_search(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = await async_client.vector_stores.files.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
-
- assert_matches_type(FileSearchResponse, file, path=["response"])
-
- @parametrize
- async def test_method_search_with_all_params(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- file = await async_client.vector_stores.files.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- top_k=1,
- filters={
- "all": [{}, {}],
- "any": [{}, {}],
- "none": [{}, {}],
- },
- file_ids=["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001"],
- search_options={
- "score_threshold": 0,
- "rewrite_query": True,
- "rerank": True,
- "agentic": True,
- "return_metadata": True,
- "return_chunks": True,
- "chunks_per_file": 0,
- "apply_search_rules": True,
- },
- )
-
- assert_matches_type(FileSearchResponse, file, path=["response"])
-
- @parametrize
- async def test_raw_response_search(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- response = await async_client.vector_stores.files.with_raw_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- )
-
- assert response.is_closed is True
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
- file = await response.parse()
- assert_matches_type(FileSearchResponse, file, path=["response"])
-
- @parametrize
- async def test_streaming_response_search(self, async_client: AsyncMixedbread) -> None:
- with pytest.warns(DeprecationWarning):
- async with async_client.vector_stores.files.with_streaming_response.search(
- query="how to configure SSL",
- vector_store_identifiers=["string"],
- ) as response:
- assert not response.is_closed
- assert response.http_request.headers.get("X-Stainless-Lang") == "python"
-
- file = await response.parse()
- assert_matches_type(FileSearchResponse, file, path=["response"])
-
- assert cast(Any, response.is_closed) is True
From b4b8ee5d5cb9140621d34dc2926595be4b214676 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 20 Jan 2026 16:27:18 +0000
Subject: [PATCH 352/375] feat(api): api update
---
.stats.yml | 4 ++--
.../types/scored_audio_url_input_chunk.py | 6 ++---
.../types/scored_image_url_input_chunk.py | 6 ++---
.../types/scored_text_input_chunk.py | 4 ++--
.../types/scored_video_url_input_chunk.py | 6 ++---
src/mixedbread/types/store.py | 8 +++++++
src/mixedbread/types/store_create_params.py | 8 +++++++
src/mixedbread/types/stores/store_file.py | 22 +++++++++----------
tests/api_resources/test_stores.py | 10 +++++++--
9 files changed, 48 insertions(+), 26 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 80b8735a..fb87ba0d 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-5ad16eef3948ad48d494f6c0bf0b7da1063e177df5b8deaeedb53502101026d7.yml
-openapi_spec_hash: 631634e0b03b231050e790e28377e51f
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-1ca6a76a119213a04eb2ad5df39b49ca21d3fd46f826b140f313116e8140d7f1.yml
+openapi_spec_hash: c90e39ae364dd4075c49a7675ab8a389
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 68a8d369..80c55a37 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -186,7 +186,7 @@ def __getattr__(self, attr: str) -> object: ...
class AudioURL(BaseModel):
- """The audio input specification."""
+ """Model for audio URL validation."""
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -229,8 +229,8 @@ class ScoredAudioURLInputChunk(BaseModel):
summary: Optional[str] = None
"""summary of the audio"""
- audio_url: AudioURL
- """The audio input specification."""
+ audio_url: Optional[AudioURL] = None
+ """Model for audio URL validation."""
sampling_rate: int
"""The sampling rate 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
index c142e5c4..c908e513 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -186,7 +186,7 @@ def __getattr__(self, attr: str) -> object: ...
class ImageURL(BaseModel):
- """The image input specification."""
+ """Model for image URL validation."""
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -232,5 +232,5 @@ class ScoredImageURLInputChunk(BaseModel):
summary: Optional[str] = None
"""summary of the image"""
- image_url: ImageURL
- """The image input specification."""
+ image_url: Optional[ImageURL] = None
+ """Model for image URL validation."""
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index 2eeddb07..4a937cf1 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -218,5 +218,5 @@ class ScoredTextInputChunk(BaseModel):
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"""
+ text: Optional[str] = None
+ """Text content"""
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index 388c87ce..b1840830 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -186,7 +186,7 @@ def __getattr__(self, attr: str) -> object: ...
class VideoURL(BaseModel):
- """The video input specification."""
+ """Model for video URL validation."""
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -229,5 +229,5 @@ class ScoredVideoURLInputChunk(BaseModel):
summary: Optional[str] = None
"""summary of the video"""
- video_url: VideoURL
- """The video input specification."""
+ video_url: Optional[VideoURL] = None
+ """Model for video URL validation."""
diff --git a/src/mixedbread/types/store.py b/src/mixedbread/types/store.py
index 03c809d4..83de8954 100644
--- a/src/mixedbread/types/store.py
+++ b/src/mixedbread/types/store.py
@@ -29,6 +29,14 @@ class Config(BaseModel):
contextualization: Optional[ConfigContextualization] = None
"""Contextualize files with metadata"""
+ save_content: Optional[bool] = None
+ """Whether to save original content in the store.
+
+ When False, only vectors are indexed without the original content (index-only
+ mode). This is useful for data privacy. Note: Reranking is not supported when
+ content is not saved.
+ """
+
class FileCounts(BaseModel):
"""Counts of files in different states"""
diff --git a/src/mixedbread/types/store_create_params.py b/src/mixedbread/types/store_create_params.py
index 0edfa42b..b7814cdd 100644
--- a/src/mixedbread/types/store_create_params.py
+++ b/src/mixedbread/types/store_create_params.py
@@ -55,3 +55,11 @@ class Config(TypedDict, total=False):
contextualization: ConfigContextualization
"""Contextualize files with metadata"""
+
+ save_content: bool
+ """Whether to save original content in the store.
+
+ When False, only vectors are indexed without the original content (index-only
+ mode). This is useful for data privacy. Note: Reranking is not supported when
+ content is not saved.
+ """
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index 133f054e..119a739c 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -249,8 +249,8 @@ class ChunkTextInputChunk(BaseModel):
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"""
+ text: Optional[str] = None
+ """Text content"""
class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
@@ -421,7 +421,7 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkImageURLInputChunkImageURL(BaseModel):
- """The image input specification."""
+ """Model for image URL validation."""
url: str
"""The image URL. Can be either a URL or a Data URI."""
@@ -452,8 +452,8 @@ class ChunkImageURLInputChunk(BaseModel):
summary: Optional[str] = None
"""summary of the image"""
- image_url: ChunkImageURLInputChunkImageURL
- """The image input specification."""
+ image_url: Optional[ChunkImageURLInputChunkImageURL] = None
+ """Model for image URL validation."""
class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadataChunkHeading(BaseModel):
@@ -624,7 +624,7 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkAudioURLInputChunkAudioURL(BaseModel):
- """The audio input specification."""
+ """Model for audio URL validation."""
url: str
"""The audio URL. Can be either a URL or a Data URI."""
@@ -652,8 +652,8 @@ class ChunkAudioURLInputChunk(BaseModel):
summary: Optional[str] = None
"""summary of the audio"""
- audio_url: ChunkAudioURLInputChunkAudioURL
- """The audio input specification."""
+ audio_url: Optional[ChunkAudioURLInputChunkAudioURL] = None
+ """Model for audio URL validation."""
sampling_rate: int
"""The sampling rate of the audio."""
@@ -827,7 +827,7 @@ def __getattr__(self, attr: str) -> object: ...
class ChunkVideoURLInputChunkVideoURL(BaseModel):
- """The video input specification."""
+ """Model for video URL validation."""
url: str
"""The video URL. Can be either a URL or a Data URI."""
@@ -855,8 +855,8 @@ class ChunkVideoURLInputChunk(BaseModel):
summary: Optional[str] = None
"""summary of the video"""
- video_url: ChunkVideoURLInputChunkVideoURL
- """The video input specification."""
+ video_url: Optional[ChunkVideoURLInputChunkVideoURL] = None
+ """Model for video URL validation."""
Chunk: TypeAlias = Annotated[
diff --git a/tests/api_resources/test_stores.py b/tests/api_resources/test_stores.py
index cc59bc9f..0a076705 100644
--- a/tests/api_resources/test_stores.py
+++ b/tests/api_resources/test_stores.py
@@ -40,7 +40,10 @@ def test_method_create_with_all_params(self, client: Mixedbread) -> None:
"days": 0,
},
metadata={},
- config={"contextualization": True},
+ config={
+ "contextualization": True,
+ "save_content": True,
+ },
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(Store, store, path=["response"])
@@ -423,7 +426,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncMixedbread
"days": 0,
},
metadata={},
- config={"contextualization": True},
+ config={
+ "contextualization": True,
+ "save_content": True,
+ },
file_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"],
)
assert_matches_type(Store, store, path=["response"])
From ddfbda2c95797a13e641fa40b8d4a8fb34304d00 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 24 Jan 2026 06:26:50 +0000
Subject: [PATCH 353/375] chore(ci): upgrade `actions/github-script`
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 663f950e..fefaf86b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -63,7 +63,7 @@ jobs:
- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/mixedbread-python'
id: github-oidc
- uses: actions/github-script@v6
+ uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());
From c23c27af21138bd6e2e2478781bf20b896501661 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 24 Jan 2026 09:27:18 +0000
Subject: [PATCH 354/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/scored_audio_url_input_chunk.py | 2 ++
src/mixedbread/types/scored_image_url_input_chunk.py | 2 ++
src/mixedbread/types/scored_text_input_chunk.py | 2 ++
src/mixedbread/types/scored_video_url_input_chunk.py | 2 ++
src/mixedbread/types/stores/store_file.py | 8 ++++++++
6 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index fb87ba0d..34577fa8 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-1ca6a76a119213a04eb2ad5df39b49ca21d3fd46f826b140f313116e8140d7f1.yml
-openapi_spec_hash: c90e39ae364dd4075c49a7675ab8a389
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-61e81c8b5d4b1a203a465cc2a2bbc96edf9ef50c627deb1292dfbec20f217d0b.yml
+openapi_spec_hash: 4eee15ba8261d3c799b901c643f1034f
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 80c55a37..7f1ce86a 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -53,6 +53,8 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
num_lines: Optional[int] = None
+ frontmatter: Optional[Dict[str, object]] = 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.
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index c908e513..b8a90be5 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -53,6 +53,8 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
num_lines: Optional[int] = None
+ frontmatter: Optional[Dict[str, object]] = 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.
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index 4a937cf1..f9985071 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -52,6 +52,8 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
num_lines: Optional[int] = None
+ frontmatter: Optional[Dict[str, object]] = 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.
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index b1840830..594cde79 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -53,6 +53,8 @@ class GeneratedMetadataMarkdownChunkGeneratedMetadata(BaseModel):
num_lines: Optional[int] = None
+ frontmatter: Optional[Dict[str, object]] = 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.
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index 119a739c..d15fe43c 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -98,6 +98,8 @@ class ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(BaseMod
num_lines: Optional[int] = None
+ frontmatter: Optional[Dict[str, object]] = 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.
@@ -288,6 +290,8 @@ class ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas
num_lines: Optional[int] = None
+ frontmatter: Optional[Dict[str, object]] = 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.
@@ -491,6 +495,8 @@ class ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas
num_lines: Optional[int] = None
+ frontmatter: Optional[Dict[str, object]] = 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.
@@ -694,6 +700,8 @@ class ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata(Bas
num_lines: Optional[int] = None
+ frontmatter: Optional[Dict[str, object]] = 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.
From 990a5d5bb93ad658635b8db10da2f003bf698c59 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 30 Jan 2026 06:06:54 +0000
Subject: [PATCH 355/375] feat(client): add custom JSON encoder for extended
type support
---
src/mixedbread/_base_client.py | 7 +-
src/mixedbread/_compat.py | 6 +-
src/mixedbread/_utils/_json.py | 35 +++++++++
tests/test_utils/test_json.py | 126 +++++++++++++++++++++++++++++++++
4 files changed, 169 insertions(+), 5 deletions(-)
create mode 100644 src/mixedbread/_utils/_json.py
create mode 100644 tests/test_utils/test_json.py
diff --git a/src/mixedbread/_base_client.py b/src/mixedbread/_base_client.py
index 8da2f693..dded30e9 100644
--- a/src/mixedbread/_base_client.py
+++ b/src/mixedbread/_base_client.py
@@ -86,6 +86,7 @@
APIConnectionError,
APIResponseValidationError,
)
+from ._utils._json import openapi_dumps
log: logging.Logger = logging.getLogger(__name__)
@@ -554,8 +555,10 @@ def _build_request(
kwargs["content"] = options.content
elif isinstance(json_data, bytes):
kwargs["content"] = json_data
- else:
- kwargs["json"] = json_data if is_given(json_data) else None
+ elif not files:
+ # Don't set content when JSON is sent as multipart/form-data,
+ # since httpx's content param overrides other body arguments
+ kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
kwargs["files"] = files
else:
headers.pop("Content-Type", None)
diff --git a/src/mixedbread/_compat.py b/src/mixedbread/_compat.py
index bdef67f0..786ff42a 100644
--- a/src/mixedbread/_compat.py
+++ b/src/mixedbread/_compat.py
@@ -139,6 +139,7 @@ def model_dump(
exclude_defaults: bool = False,
warnings: bool = True,
mode: Literal["json", "python"] = "python",
+ by_alias: bool | None = None,
) -> dict[str, Any]:
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
return model.model_dump(
@@ -148,13 +149,12 @@ def model_dump(
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
warnings=True if PYDANTIC_V1 else warnings,
+ by_alias=by_alias,
)
return cast(
"dict[str, Any]",
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
- exclude=exclude,
- exclude_unset=exclude_unset,
- exclude_defaults=exclude_defaults,
+ exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
),
)
diff --git a/src/mixedbread/_utils/_json.py b/src/mixedbread/_utils/_json.py
new file mode 100644
index 00000000..60584214
--- /dev/null
+++ b/src/mixedbread/_utils/_json.py
@@ -0,0 +1,35 @@
+import json
+from typing import Any
+from datetime import datetime
+from typing_extensions import override
+
+import pydantic
+
+from .._compat import model_dump
+
+
+def openapi_dumps(obj: Any) -> bytes:
+ """
+ Serialize an object to UTF-8 encoded JSON bytes.
+
+ Extends the standard json.dumps with support for additional types
+ commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
+ """
+ return json.dumps(
+ obj,
+ cls=_CustomEncoder,
+ # Uses the same defaults as httpx's JSON serialization
+ ensure_ascii=False,
+ separators=(",", ":"),
+ allow_nan=False,
+ ).encode()
+
+
+class _CustomEncoder(json.JSONEncoder):
+ @override
+ def default(self, o: Any) -> Any:
+ if isinstance(o, datetime):
+ return o.isoformat()
+ if isinstance(o, pydantic.BaseModel):
+ return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
+ return super().default(o)
diff --git a/tests/test_utils/test_json.py b/tests/test_utils/test_json.py
new file mode 100644
index 00000000..732c37f3
--- /dev/null
+++ b/tests/test_utils/test_json.py
@@ -0,0 +1,126 @@
+from __future__ import annotations
+
+import datetime
+from typing import Union
+
+import pydantic
+
+from mixedbread import _compat
+from mixedbread._utils._json import openapi_dumps
+
+
+class TestOpenapiDumps:
+ def test_basic(self) -> None:
+ data = {"key": "value", "number": 42}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"key":"value","number":42}'
+
+ def test_datetime_serialization(self) -> None:
+ dt = datetime.datetime(2023, 1, 1, 12, 0, 0)
+ data = {"datetime": dt}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"datetime":"2023-01-01T12:00:00"}'
+
+ def test_pydantic_model_serialization(self) -> None:
+ class User(pydantic.BaseModel):
+ first_name: str
+ last_name: str
+ age: int
+
+ model_instance = User(first_name="John", last_name="Kramer", age=83)
+ data = {"model": model_instance}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"model":{"first_name":"John","last_name":"Kramer","age":83}}'
+
+ def test_pydantic_model_with_default_values(self) -> None:
+ class User(pydantic.BaseModel):
+ name: str
+ role: str = "user"
+ active: bool = True
+ score: int = 0
+
+ model_instance = User(name="Alice")
+ data = {"model": model_instance}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"model":{"name":"Alice"}}'
+
+ def test_pydantic_model_with_default_values_overridden(self) -> None:
+ class User(pydantic.BaseModel):
+ name: str
+ role: str = "user"
+ active: bool = True
+
+ model_instance = User(name="Bob", role="admin", active=False)
+ data = {"model": model_instance}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"model":{"name":"Bob","role":"admin","active":false}}'
+
+ def test_pydantic_model_with_alias(self) -> None:
+ class User(pydantic.BaseModel):
+ first_name: str = pydantic.Field(alias="firstName")
+ last_name: str = pydantic.Field(alias="lastName")
+
+ model_instance = User(firstName="John", lastName="Doe")
+ data = {"model": model_instance}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"model":{"firstName":"John","lastName":"Doe"}}'
+
+ def test_pydantic_model_with_alias_and_default(self) -> None:
+ class User(pydantic.BaseModel):
+ user_name: str = pydantic.Field(alias="userName")
+ user_role: str = pydantic.Field(default="member", alias="userRole")
+ is_active: bool = pydantic.Field(default=True, alias="isActive")
+
+ model_instance = User(userName="charlie")
+ data = {"model": model_instance}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"model":{"userName":"charlie"}}'
+
+ model_with_overrides = User(userName="diana", userRole="admin", isActive=False)
+ data = {"model": model_with_overrides}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"model":{"userName":"diana","userRole":"admin","isActive":false}}'
+
+ def test_pydantic_model_with_nested_models_and_defaults(self) -> None:
+ class Address(pydantic.BaseModel):
+ street: str
+ city: str = "Unknown"
+
+ class User(pydantic.BaseModel):
+ name: str
+ address: Address
+ verified: bool = False
+
+ if _compat.PYDANTIC_V1:
+ # to handle forward references in Pydantic v1
+ User.update_forward_refs(**locals()) # type: ignore[reportDeprecated]
+
+ address = Address(street="123 Main St")
+ user = User(name="Diana", address=address)
+ data = {"user": user}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"user":{"name":"Diana","address":{"street":"123 Main St"}}}'
+
+ address_with_city = Address(street="456 Oak Ave", city="Boston")
+ user_verified = User(name="Eve", address=address_with_city, verified=True)
+ data = {"user": user_verified}
+ json_bytes = openapi_dumps(data)
+ assert (
+ json_bytes == b'{"user":{"name":"Eve","address":{"street":"456 Oak Ave","city":"Boston"},"verified":true}}'
+ )
+
+ def test_pydantic_model_with_optional_fields(self) -> None:
+ class User(pydantic.BaseModel):
+ name: str
+ email: Union[str, None]
+ phone: Union[str, None]
+
+ model_with_none = User(name="Eve", email=None, phone=None)
+ data = {"model": model_with_none}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"model":{"name":"Eve","email":null,"phone":null}}'
+
+ model_with_values = User(name="Frank", email="frank@example.com", phone=None)
+ data = {"model": model_with_values}
+ json_bytes = openapi_dumps(data)
+ assert json_bytes == b'{"model":{"name":"Frank","email":"frank@example.com","phone":null}}'
From 1438148c85ea84141b62215e97bd090ef5bbe36b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sun, 8 Feb 2026 02:26:21 +0000
Subject: [PATCH 356/375] feat(api): api update
---
.stats.yml | 4 +-
.../types/scored_audio_url_input_chunk.py | 32 +++++
.../types/scored_image_url_input_chunk.py | 32 +++++
.../types/scored_text_input_chunk.py | 32 +++++
.../types/scored_video_url_input_chunk.py | 32 +++++
src/mixedbread/types/stores/store_file.py | 128 ++++++++++++++++++
6 files changed, 258 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 34577fa8..e145f8df 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-61e81c8b5d4b1a203a465cc2a2bbc96edf9ef50c627deb1292dfbec20f217d0b.yml
-openapi_spec_hash: 4eee15ba8261d3c799b901c643f1034f
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-c3086f1b6682ee6dcd6cdc8764f735286c48c483aaaea73a038b542a786dd8d0.yml
+openapi_spec_hash: da7874d499de73b77f7369b0fbf1072d
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 7f1ce86a..ce6ad67a 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -18,6 +18,7 @@
"GeneratedMetadataPdfChunkGeneratedMetadata",
"GeneratedMetadataCodeChunkGeneratedMetadata",
"GeneratedMetadataAudioChunkGeneratedMetadata",
+ "GeneratedMetadataVideoChunkGeneratedMetadata",
"AudioURL",
]
@@ -174,6 +175,36 @@ def __getattr__(self, attr: str) -> object: ...
__pydantic_extra__: Dict[str, object]
+class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["video"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ fps: float
+
+ width: int
+
+ height: int
+
+ frame_count: int
+
+ 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]
+
+
GeneratedMetadata: TypeAlias = Annotated[
Union[
GeneratedMetadataMarkdownChunkGeneratedMetadata,
@@ -181,6 +212,7 @@ def __getattr__(self, attr: str) -> object: ...
GeneratedMetadataPdfChunkGeneratedMetadata,
GeneratedMetadataCodeChunkGeneratedMetadata,
GeneratedMetadataAudioChunkGeneratedMetadata,
+ GeneratedMetadataVideoChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index b8a90be5..5c41db69 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -18,6 +18,7 @@
"GeneratedMetadataPdfChunkGeneratedMetadata",
"GeneratedMetadataCodeChunkGeneratedMetadata",
"GeneratedMetadataAudioChunkGeneratedMetadata",
+ "GeneratedMetadataVideoChunkGeneratedMetadata",
"ImageURL",
]
@@ -174,6 +175,36 @@ def __getattr__(self, attr: str) -> object: ...
__pydantic_extra__: Dict[str, object]
+class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["video"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ fps: float
+
+ width: int
+
+ height: int
+
+ frame_count: int
+
+ 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]
+
+
GeneratedMetadata: TypeAlias = Annotated[
Union[
GeneratedMetadataMarkdownChunkGeneratedMetadata,
@@ -181,6 +212,7 @@ def __getattr__(self, attr: str) -> object: ...
GeneratedMetadataPdfChunkGeneratedMetadata,
GeneratedMetadataCodeChunkGeneratedMetadata,
GeneratedMetadataAudioChunkGeneratedMetadata,
+ GeneratedMetadataVideoChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index f9985071..025eecdc 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -18,6 +18,7 @@
"GeneratedMetadataPdfChunkGeneratedMetadata",
"GeneratedMetadataCodeChunkGeneratedMetadata",
"GeneratedMetadataAudioChunkGeneratedMetadata",
+ "GeneratedMetadataVideoChunkGeneratedMetadata",
]
@@ -173,6 +174,36 @@ def __getattr__(self, attr: str) -> object: ...
__pydantic_extra__: Dict[str, object]
+class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["video"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ fps: float
+
+ width: int
+
+ height: int
+
+ frame_count: int
+
+ 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]
+
+
GeneratedMetadata: TypeAlias = Annotated[
Union[
GeneratedMetadataMarkdownChunkGeneratedMetadata,
@@ -180,6 +211,7 @@ def __getattr__(self, attr: str) -> object: ...
GeneratedMetadataPdfChunkGeneratedMetadata,
GeneratedMetadataCodeChunkGeneratedMetadata,
GeneratedMetadataAudioChunkGeneratedMetadata,
+ GeneratedMetadataVideoChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index 594cde79..878c5bdf 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -18,6 +18,7 @@
"GeneratedMetadataPdfChunkGeneratedMetadata",
"GeneratedMetadataCodeChunkGeneratedMetadata",
"GeneratedMetadataAudioChunkGeneratedMetadata",
+ "GeneratedMetadataVideoChunkGeneratedMetadata",
"VideoURL",
]
@@ -174,6 +175,36 @@ def __getattr__(self, attr: str) -> object: ...
__pydantic_extra__: Dict[str, object]
+class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["video"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ fps: float
+
+ width: int
+
+ height: int
+
+ frame_count: int
+
+ 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]
+
+
GeneratedMetadata: TypeAlias = Annotated[
Union[
GeneratedMetadataMarkdownChunkGeneratedMetadata,
@@ -181,6 +212,7 @@ def __getattr__(self, attr: str) -> object: ...
GeneratedMetadataPdfChunkGeneratedMetadata,
GeneratedMetadataCodeChunkGeneratedMetadata,
GeneratedMetadataAudioChunkGeneratedMetadata,
+ GeneratedMetadataVideoChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index d15fe43c..7c3c0e2e 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -23,6 +23,7 @@
"ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
"ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
"ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
+ "ChunkTextInputChunkGeneratedMetadataVideoChunkGeneratedMetadata",
"ChunkImageURLInputChunk",
"ChunkImageURLInputChunkGeneratedMetadata",
"ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata",
@@ -32,6 +33,7 @@
"ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
"ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
"ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
+ "ChunkImageURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata",
"ChunkImageURLInputChunkImageURL",
"ChunkAudioURLInputChunk",
"ChunkAudioURLInputChunkGeneratedMetadata",
@@ -42,6 +44,7 @@
"ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
"ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
"ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
+ "ChunkAudioURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata",
"ChunkAudioURLInputChunkAudioURL",
"ChunkVideoURLInputChunk",
"ChunkVideoURLInputChunkGeneratedMetadata",
@@ -52,6 +55,7 @@
"ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata",
"ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata",
"ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata",
+ "ChunkVideoURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata",
"ChunkVideoURLInputChunkVideoURL",
]
@@ -219,6 +223,36 @@ def __getattr__(self, attr: str) -> object: ...
__pydantic_extra__: Dict[str, object]
+class ChunkTextInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["video"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ fps: float
+
+ width: int
+
+ height: int
+
+ frame_count: int
+
+ 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]
+
+
ChunkTextInputChunkGeneratedMetadata: TypeAlias = Annotated[
Union[
ChunkTextInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
@@ -226,6 +260,7 @@ def __getattr__(self, attr: str) -> object: ...
ChunkTextInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataVideoChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
@@ -411,6 +446,36 @@ def __getattr__(self, attr: str) -> object: ...
__pydantic_extra__: Dict[str, object]
+class ChunkImageURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["video"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ fps: float
+
+ width: int
+
+ height: int
+
+ frame_count: int
+
+ 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]
+
+
ChunkImageURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
Union[
ChunkImageURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
@@ -418,6 +483,7 @@ def __getattr__(self, attr: str) -> object: ...
ChunkImageURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
@@ -616,6 +682,36 @@ def __getattr__(self, attr: str) -> object: ...
__pydantic_extra__: Dict[str, object]
+class ChunkAudioURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["video"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ fps: float
+
+ width: int
+
+ height: int
+
+ frame_count: int
+
+ 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]
+
+
ChunkAudioURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
Union[
ChunkAudioURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
@@ -623,6 +719,7 @@ def __getattr__(self, attr: str) -> object: ...
ChunkAudioURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
@@ -821,6 +918,36 @@ def __getattr__(self, attr: str) -> object: ...
__pydantic_extra__: Dict[str, object]
+class ChunkVideoURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
+ type: Optional[Literal["video"]] = None
+
+ file_type: str
+
+ file_size: int
+
+ total_duration_seconds: float
+
+ fps: float
+
+ width: int
+
+ height: int
+
+ frame_count: int
+
+ 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]
+
+
ChunkVideoURLInputChunkGeneratedMetadata: TypeAlias = Annotated[
Union[
ChunkVideoURLInputChunkGeneratedMetadataMarkdownChunkGeneratedMetadata,
@@ -828,6 +955,7 @@ def __getattr__(self, attr: str) -> object: ...
ChunkVideoURLInputChunkGeneratedMetadataPdfChunkGeneratedMetadata,
ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
From 9684d30358e4805b139c30a0c3ddc4bb26fa3eb7 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 9 Feb 2026 07:32:03 +0000
Subject: [PATCH 357/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/stores/files.py | 4 ++--
src/mixedbread/resources/stores/stores.py | 4 ++--
src/mixedbread/types/store_search_params.py | 8 ++++++--
src/mixedbread/types/stores/file_search_params.py | 7 ++++++-
5 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e145f8df..b158562c 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-c3086f1b6682ee6dcd6cdc8764f735286c48c483aaaea73a038b542a786dd8d0.yml
-openapi_spec_hash: da7874d499de73b77f7369b0fbf1072d
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-3af72e3aa9c8af18b1064ad7eecd0810009483f0e4489d0cb0946dbc608ee746.yml
+openapi_spec_hash: 88afc93ee4ad10a512c721078c00712b
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index c84236e2..66a789e3 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -350,7 +350,7 @@ def delete(
def search(
self,
*,
- query: str,
+ query: file_search_params.Query,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[file_search_params.Filters] | Omit = omit,
@@ -732,7 +732,7 @@ async def delete(
async def search(
self,
*,
- query: str,
+ query: file_search_params.Query,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[file_search_params.Filters] | Omit = omit,
diff --git a/src/mixedbread/resources/stores/stores.py b/src/mixedbread/resources/stores/stores.py
index 66a55d84..41eac718 100644
--- a/src/mixedbread/resources/stores/stores.py
+++ b/src/mixedbread/resources/stores/stores.py
@@ -484,7 +484,7 @@ def question_answering(
def search(
self,
*,
- query: str,
+ query: store_search_params.Query,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[store_search_params.Filters] | Omit = omit,
@@ -1000,7 +1000,7 @@ async def question_answering(
async def search(
self,
*,
- query: str,
+ query: store_search_params.Query,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[store_search_params.Filters] | Omit = omit,
diff --git a/src/mixedbread/types/store_search_params.py b/src/mixedbread/types/store_search_params.py
index 1bff13de..7a526d7d 100644
--- a/src/mixedbread/types/store_search_params.py
+++ b/src/mixedbread/types/store_search_params.py
@@ -6,14 +6,16 @@
from typing_extensions import Required, TypeAlias, TypedDict
from .._types import SequenceNotStr
+from .extractions.text_input_param import TextInputParam
from .store_chunk_search_options_param import StoreChunkSearchOptionsParam
+from .extractions.image_url_input_param import ImageURLInputParam
from .shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["StoreSearchParams", "Filters", "FiltersUnionMember2"]
+__all__ = ["StoreSearchParams", "Query", "Filters", "FiltersUnionMember2"]
class StoreSearchParams(TypedDict, total=False):
- query: Required[str]
+ query: Required[Query]
"""Search query text"""
store_identifiers: Required[SequenceNotStr[str]]
@@ -32,6 +34,8 @@ class StoreSearchParams(TypedDict, total=False):
"""Search configuration options"""
+Query: TypeAlias = Union[str, ImageURLInputParam, TextInputParam]
+
FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
diff --git a/src/mixedbread/types/stores/file_search_params.py b/src/mixedbread/types/stores/file_search_params.py
index e1a3ae74..e70bc15b 100644
--- a/src/mixedbread/types/stores/file_search_params.py
+++ b/src/mixedbread/types/stores/file_search_params.py
@@ -6,10 +6,13 @@
from typing_extensions import Required, TypeAlias, TypedDict
from ..._types import SequenceNotStr
+from ..extractions.text_input_param import TextInputParam
+from ..extractions.image_url_input_param import ImageURLInputParam
from ..shared_params.search_filter_condition import SearchFilterCondition
__all__ = [
"FileSearchParams",
+ "Query",
"Filters",
"FiltersUnionMember2",
"SearchOptions",
@@ -21,7 +24,7 @@
class FileSearchParams(TypedDict, total=False):
- query: Required[str]
+ query: Required[Query]
"""Search query text"""
store_identifiers: Required[SequenceNotStr[str]]
@@ -40,6 +43,8 @@ class FileSearchParams(TypedDict, total=False):
"""Search configuration options"""
+Query: TypeAlias = Union[str, ImageURLInputParam, TextInputParam]
+
FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
From 7ee9cca5dfe77f804b3ab37947abbfccbf01ae1d Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 9 Feb 2026 14:32:18 +0000
Subject: [PATCH 358/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/stores/files.py | 4 ++--
src/mixedbread/resources/stores/stores.py | 4 ++--
src/mixedbread/types/store_search_params.py | 8 ++------
src/mixedbread/types/stores/file_search_params.py | 7 +------
5 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index b158562c..e145f8df 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-3af72e3aa9c8af18b1064ad7eecd0810009483f0e4489d0cb0946dbc608ee746.yml
-openapi_spec_hash: 88afc93ee4ad10a512c721078c00712b
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-c3086f1b6682ee6dcd6cdc8764f735286c48c483aaaea73a038b542a786dd8d0.yml
+openapi_spec_hash: da7874d499de73b77f7369b0fbf1072d
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index 66a789e3..c84236e2 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -350,7 +350,7 @@ def delete(
def search(
self,
*,
- query: file_search_params.Query,
+ query: str,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[file_search_params.Filters] | Omit = omit,
@@ -732,7 +732,7 @@ async def delete(
async def search(
self,
*,
- query: file_search_params.Query,
+ query: str,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[file_search_params.Filters] | Omit = omit,
diff --git a/src/mixedbread/resources/stores/stores.py b/src/mixedbread/resources/stores/stores.py
index 41eac718..66a55d84 100644
--- a/src/mixedbread/resources/stores/stores.py
+++ b/src/mixedbread/resources/stores/stores.py
@@ -484,7 +484,7 @@ def question_answering(
def search(
self,
*,
- query: store_search_params.Query,
+ query: str,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[store_search_params.Filters] | Omit = omit,
@@ -1000,7 +1000,7 @@ async def question_answering(
async def search(
self,
*,
- query: store_search_params.Query,
+ query: str,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[store_search_params.Filters] | Omit = omit,
diff --git a/src/mixedbread/types/store_search_params.py b/src/mixedbread/types/store_search_params.py
index 7a526d7d..1bff13de 100644
--- a/src/mixedbread/types/store_search_params.py
+++ b/src/mixedbread/types/store_search_params.py
@@ -6,16 +6,14 @@
from typing_extensions import Required, TypeAlias, TypedDict
from .._types import SequenceNotStr
-from .extractions.text_input_param import TextInputParam
from .store_chunk_search_options_param import StoreChunkSearchOptionsParam
-from .extractions.image_url_input_param import ImageURLInputParam
from .shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["StoreSearchParams", "Query", "Filters", "FiltersUnionMember2"]
+__all__ = ["StoreSearchParams", "Filters", "FiltersUnionMember2"]
class StoreSearchParams(TypedDict, total=False):
- query: Required[Query]
+ query: Required[str]
"""Search query text"""
store_identifiers: Required[SequenceNotStr[str]]
@@ -34,8 +32,6 @@ class StoreSearchParams(TypedDict, total=False):
"""Search configuration options"""
-Query: TypeAlias = Union[str, ImageURLInputParam, TextInputParam]
-
FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
diff --git a/src/mixedbread/types/stores/file_search_params.py b/src/mixedbread/types/stores/file_search_params.py
index e70bc15b..e1a3ae74 100644
--- a/src/mixedbread/types/stores/file_search_params.py
+++ b/src/mixedbread/types/stores/file_search_params.py
@@ -6,13 +6,10 @@
from typing_extensions import Required, TypeAlias, TypedDict
from ..._types import SequenceNotStr
-from ..extractions.text_input_param import TextInputParam
-from ..extractions.image_url_input_param import ImageURLInputParam
from ..shared_params.search_filter_condition import SearchFilterCondition
__all__ = [
"FileSearchParams",
- "Query",
"Filters",
"FiltersUnionMember2",
"SearchOptions",
@@ -24,7 +21,7 @@
class FileSearchParams(TypedDict, total=False):
- query: Required[Query]
+ query: Required[str]
"""Search query text"""
store_identifiers: Required[SequenceNotStr[str]]
@@ -43,8 +40,6 @@ class FileSearchParams(TypedDict, total=False):
"""Search configuration options"""
-Query: TypeAlias = Union[str, ImageURLInputParam, TextInputParam]
-
FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
From 2912caadc2311487b966182b2a9d539f78d72fa5 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Mon, 9 Feb 2026 22:31:54 +0000
Subject: [PATCH 359/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/stores/files.py | 4 ++--
src/mixedbread/resources/stores/stores.py | 4 ++--
src/mixedbread/types/store_search_params.py | 8 ++++++--
src/mixedbread/types/stores/file_search_params.py | 7 ++++++-
5 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index e145f8df..9f60014e 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-c3086f1b6682ee6dcd6cdc8764f735286c48c483aaaea73a038b542a786dd8d0.yml
-openapi_spec_hash: da7874d499de73b77f7369b0fbf1072d
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-68449c5f406b2b3bc2b94ef7f94c47b3724aa0a69e1033bef1a84477f79420f5.yml
+openapi_spec_hash: 2b6de88d9a14a977a66f37c066d0b47a
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index c84236e2..66a789e3 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -350,7 +350,7 @@ def delete(
def search(
self,
*,
- query: str,
+ query: file_search_params.Query,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[file_search_params.Filters] | Omit = omit,
@@ -732,7 +732,7 @@ async def delete(
async def search(
self,
*,
- query: str,
+ query: file_search_params.Query,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[file_search_params.Filters] | Omit = omit,
diff --git a/src/mixedbread/resources/stores/stores.py b/src/mixedbread/resources/stores/stores.py
index 66a55d84..41eac718 100644
--- a/src/mixedbread/resources/stores/stores.py
+++ b/src/mixedbread/resources/stores/stores.py
@@ -484,7 +484,7 @@ def question_answering(
def search(
self,
*,
- query: str,
+ query: store_search_params.Query,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[store_search_params.Filters] | Omit = omit,
@@ -1000,7 +1000,7 @@ async def question_answering(
async def search(
self,
*,
- query: str,
+ query: store_search_params.Query,
store_identifiers: SequenceNotStr[str],
top_k: int | Omit = omit,
filters: Optional[store_search_params.Filters] | Omit = omit,
diff --git a/src/mixedbread/types/store_search_params.py b/src/mixedbread/types/store_search_params.py
index 1bff13de..7a526d7d 100644
--- a/src/mixedbread/types/store_search_params.py
+++ b/src/mixedbread/types/store_search_params.py
@@ -6,14 +6,16 @@
from typing_extensions import Required, TypeAlias, TypedDict
from .._types import SequenceNotStr
+from .extractions.text_input_param import TextInputParam
from .store_chunk_search_options_param import StoreChunkSearchOptionsParam
+from .extractions.image_url_input_param import ImageURLInputParam
from .shared_params.search_filter_condition import SearchFilterCondition
-__all__ = ["StoreSearchParams", "Filters", "FiltersUnionMember2"]
+__all__ = ["StoreSearchParams", "Query", "Filters", "FiltersUnionMember2"]
class StoreSearchParams(TypedDict, total=False):
- query: Required[str]
+ query: Required[Query]
"""Search query text"""
store_identifiers: Required[SequenceNotStr[str]]
@@ -32,6 +34,8 @@ class StoreSearchParams(TypedDict, total=False):
"""Search configuration options"""
+Query: TypeAlias = Union[str, ImageURLInputParam, TextInputParam]
+
FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
diff --git a/src/mixedbread/types/stores/file_search_params.py b/src/mixedbread/types/stores/file_search_params.py
index e1a3ae74..e70bc15b 100644
--- a/src/mixedbread/types/stores/file_search_params.py
+++ b/src/mixedbread/types/stores/file_search_params.py
@@ -6,10 +6,13 @@
from typing_extensions import Required, TypeAlias, TypedDict
from ..._types import SequenceNotStr
+from ..extractions.text_input_param import TextInputParam
+from ..extractions.image_url_input_param import ImageURLInputParam
from ..shared_params.search_filter_condition import SearchFilterCondition
__all__ = [
"FileSearchParams",
+ "Query",
"Filters",
"FiltersUnionMember2",
"SearchOptions",
@@ -21,7 +24,7 @@
class FileSearchParams(TypedDict, total=False):
- query: Required[str]
+ query: Required[Query]
"""Search query text"""
store_identifiers: Required[SequenceNotStr[str]]
@@ -40,6 +43,8 @@ class FileSearchParams(TypedDict, total=False):
"""Search configuration options"""
+Query: TypeAlias = Union[str, ImageURLInputParam, TextInputParam]
+
FiltersUnionMember2: TypeAlias = Union["SearchFilter", SearchFilterCondition]
Filters: TypeAlias = Union["SearchFilter", SearchFilterCondition, Iterable[FiltersUnionMember2]]
From 8d5d61833493644f4ccce2ef1dbe9a4f1323a7fd Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 10 Feb 2026 08:48:47 +0000
Subject: [PATCH 360/375] chore(internal): bump dependencies
---
requirements-dev.lock | 20 ++++++++++----------
requirements.lock | 8 ++++----
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/requirements-dev.lock b/requirements-dev.lock
index fe8d5892..35a7b124 100644
--- a/requirements-dev.lock
+++ b/requirements-dev.lock
@@ -12,14 +12,14 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
-aiohttp==3.13.2
+aiohttp==3.13.3
# via httpx-aiohttp
# via mixedbread
aiosignal==1.4.0
# via aiohttp
annotated-types==0.7.0
# via pydantic
-anyio==4.12.0
+anyio==4.12.1
# via httpx
# via mixedbread
argcomplete==3.6.3
@@ -31,7 +31,7 @@ attrs==25.4.0
# via nox
backports-asyncio-runner==1.2.0
# via pytest-asyncio
-certifi==2025.11.12
+certifi==2026.1.4
# via httpcore
# via httpx
colorlog==6.10.1
@@ -61,7 +61,7 @@ httpx==0.28.1
# via httpx-aiohttp
# via mixedbread
# via respx
-httpx-aiohttp==0.1.9
+httpx-aiohttp==0.1.12
# via mixedbread
humanize==4.13.0
# via nox
@@ -69,7 +69,7 @@ idna==3.11
# via anyio
# via httpx
# via yarl
-importlib-metadata==8.7.0
+importlib-metadata==8.7.1
iniconfig==2.1.0
# via pytest
markdown-it-py==3.0.0
@@ -82,14 +82,14 @@ multidict==6.7.0
mypy==1.17.0
mypy-extensions==1.1.0
# via mypy
-nodeenv==1.9.1
+nodeenv==1.10.0
# via pyright
nox==2025.11.12
packaging==25.0
# via dependency-groups
# via nox
# via pytest
-pathspec==0.12.1
+pathspec==1.0.3
# via mypy
platformdirs==4.4.0
# via virtualenv
@@ -115,13 +115,13 @@ python-dateutil==2.9.0.post0
# via time-machine
respx==0.22.0
rich==14.2.0
-ruff==0.14.7
+ruff==0.14.13
six==1.17.0
# via python-dateutil
sniffio==1.3.1
# via mixedbread
time-machine==2.19.0
-tomli==2.3.0
+tomli==2.4.0
# via dependency-groups
# via mypy
# via nox
@@ -141,7 +141,7 @@ typing-extensions==4.15.0
# via virtualenv
typing-inspection==0.4.2
# via pydantic
-virtualenv==20.35.4
+virtualenv==20.36.1
# via nox
yarl==1.22.0
# via aiohttp
diff --git a/requirements.lock b/requirements.lock
index 1161d859..ce962fbc 100644
--- a/requirements.lock
+++ b/requirements.lock
@@ -12,21 +12,21 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
-aiohttp==3.13.2
+aiohttp==3.13.3
# via httpx-aiohttp
# via mixedbread
aiosignal==1.4.0
# via aiohttp
annotated-types==0.7.0
# via pydantic
-anyio==4.12.0
+anyio==4.12.1
# via httpx
# via mixedbread
async-timeout==5.0.1
# via aiohttp
attrs==25.4.0
# via aiohttp
-certifi==2025.11.12
+certifi==2026.1.4
# via httpcore
# via httpx
distro==1.9.0
@@ -43,7 +43,7 @@ httpcore==1.0.9
httpx==0.28.1
# via httpx-aiohttp
# via mixedbread
-httpx-aiohttp==0.1.9
+httpx-aiohttp==0.1.12
# via mixedbread
idna==3.11
# via anyio
From 1cd9af41d5e8acd6009b3994ecdfe46c19fba16f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 12 Feb 2026 04:06:59 +0000
Subject: [PATCH 361/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index fc0d7ff8..563004f2 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.45.0"
+ ".": "0.46.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 862539cb..999e2513 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.45.0"
+version = "0.46.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 6ab4a606..d86e36b9 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.45.0" # x-release-please-version
+__version__ = "0.46.0" # x-release-please-version
From bbddaa1d2c644d31a7c972515c01d81146ccef8f Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 12 Feb 2026 08:27:09 +0000
Subject: [PATCH 362/375] chore(internal): version bump
---
.release-please-manifest.json | 2 +-
pyproject.toml | 2 +-
src/mixedbread/_version.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 563004f2..fea34540 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.46.0"
+ ".": "1.0.0"
}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 999e2513..babc8df7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
-version = "0.46.0"
+version = "1.0.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 d86e36b9..a6b0880b 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.46.0" # x-release-please-version
+__version__ = "1.0.0" # x-release-please-version
From 7aaa75729505836024573c540ce3b725202c8551 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 12 Feb 2026 12:47:55 +0000
Subject: [PATCH 363/375] chore(internal): fix lint error on Python 3.14
---
src/mixedbread/_utils/_compat.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mixedbread/_utils/_compat.py b/src/mixedbread/_utils/_compat.py
index dd703233..2c70b299 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:
From 9b45467230f24ce64aa6147a779f9bc1bf39f8fa Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 13 Feb 2026 07:35:06 +0000
Subject: [PATCH 364/375] chore: format all `api.md` files
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index babc8df7..e563f7e5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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 = [
From 4592a4a7e68bd09d2fd88236a597c64137fccd3a Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 17 Feb 2026 20:29:02 +0000
Subject: [PATCH 365/375] codegen metadata
---
.stats.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 9f60014e..b53b5204 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-c8b3f2a21a904339787e1a5cf78ef9d3ad47bf20a368d45b50fbc7f9b6240ce1.yml
+openapi_spec_hash: 645cbaa3a4bb0b67c49bb11b0e46310b
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
From c3abab8dea56e235f32bf0b4f4c427dc6f4979d9 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 18 Feb 2026 17:29:02 +0000
Subject: [PATCH 366/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/scored_audio_url_input_chunk.py | 3 +++
src/mixedbread/types/scored_image_url_input_chunk.py | 3 +++
src/mixedbread/types/scored_text_input_chunk.py | 3 +++
src/mixedbread/types/scored_video_url_input_chunk.py | 3 +++
5 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index b53b5204..eaf004f9 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-c8b3f2a21a904339787e1a5cf78ef9d3ad47bf20a368d45b50fbc7f9b6240ce1.yml
-openapi_spec_hash: 645cbaa3a4bb0b67c49bb11b0e46310b
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b1dc7adca94d1a8c12d66e06400ce2f254a7e0ff0036c3817189c68ff1405ece.yml
+openapi_spec_hash: dff0a2dc18d54f7f0a8c5be2cfe0aa09
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index ce6ad67a..58295201 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -251,6 +251,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 5c41db69..c9211b51 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -254,6 +254,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 025eecdc..e799821c 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -243,6 +243,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 878c5bdf..359f7395 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -251,6 +251,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"""
From bb5a940136fbf0023558783c751391113771b3f1 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 20 Feb 2026 07:28:37 +0000
Subject: [PATCH 367/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/scored_audio_url_input_chunk.py | 2 ++
src/mixedbread/types/scored_image_url_input_chunk.py | 2 ++
src/mixedbread/types/scored_text_input_chunk.py | 2 ++
src/mixedbread/types/scored_video_url_input_chunk.py | 2 ++
src/mixedbread/types/stores/store_file.py | 8 ++++++++
6 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index eaf004f9..ffd73101 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-b1dc7adca94d1a8c12d66e06400ce2f254a7e0ff0036c3817189c68ff1405ece.yml
-openapi_spec_hash: dff0a2dc18d54f7f0a8c5be2cfe0aa09
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-6ba48fa06aa557530108aa3c41662495c0df7de025f3c8d5986bf920a8d23519.yml
+openapi_spec_hash: 42e7e3822156c5fde4bed8fb291fc05a
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index 58295201..b7049d49 100644
--- a/src/mixedbread/types/scored_audio_url_input_chunk.py
+++ b/src/mixedbread/types/scored_audio_url_input_chunk.py
@@ -192,6 +192,8 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
frame_count: int
+ has_audio_stream: Optional[bool] = 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.
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index c9211b51..ea58bb83 100644
--- a/src/mixedbread/types/scored_image_url_input_chunk.py
+++ b/src/mixedbread/types/scored_image_url_input_chunk.py
@@ -192,6 +192,8 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
frame_count: int
+ has_audio_stream: Optional[bool] = 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.
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index e799821c..254193a6 100644
--- a/src/mixedbread/types/scored_text_input_chunk.py
+++ b/src/mixedbread/types/scored_text_input_chunk.py
@@ -191,6 +191,8 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
frame_count: int
+ has_audio_stream: Optional[bool] = 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.
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index 359f7395..e05a7f5c 100644
--- a/src/mixedbread/types/scored_video_url_input_chunk.py
+++ b/src/mixedbread/types/scored_video_url_input_chunk.py
@@ -192,6 +192,8 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
frame_count: int
+ has_audio_stream: Optional[bool] = 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.
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index 7c3c0e2e..106f3e3e 100644
--- a/src/mixedbread/types/stores/store_file.py
+++ b/src/mixedbread/types/stores/store_file.py
@@ -240,6 +240,8 @@ class ChunkTextInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseModel)
frame_count: int
+ has_audio_stream: Optional[bool] = 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 +465,8 @@ class ChunkImageURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseMo
frame_count: int
+ has_audio_stream: Optional[bool] = 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 +703,8 @@ class ChunkAudioURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseMo
frame_count: int
+ has_audio_stream: Optional[bool] = 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 +941,8 @@ class ChunkVideoURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseMo
frame_count: int
+ has_audio_stream: Optional[bool] = 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.
From 373f03aa0eedefc3b82c6da69bc3274b2e44f23b Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 20 Feb 2026 11:25:11 +0000
Subject: [PATCH 368/375] chore: update mock server docs
---
CONTRIBUTING.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0b147f05..ed6fa9a1 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
From 64830eda86bd71536a4b0fc069f6c95c9b5359d8 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 20 Feb 2026 23:28:49 +0000
Subject: [PATCH 369/375] feat(api): api update
---
.stats.yml | 4 +-
.../types/scored_audio_url_input_chunk.py | 40 +++++
.../types/scored_image_url_input_chunk.py | 40 +++++
.../types/scored_text_input_chunk.py | 40 +++++
.../types/scored_video_url_input_chunk.py | 40 +++++
src/mixedbread/types/stores/store_file.py | 160 ++++++++++++++++++
6 files changed, 322 insertions(+), 2 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index ffd73101..74bbf70b 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-6ba48fa06aa557530108aa3c41662495c0df7de025f3c8d5986bf920a8d23519.yml
-openapi_spec_hash: 42e7e3822156c5fde4bed8fb291fc05a
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-b1e738661f623d4043d56f4d1b9d9c010701964b40823831b7e28d86b496463f.yml
+openapi_spec_hash: 986f5e966aae0a82a7f45c7d5bf48dba
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/types/scored_audio_url_input_chunk.py b/src/mixedbread/types/scored_audio_url_input_chunk.py
index b7049d49..237a55b7 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.
@@ -194,6 +205,34 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
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.
@@ -215,6 +254,7 @@ def __getattr__(self, attr: str) -> object: ...
GeneratedMetadataCodeChunkGeneratedMetadata,
GeneratedMetadataAudioChunkGeneratedMetadata,
GeneratedMetadataVideoChunkGeneratedMetadata,
+ GeneratedMetadataImageChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
diff --git a/src/mixedbread/types/scored_image_url_input_chunk.py b/src/mixedbread/types/scored_image_url_input_chunk.py
index ea58bb83..412bcb5a 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.
@@ -194,6 +205,34 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
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.
@@ -215,6 +254,7 @@ def __getattr__(self, attr: str) -> object: ...
GeneratedMetadataCodeChunkGeneratedMetadata,
GeneratedMetadataAudioChunkGeneratedMetadata,
GeneratedMetadataVideoChunkGeneratedMetadata,
+ GeneratedMetadataImageChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
diff --git a/src/mixedbread/types/scored_text_input_chunk.py b/src/mixedbread/types/scored_text_input_chunk.py
index 254193a6..74977788 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.
@@ -193,6 +204,34 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
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.
@@ -214,6 +253,7 @@ def __getattr__(self, attr: str) -> object: ...
GeneratedMetadataCodeChunkGeneratedMetadata,
GeneratedMetadataAudioChunkGeneratedMetadata,
GeneratedMetadataVideoChunkGeneratedMetadata,
+ GeneratedMetadataImageChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
diff --git a/src/mixedbread/types/scored_video_url_input_chunk.py b/src/mixedbread/types/scored_video_url_input_chunk.py
index e05a7f5c..788e0c37 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.
@@ -194,6 +205,34 @@ class GeneratedMetadataVideoChunkGeneratedMetadata(BaseModel):
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.
@@ -215,6 +254,7 @@ def __getattr__(self, attr: str) -> object: ...
GeneratedMetadataCodeChunkGeneratedMetadata,
GeneratedMetadataAudioChunkGeneratedMetadata,
GeneratedMetadataVideoChunkGeneratedMetadata,
+ GeneratedMetadataImageChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
diff --git a/src/mixedbread/types/stores/store_file.py b/src/mixedbread/types/stores/store_file.py
index 106f3e3e..f8d4c162 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.
@@ -242,6 +256,34 @@ class ChunkTextInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseModel)
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.
@@ -263,6 +305,7 @@ def __getattr__(self, attr: str) -> object: ...
ChunkTextInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
ChunkTextInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
ChunkTextInputChunkGeneratedMetadataVideoChunkGeneratedMetadata,
+ ChunkTextInputChunkGeneratedMetadataImageChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
@@ -327,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:
@@ -357,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.
@@ -379,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.
@@ -407,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.
@@ -435,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.
@@ -467,6 +520,34 @@ class ChunkImageURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseMo
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.
@@ -488,6 +569,7 @@ def __getattr__(self, attr: str) -> object: ...
ChunkImageURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
ChunkImageURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
ChunkImageURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata,
+ ChunkImageURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
@@ -565,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:
@@ -595,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.
@@ -617,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.
@@ -645,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.
@@ -673,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.
@@ -705,6 +797,34 @@ class ChunkAudioURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseMo
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.
@@ -726,6 +846,7 @@ def __getattr__(self, attr: str) -> object: ...
ChunkAudioURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
ChunkAudioURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
ChunkAudioURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata,
+ ChunkAudioURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
@@ -803,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:
@@ -833,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.
@@ -855,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.
@@ -883,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.
@@ -911,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.
@@ -943,6 +1074,34 @@ class ChunkVideoURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata(BaseMo
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.
@@ -964,6 +1123,7 @@ def __getattr__(self, attr: str) -> object: ...
ChunkVideoURLInputChunkGeneratedMetadataCodeChunkGeneratedMetadata,
ChunkVideoURLInputChunkGeneratedMetadataAudioChunkGeneratedMetadata,
ChunkVideoURLInputChunkGeneratedMetadataVideoChunkGeneratedMetadata,
+ ChunkVideoURLInputChunkGeneratedMetadataImageChunkGeneratedMetadata,
None,
],
PropertyInfo(discriminator="type"),
From 6894672a50c4ff2cfb49d0c1f747c1e9fcdca1dd Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 24 Feb 2026 12:12:25 +0000
Subject: [PATCH 370/375] chore(internal): add request options to SSE classes
---
src/mixedbread/_response.py | 3 +++
src/mixedbread/_streaming.py | 11 ++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/mixedbread/_response.py b/src/mixedbread/_response.py
index 543946b9..50547a3b 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 e7f6340f..235a94a8 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__()
From 81acceff836795025a8fc917a1b552e65efb94a3 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Tue, 24 Feb 2026 12:23:01 +0000
Subject: [PATCH 371/375] chore(internal): make
`test_proxy_environment_variables` more resilient
---
tests/test_client.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/test_client.py b/tests/test_client.py
index 6696b539..83a44b8c 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -967,6 +967,8 @@ 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 this set
+ monkeypatch.delenv("HTTP_PROXY", raising=False)
client = DefaultHttpxClient()
@@ -1887,6 +1889,8 @@ 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 this set
+ monkeypatch.delenv("HTTP_PROXY", raising=False)
client = DefaultAsyncHttpxClient()
From 86bbd548aeb5229c55da17e07e0c651e03f955d6 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Feb 2026 00:28:39 +0000
Subject: [PATCH 372/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/store_chunk_search_options_param.py | 3 ---
src/mixedbread/types/stores/file_search_params.py | 3 ---
3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index 74bbf70b..cdc7fd24 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-b1e738661f623d4043d56f4d1b9d9c010701964b40823831b7e28d86b496463f.yml
-openapi_spec_hash: 986f5e966aae0a82a7f45c7d5bf48dba
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-1942d52b83f70e100db8b891551aa54fb02d9574aec159e105013a33640d2c7f.yml
+openapi_spec_hash: 8971bb33a2af97d9e0b649ff8f02a33e
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/types/store_chunk_search_options_param.py b/src/mixedbread/types/store_chunk_search_options_param.py
index 12e5f590..90bb9816 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_search_params.py b/src/mixedbread/types/stores/file_search_params.py
index e70bc15b..6f6aa2d1 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]
From 7a8b3881901ae6cfe028b21298ce2abb48cfe519 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Feb 2026 12:39:07 +0000
Subject: [PATCH 373/375] chore(internal): make
`test_proxy_environment_variables` more resilient to env
---
tests/test_client.py | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/tests/test_client.py b/tests/test_client.py
index 83a44b8c..8cc00170 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -967,8 +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 this set
+ # 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()
@@ -1889,8 +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 this set
+ # 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()
From e3a5d9505f6a3e267ce60b8e460783dcadc110c0 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Wed, 25 Feb 2026 13:28:43 +0000
Subject: [PATCH 374/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/types/parsing/parsing_job.py | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index cdc7fd24..d2a86c88 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-1942d52b83f70e100db8b891551aa54fb02d9574aec159e105013a33640d2c7f.yml
-openapi_spec_hash: 8971bb33a2af97d9e0b649ff8f02a33e
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-67f1ae8cdd8a043199c7da700cf26c5da787862faf895c2e0d737c83085e1573.yml
+openapi_spec_hash: 38dde555682223f7b5c92e9e575e2beb
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/types/parsing/parsing_job.py b/src/mixedbread/types/parsing/parsing_job.py
index 56380010..2f3d250d 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."""
From ae7e24232787109648317b6f418a6ffd4257d339 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Sat, 28 Feb 2026 04:28:45 +0000
Subject: [PATCH 375/375] feat(api): api update
---
.stats.yml | 4 ++--
src/mixedbread/resources/stores/files.py | 4 ++--
src/mixedbread/types/stores/file_list_params.py | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.stats.yml b/.stats.yml
index d2a86c88..bcefba01 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-67f1ae8cdd8a043199c7da700cf26c5da787862faf895c2e0d737c83085e1573.yml
-openapi_spec_hash: 38dde555682223f7b5c92e9e575e2beb
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-0f4c537661b6b41d8a474988d30d94b16886f6969589c8c86e13f6dac8c54d72.yml
+openapi_spec_hash: f585ba82e9ab6363aa405fa685c12db8
config_hash: fb2cfcdc5ef83ff03407a8b66c26a59b
diff --git a/src/mixedbread/resources/stores/files.py b/src/mixedbread/resources/stores/files.py
index 66a789e3..87b884a9 100644
--- a/src/mixedbread/resources/stores/files.py
+++ b/src/mixedbread/resources/stores/files.py
@@ -269,7 +269,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
@@ -651,7 +651,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/stores/file_list_params.py b/src/mixedbread/types/stores/file_list_params.py
index 2782573a..2089f9cf 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]