Files
ragflow/conf/models/siliconflow.json

119 lines
2.2 KiB
JSON
Raw Normal View History

{
"name": "SiliconFlow",
"url": {
"default": "https://api.siliconflow.cn/v1"
},
"url_suffix": {
"chat": "chat/completions",
"models": "models",
"embedding": "embeddings",
Go: implement Balance in SiliconFlow driver (#14643) ### What problem does this PR solve? The SiliconFlow Go driver shipped with a stub \`Balance\` method that returned \`no such method\`, even though SiliconFlow exposes a public \`GET /v1/user/info\` endpoint that returns the account balance per currency. So the "Balance" panel in the model provider UI always shows an error for SiliconFlow tenants, while it already works for Moonshot and Gitee. This PR fills the gap. ### What this PR includes - \`conf/models/siliconflow.json\`: add \`\"balance\": \"user/info\"\` under \`url_suffix\` so the driver builds the URL from config. - \`internal/entity/models/siliconflow.go\`: replace the \`Balance\` stub with a real implementation. Adds a small local response type that matches the upstream shape. No factory change. No interface change. ### How the driver works - Validate \`apiConfig\` and the API key, resolve the region with a default fallback, and build the URL from \`BaseURL[region] + URLSuffix.Balance\`. - GET the URL with \`Authorization: Bearer <api_key>\`. - Parse the upstream response. SiliconFlow returns balance fields as strings, so the driver parses them with \`strconv.ParseFloat\`. It prefers \`totalBalance\` over \`balance\` when both are present. - Return \`{\"balance\": <float>, \"currency\": \"CNY\"}\`, the same shape the Moonshot driver returns. The UI can render it with no provider-specific code. ### Edge cases - Missing or empty API key returns a clear local error before any HTTP call. - An unknown region falls back to the default base URL. - Empty \`balance\` and \`totalBalance\` returns a clear "no balance info in response" error rather than a zero-value silent success. - Non-numeric balance string returns a clear parse error. - Non-200 responses propagate the upstream status line and body. ### Type of change - [x] New Feature (non-breaking change which adds functionality) ### How was this tested? - \`go build ./internal/entity/models/...\` in a clean go 1.25 image returns exit 0. - The full method set on \`SiliconflowModel\` still matches the \`ModelDriver\` interface. - Pattern parity with the existing Moonshot and Gitee Balance implementations. Closes #14642
2026-05-08 06:01:10 +02:00
"rerank": "rerank",
Go: implement TTS, ASR for Siliconflow and TTs for StepFun (#14944) ### What problem does this PR solve? This PRimplement TTS, ASR for Siliconflow and TTs for StepFun **The following functionalities are now supported:** **SiliConFlow:** - [x] Text To Speech - [x] Audio To Text - [x] Stream Audio To Text **StrepFun:** - [x] Audio To Text - [x] Stream Audio To Text **Verified examples from the CLI:** ```plaintext # SiliconFlow RAGFlow(user)> tts with 'FunAudioLLM/CosyVoice2-0.5B@test@Siliconflow' text 'hello? show yourself' play format 'wav' param '{"voice": "fnlp/MOSS-TTSD-v0.5:alex"}' SUCCESS RAGFlow(user)> asr with 'FunAudioLLM/SenseVoiceSmall@test@siliconflow' audio './internal/test.wav' param '' +----------------------------------------------------------------------------------------------------------------------+ | text | +----------------------------------------------------------------------------------------------------------------------+ | The examination and testimony of the experts enabled the commission to conclude that five shots may have been fired. | +----------------------------------------------------------------------------------------------------------------------+ RAGFlow(user)> stream asr with 'FunAudioLLM/SenseVoiceSmall@test@siliconflow' audio './internal/test.wav' param '' +----------------------------------------------------------------------------------------------------------------------+ | text | +----------------------------------------------------------------------------------------------------------------------+ | The examination and testimony of the experts enabled the commission to conclude that five shots may have been fired. | +----------------------------------------------------------------------------------------------------------------------+ ``` ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality)
2026-05-15 14:03:33 +08:00
"balance": "user/info",
"tts": "audio/speech",
"asr": "audio/transcriptions"
},
"models": [
{
"name": "Pro/deepseek-ai/DeepSeek-V4-Pro",
"max_tokens": 1048576,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "Pro/deepseek-ai/DeepSeek-V4-Flash",
"max_tokens": 1048576,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "Pro/moonshotai/Kimi-K2.6",
"max_tokens": 262144,
"model_types": [
"chat",
"vision"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "Pro/zai-org/GLM-5.1",
"max_tokens": 204800,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "qwen/qwen3-8b",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "qwen/qwen3.5-4b",
"max_tokens": 262144,
"model_types": [
"chat"
]
},
{
"name": "tencent/hunyuan-mt-7b",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "BAAI/bge-reranker-v2-m3",
"max_tokens": 8192,
"model_types": [
"rerank"
]
},
{
"name": "Qwen/Qwen3-Embedding-0.6B",
"max_tokens": 8192,
"model_types": [
"embedding"
]
Go: implement TTS, ASR for Siliconflow and TTs for StepFun (#14944) ### What problem does this PR solve? This PRimplement TTS, ASR for Siliconflow and TTs for StepFun **The following functionalities are now supported:** **SiliConFlow:** - [x] Text To Speech - [x] Audio To Text - [x] Stream Audio To Text **StrepFun:** - [x] Audio To Text - [x] Stream Audio To Text **Verified examples from the CLI:** ```plaintext # SiliconFlow RAGFlow(user)> tts with 'FunAudioLLM/CosyVoice2-0.5B@test@Siliconflow' text 'hello? show yourself' play format 'wav' param '{"voice": "fnlp/MOSS-TTSD-v0.5:alex"}' SUCCESS RAGFlow(user)> asr with 'FunAudioLLM/SenseVoiceSmall@test@siliconflow' audio './internal/test.wav' param '' +----------------------------------------------------------------------------------------------------------------------+ | text | +----------------------------------------------------------------------------------------------------------------------+ | The examination and testimony of the experts enabled the commission to conclude that five shots may have been fired. | +----------------------------------------------------------------------------------------------------------------------+ RAGFlow(user)> stream asr with 'FunAudioLLM/SenseVoiceSmall@test@siliconflow' audio './internal/test.wav' param '' +----------------------------------------------------------------------------------------------------------------------+ | text | +----------------------------------------------------------------------------------------------------------------------+ | The examination and testimony of the experts enabled the commission to conclude that five shots may have been fired. | +----------------------------------------------------------------------------------------------------------------------+ ``` ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality)
2026-05-15 14:03:33 +08:00
},
{
"name": "fnlp/MOSS-TTSD-v0.5",
"max_tokens": 8192,
"model_types": [
"tts"
]
},
{
"name": "FunAudioLLM/CosyVoice2-0.5B",
"max_tokens": 8192,
"model_types": [
"tts"
]
},
{
"name": "FunAudioLLM/SenseVoiceSmall",
"max_tokens": 8192,
"model_types": [
"asr"
]
}
]
}