Class WebSearchTool

java.lang.Object
dev.langchain4j.web.search.WebSearchTool

public class WebSearchTool extends Object
  • Constructor Details

  • Method Details

    • searchWeb

      public String searchWeb(String query)
      Runs a search query on the web search engine and returns a pretty-string representation of the search results.
      Parameters:
      query - the search user query
      Returns:
      a pretty-string representation of the search results
    • from

      public static WebSearchTool from(WebSearchEngine searchEngine)
      Creates a new WebSearchTool with the specified web search engine.
      Parameters:
      searchEngine - the web search engine to use for searching the web
      Returns:
      a new WebSearchTool