Skip to content
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 @@
{
".": "3.5.0"
".": "3.6.0"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 3.6.0 (2025-10-16)

Full Changelog: [v3.5.0...v3.6.0](https://github.com/digitalocean/gradient-python/compare/v3.5.0...v3.6.0)

### Features

* **api:** manual updates ([da88e9e](https://github.com/digitalocean/gradient-python/commit/da88e9eee0adc6152d0d8212305397483be0d686))


### Bug Fixes

* lints ([a1b1fc6](https://github.com/digitalocean/gradient-python/commit/a1b1fc6b7747c00d9bfc2b86c6262e9c123416dc))
* test setup needs all three access keys ([01ac735](https://github.com/digitalocean/gradient-python/commit/01ac735fb965686699df82ec8763b18ceb660972))

## 3.5.0 (2025-10-14)

Full Changelog: [v3.4.0...v3.5.0](https://github.com/digitalocean/gradient-python/compare/v3.4.0...v3.5.0)
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 = "gradient"
version = "3.5.0"
version = "3.6.0"
description = "The official Python library for the Gradient API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
20 changes: 20 additions & 0 deletions src/gradient/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,16 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
if isinstance(custom_headers.get("Authorization"), Omit):
return

if self.model_access_key and headers.get("Authorization"):
return
if isinstance(custom_headers.get("Authorization"), Omit):
return

if self.agent_access_key and headers.get("Authorization"):
return
if isinstance(custom_headers.get("Authorization"), Omit):
return

raise TypeError(
'"Could not resolve authentication method. Expected access_token, agent_access_key, or model_access_key to be set. Or for the `Authorization` headers to be explicitly omitted"'
)
Expand Down Expand Up @@ -614,6 +624,16 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
if isinstance(custom_headers.get("Authorization"), Omit):
return

if self.model_access_key and headers.get("Authorization"):
return
if isinstance(custom_headers.get("Authorization"), Omit):
return

if self.agent_access_key and headers.get("Authorization"):
return
if isinstance(custom_headers.get("Authorization"), Omit):
return

raise TypeError(
'"Could not resolve authentication method. Expected access_token, agent_access_key, or model_access_key to be set. Or for the `Authorization` headers to be explicitly omitted"'
)
Expand Down
2 changes: 1 addition & 1 deletion src/gradient/_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__ = "gradient"
__version__ = "3.5.0" # x-release-please-version
__version__ = "3.6.0" # x-release-please-version
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
from gradient._utils import is_dict

if TYPE_CHECKING:
from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]
from _pytest.fixtures import (
FixtureRequest, # pyright: ignore[reportPrivateImportUsage]
)

pytest.register_assert_rewrite("tests.utils")

Expand Down