类 GoogleCustomWebSearchEngine
java.lang.Object
dev.langchain4j.web.search.google.customsearch.GoogleCustomWebSearchEngine
- 所有已实现的接口:
WebSearchEngine
An implementation of a
WebSearchEngine that uses
Google Custom Search API for performing web searches.-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明search(WebSearchRequest webSearchRequest) static GoogleCustomWebSearchEnginewithApiKeyAndCsi(String apiKey, String csi) Creates a new builder for constructing a GoogleCustomWebSearchEngine with the specified API key and Custom Search ID.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 dev.langchain4j.web.search.WebSearchEngine
search
-
构造器详细资料
-
GoogleCustomWebSearchEngine
public GoogleCustomWebSearchEngine(String apiKey, String csi, Boolean siteRestrict, Boolean includeImages, Duration timeout, Integer maxRetries, Boolean logRequests, Boolean logResponses) Constructs a new GoogleCustomWebSearchEngine with the specified parameters.- 参数:
apiKey- the Google Search API key for accessing the Google Custom Search APIYou can just generate an API key here
csi- the Custom Search ID parameter for search the entire webYou can create a Custom Search Engine here
siteRestrict- if your Search Engine is restricted to only searching specific sites, you can set this parameter to true.Default value is false. View the documentation for more information here
includeImages- If it is true then include public images relevant to the query. This can add more latency to the search.Default value is false.
timeout- the timeout duration for API requestsDefault value is 60 seconds.
maxRetries- the maximum number of retries for API requestsDefault value is 10.
logRequests- whether to log API requestsDefault value is false.
logResponses- whether to log API responsesDefault value is false.
-
-
方法详细资料
-
withApiKeyAndCsi
Creates a new builder for constructing a GoogleCustomWebSearchEngine with the specified API key and Custom Search ID.- 参数:
apiKey- the API key for accessing the Google Custom Search APIcsi- the Custom Search ID parameter for search the entire web- 返回:
- a new builder instance
-
search
- 指定者:
search在接口中WebSearchEngine
-