类 WebSearchResults
java.lang.Object
dev.langchain4j.web.search.WebSearchResults
Represents the response of a web search performed.
This includes the list of organic search results, information about the search, and pagination information.
WebSearchResults follow opensearch foundation standard implemented by most web search engine libs like Google, Bing, Yahoo, etc.
OpenSearch#response
The organic search results are the web pages that are returned by the search engine in response to a search query. These results are typically ranked by relevance to the search query.
-
构造器概要
构造器构造器说明WebSearchResults(WebSearchInformationResult searchInformation, List<WebSearchOrganicResult> results) Constructs a new instance of WebSearchResults.WebSearchResults(Map<String, Object> searchMetadata, WebSearchInformationResult searchInformation, List<WebSearchOrganicResult> results) Constructs a new instance of WebSearchResults. -
方法概要
修饰符和类型方法说明booleanstatic WebSearchResultsfrom(WebSearchInformationResult searchInformation, List<WebSearchOrganicResult> results) Creates a new instance of WebSearchResults from the specified parameters.static WebSearchResultsfrom(Map<String, Object> searchMetadata, WebSearchInformationResult searchInformation, List<WebSearchOrganicResult> results) Creates a new instance of WebSearchResults from the specified parameters.inthashCode()results()Gets the list of organic search results.Gets the information about the web search.Gets the metadata associated with the web search.Converts the organic search results to a list of documents.toString()Converts the organic search results to a list of text segments.
-
构造器详细资料
-
WebSearchResults
public WebSearchResults(WebSearchInformationResult searchInformation, List<WebSearchOrganicResult> results) Constructs a new instance of WebSearchResults.- 参数:
searchInformation- The information about the web search.results- The list of organic search results.
-
WebSearchResults
public WebSearchResults(Map<String, Object> searchMetadata, WebSearchInformationResult searchInformation, List<WebSearchOrganicResult> results) Constructs a new instance of WebSearchResults.- 参数:
searchMetadata- The metadata associated with the web search.searchInformation- The information about the web search.results- The list of organic search results.
-
-
方法详细资料
-
searchMetadata
Gets the metadata associated with the web search.- 返回:
- The metadata associated with the web search.
-
searchInformation
Gets the information about the web search.- 返回:
- The information about the web search.
-
results
Gets the list of organic search results.- 返回:
- The list of organic search results.
-
equals
-
hashCode
public int hashCode() -
toString
-
toTextSegments
Converts the organic search results to a list of text segments.- 返回:
- The list of text segments.
-
toDocuments
Converts the organic search results to a list of documents.- 返回:
- The list of documents.
-
from
public static WebSearchResults from(WebSearchInformationResult searchInformation, List<WebSearchOrganicResult> results) Creates a new instance of WebSearchResults from the specified parameters.- 参数:
results- The list of organic search results.searchInformation- The information about the web search.- 返回:
- The new instance of WebSearchResults.
-
from
public static WebSearchResults from(Map<String, Object> searchMetadata, WebSearchInformationResult searchInformation, List<WebSearchOrganicResult> results) Creates a new instance of WebSearchResults from the specified parameters.- 参数:
searchMetadata- The metadata associated with the search results.searchInformation- The information about the web search.results- The list of organic search results.- 返回:
- The new instance of WebSearchResults.
-