mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-12 22:55:45 +08:00
### 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)
46 lines
857 B
JSON
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
|
|
}
|
|
}
|
|
]
|
|
} |