* fix(gateway): 统一 Responses store 路由兼容 * fix(gateway): 收紧 Responses 降级归一化 * fix(channel): 将 DeepSeek 标记为无状态
52 lines
2.1 KiB
Go
52 lines
2.1 KiB
Go
package modules
|
|
|
|
import (
|
|
"gpt-load/internal/channel/spec"
|
|
"gpt-load/internal/execution"
|
|
"gpt-load/internal/protocol"
|
|
)
|
|
|
|
func Volcengine() spec.Module {
|
|
return spec.Module{
|
|
Definition: spec.Definition{
|
|
ID: spec.Volcengine,
|
|
Name: "Volcengine Ark",
|
|
Mark: "VE",
|
|
Icon: "volcengine",
|
|
SearchTerms: []string{"doubao", "ark"},
|
|
Description: "Managed API preset",
|
|
Connection: spec.Connection{
|
|
Type: spec.ConnectionAPIKey,
|
|
CredentialInput: "batch_text",
|
|
},
|
|
Params: []spec.Field{{
|
|
Key: "base_url", Label: "Base URL", InputKind: spec.InputURL,
|
|
Normalizer: spec.NormalizeBaseURL,
|
|
}},
|
|
Credentials: []spec.Field{{
|
|
Key: "api_key", Label: "API Key", InputKind: spec.InputSecret,
|
|
Required: true, Sensitive: true, Normalizer: spec.NormalizeNonEmpty,
|
|
}},
|
|
Provider: spec.ProviderBinding{
|
|
ProviderKind: spec.ProviderOpenAICompatible,
|
|
CatalogProviderID: "volcengine",
|
|
EndpointPolicy: spec.EndpointFixedWithOverride,
|
|
FixedBaseURL: "https://ark.cn-beijing.volces.com/api/v3",
|
|
},
|
|
Routes: []spec.Route{
|
|
spec.NewRoute(protocol.OpenAICompletions, execution.OperationChatCompletion, execution.RouteNative),
|
|
spec.NewRoute(protocol.OpenAICompletions, execution.OperationListModels, execution.RouteNative),
|
|
spec.NewRoute(protocol.OpenAICompletions, execution.OperationProbe, execution.RouteNative),
|
|
spec.NewResponsesCreateRoute(execution.RouteConverted, spec.ResponsesStoreHandlingStateless),
|
|
spec.NewRoute(protocol.OpenAIResponses, execution.OperationProbe, execution.RouteConverted),
|
|
spec.NewRoute(protocol.Anthropic, execution.OperationChatCompletion, execution.RouteConverted),
|
|
spec.NewRoute(protocol.Anthropic, execution.OperationListModels, execution.RouteConverted),
|
|
spec.NewRoute(protocol.Anthropic, execution.OperationProbe, execution.RouteConverted),
|
|
spec.NewRoute(protocol.Gemini, execution.OperationChatCompletion, execution.RouteConverted),
|
|
spec.NewRoute(protocol.Gemini, execution.OperationListModels, execution.RouteConverted),
|
|
spec.NewRoute(protocol.Gemini, execution.OperationProbe, execution.RouteConverted),
|
|
},
|
|
},
|
|
}
|
|
}
|