22
33from __future__ import annotations
44
5+ from typing import List , Iterable
56from typing_extensions import Literal
67
78import httpx
89
910from ..types import (
1011 brand_search_params ,
12+ brand_ai_query_params ,
1113 brand_retrieve_params ,
1214 brand_retrieve_naics_params ,
1315 brand_retrieve_by_ticker_params ,
2527)
2628from .._base_client import make_request_options
2729from ..types .brand_search_response import BrandSearchResponse
30+ from ..types .brand_ai_query_response import BrandAIQueryResponse
2831from ..types .brand_retrieve_response import BrandRetrieveResponse
2932from ..types .brand_retrieve_naics_response import BrandRetrieveNaicsResponse
3033from ..types .brand_retrieve_by_ticker_response import BrandRetrieveByTickerResponse
@@ -153,6 +156,56 @@ def retrieve(
153156 cast_to = BrandRetrieveResponse ,
154157 )
155158
159+ def ai_query (
160+ self ,
161+ * ,
162+ data_to_extract : Iterable [brand_ai_query_params .DataToExtract ],
163+ domain : str ,
164+ specific_pages : List [str ] | NotGiven = NOT_GIVEN ,
165+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
166+ # The extra values given here take precedence over values defined on the client or passed to this method.
167+ extra_headers : Headers | None = None ,
168+ extra_query : Query | None = None ,
169+ extra_body : Body | None = None ,
170+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
171+ ) -> BrandAIQueryResponse :
172+ """Beta feature: Use AI to extract specific data points from a brand's website.
173+
174+ The
175+ AI will crawl the website and extract the requested information based on the
176+ provided data points.
177+
178+ Args:
179+ data_to_extract: Array of data points to extract from the website
180+
181+ domain: The domain name to analyze
182+
183+ specific_pages: Optional array of specific pages to analyze
184+
185+ extra_headers: Send extra headers
186+
187+ extra_query: Add additional query parameters to the request
188+
189+ extra_body: Add additional JSON properties to the request
190+
191+ timeout: Override the client-level default timeout for this request, in seconds
192+ """
193+ return self ._post (
194+ "/brand/ai/query" ,
195+ body = maybe_transform (
196+ {
197+ "data_to_extract" : data_to_extract ,
198+ "domain" : domain ,
199+ "specific_pages" : specific_pages ,
200+ },
201+ brand_ai_query_params .BrandAIQueryParams ,
202+ ),
203+ options = make_request_options (
204+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
205+ ),
206+ cast_to = BrandAIQueryResponse ,
207+ )
208+
156209 def identify_from_transaction (
157210 self ,
158211 * ,
@@ -429,6 +482,56 @@ async def retrieve(
429482 cast_to = BrandRetrieveResponse ,
430483 )
431484
485+ async def ai_query (
486+ self ,
487+ * ,
488+ data_to_extract : Iterable [brand_ai_query_params .DataToExtract ],
489+ domain : str ,
490+ specific_pages : List [str ] | NotGiven = NOT_GIVEN ,
491+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
492+ # The extra values given here take precedence over values defined on the client or passed to this method.
493+ extra_headers : Headers | None = None ,
494+ extra_query : Query | None = None ,
495+ extra_body : Body | None = None ,
496+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
497+ ) -> BrandAIQueryResponse :
498+ """Beta feature: Use AI to extract specific data points from a brand's website.
499+
500+ The
501+ AI will crawl the website and extract the requested information based on the
502+ provided data points.
503+
504+ Args:
505+ data_to_extract: Array of data points to extract from the website
506+
507+ domain: The domain name to analyze
508+
509+ specific_pages: Optional array of specific pages to analyze
510+
511+ extra_headers: Send extra headers
512+
513+ extra_query: Add additional query parameters to the request
514+
515+ extra_body: Add additional JSON properties to the request
516+
517+ timeout: Override the client-level default timeout for this request, in seconds
518+ """
519+ return await self ._post (
520+ "/brand/ai/query" ,
521+ body = await async_maybe_transform (
522+ {
523+ "data_to_extract" : data_to_extract ,
524+ "domain" : domain ,
525+ "specific_pages" : specific_pages ,
526+ },
527+ brand_ai_query_params .BrandAIQueryParams ,
528+ ),
529+ options = make_request_options (
530+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
531+ ),
532+ cast_to = BrandAIQueryResponse ,
533+ )
534+
432535 async def identify_from_transaction (
433536 self ,
434537 * ,
@@ -596,6 +699,9 @@ def __init__(self, brand: BrandResource) -> None:
596699 self .retrieve = to_raw_response_wrapper (
597700 brand .retrieve ,
598701 )
702+ self .ai_query = to_raw_response_wrapper (
703+ brand .ai_query ,
704+ )
599705 self .identify_from_transaction = to_raw_response_wrapper (
600706 brand .identify_from_transaction ,
601707 )
@@ -617,6 +723,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
617723 self .retrieve = async_to_raw_response_wrapper (
618724 brand .retrieve ,
619725 )
726+ self .ai_query = async_to_raw_response_wrapper (
727+ brand .ai_query ,
728+ )
620729 self .identify_from_transaction = async_to_raw_response_wrapper (
621730 brand .identify_from_transaction ,
622731 )
@@ -638,6 +747,9 @@ def __init__(self, brand: BrandResource) -> None:
638747 self .retrieve = to_streamed_response_wrapper (
639748 brand .retrieve ,
640749 )
750+ self .ai_query = to_streamed_response_wrapper (
751+ brand .ai_query ,
752+ )
641753 self .identify_from_transaction = to_streamed_response_wrapper (
642754 brand .identify_from_transaction ,
643755 )
@@ -659,6 +771,9 @@ def __init__(self, brand: AsyncBrandResource) -> None:
659771 self .retrieve = async_to_streamed_response_wrapper (
660772 brand .retrieve ,
661773 )
774+ self .ai_query = async_to_streamed_response_wrapper (
775+ brand .ai_query ,
776+ )
662777 self .identify_from_transaction = async_to_streamed_response_wrapper (
663778 brand .identify_from_transaction ,
664779 )
0 commit comments