77
88import httpx
99
10- from ..types import person_enrich_params
10+ from ..types import person_enrich_params , person_search_params
1111from .._types import Body , Omit , Query , Headers , NotGiven , SequenceNotStr , omit , not_given
1212from .._utils import maybe_transform , async_maybe_transform
1313from .._compat import cached_property
2020)
2121from .._base_client import make_request_options
2222from ..types .person_enrich_response import PersonEnrichResponse
23+ from ..types .person_search_response import PersonSearchResponse
2324
2425__all__ = ["PeopleResource" , "AsyncPeopleResource" ]
2526
@@ -120,6 +121,57 @@ def enrich(
120121 cast_to = PersonEnrichResponse ,
121122 )
122123
124+ def search (
125+ self ,
126+ * ,
127+ query : str ,
128+ cursor : str | Omit = omit ,
129+ filters : person_search_params .Filters | Omit = omit ,
130+ tags : SequenceNotStr [str ] | Omit = omit ,
131+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
132+ # The extra values given here take precedence over values defined on the client or passed to this method.
133+ extra_headers : Headers | None = None ,
134+ extra_query : Query | None = None ,
135+ extra_body : Body | None = None ,
136+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
137+ ) -> PersonSearchResponse :
138+ """
139+ Find people with a natural-language query.
140+
141+ Args:
142+ query: Describe the people to find.
143+
144+ cursor: Use next_cursor with the same query and filters to fetch the next page.
145+
146+ filters: Additional constraints every result must match.
147+
148+ tags: Labels for filtering usage in the dashboard.
149+
150+ extra_headers: Send extra headers
151+
152+ extra_query: Add additional query parameters to the request
153+
154+ extra_body: Add additional JSON properties to the request
155+
156+ timeout: Override the client-level default timeout for this request, in seconds
157+ """
158+ return self ._post (
159+ "/people/search" ,
160+ body = maybe_transform (
161+ {
162+ "query" : query ,
163+ "cursor" : cursor ,
164+ "filters" : filters ,
165+ "tags" : tags ,
166+ },
167+ person_search_params .PersonSearchParams ,
168+ ),
169+ options = make_request_options (
170+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
171+ ),
172+ cast_to = PersonSearchResponse ,
173+ )
174+
123175
124176class AsyncPeopleResource (AsyncAPIResource ):
125177 @cached_property
@@ -217,6 +269,57 @@ async def enrich(
217269 cast_to = PersonEnrichResponse ,
218270 )
219271
272+ async def search (
273+ self ,
274+ * ,
275+ query : str ,
276+ cursor : str | Omit = omit ,
277+ filters : person_search_params .Filters | Omit = omit ,
278+ tags : SequenceNotStr [str ] | Omit = omit ,
279+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
280+ # The extra values given here take precedence over values defined on the client or passed to this method.
281+ extra_headers : Headers | None = None ,
282+ extra_query : Query | None = None ,
283+ extra_body : Body | None = None ,
284+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
285+ ) -> PersonSearchResponse :
286+ """
287+ Find people with a natural-language query.
288+
289+ Args:
290+ query: Describe the people to find.
291+
292+ cursor: Use next_cursor with the same query and filters to fetch the next page.
293+
294+ filters: Additional constraints every result must match.
295+
296+ tags: Labels for filtering usage in the dashboard.
297+
298+ extra_headers: Send extra headers
299+
300+ extra_query: Add additional query parameters to the request
301+
302+ extra_body: Add additional JSON properties to the request
303+
304+ timeout: Override the client-level default timeout for this request, in seconds
305+ """
306+ return await self ._post (
307+ "/people/search" ,
308+ body = await async_maybe_transform (
309+ {
310+ "query" : query ,
311+ "cursor" : cursor ,
312+ "filters" : filters ,
313+ "tags" : tags ,
314+ },
315+ person_search_params .PersonSearchParams ,
316+ ),
317+ options = make_request_options (
318+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
319+ ),
320+ cast_to = PersonSearchResponse ,
321+ )
322+
220323
221324class PeopleResourceWithRawResponse :
222325 def __init__ (self , people : PeopleResource ) -> None :
@@ -225,6 +328,9 @@ def __init__(self, people: PeopleResource) -> None:
225328 self .enrich = to_raw_response_wrapper (
226329 people .enrich ,
227330 )
331+ self .search = to_raw_response_wrapper (
332+ people .search ,
333+ )
228334
229335
230336class AsyncPeopleResourceWithRawResponse :
@@ -234,6 +340,9 @@ def __init__(self, people: AsyncPeopleResource) -> None:
234340 self .enrich = async_to_raw_response_wrapper (
235341 people .enrich ,
236342 )
343+ self .search = async_to_raw_response_wrapper (
344+ people .search ,
345+ )
237346
238347
239348class PeopleResourceWithStreamingResponse :
@@ -243,6 +352,9 @@ def __init__(self, people: PeopleResource) -> None:
243352 self .enrich = to_streamed_response_wrapper (
244353 people .enrich ,
245354 )
355+ self .search = to_streamed_response_wrapper (
356+ people .search ,
357+ )
246358
247359
248360class AsyncPeopleResourceWithStreamingResponse :
@@ -252,3 +364,6 @@ def __init__(self, people: AsyncPeopleResource) -> None:
252364 self .enrich = async_to_streamed_response_wrapper (
253365 people .enrich ,
254366 )
367+ self .search = async_to_streamed_response_wrapper (
368+ people .search ,
369+ )
0 commit comments