You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Program.cs 1.9 kB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Program.cs
  3. var builder = DistributedApplication.CreateBuilder(args);
  4. builder.AddAzureProvisioning();
  5. var qdrant = builder.AddQdrant("qdrant");
  6. var agentHost = builder.AddContainer("agent-host", "autogen-host")
  7. .WithEnvironment("ASPNETCORE_URLS", "https://+;http://+")
  8. .WithEnvironment("ASPNETCORE_HTTPS_PORTS", "5001")
  9. .WithEnvironment("ASPNETCORE_Kestrel__Certificates__Default__Password", "mysecurepass")
  10. .WithEnvironment("ASPNETCORE_Kestrel__Certificates__Default__Path", "/https/devcert.pfx")
  11. .WithBindMount("./certs", "/https/", true)
  12. .WithHttpsEndpoint(targetPort: 5001);
  13. var agentHostHttps = agentHost.GetEndpoint("https");
  14. builder.AddProject<Projects.DevTeam_Backend>("backend")
  15. .WithEnvironment("AGENT_HOST", $"{agentHostHttps.Property(EndpointProperty.Url)}")
  16. .WithEnvironment("Qdrant__Endpoint", $"{qdrant.Resource.HttpEndpoint.Property(EndpointProperty.Url)}")
  17. .WithEnvironment("Qdrant__ApiKey", $"{qdrant.Resource.ApiKeyParameter.Value}")
  18. .WithEnvironment("Qdrant__VectorSize", "1536")
  19. .WithEnvironment("OpenAI__Key", builder.Configuration["OpenAI:Key"])
  20. .WithEnvironment("OpenAI__Endpoint", builder.Configuration["OpenAI:Endpoint"])
  21. .WithEnvironment("Github__AppId", builder.Configuration["Github:AppId"])
  22. .WithEnvironment("Github__InstallationId", builder.Configuration["Github:InstallationId"])
  23. .WithEnvironment("Github__WebhookSecret", builder.Configuration["Github:WebhookSecret"])
  24. .WithEnvironment("Github__AppKey", builder.Configuration["Github:AppKey"])
  25. .WaitFor(agentHost)
  26. .WaitFor(qdrant);
  27. //TODO: add this to the config in backend
  28. //.WithEnvironment("", acaSessionsEndpoint);
  29. builder.Build().Run();