|
12 | 12 | brand_ai_query_params, |
13 | 13 | brand_prefetch_params, |
14 | 14 | brand_retrieve_params, |
| 15 | + brand_ai_product_params, |
15 | 16 | brand_screenshot_params, |
16 | 17 | brand_styleguide_params, |
17 | 18 | brand_ai_products_params, |
|
39 | 40 | from ..types.brand_ai_query_response import BrandAIQueryResponse |
40 | 41 | from ..types.brand_prefetch_response import BrandPrefetchResponse |
41 | 42 | from ..types.brand_retrieve_response import BrandRetrieveResponse |
| 43 | +from ..types.brand_ai_product_response import BrandAIProductResponse |
42 | 44 | from ..types.brand_screenshot_response import BrandScreenshotResponse |
43 | 45 | from ..types.brand_styleguide_response import BrandStyleguideResponse |
44 | 46 | from ..types.brand_ai_products_response import BrandAIProductsResponse |
@@ -189,6 +191,52 @@ def retrieve( |
189 | 191 | cast_to=BrandRetrieveResponse, |
190 | 192 | ) |
191 | 193 |
|
| 194 | + def ai_product( |
| 195 | + self, |
| 196 | + *, |
| 197 | + url: str, |
| 198 | + timeout_ms: int | Omit = omit, |
| 199 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 200 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 201 | + extra_headers: Headers | None = None, |
| 202 | + extra_query: Query | None = None, |
| 203 | + extra_body: Body | None = None, |
| 204 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 205 | + ) -> BrandAIProductResponse: |
| 206 | + """ |
| 207 | + Beta feature: Given a single URL, determines if it is a product detail page, |
| 208 | + classifies the platform/product type, and extracts the product information. |
| 209 | + Supports Amazon, TikTok Shop, Etsy, and generic ecommerce sites. |
| 210 | +
|
| 211 | + Args: |
| 212 | + url: The product page URL to extract product data from. |
| 213 | +
|
| 214 | + timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is |
| 215 | + 300000ms (5 minutes). |
| 216 | +
|
| 217 | + extra_headers: Send extra headers |
| 218 | +
|
| 219 | + extra_query: Add additional query parameters to the request |
| 220 | +
|
| 221 | + extra_body: Add additional JSON properties to the request |
| 222 | +
|
| 223 | + timeout: Override the client-level default timeout for this request, in seconds |
| 224 | + """ |
| 225 | + return self._post( |
| 226 | + "/brand/ai/product", |
| 227 | + body=maybe_transform( |
| 228 | + { |
| 229 | + "url": url, |
| 230 | + "timeout_ms": timeout_ms, |
| 231 | + }, |
| 232 | + brand_ai_product_params.BrandAIProductParams, |
| 233 | + ), |
| 234 | + options=make_request_options( |
| 235 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 236 | + ), |
| 237 | + cast_to=BrandAIProductResponse, |
| 238 | + ) |
| 239 | + |
192 | 240 | @overload |
193 | 241 | def ai_products( |
194 | 242 | self, |
@@ -1785,6 +1833,52 @@ async def retrieve( |
1785 | 1833 | cast_to=BrandRetrieveResponse, |
1786 | 1834 | ) |
1787 | 1835 |
|
| 1836 | + async def ai_product( |
| 1837 | + self, |
| 1838 | + *, |
| 1839 | + url: str, |
| 1840 | + timeout_ms: int | Omit = omit, |
| 1841 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 1842 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 1843 | + extra_headers: Headers | None = None, |
| 1844 | + extra_query: Query | None = None, |
| 1845 | + extra_body: Body | None = None, |
| 1846 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 1847 | + ) -> BrandAIProductResponse: |
| 1848 | + """ |
| 1849 | + Beta feature: Given a single URL, determines if it is a product detail page, |
| 1850 | + classifies the platform/product type, and extracts the product information. |
| 1851 | + Supports Amazon, TikTok Shop, Etsy, and generic ecommerce sites. |
| 1852 | +
|
| 1853 | + Args: |
| 1854 | + url: The product page URL to extract product data from. |
| 1855 | +
|
| 1856 | + timeout_ms: Optional timeout in milliseconds for the request. Maximum allowed value is |
| 1857 | + 300000ms (5 minutes). |
| 1858 | +
|
| 1859 | + extra_headers: Send extra headers |
| 1860 | +
|
| 1861 | + extra_query: Add additional query parameters to the request |
| 1862 | +
|
| 1863 | + extra_body: Add additional JSON properties to the request |
| 1864 | +
|
| 1865 | + timeout: Override the client-level default timeout for this request, in seconds |
| 1866 | + """ |
| 1867 | + return await self._post( |
| 1868 | + "/brand/ai/product", |
| 1869 | + body=await async_maybe_transform( |
| 1870 | + { |
| 1871 | + "url": url, |
| 1872 | + "timeout_ms": timeout_ms, |
| 1873 | + }, |
| 1874 | + brand_ai_product_params.BrandAIProductParams, |
| 1875 | + ), |
| 1876 | + options=make_request_options( |
| 1877 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 1878 | + ), |
| 1879 | + cast_to=BrandAIProductResponse, |
| 1880 | + ) |
| 1881 | + |
1788 | 1882 | @overload |
1789 | 1883 | async def ai_products( |
1790 | 1884 | self, |
@@ -3253,6 +3347,9 @@ def __init__(self, brand: BrandResource) -> None: |
3253 | 3347 | self.retrieve = to_raw_response_wrapper( |
3254 | 3348 | brand.retrieve, |
3255 | 3349 | ) |
| 3350 | + self.ai_product = to_raw_response_wrapper( |
| 3351 | + brand.ai_product, |
| 3352 | + ) |
3256 | 3353 | self.ai_products = to_raw_response_wrapper( |
3257 | 3354 | brand.ai_products, |
3258 | 3355 | ) |
@@ -3304,6 +3401,9 @@ def __init__(self, brand: AsyncBrandResource) -> None: |
3304 | 3401 | self.retrieve = async_to_raw_response_wrapper( |
3305 | 3402 | brand.retrieve, |
3306 | 3403 | ) |
| 3404 | + self.ai_product = async_to_raw_response_wrapper( |
| 3405 | + brand.ai_product, |
| 3406 | + ) |
3307 | 3407 | self.ai_products = async_to_raw_response_wrapper( |
3308 | 3408 | brand.ai_products, |
3309 | 3409 | ) |
@@ -3355,6 +3455,9 @@ def __init__(self, brand: BrandResource) -> None: |
3355 | 3455 | self.retrieve = to_streamed_response_wrapper( |
3356 | 3456 | brand.retrieve, |
3357 | 3457 | ) |
| 3458 | + self.ai_product = to_streamed_response_wrapper( |
| 3459 | + brand.ai_product, |
| 3460 | + ) |
3358 | 3461 | self.ai_products = to_streamed_response_wrapper( |
3359 | 3462 | brand.ai_products, |
3360 | 3463 | ) |
@@ -3406,6 +3509,9 @@ def __init__(self, brand: AsyncBrandResource) -> None: |
3406 | 3509 | self.retrieve = async_to_streamed_response_wrapper( |
3407 | 3510 | brand.retrieve, |
3408 | 3511 | ) |
| 3512 | + self.ai_product = async_to_streamed_response_wrapper( |
| 3513 | + brand.ai_product, |
| 3514 | + ) |
3409 | 3515 | self.ai_products = async_to_streamed_response_wrapper( |
3410 | 3516 | brand.ai_products, |
3411 | 3517 | ) |
|
0 commit comments