Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.
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.4.1"
".": "0.5.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/miru-ml%2Fmiru-server-d5d0de741a61bae4e957197c6fb0859ee5880ddab98616469f4414dc373c9d7f.yml
openapi_spec_hash: 10d91729a0e0430fd2a6c68b2c81f886
config_hash: 568f270a0ae3182575201912161a09cf
config_hash: 12fa4b9e99bf5317506a12aa9fecf73b
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.5.0 (2025-10-07)

Full Changelog: [v0.4.1...v0.5.0](https://github.com/miruml/python-server-sdk/compare/v0.4.1...v0.5.0)

### Features

* **api:** uat environment ([67e2b55](https://github.com/miruml/python-server-sdk/commit/67e2b5530fadfbd61d67e85d4fc5b4c363558fd9))

## 0.4.1 (2025-10-05)

Full Changelog: [v0.4.1-beta.3...v0.4.1](https://github.com/miruml/python-server-sdk/compare/v0.4.1-beta.3...v0.4.1)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ from miru_server_sdk import Miru

client = Miru(
api_key=os.environ.get("MIRU_SERVER_API_KEY"), # This is the default and can be omitted
# or 'production' | 'local'; defaults to "production".
environment="staging",
# or 'prod' | 'staging' | 'local'; defaults to "prod".
environment="uat",
)

config_instance = client.config_instances.retrieve(
Expand All @@ -56,8 +56,8 @@ from miru_server_sdk import AsyncMiru

client = AsyncMiru(
api_key=os.environ.get("MIRU_SERVER_API_KEY"), # This is the default and can be omitted
# or 'production' | 'local'; defaults to "production".
environment="staging",
# or 'prod' | 'staging' | 'local'; defaults to "prod".
environment="uat",
)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "miru_server_sdk"
version = "0.4.1"
version = "0.5.0"
description = "The official Python library for the miru API"
dynamic = ["readme"]
license = "MIT"
Expand Down
19 changes: 10 additions & 9 deletions src/miru_server_sdk/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
]

ENVIRONMENTS: Dict[str, str] = {
"production": "https://configs.api.miruml.com/v1",
"prod": "https://configs.api.miruml.com/v1",
"uat": "https://uat.api.miruml.com/v1",
"staging": "https://configs.dev.api.miruml.com/v1",
"local": "http://localhost:8080/v1",
}
Expand All @@ -63,15 +64,15 @@ class Miru(SyncAPIClient):
host: str
version: str

_environment: Literal["production", "staging", "local"] | NotGiven
_environment: Literal["prod", "uat", "staging", "local"] | NotGiven

def __init__(
self,
*,
api_key: str | None = None,
host: str | None = None,
version: str | None = None,
environment: Literal["production", "staging", "local"] | NotGiven = not_given,
environment: Literal["prod", "uat", "staging", "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,
Expand Down Expand Up @@ -133,7 +134,7 @@ def __init__(
elif base_url_env is not None:
base_url = base_url_env
else:
self._environment = environment = "production"
self._environment = environment = "prod"

try:
base_url = ENVIRONMENTS[environment]
Expand Down Expand Up @@ -185,7 +186,7 @@ def copy(
api_key: str | None = None,
host: str | None = None,
version: str | None = None,
environment: Literal["production", "staging", "local"] | None = None,
environment: Literal["prod", "uat", "staging", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
Expand Down Expand Up @@ -284,15 +285,15 @@ class AsyncMiru(AsyncAPIClient):
host: str
version: str

_environment: Literal["production", "staging", "local"] | NotGiven
_environment: Literal["prod", "uat", "staging", "local"] | NotGiven

def __init__(
self,
*,
api_key: str | None = None,
host: str | None = None,
version: str | None = None,
environment: Literal["production", "staging", "local"] | NotGiven = not_given,
environment: Literal["prod", "uat", "staging", "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,
Expand Down Expand Up @@ -354,7 +355,7 @@ def __init__(
elif base_url_env is not None:
base_url = base_url_env
else:
self._environment = environment = "production"
self._environment = environment = "prod"

try:
base_url = ENVIRONMENTS[environment]
Expand Down Expand Up @@ -406,7 +407,7 @@ def copy(
api_key: str | None = None,
host: str | None = None,
version: str | None = None,
environment: Literal["production", "staging", "local"] | None = None,
environment: Literal["prod", "uat", "staging", "local"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
Expand Down
2 changes: 1 addition & 1 deletion src/miru_server_sdk/_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__ = "miru_server_sdk"
__version__ = "0.4.1" # x-release-please-version
__version__ = "0.5.0" # x-release-please-version
10 changes: 4 additions & 6 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ def test_base_url_env(self) -> None:
# explicit environment arg requires explicitness
with update_env(MIRU_BASE_URL="http://localhost:5000/from/env"):
with pytest.raises(ValueError, match=r"you must pass base_url=None"):
Miru(api_key=api_key, _strict_response_validation=True, environment="production")
Miru(api_key=api_key, _strict_response_validation=True, environment="prod")

client = Miru(base_url=None, api_key=api_key, _strict_response_validation=True, environment="production")
client = Miru(base_url=None, api_key=api_key, _strict_response_validation=True, environment="prod")
assert str(client.base_url).startswith("https://configs.api.miruml.com/v1")

@pytest.mark.parametrize(
Expand Down Expand Up @@ -1366,11 +1366,9 @@ def test_base_url_env(self) -> None:
# explicit environment arg requires explicitness
with update_env(MIRU_BASE_URL="http://localhost:5000/from/env"):
with pytest.raises(ValueError, match=r"you must pass base_url=None"):
AsyncMiru(api_key=api_key, _strict_response_validation=True, environment="production")
AsyncMiru(api_key=api_key, _strict_response_validation=True, environment="prod")

client = AsyncMiru(
base_url=None, api_key=api_key, _strict_response_validation=True, environment="production"
)
client = AsyncMiru(base_url=None, api_key=api_key, _strict_response_validation=True, environment="prod")
assert str(client.base_url).startswith("https://configs.api.miruml.com/v1")

@pytest.mark.parametrize(
Expand Down