Class LangChain4jWebSearchConfiguration
java.lang.Object
org.apache.camel.component.langchain4j.web.search.LangChain4jWebSearchConfiguration
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Thelanguageis the desired language for search results.ThemaxResultsis the expected number of results to be found if the search request were made.dev.langchain4j.web.search.WebSearchEnginedev.langchain4j.web.search.WebSearchRequestvoidsetAdditionalParams(Map<String, Object> additionalParams) TheadditionalParamsis the additional parameters for the search request are a map of key-value pairs that represent additional parameters for the search request.voidsetGeoLocation(String geoLocation) ThegeoLocationis the desired geolocation for search results.voidsetLanguage(String language) voidsetMaxResults(Integer maxResults) voidsetResultType(LangChain4jWebSearchResultType resultType) TheresultTypeis the result type of the request.voidsetSafeSearch(Boolean safeSearch) ThesafeSearchis the safe search flag, indicating whether to enable or disable safe search.voidsetStartIndex(Integer startIndex) ThestartIndexis the start index for search results, which may vary depending on the search engine.voidsetStartPage(Integer startPage) ThestartPageis the start page number for search resultsvoidsetWebSearchEngine(dev.langchain4j.web.search.WebSearchEngine webSearchEngine) TheWebSearchEngineengine to use.voidsetWebSearchRequest(dev.langchain4j.web.search.WebSearchRequest webSearchRequest) ThewebSearchRequestis the custom WebSearchRequest - advanced
-
Constructor Details
-
LangChain4jWebSearchConfiguration
public LangChain4jWebSearchConfiguration()
-
-
Method Details
-
getWebSearchEngine
public dev.langchain4j.web.search.WebSearchEngine getWebSearchEngine() -
setWebSearchEngine
public void setWebSearchEngine(dev.langchain4j.web.search.WebSearchEngine webSearchEngine) TheWebSearchEngineengine to use. This is mandatory. Use one of the implementations from Langchain4j web search engines. -
getResultType
-
setResultType
TheresultTypeis the result type of the request. Valid values are LANGCHAIN4J_WEB_SEARCH_ORGANIC_RESULT, CONTENT, or SNIPPET. CONTENT is the default value; it will return a list of String . You can also specify to return either the Langchain4j Web Search Organic Result object (using `LANGCHAIN4J_WEB_SEARCH_ORGANIC_RESULT`) or snippet (using `SNIPPET`) for each result. IfmaxResultsis equal to 1, the response will be a single object instead of a list. -
getMaxResults
ThemaxResultsis the expected number of results to be found if the search request were made. Each search engine may have a different limit for the maximum number of results that can be returned.- Returns:
-
setMaxResults
-
getLanguage
Thelanguageis the desired language for search results. The expected values may vary depending on the search engine.- Returns:
-
setLanguage
-
getGeoLocation
-
setGeoLocation
ThegeoLocationis the desired geolocation for search results. Each search engine may have a different set of supported geolocations. -
getStartPage
-
setStartPage
ThestartPageis the start page number for search results -
getStartIndex
-
setStartIndex
ThestartIndexis the start index for search results, which may vary depending on the search engine. -
getSafeSearch
-
setSafeSearch
ThesafeSearchis the safe search flag, indicating whether to enable or disable safe search. -
getAdditionalParams
-
setAdditionalParams
TheadditionalParamsis the additional parameters for the search request are a map of key-value pairs that represent additional parameters for the search request. -
getWebSearchRequest
public dev.langchain4j.web.search.WebSearchRequest getWebSearchRequest() -
setWebSearchRequest
public void setWebSearchRequest(dev.langchain4j.web.search.WebSearchRequest webSearchRequest) ThewebSearchRequestis the custom WebSearchRequest - advanced -
copy
-