From 8b0da45454d25c06d128a2c9c9db6f5a2f4d79ab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 03:14:41 +0000 Subject: [PATCH 1/5] chore(internal): codegen related update (#80) --- src/honcho/_client.py | 20 +++++++------- src/honcho/resources/apps/apps.py | 17 ++++++------ src/honcho/resources/apps/users/users.py | 34 +++++++++++++----------- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/src/honcho/_client.py b/src/honcho/_client.py index 6da443c..844ae11 100644 --- a/src/honcho/_client.py +++ b/src/honcho/_client.py @@ -8,7 +8,7 @@ import httpx -from . import _exceptions +from . import resources, _exceptions from ._qs import Querystring from ._types import ( NOT_GIVEN, @@ -31,7 +31,6 @@ SyncAPIClient, AsyncAPIClient, ) -from .resources.apps import apps __all__ = [ "ENVIRONMENTS", @@ -39,6 +38,7 @@ "Transport", "ProxiesTypes", "RequestOptions", + "resources", "Honcho", "AsyncHoncho", "Client", @@ -52,7 +52,7 @@ class Honcho(SyncAPIClient): - apps: apps.AppsResource + apps: resources.AppsResource with_raw_response: HonchoWithRawResponse with_streaming_response: HonchoWithStreamedResponse @@ -130,7 +130,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.apps = apps.AppsResource(self) + self.apps = resources.AppsResource(self) self.with_raw_response = HonchoWithRawResponse(self) self.with_streaming_response = HonchoWithStreamedResponse(self) @@ -244,7 +244,7 @@ def _make_status_error( class AsyncHoncho(AsyncAPIClient): - apps: apps.AsyncAppsResource + apps: resources.AsyncAppsResource with_raw_response: AsyncHonchoWithRawResponse with_streaming_response: AsyncHonchoWithStreamedResponse @@ -322,7 +322,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.apps = apps.AsyncAppsResource(self) + self.apps = resources.AsyncAppsResource(self) self.with_raw_response = AsyncHonchoWithRawResponse(self) self.with_streaming_response = AsyncHonchoWithStreamedResponse(self) @@ -437,22 +437,22 @@ def _make_status_error( class HonchoWithRawResponse: def __init__(self, client: Honcho) -> None: - self.apps = apps.AppsResourceWithRawResponse(client.apps) + self.apps = resources.AppsResourceWithRawResponse(client.apps) class AsyncHonchoWithRawResponse: def __init__(self, client: AsyncHoncho) -> None: - self.apps = apps.AsyncAppsResourceWithRawResponse(client.apps) + self.apps = resources.AsyncAppsResourceWithRawResponse(client.apps) class HonchoWithStreamedResponse: def __init__(self, client: Honcho) -> None: - self.apps = apps.AppsResourceWithStreamingResponse(client.apps) + self.apps = resources.AppsResourceWithStreamingResponse(client.apps) class AsyncHonchoWithStreamedResponse: def __init__(self, client: AsyncHoncho) -> None: - self.apps = apps.AsyncAppsResourceWithStreamingResponse(client.apps) + self.apps = resources.AsyncAppsResourceWithStreamingResponse(client.apps) Client = Honcho diff --git a/src/honcho/resources/apps/apps.py b/src/honcho/resources/apps/apps.py index 2138f32..cc5013e 100644 --- a/src/honcho/resources/apps/apps.py +++ b/src/honcho/resources/apps/apps.py @@ -6,6 +6,14 @@ import httpx +from .users import ( + UsersResource, + AsyncUsersResource, + UsersResourceWithRawResponse, + AsyncUsersResourceWithRawResponse, + UsersResourceWithStreamingResponse, + AsyncUsersResourceWithStreamingResponse, +) from ...types import app_create_params, app_update_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( @@ -21,14 +29,7 @@ async_to_streamed_response_wrapper, ) from ...types.app import App -from .users.users import ( - UsersResource, - AsyncUsersResource, - UsersResourceWithRawResponse, - AsyncUsersResourceWithRawResponse, - UsersResourceWithStreamingResponse, - AsyncUsersResourceWithStreamingResponse, -) +from .users.users import UsersResource, AsyncUsersResource from ..._base_client import make_request_options __all__ = ["AppsResource", "AsyncAppsResource"] diff --git a/src/honcho/resources/apps/users/users.py b/src/honcho/resources/apps/users/users.py index 77cb387..1c10672 100644 --- a/src/honcho/resources/apps/users/users.py +++ b/src/honcho/resources/apps/users/users.py @@ -6,12 +6,28 @@ import httpx +from .sessions import ( + SessionsResource, + AsyncSessionsResource, + SessionsResourceWithRawResponse, + AsyncSessionsResourceWithRawResponse, + SessionsResourceWithStreamingResponse, + AsyncSessionsResourceWithStreamingResponse, +) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( maybe_transform, async_maybe_transform, ) from ...._compat import cached_property +from .collections import ( + CollectionsResource, + AsyncCollectionsResource, + CollectionsResourceWithRawResponse, + AsyncCollectionsResourceWithRawResponse, + CollectionsResourceWithStreamingResponse, + AsyncCollectionsResourceWithStreamingResponse, +) from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( to_raw_response_wrapper, @@ -30,23 +46,9 @@ from ....pagination import SyncPage, AsyncPage from ....types.apps import user_list_params, user_create_params, user_update_params from ...._base_client import AsyncPaginator, make_request_options -from .sessions.sessions import ( - SessionsResource, - AsyncSessionsResource, - SessionsResourceWithRawResponse, - AsyncSessionsResourceWithRawResponse, - SessionsResourceWithStreamingResponse, - AsyncSessionsResourceWithStreamingResponse, -) +from .sessions.sessions import SessionsResource, AsyncSessionsResource from ....types.apps.user import User -from .collections.collections import ( - CollectionsResource, - AsyncCollectionsResource, - CollectionsResourceWithRawResponse, - AsyncCollectionsResourceWithRawResponse, - CollectionsResourceWithStreamingResponse, - AsyncCollectionsResourceWithStreamingResponse, -) +from .collections.collections import CollectionsResource, AsyncCollectionsResource __all__ = ["UsersResource", "AsyncUsersResource"] From a01befac4dca887e142a1385ddc056e519090582 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 03:22:05 +0000 Subject: [PATCH 2/5] chore(internal): codegen related update (#81) --- src/honcho/_client.py | 20 +++++++------- src/honcho/resources/apps/apps.py | 17 ++++++------ src/honcho/resources/apps/users/users.py | 34 +++++++++++------------- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/src/honcho/_client.py b/src/honcho/_client.py index 844ae11..6da443c 100644 --- a/src/honcho/_client.py +++ b/src/honcho/_client.py @@ -8,7 +8,7 @@ import httpx -from . import resources, _exceptions +from . import _exceptions from ._qs import Querystring from ._types import ( NOT_GIVEN, @@ -31,6 +31,7 @@ SyncAPIClient, AsyncAPIClient, ) +from .resources.apps import apps __all__ = [ "ENVIRONMENTS", @@ -38,7 +39,6 @@ "Transport", "ProxiesTypes", "RequestOptions", - "resources", "Honcho", "AsyncHoncho", "Client", @@ -52,7 +52,7 @@ class Honcho(SyncAPIClient): - apps: resources.AppsResource + apps: apps.AppsResource with_raw_response: HonchoWithRawResponse with_streaming_response: HonchoWithStreamedResponse @@ -130,7 +130,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.apps = resources.AppsResource(self) + self.apps = apps.AppsResource(self) self.with_raw_response = HonchoWithRawResponse(self) self.with_streaming_response = HonchoWithStreamedResponse(self) @@ -244,7 +244,7 @@ def _make_status_error( class AsyncHoncho(AsyncAPIClient): - apps: resources.AsyncAppsResource + apps: apps.AsyncAppsResource with_raw_response: AsyncHonchoWithRawResponse with_streaming_response: AsyncHonchoWithStreamedResponse @@ -322,7 +322,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.apps = resources.AsyncAppsResource(self) + self.apps = apps.AsyncAppsResource(self) self.with_raw_response = AsyncHonchoWithRawResponse(self) self.with_streaming_response = AsyncHonchoWithStreamedResponse(self) @@ -437,22 +437,22 @@ def _make_status_error( class HonchoWithRawResponse: def __init__(self, client: Honcho) -> None: - self.apps = resources.AppsResourceWithRawResponse(client.apps) + self.apps = apps.AppsResourceWithRawResponse(client.apps) class AsyncHonchoWithRawResponse: def __init__(self, client: AsyncHoncho) -> None: - self.apps = resources.AsyncAppsResourceWithRawResponse(client.apps) + self.apps = apps.AsyncAppsResourceWithRawResponse(client.apps) class HonchoWithStreamedResponse: def __init__(self, client: Honcho) -> None: - self.apps = resources.AppsResourceWithStreamingResponse(client.apps) + self.apps = apps.AppsResourceWithStreamingResponse(client.apps) class AsyncHonchoWithStreamedResponse: def __init__(self, client: AsyncHoncho) -> None: - self.apps = resources.AsyncAppsResourceWithStreamingResponse(client.apps) + self.apps = apps.AsyncAppsResourceWithStreamingResponse(client.apps) Client = Honcho diff --git a/src/honcho/resources/apps/apps.py b/src/honcho/resources/apps/apps.py index cc5013e..2138f32 100644 --- a/src/honcho/resources/apps/apps.py +++ b/src/honcho/resources/apps/apps.py @@ -6,14 +6,6 @@ import httpx -from .users import ( - UsersResource, - AsyncUsersResource, - UsersResourceWithRawResponse, - AsyncUsersResourceWithRawResponse, - UsersResourceWithStreamingResponse, - AsyncUsersResourceWithStreamingResponse, -) from ...types import app_create_params, app_update_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( @@ -29,7 +21,14 @@ async_to_streamed_response_wrapper, ) from ...types.app import App -from .users.users import UsersResource, AsyncUsersResource +from .users.users import ( + UsersResource, + AsyncUsersResource, + UsersResourceWithRawResponse, + AsyncUsersResourceWithRawResponse, + UsersResourceWithStreamingResponse, + AsyncUsersResourceWithStreamingResponse, +) from ..._base_client import make_request_options __all__ = ["AppsResource", "AsyncAppsResource"] diff --git a/src/honcho/resources/apps/users/users.py b/src/honcho/resources/apps/users/users.py index 1c10672..77cb387 100644 --- a/src/honcho/resources/apps/users/users.py +++ b/src/honcho/resources/apps/users/users.py @@ -6,28 +6,12 @@ import httpx -from .sessions import ( - SessionsResource, - AsyncSessionsResource, - SessionsResourceWithRawResponse, - AsyncSessionsResourceWithRawResponse, - SessionsResourceWithStreamingResponse, - AsyncSessionsResourceWithStreamingResponse, -) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._utils import ( maybe_transform, async_maybe_transform, ) from ...._compat import cached_property -from .collections import ( - CollectionsResource, - AsyncCollectionsResource, - CollectionsResourceWithRawResponse, - AsyncCollectionsResourceWithRawResponse, - CollectionsResourceWithStreamingResponse, - AsyncCollectionsResourceWithStreamingResponse, -) from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( to_raw_response_wrapper, @@ -46,9 +30,23 @@ from ....pagination import SyncPage, AsyncPage from ....types.apps import user_list_params, user_create_params, user_update_params from ...._base_client import AsyncPaginator, make_request_options -from .sessions.sessions import SessionsResource, AsyncSessionsResource +from .sessions.sessions import ( + SessionsResource, + AsyncSessionsResource, + SessionsResourceWithRawResponse, + AsyncSessionsResourceWithRawResponse, + SessionsResourceWithStreamingResponse, + AsyncSessionsResourceWithStreamingResponse, +) from ....types.apps.user import User -from .collections.collections import CollectionsResource, AsyncCollectionsResource +from .collections.collections import ( + CollectionsResource, + AsyncCollectionsResource, + CollectionsResourceWithRawResponse, + AsyncCollectionsResourceWithRawResponse, + CollectionsResourceWithStreamingResponse, + AsyncCollectionsResourceWithStreamingResponse, +) __all__ = ["UsersResource", "AsyncUsersResource"] From 510448166eb83ba17f4da2bcacaf7575cbba63fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 03:24:19 +0000 Subject: [PATCH 3/5] docs(readme): example snippet for client context manager (#85) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 200f918..aca7109 100644 --- a/README.md +++ b/README.md @@ -379,6 +379,16 @@ client.with_options(http_client=DefaultHttpxClient(...)) By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. +```py +from honcho import Honcho + +with Honcho() as client: + # make requests here + ... + +# HTTP client is now closed +``` + ## Versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: From 5395ecaff9e7fcfec1cfc827b21607313cfc911f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 03:19:21 +0000 Subject: [PATCH 4/5] chore(internal): codegen related update (#86) --- tests/test_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 37451fe..cad46ca 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -348,11 +348,11 @@ def test_default_query_option(self) -> None: FinalRequestOptions( method="get", url="/foo", - params={"foo": "baz", "query_param": "overriden"}, + params={"foo": "baz", "query_param": "overridden"}, ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} def test_request_extra_json(self) -> None: request = self.client._build_request( @@ -1118,11 +1118,11 @@ def test_default_query_option(self) -> None: FinalRequestOptions( method="get", url="/foo", - params={"foo": "baz", "query_param": "overriden"}, + params={"foo": "baz", "query_param": "overridden"}, ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} def test_request_extra_json(self) -> None: request = self.client._build_request( From fc5aa72434e65a91aa69ed7081ff33bad6ec9bf1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 03:19:37 +0000 Subject: [PATCH 5/5] release: 0.0.20 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ pyproject.toml | 2 +- src/honcho/_version.py | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f79d778..22b1a1e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.19" + ".": "0.0.20" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c51742..0cf72d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.0.20 (2024-12-18) + +Full Changelog: [v0.0.19...v0.0.20](https://github.com/plastic-labs/honcho-python/compare/v0.0.19...v0.0.20) + +### Chores + +* **internal:** codegen related update ([#80](https://github.com/plastic-labs/honcho-python/issues/80)) ([8b0da45](https://github.com/plastic-labs/honcho-python/commit/8b0da45454d25c06d128a2c9c9db6f5a2f4d79ab)) +* **internal:** codegen related update ([#81](https://github.com/plastic-labs/honcho-python/issues/81)) ([a01befa](https://github.com/plastic-labs/honcho-python/commit/a01befac4dca887e142a1385ddc056e519090582)) +* **internal:** codegen related update ([#86](https://github.com/plastic-labs/honcho-python/issues/86)) ([5395eca](https://github.com/plastic-labs/honcho-python/commit/5395ecaff9e7fcfec1cfc827b21607313cfc911f)) + + +### Documentation + +* **readme:** example snippet for client context manager ([#85](https://github.com/plastic-labs/honcho-python/issues/85)) ([5104481](https://github.com/plastic-labs/honcho-python/commit/510448166eb83ba17f4da2bcacaf7575cbba63fd)) + ## 0.0.19 (2024-12-16) Full Changelog: [v0.0.18...v0.0.19](https://github.com/plastic-labs/honcho-python/compare/v0.0.18...v0.0.19) diff --git a/pyproject.toml b/pyproject.toml index 60e8a83..82dacb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "honcho-ai" -version = "0.0.19" +version = "0.0.20" description = "The official Python library for the honcho API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/honcho/_version.py b/src/honcho/_version.py index cbd11a5..3118251 100644 --- a/src/honcho/_version.py +++ b/src/honcho/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "honcho" -__version__ = "0.0.19" # x-release-please-version +__version__ = "0.0.20" # x-release-please-version