diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 0000000..a0f82a7 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,31 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to PyPI in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/AgentbaseHQ/agentbase-python/actions/workflows/publish-pypi.yml +name: Publish PyPI +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Publish to PyPI + run: | + bash ./bin/publish-pypi + env: + PYPI_TOKEN: ${{ secrets.AGENTBASE_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..98cfb64 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,21 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'AgentbaseHQ/agentbase-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + PYPI_TOKEN: ${{ secrets.AGENTBASE_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..3d2ac0b --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index e4a2907..6b0570c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 3 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/agentbase%2Fagentbase-89d6a8ac685cda7f8852372375d3cfcf973303a3f9a2427611a80612ec810bdd.yml openapi_spec_hash: 8d81d4a97aec02004be2289ff4a35baf -config_hash: 1646f172d80693aae0c2967f96e4c4d0 +config_hash: 83d0e670ca234150b5b1f0656d707073 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0d8d2c5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +## 0.1.0 (2025-09-22) + +Full Changelog: [v0.0.1...v0.1.0](https://github.com/AgentbaseHQ/agentbase-python/compare/v0.0.1...v0.1.0) + +### Chores + +* configure new SDK language ([2e448ce](https://github.com/AgentbaseHQ/agentbase-python/commit/2e448ce075c5a14429adf3f0577fd1f357ed9f4f)) +* update SDK settings ([812f1a4](https://github.com/AgentbaseHQ/agentbase-python/commit/812f1a4361f2319ea3339fa806c9e46c0ee1ebb2)) +* update SDK settings ([f2fe6b8](https://github.com/AgentbaseHQ/agentbase-python/commit/f2fe6b84d51c36039583b2993fca76c3ad4f6125)) +* update SDK settings ([cc64773](https://github.com/AgentbaseHQ/agentbase-python/commit/cc64773a3632a48301cdf7e505015d317fbc5aec)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f30b65..f6cf417 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```sh -$ pip install git+ssh://git@github.com/stainless-sdks/agentbase-python.git +$ pip install git+ssh://git@github.com/AgentbaseHQ/agentbase-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -120,7 +120,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/agentbase-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/AgentbaseHQ/agentbase-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index 682f40e..041ab4d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Agentbase Python API library -[![PyPI version](https://img.shields.io/pypi/v/agentbase.svg?label=pypi%20(stable))](https://pypi.org/project/agentbase/) +[![PyPI version](https://img.shields.io/pypi/v/agentbase-sdk.svg?label=pypi%20(stable))](https://pypi.org/project/agentbase-sdk/) The Agentbase Python library provides convenient access to the Agentbase REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, @@ -16,13 +16,10 @@ The full API of this library can be found in [api.md](api.md). ## Installation ```sh -# install from this staging repo -pip install git+ssh://git@github.com/stainless-sdks/agentbase-python.git +# install from PyPI +pip install agentbase-sdk ``` -> [!NOTE] -> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install agentbase` - ## Usage The full API of this library can be found in [api.md](api.md). @@ -77,8 +74,8 @@ By default, the async client uses `httpx` for HTTP requests. However, for improv You can enable this by installing `aiohttp`: ```sh -# install from this staging repo -pip install 'agentbase[aiohttp] @ git+ssh://git@github.com/stainless-sdks/agentbase-python.git' +# install from PyPI +pip install agentbase-sdk[aiohttp] ``` Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: @@ -279,9 +276,9 @@ client = response.parse() # get the object that `run_agent()` would have return print(client) ``` -These methods return an [`APIResponse`](https://github.com/stainless-sdks/agentbase-python/tree/main/src/agentbase/_response.py) object. +These methods return an [`APIResponse`](https://github.com/AgentbaseHQ/agentbase-python/tree/main/src/agentbase/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/agentbase-python/tree/main/src/agentbase/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/AgentbaseHQ/agentbase-python/tree/main/src/agentbase/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -387,7 +384,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/agentbase-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/AgentbaseHQ/agentbase-python/issues) with questions, bugs, or suggestions. ### Determining the installed version diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..b845b0f --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${PYPI_TOKEN}" ]; then + errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/pyproject.toml b/pyproject.toml index 5eb309d..6a2f769 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] -name = "agentbase" -version = "0.0.1" +name = "agentbase-sdk" +version = "0.1.0" description = "The official Python library for the agentbase API" dynamic = ["readme"] license = "Apache-2.0" @@ -35,8 +35,8 @@ classifiers = [ ] [project.urls] -Homepage = "https://github.com/stainless-sdks/agentbase-python" -Repository = "https://github.com/stainless-sdks/agentbase-python" +Homepage = "https://github.com/AgentbaseHQ/agentbase-python" +Repository = "https://github.com/AgentbaseHQ/agentbase-python" [project.optional-dependencies] aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] @@ -124,7 +124,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/stainless-sdks/agentbase-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/AgentbaseHQ/agentbase-python/tree/main/\g<2>)' [tool.pytest.ini_options] testpaths = ["tests"] diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..32a7cfe --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,66 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "python", + "extra-files": [ + "src/agentbase/_version.py" + ] +} \ No newline at end of file diff --git a/requirements-dev.lock b/requirements-dev.lock index 967af64..038c174 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -13,14 +13,14 @@ aiohappyeyeballs==2.6.1 # via aiohttp aiohttp==3.12.8 - # via agentbase + # via agentbase-sdk # via httpx-aiohttp aiosignal==1.3.2 # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 - # via agentbase + # via agentbase-sdk # via httpx argcomplete==3.1.2 # via nox @@ -37,7 +37,7 @@ dirty-equals==0.6.0 distlib==0.3.7 # via virtualenv distro==1.8.0 - # via agentbase + # via agentbase-sdk exceptiongroup==1.2.2 # via anyio # via pytest @@ -53,11 +53,11 @@ h11==0.16.0 httpcore==1.0.9 # via httpx httpx==0.28.1 - # via agentbase + # via agentbase-sdk # via httpx-aiohttp # via respx httpx-aiohttp==0.1.8 - # via agentbase + # via agentbase-sdk idna==3.4 # via anyio # via httpx @@ -89,7 +89,7 @@ propcache==0.3.1 # via aiohttp # via yarl pydantic==2.11.9 - # via agentbase + # via agentbase-sdk pydantic-core==2.33.2 # via pydantic pygments==2.18.0 @@ -112,14 +112,14 @@ setuptools==68.2.2 six==1.16.0 # via python-dateutil sniffio==1.3.0 - # via agentbase + # via agentbase-sdk # via anyio time-machine==2.9.0 tomli==2.0.2 # via mypy # via pytest typing-extensions==4.12.2 - # via agentbase + # via agentbase-sdk # via anyio # via multidict # via mypy diff --git a/requirements.lock b/requirements.lock index fbc6c81..a311c57 100644 --- a/requirements.lock +++ b/requirements.lock @@ -13,14 +13,14 @@ aiohappyeyeballs==2.6.1 # via aiohttp aiohttp==3.12.8 - # via agentbase + # via agentbase-sdk # via httpx-aiohttp aiosignal==1.3.2 # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 - # via agentbase + # via agentbase-sdk # via httpx async-timeout==5.0.1 # via aiohttp @@ -30,7 +30,7 @@ certifi==2023.7.22 # via httpcore # via httpx distro==1.8.0 - # via agentbase + # via agentbase-sdk exceptiongroup==1.2.2 # via anyio frozenlist==1.6.2 @@ -41,10 +41,10 @@ h11==0.16.0 httpcore==1.0.9 # via httpx httpx==0.28.1 - # via agentbase + # via agentbase-sdk # via httpx-aiohttp httpx-aiohttp==0.1.8 - # via agentbase + # via agentbase-sdk idna==3.4 # via anyio # via httpx @@ -56,14 +56,14 @@ propcache==0.3.1 # via aiohttp # via yarl pydantic==2.11.9 - # via agentbase + # via agentbase-sdk pydantic-core==2.33.2 # via pydantic sniffio==1.3.0 - # via agentbase + # via agentbase-sdk # via anyio typing-extensions==4.12.2 - # via agentbase + # via agentbase-sdk # via anyio # via multidict # via pydantic diff --git a/src/agentbase/_version.py b/src/agentbase/_version.py index 5347c7f..885bba6 100644 --- a/src/agentbase/_version.py +++ b/src/agentbase/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "agentbase" -__version__ = "0.0.1" +__version__ = "0.1.0" # x-release-please-version diff --git a/src/agentbase/resources/clear_messages.py b/src/agentbase/resources/clear_messages.py index 8b3bd83..2bc95d9 100644 --- a/src/agentbase/resources/clear_messages.py +++ b/src/agentbase/resources/clear_messages.py @@ -28,7 +28,7 @@ def with_raw_response(self) -> ClearMessagesResourceWithRawResponse: 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/stainless-sdks/agentbase-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/AgentbaseHQ/agentbase-python#accessing-raw-response-data-eg-headers """ return ClearMessagesResourceWithRawResponse(self) @@ -37,7 +37,7 @@ def with_streaming_response(self) -> ClearMessagesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/agentbase-python#with_streaming_response + For more information, see https://www.github.com/AgentbaseHQ/agentbase-python#with_streaming_response """ return ClearMessagesResourceWithStreamingResponse(self) @@ -86,7 +86,7 @@ def with_raw_response(self) -> AsyncClearMessagesResourceWithRawResponse: 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/stainless-sdks/agentbase-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/AgentbaseHQ/agentbase-python#accessing-raw-response-data-eg-headers """ return AsyncClearMessagesResourceWithRawResponse(self) @@ -95,7 +95,7 @@ def with_streaming_response(self) -> AsyncClearMessagesResourceWithStreamingResp """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/agentbase-python#with_streaming_response + For more information, see https://www.github.com/AgentbaseHQ/agentbase-python#with_streaming_response """ return AsyncClearMessagesResourceWithStreamingResponse(self) diff --git a/src/agentbase/resources/get_messages.py b/src/agentbase/resources/get_messages.py index 14a299b..d47a0db 100644 --- a/src/agentbase/resources/get_messages.py +++ b/src/agentbase/resources/get_messages.py @@ -28,7 +28,7 @@ def with_raw_response(self) -> GetMessagesResourceWithRawResponse: 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/stainless-sdks/agentbase-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/AgentbaseHQ/agentbase-python#accessing-raw-response-data-eg-headers """ return GetMessagesResourceWithRawResponse(self) @@ -37,7 +37,7 @@ def with_streaming_response(self) -> GetMessagesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/agentbase-python#with_streaming_response + For more information, see https://www.github.com/AgentbaseHQ/agentbase-python#with_streaming_response """ return GetMessagesResourceWithStreamingResponse(self) @@ -89,7 +89,7 @@ def with_raw_response(self) -> AsyncGetMessagesResourceWithRawResponse: 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/stainless-sdks/agentbase-python#accessing-raw-response-data-eg-headers + For more information, see https://www.github.com/AgentbaseHQ/agentbase-python#accessing-raw-response-data-eg-headers """ return AsyncGetMessagesResourceWithRawResponse(self) @@ -98,7 +98,7 @@ def with_streaming_response(self) -> AsyncGetMessagesResourceWithStreamingRespon """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. - For more information, see https://www.github.com/stainless-sdks/agentbase-python#with_streaming_response + For more information, see https://www.github.com/AgentbaseHQ/agentbase-python#with_streaming_response """ return AsyncGetMessagesResourceWithStreamingResponse(self)