Package dev.langchain4j.web.search
Class WebSearchTool
-
- All Implemented Interfaces:
public class WebSearchTool
-
-
Constructor Summary
Constructors Constructor Description WebSearchTool(WebSearchEngine searchEngine)
-
Method Summary
Modifier and Type Method Description String
searchWeb(String query)
Runs a search query on the web search engine and returns a pretty-string representation of the search results. static WebSearchTool
from(WebSearchEngine searchEngine)
Creates a new WebSearchTool with the specified web search engine. -
-
Constructor Detail
-
WebSearchTool
WebSearchTool(WebSearchEngine searchEngine)
-
-
Method Detail
-
searchWeb
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
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
-
-
-
-