forked from langchain4j/langchain4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
548d979
commit ff28ce0
Showing
7 changed files
with
80 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
...b-search-engine-brave/src/main/java/dev/langchain4j/web/search/brave/BraveSearchDemo.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...h-engine-brave/src/test/java/dev/langchain4j/web/search/brave/BraveWebSearchEngineIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package dev.langchain4j.web.search.brave; | ||
|
||
import dev.langchain4j.web.search.WebSearchEngine; | ||
import dev.langchain4j.web.search.WebSearchEngineIT; | ||
import dev.langchain4j.web.search.WebSearchRequest; | ||
|
||
import java.time.Duration; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class BraveWebSearchEngineIT extends WebSearchEngineIT { | ||
|
||
@Override | ||
protected WebSearchEngine searchEngine() { | ||
// Parameters for the BraveWebSearchEngine | ||
String baseUrl = "https://api.search.brave.com"; | ||
String apiKey = ""; // Replace with your API key | ||
Duration timeout = Duration.ofSeconds(10); | ||
Integer count = WebSearchEngineIT.EXPECTED_MAX_RESULTS; | ||
String safeSearch = "off"; | ||
String resultFilter = "web"; | ||
String freshness = ""; | ||
Map<String, Object> params = new HashMap<>(); | ||
params.put("count",count); | ||
params.put("safeSearch",safeSearch); | ||
params.put("resultFilter",resultFilter); | ||
params.put("freshness",freshness); | ||
return new BraveWebSearchEngine(baseUrl,apiKey,timeout,params); | ||
} | ||
} | ||
|