Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion linkup/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.4"
__version__ = "0.2.5"
12 changes: 10 additions & 2 deletions linkup/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ async def async_search(
output_type: Literal["searchResults", "sourcedAnswer", "structured"],
structured_output_schema: Union[Type[BaseModel], str, None] = None,
include_images: bool = False,
from_date: Union[date, None] = None,
to_date: Union[date, None] = None,
) -> Any:
"""
Asynchronously search for a query in the Linkup API.
Expand All @@ -141,6 +143,10 @@ async def async_search(
valid object JSON schema.
include_images: If output_type is "searchResults", specifies if the response can include
images. Default to False
from_date: The date from which the search results should be considered. If None, the
search results will not be filtered by date.
to_date: The date until which the search results should be considered. If None, the
search results will not be filtered by date.

Returns:
The Linkup API search result. If output_type is "searchResults", the result will be a
Expand All @@ -163,6 +169,8 @@ async def async_search(
output_type=output_type,
structured_output_schema=structured_output_schema,
include_images=include_images,
from_date=from_date,
to_date=to_date,
)

response: httpx.Response = await self._async_request(
Expand Down Expand Up @@ -278,8 +286,8 @@ def _get_search_params(
output_type: Literal["searchResults", "sourcedAnswer", "structured"],
structured_output_schema: Union[Type[BaseModel], str, None],
include_images: bool,
from_date: Union[date, None] = None,
to_date: Union[date, None] = None,
from_date: Union[date, None],
to_date: Union[date, None],
) -> Dict[str, Union[str, bool]]:
params: Dict[str, Union[str, bool]] = dict(
q=query,
Expand Down