From 5e166ca6faa805dd041e31871f601215a032744f 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 1/2] 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 0b9b9ed80e7641495d2562629861c7f817117a21 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:53 +0000 Subject: [PATCH 2/2] release: 0.2.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/mixedbread/_version.py | 2 +- 4 files changed, 11 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/CHANGELOG.md b/CHANGELOG.md index a8baf23f..908548a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.2.0 (2025-04-08) + +Full Changelog: [v0.1.0...v0.2.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.1.0...v0.2.0) + +### Features + +* **api:** update via SDK Studio ([#194](https://github.com/mixedbread-ai/mixedbread-python/issues/194)) ([5e166ca](https://github.com/mixedbread-ai/mixedbread-python/commit/5e166ca6faa805dd041e31871f601215a032744f)) + ## 0.1.0 (2025-04-04) Full Changelog: [v0.1.0-alpha.42...v0.1.0](https://github.com/mixedbread-ai/mixedbread-python/compare/v0.1.0-alpha.42...v0.1.0) 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