Skip to content

Commit 38a24e6

Browse files
BruceWouaigneBruceWouaigne
authored andcommitted
Fix for pyton3.9
1 parent a91cad2 commit 38a24e6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

linkup/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def search(
8585
LinkupInsufficientCreditError: If you have run out of credit.
8686
LinkupNoResultError: If the search query did not yield any result.
8787
"""
88-
params: Dict[str, str] = self._get_search_params(
88+
params: Dict[str, Union[str, bool]] = self._get_search_params(
8989
query=query,
9090
depth=depth,
9191
output_type=output_type,
@@ -148,7 +148,7 @@ async def async_search(
148148
LinkupAuthenticationError: If the Linkup API key is invalid, or there is no more credit
149149
available.
150150
"""
151-
params: Dict[str, str] = self._get_search_params(
151+
params: Dict[str, Union[str, bool]] = self._get_search_params(
152152
query=query,
153153
depth=depth,
154154
output_type=output_type,
@@ -253,7 +253,6 @@ def _get_search_params(
253253
q=query,
254254
depth=depth,
255255
outputType=output_type,
256-
includeImages=include_images,
257256
)
258257

259258
if output_type == "structured" and structured_output_schema is not None:
@@ -267,6 +266,9 @@ def _get_search_params(
267266
f"Unexpected structured_output_schema type: '{type(structured_output_schema)}'"
268267
)
269268

269+
if include_images:
270+
params["includeImages"] = True
271+
270272
return params
271273

272274
def _validate_search_response(

linkup/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class LinkupSearchResults(BaseModel):
4141
results: The results of the Linkup search.
4242
"""
4343

44-
results: List[Union[LinkupSearchTextResult | LinkupSearchImageResult]]
44+
results: List[Union[LinkupSearchTextResult, LinkupSearchImageResult]]
4545

4646

4747
class LinkupSource(BaseModel):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.mypy]
2-
exclude = ['^tests/']
2+
exclude = ['^tests/', 'venv/', '.venv/']
33
strict = true
44

55
[tool.pytest.ini_options]

0 commit comments

Comments
 (0)