Package dev.langchain4j.web.search
Class WebSearchInformationResult
java.lang.Object
dev.langchain4j.web.search.WebSearchInformationResult
Represents general information about the web search performed.
This includes the total number of results, the page number, and metadata.
The total number of results is the total number of web pages that are found by the search engine in response to a search query. The page number is the current page number of the search results. The metadata is a map of key-value pairs that provide additional information about the search. For example, it could include the search query, the search engine used, the time it took to perform the search, etc.
-
Constructor Summary
ConstructorDescriptionWebSearchInformationResult
(Long totalResults) Constructs a new WebSearchInformationResult with the specified total results.Constructs a new WebSearchInformationResult with the specified total results, page number, and metadata. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static WebSearchInformationResult
Creates a new WebSearchInformationResult with the specified total results.static WebSearchInformationResult
Creates a new WebSearchInformationResult with the specified total results, page number, and metadata.int
hashCode()
metadata()
Gets the metadata.Gets the page number.toString()
Gets the total number of results.
-
Constructor Details
-
WebSearchInformationResult
Constructs a new WebSearchInformationResult with the specified total results.- Parameters:
totalResults
- The total number of results.
-
WebSearchInformationResult
public WebSearchInformationResult(Long totalResults, Integer pageNumber, Map<String, Object> metadata) Constructs a new WebSearchInformationResult with the specified total results, page number, and metadata.- Parameters:
totalResults
- The total number of results.pageNumber
- The page number.metadata
- The metadata.
-
-
Method Details
-
totalResults
Gets the total number of results.- Returns:
- The total number of results.
-
pageNumber
Gets the page number.- Returns:
- The page number.
-
metadata
Gets the metadata.- Returns:
- The metadata.
-
equals
-
hashCode
public int hashCode() -
toString
-
from
Creates a new WebSearchInformationResult with the specified total results.- Parameters:
totalResults
- The total number of results.- Returns:
- The new WebSearchInformationResult.
-
from
public static WebSearchInformationResult from(Long totalResults, Integer pageNumber, Map<String, Object> metadata) Creates a new WebSearchInformationResult with the specified total results, page number, and metadata.- Parameters:
totalResults
- The total number of results.pageNumber
- The page number.metadata
- The metadata.- Returns:
- The new WebSearchInformationResult.
-