Skip to content

Commit 2893a05

Browse files
committed
feat: allow passing single endpoint
1 parent 3dd371c commit 2893a05

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## Changelog 🔄
22
All notable changes to `isaacus-sagemaker` will be documented here. This project adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
33

4+
## [0.1.4] - 2025-10-28
5+
### Added
6+
- Allowed for passing of a single endpoint as the `endpoints` argument to both `IsaacusSageMakerRuntimeHTTPClient` and `AsyncIsaacusSageMakerRuntimeHTTPClient`.
7+
48
## [0.1.3] - 2025-10-27
59
### Changed
610
- Updated README to link to Isaacus' AWS Marketplace listings.
@@ -24,6 +28,7 @@ All notable changes to `isaacus-sagemaker` will be documented here. This project
2428
### Added
2529
- Initial release of `isaacus-sagemaker`, providing synchronous and asynchronous HTTP clients for interacting with Isaacus models deployed on AWS SageMaker via the SageMaker Runtime InvokeEndpoint API.
2630

31+
[0.1.4]: https://github.com/isaacus-dev/isaacus-sagemaker-python/compare/v0.1.3...v0.1.4
2732
[0.1.3]: https://github.com/isaacus-dev/isaacus-sagemaker-python/compare/v0.1.2...v0.1.3
2833
[0.1.2]: https://github.com/isaacus-dev/isaacus-sagemaker-python/compare/v0.1.1...v0.1.2
2934
[0.1.1]: https://github.com/isaacus-dev/isaacus-sagemaker-python/compare/v0.1.0...v0.1.1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class IsaacusSageMakerRuntimeHTTPClient(httpx.Client):
9292
This client extends `httpx.Client`.
9393
9494
Arguments:
95-
`endpoints` (`Sequence[IsaacusSageMakerRuntimeEndpoint]`): A sequence of SageMaker endpoints to route requests to.
95+
`endpoints` (`Sequence[IsaacusSageMakerRuntimeEndpoint] | IsaacusSageMakerRuntimeEndpoint`): A sequence of SageMaker endpoints to route requests to or a single endpoint.
9696
`region` (`str`, optional): The AWS region where the SageMaker endpoints are deployed. Overriden by any region specified at the endpoint-level. Defaults to `None`, in which case the AWS SDK's default region resolution is used.
9797
`profile` (`str`, optional): The AWS profile to use when accessing the SageMaker endpoints. Overriden by any profile specified at the endpoint-level. Defaults to `None`, in which case the AWS SDK's default profile resolution is used.
9898
`boto_session_kwargs` (`Dict[str, Any]`, optional): Additional keyword arguments to pass to the `boto3.Session` constructor when creating the AWS session. Defaults to `None`.
@@ -109,7 +109,7 @@ class AsyncIsaacusSageMakerRuntimeHTTPClient(httpx.AsyncClient):
109109
This client extends `httpx.AsyncClient`.
110110
111111
Arguments:
112-
`endpoints` (`Sequence[IsaacusSageMakerRuntimeEndpoint]`): A sequence of SageMaker endpoints to route requests to.
112+
`endpoints` (`Sequence[IsaacusSageMakerRuntimeEndpoint] | IsaacusSageMakerRuntimeEndpoint`): A sequence of SageMaker endpoints to route requests to or a single endpoint.
113113
`region` (`str`, optional): The AWS region where the SageMaker endpoints are deployed. Overriden by any region specified at the endpoint-level. Defaults to `None`, in which case the AWS SDK's default region resolution is used.
114114
`profile` (`str`, optional): The AWS profile to use when accessing the SageMaker endpoints. Overriden by any profile specified at the endpoint-level. Defaults to `None`, in which case the AWS SDK's default profile resolution is used.
115115
`boto_session_kwargs` (`Dict[str, Any]`, optional): Additional keyword arguments to pass to the `boto3.Session` constructor when creating the AWS session. Defaults to `None`.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "isaacus-sagemaker"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
authors = [
55
{name="Isaacus", email="support@isaacus.com"},
66
]

src/isaacus_sagemaker/runtime_client.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class IsaacusSageMakerRuntimeHTTPClient(httpx.Client):
200200
This client extends `httpx.AsyncClient`.
201201
202202
Arguments:
203-
`endpoints` (`Sequence[IsaacusSageMakerRuntimeEndpoint]`): A sequence of SageMaker endpoints to route requests to.
203+
`endpoints` (`Sequence[IsaacusSageMakerRuntimeEndpoint] | IsaacusSageMakerRuntimeEndpoint`): A sequence of SageMaker endpoints to route requests to or a single endpoint.
204204
`region` (`str`, optional): The AWS region where the SageMaker endpoints are deployed. Overriden by any region specified at the endpoint-level. Defaults to `None`, in which case the AWS SDK's default region resolution is used.
205205
`profile` (`str`, optional): The AWS profile to use when accessing the SageMaker endpoints. Overriden by any profile specified at the endpoint-level. Defaults to `None`, in which case the AWS SDK's default profile resolution is used.
206206
`boto_session_kwargs` (`Dict[str, Any]`, optional): Additional keyword arguments to pass to the `boto3.Session` constructor when creating the AWS session. Defaults to `None`.
@@ -210,13 +210,16 @@ class IsaacusSageMakerRuntimeHTTPClient(httpx.Client):
210210
def __init__(
211211
self,
212212
*,
213-
endpoints: Sequence[IsaacusSageMakerRuntimeEndpoint],
213+
endpoints: Union[Sequence[IsaacusSageMakerRuntimeEndpoint], IsaacusSageMakerRuntimeEndpoint],
214214
region: Optional[str] = None,
215215
profile: Optional[str] = None,
216216
boto_session_kwargs: Optional[Dict[str, Any]] = None,
217217
**httpx_kwargs: Any,
218218
) -> None:
219219
super().__init__(**httpx_kwargs)
220+
221+
if isinstance(endpoints, IsaacusSageMakerRuntimeEndpoint):
222+
endpoints = [endpoints]
220223

221224
self._router = Router(endpoints)
222225

@@ -261,7 +264,7 @@ class AsyncIsaacusSageMakerRuntimeHTTPClient(httpx.AsyncClient):
261264
This client extends `httpx.Client`.
262265
263266
Arguments:
264-
`endpoints` (`Sequence[IsaacusSageMakerRuntimeEndpoint]`): A sequence of SageMaker endpoints to route requests to.
267+
`endpoints` (`Sequence[IsaacusSageMakerRuntimeEndpoint] | IsaacusSageMakerRuntimeEndpoint`): A sequence of SageMaker endpoints to route requests to or a single endpoint.
265268
`region` (`str`, optional): The AWS region where the SageMaker endpoints are deployed. Overriden by any region specified at the endpoint-level. Defaults to `None`, in which case the AWS SDK's default region resolution is used.
266269
`profile` (`str`, optional): The AWS profile to use when accessing the SageMaker endpoints. Overriden by any profile specified at the endpoint-level. Defaults to `None`, in which case the AWS SDK's default profile resolution is used.
267270
`boto_session_kwargs` (`Dict[str, Any]`, optional): Additional keyword arguments to pass to the `boto3.Session` constructor when creating the AWS session. Defaults to `None`.
@@ -271,13 +274,16 @@ class AsyncIsaacusSageMakerRuntimeHTTPClient(httpx.AsyncClient):
271274
def __init__(
272275
self,
273276
*,
274-
endpoints: Sequence[IsaacusSageMakerRuntimeEndpoint],
277+
endpoints: Union[Sequence[IsaacusSageMakerRuntimeEndpoint], IsaacusSageMakerRuntimeEndpoint],
275278
region: Optional[str] = None,
276279
profile: Optional[str] = None,
277280
boto_session_kwargs: Optional[Dict[str, Any]] = None,
278281
**httpx_kwargs: Any,
279282
) -> None:
280283
super().__init__(**httpx_kwargs)
284+
285+
if isinstance(endpoints, IsaacusSageMakerRuntimeEndpoint):
286+
endpoints = [endpoints]
281287

282288
self._router = Router(endpoints)
283289

0 commit comments

Comments
 (0)