|
14 | 14 | brand_retrieve_params, |
15 | 15 | brand_screenshot_params, |
16 | 16 | brand_styleguide_params, |
| 17 | + brand_ai_products_params, |
17 | 18 | brand_retrieve_naics_params, |
18 | 19 | brand_retrieve_by_isin_params, |
19 | 20 | brand_retrieve_by_name_params, |
|
40 | 41 | from ..types.brand_retrieve_response import BrandRetrieveResponse |
41 | 42 | from ..types.brand_screenshot_response import BrandScreenshotResponse |
42 | 43 | from ..types.brand_styleguide_response import BrandStyleguideResponse |
| 44 | +from ..types.brand_ai_products_response import BrandAIProductsResponse |
43 | 45 | from ..types.brand_retrieve_naics_response import BrandRetrieveNaicsResponse |
44 | 46 | from ..types.brand_retrieve_by_isin_response import BrandRetrieveByIsinResponse |
45 | 47 | from ..types.brand_retrieve_by_name_response import BrandRetrieveByNameResponse |
@@ -187,6 +189,58 @@ def retrieve( |
187 | 189 | cast_to=BrandRetrieveResponse, |
188 | 190 | ) |
189 | 191 |
|
| 192 | + def ai_products( |
| 193 | + self, |
| 194 | + *, |
| 195 | + domain: str, |
| 196 | + max_products: int | Omit = omit, |
| 197 | + timeout_ms: int | Omit = omit, |
| 198 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 199 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 200 | + extra_headers: Headers | None = None, |
| 201 | + extra_query: Query | None = None, |
| 202 | + extra_body: Body | None = None, |
| 203 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 204 | + ) -> BrandAIProductsResponse: |
| 205 | + """Beta feature: Use AI to extract product information from a brand's website. |
| 206 | +
|
| 207 | + The |
| 208 | + AI will analyze the website and return a list of products with details such as |
| 209 | + name, description, pricing, features, and more. |
| 210 | +
|
| 211 | + Args: |
| 212 | + domain: The domain name to analyze |
| 213 | +
|
| 214 | + max_products: Maximum number of products to extract. |
| 215 | +
|
| 216 | + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer |
| 217 | + than this value, it will be aborted with a 408 status code. Maximum allowed |
| 218 | + value is 300000ms (5 minutes). |
| 219 | +
|
| 220 | + extra_headers: Send extra headers |
| 221 | +
|
| 222 | + extra_query: Add additional query parameters to the request |
| 223 | +
|
| 224 | + extra_body: Add additional JSON properties to the request |
| 225 | +
|
| 226 | + timeout: Override the client-level default timeout for this request, in seconds |
| 227 | + """ |
| 228 | + return self._post( |
| 229 | + "/brand/ai/products", |
| 230 | + body=maybe_transform( |
| 231 | + { |
| 232 | + "domain": domain, |
| 233 | + "max_products": max_products, |
| 234 | + "timeout_ms": timeout_ms, |
| 235 | + }, |
| 236 | + brand_ai_products_params.BrandAIProductsParams, |
| 237 | + ), |
| 238 | + options=make_request_options( |
| 239 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 240 | + ), |
| 241 | + cast_to=BrandAIProductsResponse, |
| 242 | + ) |
| 243 | + |
190 | 244 | def ai_query( |
191 | 245 | self, |
192 | 246 | *, |
@@ -1674,6 +1728,58 @@ async def retrieve( |
1674 | 1728 | cast_to=BrandRetrieveResponse, |
1675 | 1729 | ) |
1676 | 1730 |
|
| 1731 | + async def ai_products( |
| 1732 | + self, |
| 1733 | + *, |
| 1734 | + domain: str, |
| 1735 | + max_products: int | Omit = omit, |
| 1736 | + timeout_ms: int | Omit = omit, |
| 1737 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1738 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1739 | + extra_headers: Headers | None = None, |
| 1740 | + extra_query: Query | None = None, |
| 1741 | + extra_body: Body | None = None, |
| 1742 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1743 | + ) -> BrandAIProductsResponse: |
| 1744 | + """Beta feature: Use AI to extract product information from a brand's website. |
| 1745 | +
|
| 1746 | + The |
| 1747 | + AI will analyze the website and return a list of products with details such as |
| 1748 | + name, description, pricing, features, and more. |
| 1749 | +
|
| 1750 | + Args: |
| 1751 | + domain: The domain name to analyze |
| 1752 | +
|
| 1753 | + max_products: Maximum number of products to extract. |
| 1754 | +
|
| 1755 | + timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer |
| 1756 | + than this value, it will be aborted with a 408 status code. Maximum allowed |
| 1757 | + value is 300000ms (5 minutes). |
| 1758 | +
|
| 1759 | + extra_headers: Send extra headers |
| 1760 | +
|
| 1761 | + extra_query: Add additional query parameters to the request |
| 1762 | +
|
| 1763 | + extra_body: Add additional JSON properties to the request |
| 1764 | +
|
| 1765 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1766 | + """ |
| 1767 | + return await self._post( |
| 1768 | + "/brand/ai/products", |
| 1769 | + body=await async_maybe_transform( |
| 1770 | + { |
| 1771 | + "domain": domain, |
| 1772 | + "max_products": max_products, |
| 1773 | + "timeout_ms": timeout_ms, |
| 1774 | + }, |
| 1775 | + brand_ai_products_params.BrandAIProductsParams, |
| 1776 | + ), |
| 1777 | + options=make_request_options( |
| 1778 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 1779 | + ), |
| 1780 | + cast_to=BrandAIProductsResponse, |
| 1781 | + ) |
| 1782 | + |
1677 | 1783 | async def ai_query( |
1678 | 1784 | self, |
1679 | 1785 | *, |
@@ -3033,6 +3139,9 @@ def __init__(self, brand: BrandResource) -> None: |
3033 | 3139 | self.retrieve = to_raw_response_wrapper( |
3034 | 3140 | brand.retrieve, |
3035 | 3141 | ) |
| 3142 | + self.ai_products = to_raw_response_wrapper( |
| 3143 | + brand.ai_products, |
| 3144 | + ) |
3036 | 3145 | self.ai_query = to_raw_response_wrapper( |
3037 | 3146 | brand.ai_query, |
3038 | 3147 | ) |
@@ -3081,6 +3190,9 @@ def __init__(self, brand: AsyncBrandResource) -> None: |
3081 | 3190 | self.retrieve = async_to_raw_response_wrapper( |
3082 | 3191 | brand.retrieve, |
3083 | 3192 | ) |
| 3193 | + self.ai_products = async_to_raw_response_wrapper( |
| 3194 | + brand.ai_products, |
| 3195 | + ) |
3084 | 3196 | self.ai_query = async_to_raw_response_wrapper( |
3085 | 3197 | brand.ai_query, |
3086 | 3198 | ) |
@@ -3129,6 +3241,9 @@ def __init__(self, brand: BrandResource) -> None: |
3129 | 3241 | self.retrieve = to_streamed_response_wrapper( |
3130 | 3242 | brand.retrieve, |
3131 | 3243 | ) |
| 3244 | + self.ai_products = to_streamed_response_wrapper( |
| 3245 | + brand.ai_products, |
| 3246 | + ) |
3132 | 3247 | self.ai_query = to_streamed_response_wrapper( |
3133 | 3248 | brand.ai_query, |
3134 | 3249 | ) |
@@ -3177,6 +3292,9 @@ def __init__(self, brand: AsyncBrandResource) -> None: |
3177 | 3292 | self.retrieve = async_to_streamed_response_wrapper( |
3178 | 3293 | brand.retrieve, |
3179 | 3294 | ) |
| 3295 | + self.ai_products = async_to_streamed_response_wrapper( |
| 3296 | + brand.ai_products, |
| 3297 | + ) |
3180 | 3298 | self.ai_query = async_to_streamed_response_wrapper( |
3181 | 3299 | brand.ai_query, |
3182 | 3300 | ) |
|
0 commit comments