2025-07-18 20:46:30 +08:00
|
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
|
using Volo.Abp.DependencyInjection;
|
2025-10-11 15:25:43 +08:00
|
|
|
|
using Yi.Framework.AiHub.Domain.Shared.Dtos.Anthropic;
|
2025-08-11 15:31:11 +08:00
|
|
|
|
using Yi.Framework.AiHub.Domain.Shared.Dtos.OpenAi;
|
2025-07-18 20:46:30 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.AiHub.Domain.AiGateWay;
|
|
|
|
|
|
|
|
|
|
|
|
public class SpecialCompatible : ISpecialCompatible,ISingletonDependency
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly IOptions<SpecialCompatibleOptions> _options;
|
|
|
|
|
|
|
|
|
|
|
|
public SpecialCompatible(IOptions<SpecialCompatibleOptions> options)
|
|
|
|
|
|
{
|
|
|
|
|
|
_options = options;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Compatible(ThorChatCompletionsRequest request)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var handle in _options.Value.Handles)
|
|
|
|
|
|
{
|
|
|
|
|
|
handle(request);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-11 15:25:43 +08:00
|
|
|
|
|
|
|
|
|
|
public void AnthropicCompatible(AnthropicInput request)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var handle in _options.Value.AnthropicHandles)
|
|
|
|
|
|
{
|
|
|
|
|
|
handle(request);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-07-18 20:46:30 +08:00
|
|
|
|
}
|