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.3 kB

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