feat(models): 统一模型规格价格与路由

This commit is contained in:
kinoko committed 2026-08-22 17:00:08 +08:00
1 parent d268a938e5
commit 236b850177
36 files changed
+3404 -421

No files matched your search

+6 -1
View File
@@ -116,7 +116,7 @@ func applyRoutedProviderSelection(input map[string]any, routed *RoutedModel) map
nextConfig := make(map[string]any, len(config)+2)
for key, value := range config {
switch key {
case "channelId", "apiFormat", "interfaceType", "baseUrl", "allowLocalChannel", "apiKey", "secretKey", "headers", "model", "capabilityConfig":
case "channelId", "channelModelKey", "priceTierId", "providerModelKey", "apiFormat", "interfaceType", "baseUrl", "allowLocalChannel", "apiKey", "secretKey", "headers", "model", "capabilityConfig":
continue
default:
nextConfig[key] = value
@@ -139,6 +139,11 @@ func applyRoutedProviderSelection(input map[string]any, routed *RoutedModel) map
}
nextConfig["channelId"] = routed.ChannelModel.ChannelID
nextConfig["model"] = routed.ChannelModel.ModelKey
nextConfig["channelModelKey"] = routed.ChannelModel.ModelKey
if routed.PriceTier != nil {
nextConfig["priceTierId"] = routed.PriceTier.ID
nextConfig["providerModelKey"] = routed.PriceTier.ProviderModelKey
}
input["config"] = nextConfig
return input
}