Package com.hw.langchain.utilities
Class GoogleSearchAPIWrapper
java.lang.Object
com.hw.langchain.utilities.GoogleSearchAPIWrapper
Wrapper for Google Search API.
- Create an API key
- Setup Custom Search Engine to search the entire web
- Enable the Custom Search API
- Author:
- HamaWhite
-
Nested Class Summary
-
Method Summary
-
Method Details
-
run
Run a query through Google Search and parse the results.- Parameters:
query
- The search query to be executed.- Returns:
- A string containing snippets from the Google Search results, joined with spaces.
-
results
Run query through GoogleSearch and return metadata.- Parameters:
query
- The query to search for.num
- The number of results to return.- Returns:
- A list of dictionaries with the following keys:
- snippet - The description of the result.
- title - The title of the result.
- link - The link to the result.
-
builder
-