add architecture skeleton
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using GymLogAI.Application.Interfaces;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace GymLogAI.AI;
|
||||
|
||||
public static class DependencyInjection
|
||||
{
|
||||
public static IServiceCollection AddAiServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services
|
||||
.AddOptions<OpenRouterOptions>()
|
||||
.Bind(configuration.GetSection(OpenRouterOptions.SectionName));
|
||||
|
||||
services.AddHttpClient<OpenRouterChatClient>((serviceProvider, client) =>
|
||||
{
|
||||
var options = serviceProvider.GetRequiredService<Microsoft.Extensions.Options.IOptions<OpenRouterOptions>>().Value;
|
||||
client.BaseAddress = new Uri(options.BaseUrl);
|
||||
});
|
||||
|
||||
services.AddHttpClient<OpenRouterEmbeddingClient>((serviceProvider, client) =>
|
||||
{
|
||||
var options = serviceProvider.GetRequiredService<Microsoft.Extensions.Options.IOptions<OpenRouterOptions>>().Value;
|
||||
client.BaseAddress = new Uri(options.BaseUrl);
|
||||
});
|
||||
|
||||
services.AddScoped<IWorkoutParser, WorkoutParserAIService>();
|
||||
services.AddScoped<IWorkoutRecommendationGenerator, WorkoutRecommendationAIService>();
|
||||
services.AddScoped<IEmbeddingService, StubEmbeddingService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user