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 @@
{
".": "0.0.1-alpha.1"
".": "1.0.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-bf411a5dc003606804e8544b1ae67679048e1e709ee932d0ee84d005507a3095.yml
openapi_spec_hash: b910fd6625c8b2f3451a03df123cd420
config_hash: 86dcace891937635f9e56dcdea517aa3
configured_endpoints: 6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/brand-dev%2Fbrand.dev-d5cf52f21333b8216b73e9659b4a1e8e0675404f0ae3d15bdd7ef368ccfa94cf.yml
openapi_spec_hash: c70cbc2e38e7aeaf2173574a13e9ca55
config_hash: 372b187172495fc2f76f05ba016b4a45
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.0.0 (2025-06-02)

Full Changelog: [v0.0.1-alpha.1...v1.0.0](https://github.com/brand-dot-dev/python-sdk/compare/v0.0.1-alpha.1...v1.0.0)

### Features

* **api:** manual updates ([90c550f](https://github.com/brand-dot-dev/python-sdk/commit/90c550fdeaefe75facfd24724c878a70f8aa35b4))

## 0.0.1-alpha.1 (2025-05-21)

Full Changelog: [v0.0.1-alpha.0...v0.0.1-alpha.1](https://github.com/brand-dot-dev/python-sdk/compare/v0.0.1-alpha.0...v0.0.1-alpha.1)
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 full API of this library can be found in [api.md](api.md).

```sh
# install from PyPI
pip install --pre brand.dev
pip install brand.dev
```

## Usage
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Types:
```python
from brand.dev.types import (
BrandRetrieveResponse,
BrandAIQueryResponse,
BrandIdentifyFromTransactionResponse,
BrandRetrieveByTickerResponse,
BrandRetrieveNaicsResponse,
Expand All @@ -15,6 +16,7 @@ from brand.dev.types import (
Methods:

- <code title="get /brand/retrieve">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_response.py">BrandRetrieveResponse</a></code>
- <code title="post /brand/ai/query">client.brand.<a href="./src/brand/dev/resources/brand.py">ai_query</a>(\*\*<a href="src/brand/dev/types/brand_ai_query_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_ai_query_response.py">BrandAIQueryResponse</a></code>
- <code title="get /brand/transaction_identifier">client.brand.<a href="./src/brand/dev/resources/brand.py">identify_from_transaction</a>(\*\*<a href="src/brand/dev/types/brand_identify_from_transaction_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_identify_from_transaction_response.py">BrandIdentifyFromTransactionResponse</a></code>
- <code title="get /brand/retrieve-by-ticker">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_by_ticker</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_by_ticker_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_by_ticker_response.py">BrandRetrieveByTickerResponse</a></code>
- <code title="get /brand/naics">client.brand.<a href="./src/brand/dev/resources/brand.py">retrieve_naics</a>(\*\*<a href="src/brand/dev/types/brand_retrieve_naics_params.py">params</a>) -> <a href="./src/brand/dev/types/brand_retrieve_naics_response.py">BrandRetrieveNaicsResponse</a></code>
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 = "brand.dev"
version = "0.0.1-alpha.1"
version = "1.0.0"
description = "The official Python library for the brand.dev API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/brand/dev/_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__ = "brand.dev"
__version__ = "0.0.1-alpha.1" # x-release-please-version
__version__ = "1.0.0" # x-release-please-version
115 changes: 115 additions & 0 deletions src/brand/dev/resources/brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

from __future__ import annotations

from typing import List, Iterable
from typing_extensions import Literal

import httpx

from ..types import (
brand_search_params,
brand_ai_query_params,
brand_retrieve_params,
brand_retrieve_naics_params,
brand_retrieve_by_ticker_params,
Expand All @@ -25,6 +27,7 @@
)
from .._base_client import make_request_options
from ..types.brand_search_response import BrandSearchResponse
from ..types.brand_ai_query_response import BrandAIQueryResponse
from ..types.brand_retrieve_response import BrandRetrieveResponse
from ..types.brand_retrieve_naics_response import BrandRetrieveNaicsResponse
from ..types.brand_retrieve_by_ticker_response import BrandRetrieveByTickerResponse
Expand Down Expand Up @@ -153,6 +156,56 @@ def retrieve(
cast_to=BrandRetrieveResponse,
)

def ai_query(
self,
*,
data_to_extract: Iterable[brand_ai_query_params.DataToExtract],
domain: str,
specific_pages: List[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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> BrandAIQueryResponse:
"""Beta feature: Use AI to extract specific data points from a brand's website.

The
AI will crawl the website and extract the requested information based on the
provided data points.

Args:
data_to_extract: Array of data points to extract from the website

domain: The domain name to analyze

specific_pages: Optional array of specific pages to analyze

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return self._post(
"/brand/ai/query",
body=maybe_transform(
{
"data_to_extract": data_to_extract,
"domain": domain,
"specific_pages": specific_pages,
},
brand_ai_query_params.BrandAIQueryParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=BrandAIQueryResponse,
)

def identify_from_transaction(
self,
*,
Expand Down Expand Up @@ -429,6 +482,56 @@ async def retrieve(
cast_to=BrandRetrieveResponse,
)

async def ai_query(
self,
*,
data_to_extract: Iterable[brand_ai_query_params.DataToExtract],
domain: str,
specific_pages: List[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.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> BrandAIQueryResponse:
"""Beta feature: Use AI to extract specific data points from a brand's website.

The
AI will crawl the website and extract the requested information based on the
provided data points.

Args:
data_to_extract: Array of data points to extract from the website

domain: The domain name to analyze

specific_pages: Optional array of specific pages to analyze

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
return await self._post(
"/brand/ai/query",
body=await async_maybe_transform(
{
"data_to_extract": data_to_extract,
"domain": domain,
"specific_pages": specific_pages,
},
brand_ai_query_params.BrandAIQueryParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=BrandAIQueryResponse,
)

async def identify_from_transaction(
self,
*,
Expand Down Expand Up @@ -596,6 +699,9 @@ def __init__(self, brand: BrandResource) -> None:
self.retrieve = to_raw_response_wrapper(
brand.retrieve,
)
self.ai_query = to_raw_response_wrapper(
brand.ai_query,
)
self.identify_from_transaction = to_raw_response_wrapper(
brand.identify_from_transaction,
)
Expand All @@ -617,6 +723,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
self.retrieve = async_to_raw_response_wrapper(
brand.retrieve,
)
self.ai_query = async_to_raw_response_wrapper(
brand.ai_query,
)
self.identify_from_transaction = async_to_raw_response_wrapper(
brand.identify_from_transaction,
)
Expand All @@ -638,6 +747,9 @@ def __init__(self, brand: BrandResource) -> None:
self.retrieve = to_streamed_response_wrapper(
brand.retrieve,
)
self.ai_query = to_streamed_response_wrapper(
brand.ai_query,
)
self.identify_from_transaction = to_streamed_response_wrapper(
brand.identify_from_transaction,
)
Expand All @@ -659,6 +771,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
self.retrieve = async_to_streamed_response_wrapper(
brand.retrieve,
)
self.ai_query = async_to_streamed_response_wrapper(
brand.ai_query,
)
self.identify_from_transaction = async_to_streamed_response_wrapper(
brand.identify_from_transaction,
)
Expand Down
2 changes: 2 additions & 0 deletions src/brand/dev/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
from __future__ import annotations

from .brand_search_params import BrandSearchParams as BrandSearchParams
from .brand_ai_query_params import BrandAIQueryParams as BrandAIQueryParams
from .brand_retrieve_params import BrandRetrieveParams as BrandRetrieveParams
from .brand_search_response import BrandSearchResponse as BrandSearchResponse
from .brand_ai_query_response import BrandAIQueryResponse as BrandAIQueryResponse
from .brand_retrieve_response import BrandRetrieveResponse as BrandRetrieveResponse
from .brand_retrieve_naics_params import BrandRetrieveNaicsParams as BrandRetrieveNaicsParams
from .brand_retrieve_naics_response import BrandRetrieveNaicsResponse as BrandRetrieveNaicsResponse
Expand Down
33 changes: 33 additions & 0 deletions src/brand/dev/types/brand_ai_query_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import List, Iterable
from typing_extensions import Literal, Required, TypedDict

__all__ = ["BrandAIQueryParams", "DataToExtract"]


class BrandAIQueryParams(TypedDict, total=False):
data_to_extract: Required[Iterable[DataToExtract]]
"""Array of data points to extract from the website"""

domain: Required[str]
"""The domain name to analyze"""

specific_pages: List[str]
"""Optional array of specific pages to analyze"""


class DataToExtract(TypedDict, total=False):
datapoint_description: Required[str]
"""Description of what to extract"""

datapoint_example: Required[str]
"""Example of the expected value"""

datapoint_name: Required[str]
"""Name of the data point to extract"""

datapoint_type: Required[Literal["text", "number", "date", "boolean", "list", "url"]]
"""Type of the data point"""
26 changes: 26 additions & 0 deletions src/brand/dev/types/brand_ai_query_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Union, Optional

from .._models import BaseModel

__all__ = ["BrandAIQueryResponse", "DataExtracted"]


class DataExtracted(BaseModel):
datapoint_name: Optional[str] = None
"""Name of the extracted data point"""

datapoint_value: Union[str, float, bool, List[str], List[float], None] = None
"""Value of the extracted data point"""


class BrandAIQueryResponse(BaseModel):
data_extracted: Optional[List[DataExtracted]] = None
"""Array of extracted data points"""

domain: Optional[str] = None
"""The domain that was analyzed"""

urls_analyzed: Optional[List[str]] = None
"""List of URLs that were analyzed"""
Loading