From 2c7a465cd6c6af51ee31c51e654197c5b2f2141c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 03:30:11 +0000 Subject: [PATCH 1/6] chore(internal): add request options to SSE classes --- src/brand/dev/_response.py | 3 +++ src/brand/dev/_streaming.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/brand/dev/_response.py b/src/brand/dev/_response.py index 4e25cd6..083e7ba 100644 --- a/src/brand/dev/_response.py +++ b/src/brand/dev/_response.py @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/brand/dev/_streaming.py b/src/brand/dev/_streaming.py index 488f08c..8dbd7f2 100644 --- a/src/brand/dev/_streaming.py +++ b/src/brand/dev/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ._client import BrandDev, AsyncBrandDev + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -22,7 +23,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -31,10 +32,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: BrandDev, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -94,10 +97,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncBrandDev, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() From 481029be8d533936b4078d6eeecf135b102463c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 03:37:46 +0000 Subject: [PATCH 2/6] chore(internal): make `test_proxy_environment_variables` more resilient --- tests/test_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 439afad..d7db511 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -951,6 +951,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultHttpxClient() @@ -1861,6 +1863,8 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultAsyncHttpxClient() From b7ecf85a40b0f93e742349f13b986f1263a2cc73 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 03:15:54 +0000 Subject: [PATCH 3/6] chore(internal): make `test_proxy_environment_variables` more resilient to env --- tests/test_client.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index d7db511..9a1bb3d 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -951,8 +951,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultHttpxClient() @@ -1863,8 +1869,14 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultAsyncHttpxClient() From 99080ade4047eba1c61b35aa5244ca139d259b2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 28 Feb 2026 15:02:16 +0000 Subject: [PATCH 4/6] feat(api): api update --- .stats.yml | 4 ++-- src/brand/dev/resources/brand.py | 12 ++++++++++++ .../types/brand_identify_from_transaction_params.py | 7 +++++++ tests/api_resources/test_brand.py | 2 ++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9aae198..eb3e53c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-3614380ba4315687bbaf6561e9872fd72dd876f9230ce690c35d7efc1250e808.yml -openapi_spec_hash: f1aa17e08d0379766a61de68714c7c21 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-ffb96b6ba7020a8e2608ad727c330c6f353c037485dc1c1309aa86ea5549af15.yml +openapi_spec_hash: 2b969dbfad500d6f8a8d1ccfcaae930c config_hash: 4cd3173ea1cce7183640aae49cfbb374 diff --git a/src/brand/dev/resources/brand.py b/src/brand/dev/resources/brand.py index b66a897..66bc3d1 100644 --- a/src/brand/dev/resources/brand.py +++ b/src/brand/dev/resources/brand.py @@ -762,6 +762,7 @@ def identify_from_transaction( "welsh", ] | Omit = omit, + high_confidence_only: bool | Omit = omit, max_speed: bool | Omit = omit, mcc: str | Omit = omit, phone: float | Omit = omit, @@ -787,6 +788,10 @@ def identify_from_transaction( force_language: Optional parameter to force the language of the retrieved brand data. + high_confidence_only: When set to true, the API will perform an additional verification steps to + ensure the identified brand matches the transaction with high confidence. + Defaults to false. + max_speed: Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data. @@ -821,6 +826,7 @@ def identify_from_transaction( "city": city, "country_gl": country_gl, "force_language": force_language, + "high_confidence_only": high_confidence_only, "max_speed": max_speed, "mcc": mcc, "phone": phone, @@ -2583,6 +2589,7 @@ async def identify_from_transaction( "welsh", ] | Omit = omit, + high_confidence_only: bool | Omit = omit, max_speed: bool | Omit = omit, mcc: str | Omit = omit, phone: float | Omit = omit, @@ -2608,6 +2615,10 @@ async def identify_from_transaction( force_language: Optional parameter to force the language of the retrieved brand data. + high_confidence_only: When set to true, the API will perform an additional verification steps to + ensure the identified brand matches the transaction with high confidence. + Defaults to false. + max_speed: Optional parameter to optimize the API call for maximum speed. When set to true, the API will skip time-consuming operations for faster response at the cost of less comprehensive data. @@ -2642,6 +2653,7 @@ async def identify_from_transaction( "city": city, "country_gl": country_gl, "force_language": force_language, + "high_confidence_only": high_confidence_only, "max_speed": max_speed, "mcc": mcc, "phone": phone, diff --git a/src/brand/dev/types/brand_identify_from_transaction_params.py b/src/brand/dev/types/brand_identify_from_transaction_params.py index c509338..bc46c8f 100644 --- a/src/brand/dev/types/brand_identify_from_transaction_params.py +++ b/src/brand/dev/types/brand_identify_from_transaction_params.py @@ -318,6 +318,13 @@ class BrandIdentifyFromTransactionParams(TypedDict, total=False): ] """Optional parameter to force the language of the retrieved brand data.""" + high_confidence_only: bool + """ + When set to true, the API will perform an additional verification steps to + ensure the identified brand matches the transaction with high confidence. + Defaults to false. + """ + max_speed: Annotated[bool, PropertyInfo(alias="maxSpeed")] """Optional parameter to optimize the API call for maximum speed. diff --git a/tests/api_resources/test_brand.py b/tests/api_resources/test_brand.py index b7c65bc..916aa00 100644 --- a/tests/api_resources/test_brand.py +++ b/tests/api_resources/test_brand.py @@ -364,6 +364,7 @@ def test_method_identify_from_transaction_with_all_params(self, client: BrandDev city="city", country_gl="ad", force_language="albanian", + high_confidence_only=True, max_speed=True, mcc="mcc", phone=0, @@ -1314,6 +1315,7 @@ async def test_method_identify_from_transaction_with_all_params(self, async_clie city="city", country_gl="ad", force_language="albanian", + high_confidence_only=True, max_speed=True, mcc="mcc", phone=0, From 06eeb901097ef65fc3bd748262ee0535fedbd41f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 13:59:43 +0000 Subject: [PATCH 5/6] feat(api): api update --- .stats.yml | 4 ++-- src/brand/dev/resources/brand.py | 8 ++++++++ src/brand/dev/types/brand_web_scrape_md_params.py | 3 +++ tests/api_resources/test_brand.py | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eb3e53c..f98f9e8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-ffb96b6ba7020a8e2608ad727c330c6f353c037485dc1c1309aa86ea5549af15.yml -openapi_spec_hash: 2b969dbfad500d6f8a8d1ccfcaae930c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-584d3486a6c5bf7b68dcaacb0bde2ef5f648c158e5c5ebccc7a7684d95abc832.yml +openapi_spec_hash: 29a53e1f96a2c5d9407f1a0938e301bf config_hash: 4cd3173ea1cce7183640aae49cfbb374 diff --git a/src/brand/dev/resources/brand.py b/src/brand/dev/resources/brand.py index 66bc3d1..1f77972 100644 --- a/src/brand/dev/resources/brand.py +++ b/src/brand/dev/resources/brand.py @@ -1803,6 +1803,7 @@ def web_scrape_md( url: str, include_images: bool | Omit = omit, include_links: bool | Omit = omit, + shorten_base64_images: bool | Omit = omit, # 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, @@ -1823,6 +1824,8 @@ def web_scrape_md( include_links: Preserve hyperlinks in Markdown output + shorten_base64_images: Shorten base64-encoded image data in the Markdown output + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1843,6 +1846,7 @@ def web_scrape_md( "url": url, "include_images": include_images, "include_links": include_links, + "shorten_base64_images": shorten_base64_images, }, brand_web_scrape_md_params.BrandWebScrapeMdParams, ), @@ -3632,6 +3636,7 @@ async def web_scrape_md( url: str, include_images: bool | Omit = omit, include_links: bool | Omit = omit, + shorten_base64_images: bool | Omit = omit, # 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, @@ -3652,6 +3657,8 @@ async def web_scrape_md( include_links: Preserve hyperlinks in Markdown output + shorten_base64_images: Shorten base64-encoded image data in the Markdown output + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3672,6 +3679,7 @@ async def web_scrape_md( "url": url, "include_images": include_images, "include_links": include_links, + "shorten_base64_images": shorten_base64_images, }, brand_web_scrape_md_params.BrandWebScrapeMdParams, ), diff --git a/src/brand/dev/types/brand_web_scrape_md_params.py b/src/brand/dev/types/brand_web_scrape_md_params.py index 5fc8732..bf8c2e1 100644 --- a/src/brand/dev/types/brand_web_scrape_md_params.py +++ b/src/brand/dev/types/brand_web_scrape_md_params.py @@ -21,3 +21,6 @@ class BrandWebScrapeMdParams(TypedDict, total=False): include_links: Annotated[bool, PropertyInfo(alias="includeLinks")] """Preserve hyperlinks in Markdown output""" + + shorten_base64_images: Annotated[bool, PropertyInfo(alias="shortenBase64Images")] + """Shorten base64-encoded image data in the Markdown output""" diff --git a/tests/api_resources/test_brand.py b/tests/api_resources/test_brand.py index 916aa00..bfde51f 100644 --- a/tests/api_resources/test_brand.py +++ b/tests/api_resources/test_brand.py @@ -920,6 +920,7 @@ def test_method_web_scrape_md_with_all_params(self, client: BrandDev) -> None: url="https://example.com", include_images=True, include_links=True, + shorten_base64_images=True, ) assert_matches_type(BrandWebScrapeMdResponse, brand, path=["response"]) @@ -1871,6 +1872,7 @@ async def test_method_web_scrape_md_with_all_params(self, async_client: AsyncBra url="https://example.com", include_images=True, include_links=True, + shorten_base64_images=True, ) assert_matches_type(BrandWebScrapeMdResponse, brand, path=["response"]) From 26b9d3dac462b9939f3f9b0820e81963b313f8bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 14:00:00 +0000 Subject: [PATCH 6/6] release: 1.36.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ pyproject.toml | 2 +- src/brand/dev/_version.py | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 44959ac..f29e96b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.35.0" + ".": "1.36.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 890b62a..d98777b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 1.36.0 (2026-03-01) + +Full Changelog: [v1.35.0...v1.36.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.35.0...v1.36.0) + +### Features + +* **api:** api update ([06eeb90](https://github.com/brand-dot-dev/python-sdk/commit/06eeb901097ef65fc3bd748262ee0535fedbd41f)) +* **api:** api update ([99080ad](https://github.com/brand-dot-dev/python-sdk/commit/99080ade4047eba1c61b35aa5244ca139d259b2b)) + + +### Chores + +* **internal:** add request options to SSE classes ([2c7a465](https://github.com/brand-dot-dev/python-sdk/commit/2c7a465cd6c6af51ee31c51e654197c5b2f2141c)) +* **internal:** make `test_proxy_environment_variables` more resilient ([481029b](https://github.com/brand-dot-dev/python-sdk/commit/481029be8d533936b4078d6eeecf135b102463c3)) +* **internal:** make `test_proxy_environment_variables` more resilient to env ([b7ecf85](https://github.com/brand-dot-dev/python-sdk/commit/b7ecf85a40b0f93e742349f13b986f1263a2cc73)) + ## 1.35.0 (2026-02-24) Full Changelog: [v1.34.0...v1.35.0](https://github.com/brand-dot-dev/python-sdk/compare/v1.34.0...v1.35.0) diff --git a/pyproject.toml b/pyproject.toml index 96ede79..c35fc3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "brand.dev" -version = "1.35.0" +version = "1.36.0" description = "The official Python library for the brand.dev API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/brand/dev/_version.py b/src/brand/dev/_version.py index bf19820..1f7482f 100644 --- a/src/brand/dev/_version.py +++ b/src/brand/dev/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "brand.dev" -__version__ = "1.35.0" # x-release-please-version +__version__ = "1.36.0" # x-release-please-version