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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 20
configured_endpoints: 19
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-0feabc3c80e59e946cf29c0a00a7ff40bdaf720a1c30154cf6102f7f86e2d596.yml
16 changes: 1 addition & 15 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,6 @@ Methods:

- <code title="post /v1/reranking">client.reranking.<a href="./src/mixedbread/resources/reranking.py">create</a>(\*\*<a href="src/mixedbread/types/reranking_create_params.py">params</a>) -> <a href="./src/mixedbread/types/reranking_create_response.py">RerankingCreateResponse</a></code>

# Parsing

## Jobs

Types:

```python
from mixedbread.types.parsing import ParsingJob
```

Methods:

- <code title="post /v1/parsing/jobs">client.parsing.jobs.<a href="./src/mixedbread/resources/parsing/jobs.py">create</a>(\*\*<a href="src/mixedbread/types/parsing/job_create_params.py">params</a>) -> <a href="./src/mixedbread/types/parsing/parsing_job.py">ParsingJob</a></code>
- <code title="get /v1/parsing/jobs/{job_id}">client.parsing.jobs.<a href="./src/mixedbread/resources/parsing/jobs.py">retrieve</a>(job_id) -> <a href="./src/mixedbread/types/parsing/parsing_job.py">ParsingJob</a></code>

# Files

Types:
Expand All @@ -64,6 +49,7 @@ Methods:
- <code title="post /v1/files/{file_id}">client.files.<a href="./src/mixedbread/resources/files.py">update</a>(file_id, \*\*<a href="src/mixedbread/types/file_update_params.py">params</a>) -> <a href="./src/mixedbread/types/file_object.py">FileObject</a></code>
- <code title="get /v1/files">client.files.<a href="./src/mixedbread/resources/files.py">list</a>(\*\*<a href="src/mixedbread/types/file_list_params.py">params</a>) -> <a href="./src/mixedbread/types/file_object.py">SyncPage[FileObject]</a></code>
- <code title="delete /v1/files/{file_id}">client.files.<a href="./src/mixedbread/resources/files.py">delete</a>(file_id) -> <a href="./src/mixedbread/types/file_delete_response.py">FileDeleteResponse</a></code>
- <code title="get /v1/files/{file_id}/content">client.files.<a href="./src/mixedbread/resources/files.py">content</a>(file_id) -> BinaryAPIResponse</code>

# VectorStores

Expand Down
9 changes: 0 additions & 9 deletions src/mixedbread/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
AsyncAPIClient,
make_request_options,
)
from .resources.parsing import parsing
from .types.info_response import InfoResponse
from .resources.vector_stores import vector_stores

Expand All @@ -67,7 +66,6 @@
class Mixedbread(SyncAPIClient):
embeddings: embeddings.EmbeddingsResource
reranking: reranking.RerankingResource
parsing: parsing.ParsingResource
files: files.FilesResource
vector_stores: vector_stores.VectorStoresResource
with_raw_response: MixedbreadWithRawResponse
Expand Down Expand Up @@ -153,7 +151,6 @@ def __init__(

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)
Expand Down Expand Up @@ -292,7 +289,6 @@ def _make_status_error(
class AsyncMixedbread(AsyncAPIClient):
embeddings: embeddings.AsyncEmbeddingsResource
reranking: reranking.AsyncRerankingResource
parsing: parsing.AsyncParsingResource
files: files.AsyncFilesResource
vector_stores: vector_stores.AsyncVectorStoresResource
with_raw_response: AsyncMixedbreadWithRawResponse
Expand Down Expand Up @@ -378,7 +374,6 @@ def __init__(

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)
Expand Down Expand Up @@ -518,7 +513,6 @@ 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)

Expand All @@ -531,7 +525,6 @@ 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)

Expand All @@ -544,7 +537,6 @@ 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)

Expand All @@ -557,7 +549,6 @@ 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)

Expand Down
14 changes: 0 additions & 14 deletions src/mixedbread/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
FilesResourceWithStreamingResponse,
AsyncFilesResourceWithStreamingResponse,
)
from .parsing import (
ParsingResource,
AsyncParsingResource,
ParsingResourceWithRawResponse,
AsyncParsingResourceWithRawResponse,
ParsingResourceWithStreamingResponse,
AsyncParsingResourceWithStreamingResponse,
)
from .reranking import (
RerankingResource,
AsyncRerankingResource,
Expand Down Expand Up @@ -54,12 +46,6 @@
"AsyncRerankingResourceWithRawResponse",
"RerankingResourceWithStreamingResponse",
"AsyncRerankingResourceWithStreamingResponse",
"ParsingResource",
"AsyncParsingResource",
"ParsingResourceWithRawResponse",
"AsyncParsingResourceWithRawResponse",
"ParsingResourceWithStreamingResponse",
"AsyncParsingResourceWithStreamingResponse",
"FilesResource",
"AsyncFilesResource",
"FilesResourceWithRawResponse",
Expand Down
104 changes: 104 additions & 0 deletions src/mixedbread/resources/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@
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 ..pagination import SyncPage, AsyncPage
from .._base_client import AsyncPaginator, make_request_options
Expand Down Expand Up @@ -274,6 +282,46 @@ def delete(
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.

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
Expand Down Expand Up @@ -519,6 +567,46 @@ async def delete(
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,
)


class FilesResourceWithRawResponse:
def __init__(self, files: FilesResource) -> None:
Expand All @@ -539,6 +627,10 @@ def __init__(self, files: FilesResource) -> None:
self.delete = to_raw_response_wrapper(
files.delete,
)
self.content = to_custom_raw_response_wrapper(
files.content,
BinaryAPIResponse,
)


class AsyncFilesResourceWithRawResponse:
Expand All @@ -560,6 +652,10 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.delete = async_to_raw_response_wrapper(
files.delete,
)
self.content = async_to_custom_raw_response_wrapper(
files.content,
AsyncBinaryAPIResponse,
)


class FilesResourceWithStreamingResponse:
Expand All @@ -581,6 +677,10 @@ def __init__(self, files: FilesResource) -> None:
self.delete = to_streamed_response_wrapper(
files.delete,
)
self.content = to_custom_streamed_response_wrapper(
files.content,
StreamedBinaryAPIResponse,
)


class AsyncFilesResourceWithStreamingResponse:
Expand All @@ -602,3 +702,7 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.delete = async_to_streamed_response_wrapper(
files.delete,
)
self.content = async_to_custom_streamed_response_wrapper(
files.content,
AsyncStreamedBinaryAPIResponse,
)
33 changes: 0 additions & 33 deletions src/mixedbread/resources/parsing/__init__.py

This file was deleted.

Loading