| 
									
										
										
										
											2024-10-30 11:53:37 -07:00
										 |  |  | // Copyright (c) Microsoft Corporation. All rights reserved. | 
					
						
							|  |  |  | // Program.cs | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-17 09:01:49 -04:00
										 |  |  | var builder = DistributedApplication.CreateBuilder(args); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | builder.AddAzureProvisioning(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var qdrant = builder.AddQdrant("qdrant"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-01-24 19:24:00 -08:00
										 |  |  | var agentHost = builder.AddContainer("agent-host", "autogen-host") | 
					
						
							|  |  |  |                        .WithEnvironment("ASPNETCORE_URLS", "https://+;http://+") | 
					
						
							|  |  |  |                        .WithEnvironment("ASPNETCORE_HTTPS_PORTS", "5001") | 
					
						
							|  |  |  |                        .WithEnvironment("ASPNETCORE_Kestrel__Certificates__Default__Password", "mysecurepass") | 
					
						
							|  |  |  |                        .WithEnvironment("ASPNETCORE_Kestrel__Certificates__Default__Path", "/https/devcert.pfx") | 
					
						
							|  |  |  |                        .WithBindMount("./certs", "/https/", true) | 
					
						
							|  |  |  |                        .WithHttpsEndpoint(targetPort: 5001); | 
					
						
							| 
									
										
										
										
											2024-09-17 09:01:49 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | var agentHostHttps = agentHost.GetEndpoint("https"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | builder.AddProject<Projects.DevTeam_Backend>("backend") | 
					
						
							|  |  |  |     .WithEnvironment("AGENT_HOST", $"{agentHostHttps.Property(EndpointProperty.Url)}") | 
					
						
							|  |  |  |     .WithEnvironment("Qdrant__Endpoint", $"{qdrant.Resource.HttpEndpoint.Property(EndpointProperty.Url)}") | 
					
						
							|  |  |  |     .WithEnvironment("Qdrant__ApiKey", $"{qdrant.Resource.ApiKeyParameter.Value}") | 
					
						
							|  |  |  |     .WithEnvironment("Qdrant__VectorSize", "1536") | 
					
						
							|  |  |  |     .WithEnvironment("OpenAI__Key", builder.Configuration["OpenAI:Key"]) | 
					
						
							|  |  |  |     .WithEnvironment("OpenAI__Endpoint", builder.Configuration["OpenAI:Endpoint"]) | 
					
						
							|  |  |  |     .WithEnvironment("Github__AppId", builder.Configuration["Github:AppId"]) | 
					
						
							|  |  |  |     .WithEnvironment("Github__InstallationId", builder.Configuration["Github:InstallationId"]) | 
					
						
							|  |  |  |     .WithEnvironment("Github__WebhookSecret", builder.Configuration["Github:WebhookSecret"]) | 
					
						
							| 
									
										
										
										
											2025-01-24 19:24:00 -08:00
										 |  |  |     .WithEnvironment("Github__AppKey", builder.Configuration["Github:AppKey"]) | 
					
						
							|  |  |  |     .WaitFor(agentHost) | 
					
						
							|  |  |  |     .WaitFor(qdrant); | 
					
						
							| 
									
										
										
										
											2024-10-02 11:42:27 -07:00
										 |  |  | //TODO: add this to the config in backend | 
					
						
							|  |  |  | //.WithEnvironment("", acaSessionsEndpoint); | 
					
						
							| 
									
										
										
										
											2024-09-17 09:01:49 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | builder.Build().Run(); |