Adding Brave Search as a fallback#5
Open
mefogle wants to merge 1 commit intoMaxMaeder:self-hostingfrom
Open
Conversation
…rave.com/app/documentation/web-search) if it finds an empty Bing key in the search service. The original format for results is preserved, allowing it to be used as a drop-in replacement. The template for the key file has also been updated with a placeholder for the Brave key.
Owner
|
Thanks for the contribution man! We probably want some sort of common interface, and an easy way to get the configured search service. For example, this is what I'm prototyping out for multiple auth providers: const selectProvider = (): AuthService => {
switch ((process.env.AUTH_PROVIDER ?? "firebase") as "firebase" | "static") {
case "static":
return composeAuthService(new StaticAuthProvider(process.env.STATIC_USERS_FILE));
case "firebase":
default:
return composeAuthService(new FirebaseAuthProvider());
}
};Sorry will have more time to dedicate to this after this week. Problem with the current solution is I can see it getting messy down the road. Will note also my code can be very much improved. Ex: |
Author
|
No, that totally makes sense if you're planning on each of the various services potentially having multiple providers. Once you have an established pattern I'd be happy to revise the PR accordingly. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the search service to use the Brave Search API if it finds an empty Bing key. The original format for results is preserved, allowing it to be used as a drop-in replacement. The template for the key file has also been updated with a placeholder for the Brave key.
An alternative would be to add a server-level config to select the search service - let me know if you'd like to do that instead,