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 2.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 orleans = builder.AddOrleans("orleans")
  7. .WithDevelopmentClustering();
  8. var agentHost = builder.AddProject<Projects.DevTeam_AgentHost>("agenthost")
  9. .WithReference(orleans);
  10. var agentHostHttps = agentHost.GetEndpoint("https");
  11. //TODO: pass the right variables - aca environment
  12. // var environmentId = builder.AddParameter("environmentId");
  13. // var acaSessions = builder.AddBicepTemplateString(
  14. // name: "aca-sessions",
  15. // bicepContent: BicepTemplates.Sessions
  16. // )
  17. // .WithParameter("environmentId", environmentId);
  18. // var acaSessionsEndpoint = acaSessions.GetOutput("endpoint");
  19. builder.AddProject<Projects.DevTeam_Backend>("backend")
  20. .WithEnvironment("AGENT_HOST", $"{agentHostHttps.Property(EndpointProperty.Url)}")
  21. .WithEnvironment("Qdrant__Endpoint", $"{qdrant.Resource.HttpEndpoint.Property(EndpointProperty.Url)}")
  22. .WithEnvironment("Qdrant__ApiKey", $"{qdrant.Resource.ApiKeyParameter.Value}")
  23. .WithEnvironment("Qdrant__VectorSize", "1536")
  24. .WithEnvironment("OpenAI__Key", builder.Configuration["OpenAI:Key"])
  25. .WithEnvironment("OpenAI__Endpoint", builder.Configuration["OpenAI:Endpoint"])
  26. .WithEnvironment("Github__AppId", builder.Configuration["Github:AppId"])
  27. .WithEnvironment("Github__InstallationId", builder.Configuration["Github:InstallationId"])
  28. .WithEnvironment("Github__WebhookSecret", builder.Configuration["Github:WebhookSecret"])
  29. .WithEnvironment("Github__AppKey", builder.Configuration["Github:AppKey"]);
  30. //TODO: add this to the config in backend
  31. //.WithEnvironment("", acaSessionsEndpoint);
  32. builder.AddProject<Projects.DevTeam_Agents>("dev-agents")
  33. .WithEnvironment("AGENT_HOST", $"{agentHostHttps.Property(EndpointProperty.Url)}")
  34. .WithEnvironment("Qdrant__Endpoint", $"{qdrant.Resource.HttpEndpoint.Property(EndpointProperty.Url)}")
  35. .WithEnvironment("Qdrant__ApiKey", $"{qdrant.Resource.ApiKeyParameter.Value}")
  36. .WithEnvironment("Qdrant__VectorSize", "1536")
  37. .WithEnvironment("OpenAI__Key", builder.Configuration["OpenAI:Key"])
  38. .WithEnvironment("OpenAI__Endpoint", builder.Configuration["OpenAI:Endpoint"]);
  39. builder.Build().Run();