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
Nested ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
ConstructorsConstructorDescriptionWebSearchContentRetriever(WebSearchEngine webSearchEngine, Integer maxResults) -
Method Summary
-
Constructor Details
-
WebSearchContentRetriever
-
-
Method Details
-
builder
-
retrieve
Description copied from interface:ContentRetrieverRetrieves relevantContents using a givenQuery. TheContents are sorted by relevance, with the most relevantContents appearing at the beginning of the returnedList<Content>.- Specified by:
retrievein interfaceContentRetriever- Parameters:
query- TheQueryto use for retrieval.- Returns:
- A list of retrieved
Contents.
-