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
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.1"
".": "0.4.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 32
configured_endpoints: 49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mixedbread%2Fmixedbread-82c2c1c322149cd73b2e8e45f475919b941752a89e74464ccecd1aee9352e9be.yml
openapi_spec_hash: f6661e9fafda26e7e9f3fc06739a33ad
config_hash: 6a7c1faa96b022a6959d720d7957eade
config_hash: 0619498f633d6a0d92ae15b21fd06d89
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.4.0 (2025-05-26)

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

### Features

* **api:** update via SDK Studio ([c504aa4](https://github.com/mixedbread-ai/mixedbread-python/commit/c504aa4e20404af5c2f66f21ee55ef04af7092c8))
* **api:** update via SDK Studio ([19da790](https://github.com/mixedbread-ai/mixedbread-python/commit/19da79023946597097d740650d1ff3af76839201))


### Chores

* **ci:** fix installation instructions ([3b8060d](https://github.com/mixedbread-ai/mixedbread-python/commit/3b8060de754d0b46c4aed0fb7a1f2fc20584d53d))
* **ci:** upload sdks to package manager ([360dea4](https://github.com/mixedbread-ai/mixedbread-python/commit/360dea48d1c7d36ddb7e1a932d9a9ec759441a57))
* **docs:** grammar improvements ([e3faf93](https://github.com/mixedbread-ai/mixedbread-python/commit/e3faf933f1278eec744ffdbe59202388c756791b))

## 0.3.1 (2025-05-10)

Full Changelog: [v0.3.0...v0.3.1](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.3.0...v0.3.1)
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand Down
86 changes: 83 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -96,7 +104,7 @@ Methods:
Types:

```python
from mixedbread.types import FileObject, FileDeleteResponse
from mixedbread.types import FileObject, PaginationWithTotal, FileDeleteResponse
```

Methods:
Expand Down Expand Up @@ -142,7 +150,7 @@ Methods:
Types:

```python
from mixedbread.types.extractions import ExtractionResult
from mixedbread.types.extractions import ExtractionResult, ImageURLInput, TextInput
```

Methods:
Expand All @@ -151,6 +159,78 @@ Methods:

# Embeddings

Types:

```python
from mixedbread.types import EncodingFormat, ObjectType
```

Methods:

- <code title="post /v1/embeddings">client.embeddings.<a href="./src/mixedbread/resources/embeddings.py">create</a>(\*\*<a href="src/mixedbread/types/embedding_create_params.py">params</a>) -> <a href="./src/mixedbread/types/embedding_create_response.py">EmbeddingCreateResponse</a></code>

# Chat

Types:

```python
from mixedbread.types import ChatCreateCompletionResponse
```

Methods:

- <code title="post /v1/chat/completions">client.chat.<a href="./src/mixedbread/resources/chat.py">create_completion</a>() -> <a href="./src/mixedbread/types/chat_create_completion_response.py">object</a></code>

# DataSources

Types:

```python
from mixedbread.types import (
DataSource,
DataSourceOauth2Params,
DataSourceType,
DataSourceDeleteResponse,
)
```

Methods:

- <code title="post /v1/data_sources/">client.data_sources.<a href="./src/mixedbread/resources/data_sources/data_sources.py">create</a>(\*\*<a href="src/mixedbread/types/data_source_create_params.py">params</a>) -> <a href="./src/mixedbread/types/data_source.py">DataSource</a></code>
- <code title="get /v1/data_sources/{data_source_id}">client.data_sources.<a href="./src/mixedbread/resources/data_sources/data_sources.py">retrieve</a>(data_source_id) -> <a href="./src/mixedbread/types/data_source.py">DataSource</a></code>
- <code title="put /v1/data_sources/{data_source_id}">client.data_sources.<a href="./src/mixedbread/resources/data_sources/data_sources.py">update</a>(data_source_id, \*\*<a href="src/mixedbread/types/data_source_update_params.py">params</a>) -> <a href="./src/mixedbread/types/data_source.py">DataSource</a></code>
- <code title="get /v1/data_sources/">client.data_sources.<a href="./src/mixedbread/resources/data_sources/data_sources.py">list</a>(\*\*<a href="src/mixedbread/types/data_source_list_params.py">params</a>) -> <a href="./src/mixedbread/types/data_source.py">SyncLimitOffset[DataSource]</a></code>
- <code title="delete /v1/data_sources/{data_source_id}">client.data_sources.<a href="./src/mixedbread/resources/data_sources/data_sources.py">delete</a>(data_source_id) -> <a href="./src/mixedbread/types/data_source_delete_response.py">DataSourceDeleteResponse</a></code>

## Connectors

Types:

```python
from mixedbread.types.data_sources import DataSourceConnector, ConnectorDeleteResponse
```

Methods:

- <code title="post /v1/data_sources/{data_source_id}/connectors">client.data_sources.connectors.<a href="./src/mixedbread/resources/data_sources/connectors.py">create</a>(data_source_id, \*\*<a href="src/mixedbread/types/data_sources/connector_create_params.py">params</a>) -> <a href="./src/mixedbread/types/data_sources/data_source_connector.py">DataSourceConnector</a></code>
- <code title="get /v1/data_sources/{data_source_id}/connectors/{connector_id}">client.data_sources.connectors.<a href="./src/mixedbread/resources/data_sources/connectors.py">retrieve</a>(connector_id, \*, data_source_id) -> <a href="./src/mixedbread/types/data_sources/data_source_connector.py">DataSourceConnector</a></code>
- <code title="put /v1/data_sources/{data_source_id}/connectors/{connector_id}">client.data_sources.connectors.<a href="./src/mixedbread/resources/data_sources/connectors.py">update</a>(connector_id, \*, data_source_id, \*\*<a href="src/mixedbread/types/data_sources/connector_update_params.py">params</a>) -> <a href="./src/mixedbread/types/data_sources/data_source_connector.py">DataSourceConnector</a></code>
- <code title="get /v1/data_sources/{data_source_id}/connectors">client.data_sources.connectors.<a href="./src/mixedbread/resources/data_sources/connectors.py">list</a>(data_source_id, \*\*<a href="src/mixedbread/types/data_sources/connector_list_params.py">params</a>) -> <a href="./src/mixedbread/types/data_sources/data_source_connector.py">SyncLimitOffset[DataSourceConnector]</a></code>
- <code title="delete /v1/data_sources/{data_source_id}/connectors/{connector_id}">client.data_sources.connectors.<a href="./src/mixedbread/resources/data_sources/connectors.py">delete</a>(connector_id, \*, data_source_id) -> <a href="./src/mixedbread/types/data_sources/connector_delete_response.py">ConnectorDeleteResponse</a></code>

# APIKeys

Types:

```python
from mixedbread.types import APIKey, APIKeyCreated, APIKeyDeleteResponse
```

Methods:

- <code title="post /v1/api-keys">client.api_keys.<a href="./src/mixedbread/resources/api_keys.py">create</a>(\*\*<a href="src/mixedbread/types/api_key_create_params.py">params</a>) -> <a href="./src/mixedbread/types/api_key_created.py">APIKeyCreated</a></code>
- <code title="get /v1/api-keys/{api_key_id}">client.api_keys.<a href="./src/mixedbread/resources/api_keys.py">retrieve</a>(api_key_id) -> <a href="./src/mixedbread/types/api_key.py">APIKey</a></code>
- <code title="get /v1/api-keys">client.api_keys.<a href="./src/mixedbread/resources/api_keys.py">list</a>(\*\*<a href="src/mixedbread/types/api_key_list_params.py">params</a>) -> <a href="./src/mixedbread/types/api_key.py">SyncLimitOffset[APIKey]</a></code>
- <code title="delete /v1/api-keys/{api_key_id}">client.api_keys.<a href="./src/mixedbread/resources/api_keys.py">delete</a>(api_key_id) -> <a href="./src/mixedbread/types/api_key_delete_response.py">APIKeyDeleteResponse</a></code>
- <code title="post /v1/api-keys/{api_key_id}/reroll">client.api_keys.<a href="./src/mixedbread/resources/api_keys.py">reroll</a>(api_key_id) -> <a href="./src/mixedbread/types/api_key_created.py">APIKeyCreated</a></code>
- <code title="post /v1/api-keys/{api_key_id}/revoke">client.api_keys.<a href="./src/mixedbread/resources/api_keys.py">revoke</a>(api_key_id) -> <a href="./src/mixedbread/types/api_key.py">APIKey</a></code>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mixedbread"
version = "0.3.1"
version = "0.4.0"
description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
25 changes: 25 additions & 0 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
@@ -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: pip install 'https://pkg.stainless.com/s/mixedbread-python/$SHA'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
fi
40 changes: 29 additions & 11 deletions src/mixedbread/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from .resources import 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 (
Expand All @@ -48,7 +48,9 @@
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

Expand Down Expand Up @@ -76,6 +78,9 @@ 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
with_streaming_response: MixedbreadWithStreamedResponse

Expand Down Expand Up @@ -162,6 +167,9 @@ 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)
self.with_streaming_response = MixedbreadWithStreamedResponse(self)

Expand Down Expand Up @@ -246,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,
Expand Down Expand Up @@ -437,6 +441,9 @@ 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
with_streaming_response: AsyncMixedbreadWithStreamedResponse

Expand Down Expand Up @@ -523,6 +530,9 @@ 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)
self.with_streaming_response = AsyncMixedbreadWithStreamedResponse(self)

Expand Down Expand Up @@ -607,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,
Expand Down Expand Up @@ -799,6 +805,9 @@ 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)

self.embed = to_raw_response_wrapper(
client.embed,
Expand All @@ -818,6 +827,9 @@ 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)

self.embed = async_to_raw_response_wrapper(
client.embed,
Expand All @@ -837,6 +849,9 @@ 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)

self.embed = to_streamed_response_wrapper(
client.embed,
Expand All @@ -856,6 +871,9 @@ 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)

self.embed = async_to_streamed_response_wrapper(
client.embed,
Expand Down
2 changes: 1 addition & 1 deletion src/mixedbread/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "mixedbread"
__version__ = "0.3.1" # x-release-please-version
__version__ = "0.4.0" # x-release-please-version
Loading
Loading