add architecture skeleton

This commit is contained in:
2026-04-19 13:12:04 +03:00
parent 312708531f
commit 2738f31f26
84 changed files with 2710 additions and 70 deletions
+33
View File
@@ -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;
}
}