_run() — langchain Function Reference
Architecture documentation for the _run() function in tools.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD e812ff94_a0ea_6298_d40c_2217749bbadd["_run()"] 2b330890_d049_cc63_2764_fc9bcce52bfb["ExaFindSimilarResults"] e812ff94_a0ea_6298_d40c_2217749bbadd -->|defined in| 2b330890_d049_cc63_2764_fc9bcce52bfb 2ca892f8_801d_f665_c823_eced16c2ea0d["_run()"] 2ca892f8_801d_f665_c823_eced16c2ea0d -->|calls| e812ff94_a0ea_6298_d40c_2217749bbadd 2ca892f8_801d_f665_c823_eced16c2ea0d["_run()"] e812ff94_a0ea_6298_d40c_2217749bbadd -->|calls| 2ca892f8_801d_f665_c823_eced16c2ea0d style e812ff94_a0ea_6298_d40c_2217749bbadd fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/exa/langchain_exa/tools.py lines 183–242
def _run(
self,
url: str,
num_results: int = 10,
text_contents_options: TextContentsOptions # noqa: FBT001
| dict[str, Any]
| bool
| None = None,
highlights: HighlightsContentsOptions | bool | None = None, # noqa: FBT001
include_domains: list[str] | None = None,
exclude_domains: list[str] | None = None,
start_crawl_date: str | None = None,
end_crawl_date: str | None = None,
start_published_date: str | None = None,
end_published_date: str | None = None,
exclude_source_domain: bool | None = None, # noqa: FBT001
category: str | None = None,
livecrawl: Literal["always", "fallback", "never"] | None = None,
summary: bool | dict[str, str] | None = None, # noqa: FBT001
run_manager: CallbackManagerForToolRun | None = None,
) -> list[dict] | str:
"""Use the tool.
Args:
url: The URL to find similar pages for.
num_results: The number of search results to return (1 to 100). Default: 10
text_contents_options: How to set the page content of the results. Can be True or a dict with options like max_characters.
highlights: Whether to include highlights in the results.
include_domains: A list of domains to include in the search.
exclude_domains: A list of domains to exclude from the search.
start_crawl_date: The start date for the crawl (in YYYY-MM-DD format).
end_crawl_date: The end date for the crawl (in YYYY-MM-DD format).
start_published_date: The start date for when the document was published (in YYYY-MM-DD format).
end_published_date: The end date for when the document was published (in YYYY-MM-DD format).
exclude_source_domain: If `True`, exclude pages from the same domain as the source URL.
category: Filter for similar pages by category.
livecrawl: Option to crawl live webpages if content is not in the index. Options: "always", "fallback", "never"
summary: Whether to include a summary of the content. Can be a boolean or a dict with a custom query.
run_manager: The run manager for callbacks.
""" # noqa: E501
try:
return self.client.find_similar_and_contents(
url,
num_results=num_results,
text=text_contents_options,
highlights=highlights,
include_domains=include_domains,
exclude_domains=exclude_domains,
start_crawl_date=start_crawl_date,
end_crawl_date=end_crawl_date,
start_published_date=start_published_date,
end_published_date=end_published_date,
exclude_source_domain=exclude_source_domain,
category=category,
livecrawl=livecrawl,
summary=summary,
) # type: ignore[call-overload, misc]
except Exception as e:
return repr(e)
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does _run() do?
_run() is a function in the langchain codebase, defined in libs/partners/exa/langchain_exa/tools.py.
Where is _run() defined?
_run() is defined in libs/partners/exa/langchain_exa/tools.py at line 183.
What does _run() call?
_run() calls 1 function(s): _run.
What calls _run()?
_run() is called by 1 function(s): _run.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free