Class WebSearchContentRetriever
java.lang.Object
dev.langchain4j.rag.content.retriever.WebSearchContentRetriever
- All Implemented Interfaces:
ContentRetriever
A
It returns one
Depending on the
ContentRetriever
that retrieves relevant Content
from the web using a WebSearchEngine
.
It returns one
Content
for each result that a WebSearchEngine
has returned for a given Query
.
Depending on the
WebSearchEngine
implementation, the Content.textSegment()
can contain either a snippet of a web page or a complete content of a web page.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Constructor Summary
ConstructorDescriptionWebSearchContentRetriever
(WebSearchEngine webSearchEngine, Integer maxResults) -
Method Summary
-
Constructor Details
-
WebSearchContentRetriever
-
-
Method Details
-
builder
-
retrieve
Description copied from interface:ContentRetriever
Retrieves relevantContent
s using a givenQuery
. TheContent
s are sorted by relevance, with the most relevantContent
s appearing at the beginning of the returnedList<Content>
.- Specified by:
retrieve
in interfaceContentRetriever
- Parameters:
query
- TheQuery
to use for retrieval.- Returns:
- A list of retrieved
Content
s.
-