refactor: 实现 ConversionEngine 协议转换引擎,替代旧 protocol 包
引入 Canonical Model 和 ProtocolAdapter 架构,支持 OpenAI/Anthropic 协议间 无缝转换,统一 ProxyHandler 替代分散的 OpenAI/Anthropic Handler,简化 ProviderClient 为协议无关的 HTTP 发送器,Provider 新增 protocol 字段。
This commit is contained in:
@@ -77,6 +77,7 @@ func toDomainProvider(p *config.Provider) domain.Provider {
|
||||
Name: p.Name,
|
||||
APIKey: p.APIKey,
|
||||
BaseURL: p.BaseURL,
|
||||
Protocol: p.Protocol,
|
||||
Enabled: p.Enabled,
|
||||
CreatedAt: p.CreatedAt,
|
||||
UpdatedAt: p.UpdatedAt,
|
||||
@@ -85,10 +86,11 @@ func toDomainProvider(p *config.Provider) domain.Provider {
|
||||
|
||||
func toConfigProvider(p *domain.Provider) config.Provider {
|
||||
return config.Provider{
|
||||
ID: p.ID,
|
||||
Name: p.Name,
|
||||
APIKey: p.APIKey,
|
||||
BaseURL: p.BaseURL,
|
||||
Enabled: p.Enabled,
|
||||
ID: p.ID,
|
||||
Name: p.Name,
|
||||
APIKey: p.APIKey,
|
||||
BaseURL: p.BaseURL,
|
||||
Protocol: p.Protocol,
|
||||
Enabled: p.Enabled,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user