mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 18:44:51 +00:00
1
This commit is contained in:
@@ -207,6 +207,36 @@ class ServiceRatesService {
|
||||
return 'claude'
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账户类型获取服务类型(优先级高于模型推断)
|
||||
*/
|
||||
getServiceFromAccountType(accountType) {
|
||||
if (!accountType) return null
|
||||
|
||||
const mapping = {
|
||||
claude: 'claude',
|
||||
'claude-official': 'claude',
|
||||
'claude-console': 'claude',
|
||||
ccr: 'ccr',
|
||||
bedrock: 'bedrock',
|
||||
gemini: 'gemini',
|
||||
'openai-responses': 'codex',
|
||||
openai: 'codex',
|
||||
azure: 'azure',
|
||||
'azure-openai': 'azure',
|
||||
droid: 'droid'
|
||||
}
|
||||
|
||||
return mapping[accountType] || null
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务类型(优先 accountType,后备 model)
|
||||
*/
|
||||
getService(accountType, model) {
|
||||
return this.getServiceFromAccountType(accountType) || this.getServiceFromModel(model)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有支持的服务列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user