|
25 | 25 | findall_events_params, |
26 | 26 | findall_extend_params, |
27 | 27 | findall_ingest_params, |
| 28 | + findall_candidates_params, |
28 | 29 | ) |
29 | 30 | from ..._base_client import make_request_options |
30 | 31 | from ...types.beta.findall_run import FindAllRun |
|
35 | 36 | from ...types.beta.findall_run_result import FindAllRunResult |
36 | 37 | from ...types.beta.parallel_beta_param import ParallelBetaParam |
37 | 38 | from ...types.beta.findall_events_response import FindAllEventsResponse |
| 39 | +from ...types.beta.findall_candidates_response import FindAllCandidatesResponse |
38 | 40 |
|
39 | 41 | __all__ = [ |
40 | 42 | "FindAllResource", |
@@ -263,6 +265,59 @@ def cancel( |
263 | 265 | cast_to=object, |
264 | 266 | ) |
265 | 267 |
|
| 268 | + def candidates( |
| 269 | + self, |
| 270 | + *, |
| 271 | + entity_type: Literal["company", "people"], |
| 272 | + objective: str, |
| 273 | + match_limit: int | Omit = omit, |
| 274 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 275 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 276 | + extra_headers: Headers | None = None, |
| 277 | + extra_query: Query | None = None, |
| 278 | + extra_body: Body | None = None, |
| 279 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 280 | + ) -> FindAllCandidatesResponse: |
| 281 | + """ |
| 282 | + Return ranked entity candidates matching a natural language objective. |
| 283 | +
|
| 284 | + This endpoint performs a best-effort search optimised for low latency. For |
| 285 | + comprehensive match evaluation and enrichment, use the |
| 286 | + [FindAll API](https://docs.parallel.ai/findall-api/findall-quickstart). |
| 287 | +
|
| 288 | + Args: |
| 289 | + entity_type: Type of entity to search for. |
| 290 | +
|
| 291 | + objective: Natural language description of target entities. |
| 292 | +
|
| 293 | + match_limit: Maximum number of candidates to return. Must be between 5 and 1000 (inclusive). |
| 294 | + May return fewer results. Defaults to 100. |
| 295 | +
|
| 296 | + extra_headers: Send extra headers |
| 297 | +
|
| 298 | + extra_query: Add additional query parameters to the request |
| 299 | +
|
| 300 | + extra_body: Add additional JSON properties to the request |
| 301 | +
|
| 302 | + timeout: Override the client-level default timeout for this request, in seconds |
| 303 | + """ |
| 304 | + extra_headers = {"parallel-beta": "findall-2025-09-15", **(extra_headers or {})} |
| 305 | + return self._post( |
| 306 | + "/v1beta/findall/candidates", |
| 307 | + body=maybe_transform( |
| 308 | + { |
| 309 | + "entity_type": entity_type, |
| 310 | + "objective": objective, |
| 311 | + "match_limit": match_limit, |
| 312 | + }, |
| 313 | + findall_candidates_params.FindAllCandidatesParams, |
| 314 | + ), |
| 315 | + options=make_request_options( |
| 316 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 317 | + ), |
| 318 | + cast_to=FindAllCandidatesResponse, |
| 319 | + ) |
| 320 | + |
266 | 321 | def enrich( |
267 | 322 | self, |
268 | 323 | findall_id: str, |
@@ -808,6 +863,59 @@ async def cancel( |
808 | 863 | cast_to=object, |
809 | 864 | ) |
810 | 865 |
|
| 866 | + async def candidates( |
| 867 | + self, |
| 868 | + *, |
| 869 | + entity_type: Literal["company", "people"], |
| 870 | + objective: str, |
| 871 | + match_limit: int | Omit = omit, |
| 872 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 873 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 874 | + extra_headers: Headers | None = None, |
| 875 | + extra_query: Query | None = None, |
| 876 | + extra_body: Body | None = None, |
| 877 | + timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 878 | + ) -> FindAllCandidatesResponse: |
| 879 | + """ |
| 880 | + Return ranked entity candidates matching a natural language objective. |
| 881 | +
|
| 882 | + This endpoint performs a best-effort search optimised for low latency. For |
| 883 | + comprehensive match evaluation and enrichment, use the |
| 884 | + [FindAll API](https://docs.parallel.ai/findall-api/findall-quickstart). |
| 885 | +
|
| 886 | + Args: |
| 887 | + entity_type: Type of entity to search for. |
| 888 | +
|
| 889 | + objective: Natural language description of target entities. |
| 890 | +
|
| 891 | + match_limit: Maximum number of candidates to return. Must be between 5 and 1000 (inclusive). |
| 892 | + May return fewer results. Defaults to 100. |
| 893 | +
|
| 894 | + extra_headers: Send extra headers |
| 895 | +
|
| 896 | + extra_query: Add additional query parameters to the request |
| 897 | +
|
| 898 | + extra_body: Add additional JSON properties to the request |
| 899 | +
|
| 900 | + timeout: Override the client-level default timeout for this request, in seconds |
| 901 | + """ |
| 902 | + extra_headers = {"parallel-beta": "findall-2025-09-15", **(extra_headers or {})} |
| 903 | + return await self._post( |
| 904 | + "/v1beta/findall/candidates", |
| 905 | + body=await async_maybe_transform( |
| 906 | + { |
| 907 | + "entity_type": entity_type, |
| 908 | + "objective": objective, |
| 909 | + "match_limit": match_limit, |
| 910 | + }, |
| 911 | + findall_candidates_params.FindAllCandidatesParams, |
| 912 | + ), |
| 913 | + options=make_request_options( |
| 914 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 915 | + ), |
| 916 | + cast_to=FindAllCandidatesResponse, |
| 917 | + ) |
| 918 | + |
811 | 919 | async def enrich( |
812 | 920 | self, |
813 | 921 | findall_id: str, |
@@ -1155,6 +1263,9 @@ def __init__(self, findall: FindAllResource) -> None: |
1155 | 1263 | self.cancel = to_raw_response_wrapper( |
1156 | 1264 | findall.cancel, |
1157 | 1265 | ) |
| 1266 | + self.candidates = to_raw_response_wrapper( |
| 1267 | + findall.candidates, |
| 1268 | + ) |
1158 | 1269 | self.enrich = to_raw_response_wrapper( |
1159 | 1270 | findall.enrich, |
1160 | 1271 | ) |
@@ -1188,6 +1299,9 @@ def __init__(self, findall: AsyncFindAllResource) -> None: |
1188 | 1299 | self.cancel = async_to_raw_response_wrapper( |
1189 | 1300 | findall.cancel, |
1190 | 1301 | ) |
| 1302 | + self.candidates = async_to_raw_response_wrapper( |
| 1303 | + findall.candidates, |
| 1304 | + ) |
1191 | 1305 | self.enrich = async_to_raw_response_wrapper( |
1192 | 1306 | findall.enrich, |
1193 | 1307 | ) |
@@ -1221,6 +1335,9 @@ def __init__(self, findall: FindAllResource) -> None: |
1221 | 1335 | self.cancel = to_streamed_response_wrapper( |
1222 | 1336 | findall.cancel, |
1223 | 1337 | ) |
| 1338 | + self.candidates = to_streamed_response_wrapper( |
| 1339 | + findall.candidates, |
| 1340 | + ) |
1224 | 1341 | self.enrich = to_streamed_response_wrapper( |
1225 | 1342 | findall.enrich, |
1226 | 1343 | ) |
@@ -1254,6 +1371,9 @@ def __init__(self, findall: AsyncFindAllResource) -> None: |
1254 | 1371 | self.cancel = async_to_streamed_response_wrapper( |
1255 | 1372 | findall.cancel, |
1256 | 1373 | ) |
| 1374 | + self.candidates = async_to_streamed_response_wrapper( |
| 1375 | + findall.candidates, |
| 1376 | + ) |
1257 | 1377 | self.enrich = async_to_streamed_response_wrapper( |
1258 | 1378 | findall.enrich, |
1259 | 1379 | ) |
|
0 commit comments