Class TavilyWebSearchEngine
java.lang.Object
dev.langchain4j.web.search.tavily.TavilyWebSearchEngine
- All Implemented Interfaces:
WebSearchEngine
Represents Tavily Search API as a
When
When
WebSearchEngine
.
See more details here.
When
includeRawContent
is set to true
,
the raw content will appear in the WebSearchOrganicResult.content()
field of each result.
When
includeAnswer
is set to true
,
the answer will appear in the WebSearchOrganicResult.snippet()
field of the first result.
In this case, the WebSearchOrganicResult.url()
of the first result will always be "https://tavily.com/" and
the WebSearchOrganicResult.title()
will always be "Tavily Search API".-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionsearch
(WebSearchRequest webSearchRequest) Performs a search request on the web search engine and returns the search results.static TavilyWebSearchEngine
withApiKey
(String apiKey) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.web.search.WebSearchEngine
search
-
Constructor Details
-
TavilyWebSearchEngine
-
-
Method Details
-
search
Description copied from interface:WebSearchEngine
Performs a search request on the web search engine and returns the search results.- Specified by:
search
in interfaceWebSearchEngine
- Parameters:
webSearchRequest
- the search request- Returns:
- the web search results
-
withApiKey
-