Merge pull request #3037 from jp39/kagi-native-web-search

Add native Kagi web search provider
This commit is contained in:
Mauro
2026-06-07 22:51:35 +02:00
committed by GitHub
15 changed files with 675 additions and 13 deletions
+39
View File
@@ -126,6 +126,44 @@ Baidu Search uses the [Qianfan AI Search API](https://cloud.baidu.com/doc/qianfa
| `api_keys` | string[] | - | Multiple API keys for rotation (takes priority over `api_key`) |
| `max_results` | int | 5 | Maximum number of results |
### Kagi Search
Kagi Search uses the official Kagi OpenAPI client for `POST /search` and returns normal web results from `data.search`.
| Config | Type | Default | Description |
|---------------|----------|---------------------------------------|------------------------------------------------|
| `enabled` | bool | false | Enable Kagi Search |
| `api_key` | string | - | Kagi API key |
| `api_keys` | string[] | - | Multiple API keys for rotation (takes priority over `api_key`) |
| `base_url` | string | `https://kagi.com/api/v1/search` | Kagi Search API endpoint |
| `max_results` | int | 5 | Maximum number of results |
```json
{
"tools": {
"web": {
"provider": "kagi",
"kagi": {
"enabled": true,
"max_results": 5,
"base_url": "https://kagi.com/api/v1/search"
}
}
}
}
```
Store Kagi API keys in `.security.yml`:
```yaml
web:
kagi:
api_keys:
- "YOUR_KAGI_API_KEY"
```
Kagi API usage may be billed or limited separately from a normal Kagi subscription, depending on your account and API setup.
### Tavily
| Config | Type | Default | Description |
@@ -171,6 +209,7 @@ At runtime, the `web_search` tool accepts the following parameters:
| `range` | string | no | Optional time filter: `d` (day), `w` (week), `m` (month), `y` (year) |
If `range` is omitted, PicoClaw performs an unrestricted search.
For Kagi, `d`, `w`, and `m` map to Kagi lens `time_relative`; `y` maps to a lens `time_after` date one year before the current day.
### Example `web_search` Call
+14 -4
View File
@@ -248,13 +248,16 @@ channel_list:
### Web Tools
**Brave, Tavily, Perplexity:**
**Brave, Tavily, Perplexity, Kagi:**
```yaml
web:
brave:
api_keys:
- "key-1"
- "key-2"
kagi:
api_keys:
- "your-kagi-api-key"
```
- Use `api_keys` (plural) array format
@@ -315,16 +318,19 @@ model_list:
- **Rate limit management**: Distribute usage across multiple keys
- **High availability**: Reduce downtime during API provider issues
### Web Tools (Brave/Tavily/Perplexity) - Single key
### Web Tools (Brave/Tavily/Perplexity/Kagi) - Single key
```yaml
web:
brave:
api_keys:
- "BSA-your-key"
kagi:
api_keys:
- "your-kagi-api-key"
```
### Web Tools (Brave/Tavily/Perplexity) - Multiple keys
### Web Tools (Brave/Tavily/Perplexity/Kagi) - Multiple keys
```yaml
web:
@@ -332,6 +338,10 @@ web:
api_keys:
- "BSA-key-1"
- "BSA-key-2"
kagi:
api_keys:
- "kagi-key-1"
- "kagi-key-2"
```
### Web Tool (GLMSearch/BaiduSearch) - Single key only
@@ -558,7 +568,7 @@ go test ./pkg/config -run TestSecurityConfig
- Ensure you're using `api_keys` (plural) in `.security.yml` for models and web tools (except GLMSearch/BaiduSearch)
- Check that the array format is correct in YAML (proper indentation with dashes)
- Remember: Models, Brave, Tavily, Perplexity MUST use `api_keys` (array format)
- Remember: Models, Brave, Tavily, Perplexity, Kagi MUST use `api_keys` (array format)
- GLMSearch and BaiduSearch MUST use `api_key` (single string format)
### Load Balancing/Failover Issues