feat(coding-agent/web): added Brave web search provider with recency filtering and API integration
- Added Brave web search provider with support for query, result count, and recency filtering. - Added BRAVE_API_KEY environment variable configuration for Brave search authentication. - Updated web search provider priority order to include Brave as second-highest priority after Exa. - Extended recency filter support to Brave search provider alongside Perplexity. - Implemented BraveProvider class with API integration, response mapping, and parameter validation. - Added helper functions for recency mapping, result clamping, and snippet building in Brave provider.
This commit is contained in:
@@ -213,6 +213,7 @@ export function getExtraHelpText(): string {
|
||||
|
||||
${chalk.dim("# Search & Tools")}
|
||||
EXA_API_KEY - Exa web search
|
||||
BRAVE_API_KEY - Brave web search
|
||||
PERPLEXITY_API_KEY - Perplexity web search
|
||||
ANTHROPIC_SEARCH_API_KEY - Anthropic search provider
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ const PROVIDERS: Array<SearchProviderId | "auto"> = [
|
||||
"anthropic",
|
||||
"perplexity",
|
||||
"exa",
|
||||
"brave",
|
||||
"jina",
|
||||
"zai",
|
||||
"gemini",
|
||||
@@ -131,14 +132,14 @@ ${chalk.bold("Arguments:")}
|
||||
|
||||
${chalk.bold("Options:")}
|
||||
--provider <name> Provider: ${PROVIDERS.join(", ")}
|
||||
--recency <value> Recency filter (Perplexity only): ${RECENCY_OPTIONS.join(", ")}
|
||||
--recency <value> Recency filter (Brave/Perplexity): ${RECENCY_OPTIONS.join(", ")}
|
||||
-l, --limit <n> Max results to return
|
||||
--compact Render condensed output
|
||||
-h, --help Show this help
|
||||
|
||||
${chalk.bold("Examples:")}
|
||||
${APP_NAME} q --provider=exa "what's the color of the sky"
|
||||
${APP_NAME} q --provider=perplexity --recency=week "latest TypeScript 5.7 changes"
|
||||
${APP_NAME} q --provider=brave --recency=week "latest TypeScript 5.7 changes"
|
||||
`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user