Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image links and favicon support #51

Merged
merged 2 commits into from
Dec 25, 2024
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
7 changes: 5 additions & 2 deletions exa_py/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ class ExtrasOptions(TypedDict, total=False):
"""

links: int
image_links: int

@dataclass
class _Result:
Expand All @@ -242,7 +243,7 @@ class _Result:
author (str, optional): If available, the author of the content.
image (str, optional): If available, a URL to an image associated with the content.
subpages (List[_Result], optional): If available, a list of Exa contents results for a page's subpages (e.g. tesla.com --subpage--> shop.tesla.com)
extras (Dict, optional): Additional metadata associated with the result; currently supports returning links in the text content
extras (Dict, optional): Additional metadata associated with the result; currently supports returning links and image links extracted from the text content
"""

url: str
Expand All @@ -252,6 +253,7 @@ class _Result:
published_date: Optional[str] = None
author: Optional[str] = None
image: Optional[str] = None
favicon: Optional[str] = None
subpages: Optional[List[_Result]] = None
extras: Optional[Dict] = None

Expand All @@ -263,6 +265,7 @@ def __init__(self, **kwargs):
self.published_date = kwargs.get('published_date')
self.author = kwargs.get('author')
self.image = kwargs.get('image')
self.favicon = kwargs.get('favicon')
self.subpages = kwargs.get('subpages')
self.extras = kwargs.get("extras")

Expand Down Expand Up @@ -546,7 +549,7 @@ def __init__(
self,
api_key: Optional[str],
base_url: str = "https://api.exa.ai",
user_agent: str = "exa-py 1.6.0",
user_agent: str = "exa-py 1.7.0",
):
"""Initialize the Exa client with the provided API key and optional base URL and user agent.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="exa_py",
version="1.6.0",
version="1.7.0",
description="Python SDK for Exa API.",
long_description_content_type="text/markdown",
long_description=open("README.md").read(),
Expand Down
Loading