-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
51 lines (38 loc) · 1.29 KB
/
Copy pathProgram.cs
File metadata and controls
51 lines (38 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.DevUI;
using Microsoft.Agents.AI.Hosting;
using Microsoft.Agents.AI.Hosting.OpenAI;
using GitHubAIOpsApi;
using GitHubAIOpsApi.Extensions;
using GitHubAIOpsApi.Services;
using GitHubAIOpsApi.Workflows;
var builder = WebApplication.CreateBuilder(args);
// Infrastructure
builder.Services.AddOpenApi();
builder.Services.AddProblemDetails();
// DevUI
builder.AddDevUI();
// GitHub Tools & Services
builder.Services.AddGitHubServices();
// AI Chat, Embedding, and Knowledge Base
builder.AddAIClients();
// Agents & Workflow
var opsWorkflowBuilder = builder.AddAIOpsAgents();
// OpenAI protocol adapters (required for DevUI / conversations)
builder.Services.AddOpenAIResponses();
builder.Services.AddOpenAIConversations();
// -----------------------------------------------------------------------
var app = builder.Build();
if (app.Environment.IsDevelopment())
app.MapOpenApi();
app.UseExceptionHandler();
app.UseHttpsRedirection();
// Initialize local SQLite knowledge base on startup
await app.Services.GetRequiredService<ILocalKnowledgeBaseService>().InitializeAsync();
// Routing
app.MapDevUI();
app.MapAgentDiscovery("/agents");
app.MapOpenAIResponses();
app.MapOpenAIConversations();
app.MapOpenAIChatCompletions(opsWorkflowBuilder);
app.Run();