Files
ragflow/conf/models/openrouter.json
Haruko386 a377512110 Go: implement provider: OpenRouter (#14652)
### What problem does this PR solve?

1. **Implement `OpenRouter` Provider:** Fully support OpenRouter AI
models (e.g., `gemma`, `minimax`). Includes robust handling of
Server-Sent Events (SSE) streams, error event interception, and proper
parsing of both `reasoning_content` and standard `content`.
2. **Fix BaseURL Resolution Bug:** Fixed a critical edge case in region
configuration parsing. Added a strict empty string check
(`*apiConfig.Region != ""`) alongside the `nil` check. This ensures that
if the UI passes an empty string, the system correctly falls back to the
`"default"` region, preventing `unsupported protocol scheme ""` errors
during HTTP requests.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
2026-05-08 12:02:37 +08:00

46 lines
857 B
JSON

{
"name": "OpenRouter",
"url": {
"default": "https://openrouter.ai/api/v1"
},
"url_suffix": {
"chat": "chat/completions",
"models": "models"
},
"class": "openrouter",
"models": [
{
"name": "google/gemma-4-31b-it",
"max_tokens": 262144,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "minimax/minimax-m2.5",
"max_tokens": 196608,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "tencent/hy3-preview",
"max_tokens": 262144,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
}
]
}