Class WebSearchRequest.Builder

java.lang.Object
dev.langchain4j.web.search.WebSearchRequest.Builder
Enclosing class:
WebSearchRequest

public static final class WebSearchRequest.Builder extends Object
  • Method Details

    • searchTerms

      public WebSearchRequest.Builder searchTerms(String searchTerms)
      Set the search terms.
      Parameters:
      searchTerms - The keyword or keywords desired by the search user.
      Returns:
      The builder instance.
    • maxResults

      public WebSearchRequest.Builder maxResults(Integer maxResults)
      Set the maximum number of results.
      Parameters:
      maxResults - The maximum number of results.
      Returns:
      The builder instance.
    • language

      public WebSearchRequest.Builder language(String language)
      Set the desired language for search results.
      Parameters:
      language - The desired language for search results.
      Returns:
      The builder instance.
    • geoLocation

      public WebSearchRequest.Builder geoLocation(String geoLocation)
      Set the desired geolocation for search results.
      Parameters:
      geoLocation - The desired geolocation for search results.
      Returns:
      The builder instance.
    • startPage

      public WebSearchRequest.Builder startPage(Integer startPage)
      Set the start page number for search results.
      Parameters:
      startPage - The start page number for search results.
      Returns:
      The builder instance.
    • startIndex

      public WebSearchRequest.Builder startIndex(Integer startIndex)
      Set the start index for search results.
      Parameters:
      startIndex - The start index for search results.
      Returns:
      The builder instance.
    • safeSearch

      public WebSearchRequest.Builder safeSearch(Boolean safeSearch)
      Set the safe search flag.
      Parameters:
      safeSearch - The safe search flag.
      Returns:
      The builder instance.
    • additionalParams

      public WebSearchRequest.Builder additionalParams(Map<String,Object> additionalParams)
      Set the additional parameters for the search request.
      Parameters:
      additionalParams - The additional parameters for the search request.
      Returns:
      The builder instance.
    • build

      public WebSearchRequest build()
      Build the web search request.
      Returns:
      The web search request.