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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.6.0"
".": "0.7.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: 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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.7.0 (2025-06-16)

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

### Features

* **api:** update via SDK Studio ([6859024](https://github.com/mixedbread-ai/mixedbread-python/commit/6859024cb7bd569462d50c83e84ca8864cd4fb23))


### Chores

* update the vs identifiers ([319e732](https://github.com/mixedbread-ai/mixedbread-python/commit/319e732d66ce6f793fb7ddd783d2fc61c4277801))

## 0.6.0 (2025-06-13)

Full Changelog: [v0.5.0...v0.6.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.5.0...v0.6.0)
Expand Down
11 changes: 11 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ Types:

```python
from mixedbread.types.vector_stores import (
RerankConfig,
ScoredVectorStoreFile,
VectorStoreFileStatus,
VectorStoreFile,
FileDeleteResponse,
FileSearchResponse,
Expand Down Expand Up @@ -179,6 +181,9 @@ from mixedbread.types import (
DataSource,
DataSourceOauth2Params,
DataSourceType,
LinearDataSource,
NotionDataSource,
Oauth2Params,
DataSourceDeleteResponse,
)
```
Expand Down Expand Up @@ -223,3 +228,9 @@ Methods:
- <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>

# Chat

Methods:

- <code title="post /v1/chat/completions">client.chat.<a href="./src/mixedbread/resources/chat.py">create_completion</a>() -> object</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.6.0"
version = "0.7.0"
description = "The official Python library for the Mixedbread API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
10 changes: 9 additions & 1 deletion 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, 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 (
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
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.6.0" # x-release-please-version
__version__ = "0.7.0" # x-release-please-version
14 changes: 14 additions & 0 deletions src/mixedbread/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -100,4 +108,10 @@
"AsyncAPIKeysResourceWithRawResponse",
"APIKeysResourceWithStreamingResponse",
"AsyncAPIKeysResourceWithStreamingResponse",
"ChatResource",
"AsyncChatResource",
"ChatResourceWithRawResponse",
"AsyncChatResourceWithRawResponse",
"ChatResourceWithStreamingResponse",
"AsyncChatResourceWithStreamingResponse",
]
164 changes: 164 additions & 0 deletions src/mixedbread/resources/chat.py
Original file line number Diff line number Diff line change
@@ -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,
)
Loading