@@ -53,6 +53,8 @@ def search(
53
53
output_type : Literal ["searchResults" , "sourcedAnswer" , "structured" ],
54
54
structured_output_schema : Union [Type [BaseModel ], str , None ] = None ,
55
55
include_images : bool = False ,
56
+ exclude_domains : Union [list [str ], None ] = None ,
57
+ include_domains : Union [list [str ], None ] = None ,
56
58
from_date : Union [date , None ] = None ,
57
59
to_date : Union [date , None ] = None ,
58
60
) -> Any :
@@ -72,6 +74,8 @@ def search(
72
74
valid object JSON schema.
73
75
include_images: If output_type is "searchResults", specifies if the response can include
74
76
images. Default to False.
77
+ exclude_domains: If you want to exclude specific domains from your search.
78
+ include_domains: If you want the search to only return results from certain domains.
75
79
from_date: The date from which the search results should be considered. If None, the
76
80
search results will not be filtered by date.
77
81
to_date: The date until which the search results should be considered. If None, the
@@ -93,12 +97,14 @@ def search(
93
97
LinkupInsufficientCreditError: If you have run out of credit.
94
98
LinkupNoResultError: If the search query did not yield any result.
95
99
"""
96
- params : Dict [str , Union [str , bool ]] = self ._get_search_params (
100
+ params : Dict [str , Union [str , bool , list [ str ] ]] = self ._get_search_params (
97
101
query = query ,
98
102
depth = depth ,
99
103
output_type = output_type ,
100
104
structured_output_schema = structured_output_schema ,
101
105
include_images = include_images ,
106
+ exclude_domains = exclude_domains ,
107
+ include_domains = include_domains ,
102
108
from_date = from_date ,
103
109
to_date = to_date ,
104
110
)
@@ -125,6 +131,8 @@ async def async_search(
125
131
output_type : Literal ["searchResults" , "sourcedAnswer" , "structured" ],
126
132
structured_output_schema : Union [Type [BaseModel ], str , None ] = None ,
127
133
include_images : bool = False ,
134
+ exclude_domains : Union [list [str ], None ] = None ,
135
+ include_domains : Union [list [str ], None ] = None ,
128
136
from_date : Union [date , None ] = None ,
129
137
to_date : Union [date , None ] = None ,
130
138
) -> Any :
@@ -144,6 +152,8 @@ async def async_search(
144
152
valid object JSON schema.
145
153
include_images: If output_type is "searchResults", specifies if the response can include
146
154
images. Default to False
155
+ exclude_domains: If you want to exclude specific domains from your search.
156
+ include_domains: If you want the search to only return results from certain domains.
147
157
from_date: The date from which the search results should be considered. If None, the
148
158
search results will not be filtered by date.
149
159
to_date: The date until which the search results should be considered. If None, the
@@ -164,12 +174,14 @@ async def async_search(
164
174
LinkupAuthenticationError: If the Linkup API key is invalid, or there is no more credit
165
175
available.
166
176
"""
167
- params : Dict [str , Union [str , bool ]] = self ._get_search_params (
177
+ params : Dict [str , Union [str , bool , list [ str ] ]] = self ._get_search_params (
168
178
query = query ,
169
179
depth = depth ,
170
180
output_type = output_type ,
171
181
structured_output_schema = structured_output_schema ,
172
182
include_images = include_images ,
183
+ exclude_domains = exclude_domains ,
184
+ include_domains = include_domains ,
173
185
from_date = from_date ,
174
186
to_date = to_date ,
175
187
)
@@ -303,9 +315,11 @@ def _get_search_params(
303
315
structured_output_schema : Union [Type [BaseModel ], str , None ],
304
316
include_images : bool ,
305
317
from_date : Union [date , None ],
318
+ include_domains : Union [list [str ], None ],
319
+ exclude_domains : Union [list [str ], None ],
306
320
to_date : Union [date , None ],
307
- ) -> Dict [str , Union [str , bool ]]:
308
- params : Dict [str , Union [str , bool ]] = dict (
321
+ ) -> Dict [str , Union [str , bool , list [ str ] ]]:
322
+ params : Dict [str , Union [str , bool , list [ str ] ]] = dict (
309
323
q = query ,
310
324
depth = depth ,
311
325
outputType = output_type ,
@@ -324,6 +338,10 @@ def _get_search_params(
324
338
)
325
339
if from_date is not None :
326
340
params ["fromDate" ] = from_date .isoformat ()
341
+ if exclude_domains is not None :
342
+ params ["excludeDomains" ] = exclude_domains
343
+ if include_domains is not None :
344
+ params ["includeDomains" ] = include_domains
327
345
if to_date is not None :
328
346
params ["toDate" ] = to_date .isoformat ()
329
347
0 commit comments