Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.0.9 #9

Merged
merged 4 commits into from
May 23, 2024
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.0.8"
".": "0.0.9"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 38
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/plastic-labs%2Fhoncho-a370506bdacaf58567fea52cb6312d99b0e211dd67c8d1ffb896fcf6abfee16b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/plastic-labs%2FHoncho-7967581df14089cda98ce7bd258102d5da5ec541dc5b17aa918f96be11a2bde8.yml
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.0.9 (2024-05-23)

Full Changelog: [v0.0.8...v0.0.9](https://github.com/plastic-labs/honcho-python/compare/v0.0.8...v0.0.9)

### Features

* **api:** OpenAPI spec update via Stainless API ([#12](https://github.com/plastic-labs/honcho-python/issues/12)) ([fc9f943](https://github.com/plastic-labs/honcho-python/commit/fc9f943458b81fc897d9643ff3956ed2a859a4e9))
* **api:** update via SDK Studio ([#11](https://github.com/plastic-labs/honcho-python/issues/11)) ([08b81ed](https://github.com/plastic-labs/honcho-python/commit/08b81edd9a63e10f55575ddd3d7ca542f271aed7))


### Chores

* **internal:** version bump ([#8](https://github.com/plastic-labs/honcho-python/issues/8)) ([dac6964](https://github.com/plastic-labs/honcho-python/commit/dac6964e461965e4b111a77b22a508eac849590c))

## 0.0.8 (2024-05-16)

Full Changelog: [v0.0.8-alpha.1...v0.0.8](https://github.com/plastic-labs/honcho-python/compare/v0.0.8-alpha.1...v0.0.8)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The REST API documentation can be found [on docs.honcho.dev](https://docs.honcho

```sh
# install from PyPI
pip install --pre honcho-ai
pip install honcho-ai
```

## Usage
Expand Down
13 changes: 1 addition & 12 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
#!/usr/bin/env bash

warnings=()
errors=()

if [ -z "${PYPI_TOKEN}" ]; then
warnings+=("The HONCHO_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenWarnings=${#warnings[@]}

if [[ lenWarnings -gt 0 ]]; then
echo -e "Found the following warnings in the release environment:\n"

for warning in "${warnings[@]}"; do
echo -e "- $warning\n"
done
errors+=("The HONCHO_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenErrors=${#errors[@]}
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 = "honcho-ai"
version = "0.0.8"
version = "0.0.9"
description = "The official Python library for the honcho API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
18 changes: 11 additions & 7 deletions src/honcho/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)
from ._version import __version__
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import APIStatusError
from ._exceptions import HonchoError, APIStatusError
from ._base_client import (
DEFAULT_MAX_RETRIES,
SyncAPIClient,
Expand Down Expand Up @@ -57,7 +57,7 @@ class Honcho(SyncAPIClient):
with_streaming_response: HonchoWithStreamedResponse

# client options
api_key: str | None
api_key: str

_environment: Literal["local", "demo"] | NotGiven

Expand Down Expand Up @@ -91,6 +91,10 @@ def __init__(
"""
if api_key is None:
api_key = os.environ.get("HONCHO_AUTH_TOKEN")
if api_key is None:
raise HonchoError(
"The api_key client option must be set either by passing api_key to the client or by setting the HONCHO_AUTH_TOKEN environment variable"
)
self.api_key = api_key

self._environment = environment
Expand Down Expand Up @@ -143,8 +147,6 @@ def qs(self) -> Querystring:
@override
def auth_headers(self) -> dict[str, str]:
api_key = self.api_key
if api_key is None:
return {}
return {"Authorization": f"Bearer {api_key}"}

@property
Expand Down Expand Up @@ -249,7 +251,7 @@ class AsyncHoncho(AsyncAPIClient):
with_streaming_response: AsyncHonchoWithStreamedResponse

# client options
api_key: str | None
api_key: str

_environment: Literal["local", "demo"] | NotGiven

Expand Down Expand Up @@ -283,6 +285,10 @@ def __init__(
"""
if api_key is None:
api_key = os.environ.get("HONCHO_AUTH_TOKEN")
if api_key is None:
raise HonchoError(
"The api_key client option must be set either by passing api_key to the client or by setting the HONCHO_AUTH_TOKEN environment variable"
)
self.api_key = api_key

self._environment = environment
Expand Down Expand Up @@ -335,8 +341,6 @@ def qs(self) -> Querystring:
@override
def auth_headers(self) -> dict[str, str]:
api_key = self.api_key
if api_key is None:
return {}
return {"Authorization": f"Bearer {api_key}"}

@property
Expand Down
2 changes: 1 addition & 1 deletion src/honcho/_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__ = "honcho"
__version__ = "0.0.8" # x-release-please-version
__version__ = "0.0.9" # x-release-please-version
10 changes: 5 additions & 5 deletions src/honcho/resources/apps/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Optional
from typing import Dict, Optional

import httpx

Expand Down Expand Up @@ -54,7 +54,7 @@ def create(
self,
*,
name: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -97,7 +97,7 @@ def update(
self,
app_id: str,
*,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -269,7 +269,7 @@ async def create(
self,
*,
name: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -312,7 +312,7 @@ async def update(
self,
app_id: str,
*,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down
10 changes: 5 additions & 5 deletions src/honcho/resources/apps/users/collections/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Optional
from typing import Dict, Optional

import httpx

Expand Down Expand Up @@ -63,7 +63,7 @@ def create(
*,
app_id: str,
name: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -109,7 +109,7 @@ def update(
app_id: str,
user_id: str,
name: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -403,7 +403,7 @@ async def create(
*,
app_id: str,
name: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -449,7 +449,7 @@ async def update(
app_id: str,
user_id: str,
name: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down
10 changes: 5 additions & 5 deletions src/honcho/resources/apps/users/collections/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Optional
from typing import Dict, Optional

import httpx

Expand Down Expand Up @@ -46,7 +46,7 @@ def create(
app_id: str,
user_id: str,
content: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -95,7 +95,7 @@ def update(
user_id: str,
collection_id: str,
content: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -299,7 +299,7 @@ async def create(
app_id: str,
user_id: str,
content: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -348,7 +348,7 @@ async def update(
user_id: str,
collection_id: str,
content: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down
10 changes: 5 additions & 5 deletions src/honcho/resources/apps/users/sessions/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Optional
from typing import Dict, Optional

import httpx

Expand Down Expand Up @@ -47,7 +47,7 @@ def create(
user_id: str,
content: str,
is_user: bool,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -106,7 +106,7 @@ def update(
app_id: str,
user_id: str,
session_id: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -272,7 +272,7 @@ async def create(
user_id: str,
content: str,
is_user: bool,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -331,7 +331,7 @@ async def update(
app_id: str,
user_id: str,
session_id: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down
10 changes: 5 additions & 5 deletions src/honcho/resources/apps/users/sessions/metamessages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Optional
from typing import Dict, Optional

import httpx

Expand Down Expand Up @@ -53,7 +53,7 @@ def create(
content: str,
message_id: str,
metamessage_type: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -114,7 +114,7 @@ def update(
user_id: str,
session_id: str,
message_id: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
metamessage_type: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -306,7 +306,7 @@ async def create(
content: str,
message_id: str,
metamessage_type: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -367,7 +367,7 @@ async def update(
user_id: str,
session_id: str,
message_id: str,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, object]] | NotGiven = NOT_GIVEN,
metamessage_type: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down
Loading