Compare commits
3 Commits
main
...
fix/perple
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fa16f4160 | ||
|
|
5e7e328b68 | ||
|
|
08cd5fee8e |
@ -13,6 +13,7 @@ Docs: https://docs.clawd.bot
|
|||||||
- Plugins/UI: let channel plugin metadata drive UI labels/icons and cron channel options. (#1306) — thanks @steipete.
|
- Plugins/UI: let channel plugin metadata drive UI labels/icons and cron channel options. (#1306) — thanks @steipete.
|
||||||
### Fixes
|
### Fixes
|
||||||
- Web search: infer Perplexity base URL from API key source (direct vs OpenRouter).
|
- Web search: infer Perplexity base URL from API key source (direct vs OpenRouter).
|
||||||
|
- Config: allow Perplexity as a web_search provider in config validation. (#1230, #1247) — thanks @sebslight.
|
||||||
- TUI: keep thinking blocks ordered before content during streaming and isolate per-run assembly. (#1202) — thanks @aaronveklabs.
|
- TUI: keep thinking blocks ordered before content during streaming and isolate per-run assembly. (#1202) — thanks @aaronveklabs.
|
||||||
- CLI: avoid duplicating --profile/--dev flags when formatting commands.
|
- CLI: avoid duplicating --profile/--dev flags when formatting commands.
|
||||||
- Exec: prefer bash when fish is default shell, falling back to sh if bash is missing. (#1297) — thanks @ysqander.
|
- Exec: prefer bash when fish is default shell, falling back to sh if bash is missing. (#1297) — thanks @ysqander.
|
||||||
|
|||||||
25
src/config/config.web-search-provider.test.ts
Normal file
25
src/config/config.web-search-provider.test.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
import { validateConfigObject } from "./config.js";
|
||||||
|
|
||||||
|
describe("web search provider config", () => {
|
||||||
|
it("accepts perplexity provider and config", () => {
|
||||||
|
const res = validateConfigObject({
|
||||||
|
tools: {
|
||||||
|
web: {
|
||||||
|
search: {
|
||||||
|
enabled: true,
|
||||||
|
provider: "perplexity",
|
||||||
|
perplexity: {
|
||||||
|
apiKey: "test-key",
|
||||||
|
baseUrl: "https://api.perplexity.ai",
|
||||||
|
model: "perplexity/sonar-pro",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(res.ok).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -349,12 +349,18 @@ const FIELD_HELP: Record<string, string> = {
|
|||||||
"tools.message.crossContext.marker.suffix":
|
"tools.message.crossContext.marker.suffix":
|
||||||
'Text suffix for cross-context markers (supports "{channel}").',
|
'Text suffix for cross-context markers (supports "{channel}").',
|
||||||
"tools.message.broadcast.enabled": "Enable broadcast action (default: true).",
|
"tools.message.broadcast.enabled": "Enable broadcast action (default: true).",
|
||||||
"tools.web.search.enabled": "Enable the web_search tool (requires Brave API key).",
|
"tools.web.search.enabled": "Enable the web_search tool (requires a provider API key).",
|
||||||
"tools.web.search.provider": 'Search provider (only "brave" supported today).',
|
"tools.web.search.provider": 'Search provider ("brave" or "perplexity").',
|
||||||
"tools.web.search.apiKey": "Brave Search API key (fallback: BRAVE_API_KEY env var).",
|
"tools.web.search.apiKey": "Brave Search API key (fallback: BRAVE_API_KEY env var).",
|
||||||
"tools.web.search.maxResults": "Default number of results to return (1-10).",
|
"tools.web.search.maxResults": "Default number of results to return (1-10).",
|
||||||
"tools.web.search.timeoutSeconds": "Timeout in seconds for web_search requests.",
|
"tools.web.search.timeoutSeconds": "Timeout in seconds for web_search requests.",
|
||||||
"tools.web.search.cacheTtlMinutes": "Cache TTL in minutes for web_search results.",
|
"tools.web.search.cacheTtlMinutes": "Cache TTL in minutes for web_search results.",
|
||||||
|
"tools.web.search.perplexity.apiKey":
|
||||||
|
"Perplexity or OpenRouter API key (fallback: PERPLEXITY_API_KEY or OPENROUTER_API_KEY env var).",
|
||||||
|
"tools.web.search.perplexity.baseUrl":
|
||||||
|
"Perplexity base URL override (default: https://openrouter.ai/api/v1 or https://api.perplexity.ai).",
|
||||||
|
"tools.web.search.perplexity.model":
|
||||||
|
'Perplexity model override (default: "perplexity/sonar-pro").',
|
||||||
"tools.web.fetch.enabled": "Enable the web_fetch tool (lightweight HTTP fetch).",
|
"tools.web.fetch.enabled": "Enable the web_fetch tool (lightweight HTTP fetch).",
|
||||||
"tools.web.fetch.maxChars": "Max characters returned by web_fetch (truncated).",
|
"tools.web.fetch.maxChars": "Max characters returned by web_fetch (truncated).",
|
||||||
"tools.web.fetch.timeoutSeconds": "Timeout in seconds for web_fetch requests.",
|
"tools.web.fetch.timeoutSeconds": "Timeout in seconds for web_fetch requests.",
|
||||||
|
|||||||
@ -124,11 +124,19 @@ export const ToolPolicySchema = z
|
|||||||
export const ToolsWebSearchSchema = z
|
export const ToolsWebSearchSchema = z
|
||||||
.object({
|
.object({
|
||||||
enabled: z.boolean().optional(),
|
enabled: z.boolean().optional(),
|
||||||
provider: z.union([z.literal("brave")]).optional(),
|
provider: z.union([z.literal("brave"), z.literal("perplexity")]).optional(),
|
||||||
apiKey: z.string().optional(),
|
apiKey: z.string().optional(),
|
||||||
maxResults: z.number().int().positive().optional(),
|
maxResults: z.number().int().positive().optional(),
|
||||||
timeoutSeconds: z.number().int().positive().optional(),
|
timeoutSeconds: z.number().int().positive().optional(),
|
||||||
cacheTtlMinutes: z.number().nonnegative().optional(),
|
cacheTtlMinutes: z.number().nonnegative().optional(),
|
||||||
|
perplexity: z
|
||||||
|
.object({
|
||||||
|
apiKey: z.string().optional(),
|
||||||
|
baseUrl: z.string().optional(),
|
||||||
|
model: z.string().optional(),
|
||||||
|
})
|
||||||
|
.strict()
|
||||||
|
.optional(),
|
||||||
})
|
})
|
||||||
.strict()
|
.strict()
|
||||||
.optional();
|
.optional();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user