moving to openrouter
All checks were successful
Mindforge API Build and Deploy / Build Mindforge API Image (push) Successful in 3m39s
Mindforge Cronjob Build and Deploy / Build Mindforge Cronjob Image (push) Successful in 3m49s
Mindforge API Build and Deploy / Deploy Mindforge API (internal) (push) Successful in 38s
Mindforge Cronjob Build and Deploy / Deploy Mindforge Cronjob (internal) (push) Successful in 30s

This commit is contained in:
2026-04-04 21:09:18 -03:00
parent d0543544f8
commit b9736293d3
11 changed files with 58 additions and 342 deletions

View File

@@ -34,7 +34,6 @@ builder.Services.AddHttpClient();
// Register Providers
builder.Services.AddScoped<ILlmApiProvider, OpenAIApiProvider>();
builder.Services.AddScoped<ILlmApiProvider, GeminiApiProvider>();
// Register Services
builder.Services.AddScoped<IAgentService, AgentService>();
@@ -59,30 +58,26 @@ app.UseAuthorization();
app.MapControllers();
// Check for env vars
var openAiKey = builder.Configuration["OPENAI_API_KEY"];
var geminiKey = builder.Configuration["GEMINI_API_KEY"];
var openAiApiUrl = builder.Configuration["OPENAI_API_URL"];
var openAiToken = builder.Configuration["OPENAI_TOKEN"];
var openAiModel = builder.Configuration["OPENAI_MODEL"];
if (string.IsNullOrEmpty(openAiKey))
{
app.Logger.LogWarning("OPENAI_API_KEY not found in configuration.");
}
if (string.IsNullOrEmpty(openAiApiUrl))
app.Logger.LogWarning("OPENAI_API_URL not found in configuration.");
if (string.IsNullOrEmpty(geminiKey))
{
app.Logger.LogWarning("GEMINI_API_KEY not found in configuration.");
}
if (string.IsNullOrEmpty(openAiToken))
app.Logger.LogWarning("OPENAI_TOKEN not found in configuration.");
if (string.IsNullOrEmpty(openAiModel))
app.Logger.LogWarning("OPENAI_MODEL not found in configuration.");
var giteaRepoUrl = builder.Configuration["GITEA_REPO_URL"];
var giteaAccessToken = builder.Configuration["GITEA_ACCESS_TOKEN"];
if (string.IsNullOrEmpty(giteaRepoUrl))
{
app.Logger.LogWarning("GITEA_REPO_URL not found in configuration. Repository features will not work.");
}
if (string.IsNullOrEmpty(giteaAccessToken))
{
app.Logger.LogWarning("GITEA_ACCESS_TOKEN not found in configuration. Repository features will not work.");
}
app.Run();