A programming framework for agentic AI
Orleans improvements (#6)
Kosta Petanf423e15b1afc
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfileindex bbaf9543a..ed0bd230c 100644--- a/.devcontainer/Dockerfile+++ b/.devcontainer/Dockerfile@@ -4,4 +4,10 @@ RUN apt-get update && apt-get install -y xz-utils nodejs npmRUN curl -fsSL https://aka.ms/install-azd.sh | bash+RUN curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | \+ sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && \+ echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | \+ sudo tee /etc/apt/sources.list.d/ngrok.list && \+ sudo apt update && sudo apt install ngrok+RUN npm i -g azure-functions-core-tools@4 --unsafe-perm true\ No newline at end of filediff --git a/.dockerignore b/.dockerignoreindex 7347a7fbb..a7cab3bfb 100644--- a/.dockerignore+++ b/.dockerignore@@ -11,6 +11,7 @@**/*.*proj.user**/*.dbmdl**/*.jfm+**/azds.yaml**/bin**/charts**/docker-compose*@@ -22,4 +23,4 @@**/secrets.dev.yaml**/values.dev.yamlLICENSE-README.md+README.md\ No newline at end of filediff --git a/azure.yaml b/azure.yamlindex f56fac572..53ccfef57 100644--- a/azure.yaml+++ b/azure.yaml@@ -1,8 +1,10 @@# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json-name: sk-dev-team+name: ai-dev-teamservices:- sk-func:- project: ./src/apps/gh-flow-df- language: dotnet- host: function\ No newline at end of file+ gh-flow:+ project: ./src/apps/gh-flow+ language: csharp+ host: containerapp+ docker:+ context: ../../../\ No newline at end of filediff --git a/infra/abbreviations.json b/infra/abbreviations.jsonindex 9ee376cd5..fba689e2f 100644--- a/infra/abbreviations.json+++ b/infra/abbreviations.json@@ -7,5 +7,8 @@"resourcesResourceGroups": "rg-","storageStorageAccounts": "st","webServerFarms": "plan-",- "webSitesFunctions": "func-"+ "webSitesFunctions": "func-",+ "appContainerApps": "ca-",+ "managedIdentityUserAssignedIdentities": "id-",+ "documentDBDatabaseAccounts":"cosmos-"}\ No newline at end of filediff --git a/infra/app/db.bicep b/infra/app/db.bicepnew file mode 100644index 000000000..077bb7212--- /dev/null+++ b/infra/app/db.bicep@@ -0,0 +1,46 @@+param accountName string+param location string = resourceGroup().location+param tags object = {}++param containers array = [+ {+ name: 'reminders'+ id: 'reminders'+ partitionKey: '/id'+ }+ {+ name: 'persistence'+ id: 'persistence'+ partitionKey: '/id'+ }+ {+ name: 'clustering'+ id: 'clustering'+ partitionKey: '/id'+ }+]++param databaseName string = ''+param principalIds array = []++// Because databaseName is optional in main.bicep, we make sure the database name is set here.+var defaultDatabaseName = 'Todo'+var actualDatabaseName = !empty(databaseName) ? databaseName : defaultDatabaseName++module cosmos '../core/database/cosmos/sql/cosmos-sql-db.bicep' = {+ name: 'cosmos-sql'+ params: {+ accountName: accountName+ location: location+ tags: tags+ containers: containers+ databaseName: actualDatabaseName+ principalIds: principalIds+ }+}++output accountName string = cosmos.outputs.accountName+output connectionStringKey string = cosmos.outputs.connectionStringKey+output databaseName string = cosmos.outputs.databaseName+output endpoint string = cosmos.outputs.endpoint+output roleDefinitionId string = cosmos.outputs.roleDefinitionIddiff --git a/infra/app/gh-flow.bicep b/infra/app/gh-flow.bicepnew file mode 100644index 000000000..ee5ca3265--- /dev/null+++ b/infra/app/gh-flow.bicep@@ -0,0 +1,164 @@+param name string+param location string = resourceGroup().location+param tags object = {}++param applicationInsightsName string+param identityName string+param serviceName string = 'gh-flow'+param sandboxImage string = 'mcr.microsoft.com/dotnet/sdk:7.0'+++param containerAppsEnvironmentName string+param containerRegistryName string+param storageAccountName string+param cosmosAccountName string++@secure()+param githubAppKey string+param githubAppId string+param githubAppInstallationId string+param rgName string+param aciShare string+param openAIServiceType string+param openAIServiceId string+param openAIDeploymentId string+param openAIEmbeddingId string+param openAIEndpoint string+@secure()+param openAIKey string+param qdrantEndpoint string++resource ghFlowIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {+ name: identityName+ location: location+}++resource applicationInsights 'Microsoft.Insights/components@2020-02-02' existing = {+ name: applicationInsightsName+}++resource storage 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {+ name: storageAccountName+}++resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = {+ name: cosmosAccountName+}++var contributorRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')++resource rgContributor 'Microsoft.Authorization/roleAssignments@2022-04-01' = {+ name: guid(subscription().id, resourceGroup().id, contributorRole)+ properties: {+ roleDefinitionId: contributorRole+ principalType: 'ServicePrincipal'+ principalId: app.outputs.identityPrincipalId+ }+}++module app '../core/host/container-app.bicep' = {+ name: '${serviceName}-ghflow'+ params: {+ name: name+ location: location+ tags: union(tags, { 'azd-service-name': serviceName })+ identityType: 'UserAssigned'+ identityName: ghFlowIdentity.name+ containerAppsEnvironmentName: containerAppsEnvironmentName+ containerRegistryName: containerRegistryName+ containerCpuCoreCount: '2.0'+ containerMemory: '4.0Gi'+ env: [+ {+ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'+ value: applicationInsights.properties.ConnectionString+ }+ {+ name: 'SANDBOX_IMAGE'+ value: sandboxImage+ }+ {+ name: 'GithubOptions__AppKey'+ value: githubAppKey+ }+ {+ name: 'GithubOptions__AppId'+ value: githubAppId+ }+ {+ name: 'GithubOptions__InstallationId'+ value: githubAppInstallationId+ }+ {+ name: 'AzureOptions__SubscriptionId'+ value: subscription().subscriptionId+ }+ {+ name: 'AzureOptions__Location'+ value: location+ }+ {+ name: 'AzureOptions__ManagedIdentity'+ value: ghFlowIdentity.properties.clientId+ }+ {+ name: 'AzureOptions__ContainerInstancesResourceGroup'+ value: rgName+ }+ {+ name: 'AzureOptions__FilesAccountKey'+ value: storage.listKeys().keys[0].value+ }+ {+ name: 'AzureOptions__FilesShareName'+ value: aciShare+ }+ {+ name: 'AzureOptions__FilesAccountName'+ value: storageAccountName+ }+ {+ name: 'AzureOptions__CosmosConnectionString'+ value: cosmos.listConnectionStrings().connectionStrings[0].connectionString+ }+ {+ name: 'OpenAIOptions__ServiceType'+ value: openAIServiceType+ }+ {+ name: 'OpenAIOptions__ServiceId'+ value: openAIServiceId+ }+ {+ name: 'OpenAIOptions__DeploymentOrModelId'+ value: openAIDeploymentId+ }+ {+ name: 'OpenAIOptions__EmbeddingDeploymentOrModelId'+ value: openAIEmbeddingId+ }+ {+ name: 'OpenAIOptions__Endpoint'+ value: openAIEndpoint+ }+ {+ name: 'OpenAIOptions__ApiKey'+ value: openAIKey+ }+ {+ name: 'QdrantOptions__Endpoint'+ value: qdrantEndpoint+ }+ {+ name: 'QdrantOptions__VectorSize'+ value: '1536'+ }+ ]+ targetPort: 5274+ }+}+++output SERVICE_TRANSLATE_API_IDENTITY_PRINCIPAL_ID string = app.outputs.identityPrincipalId+output SERVICE_TRANSLATE_API_NAME string = app.outputs.name+output SERVICE_TRANSLATE_API_URI string = app.outputs.uridiff --git a/infra/core/database/cosmos/cosmos-account.bicep b/infra/core/database/cosmos/cosmos-account.bicepnew file mode 100644index 000000000..4c129b0f7--- /dev/null+++ b/infra/core/database/cosmos/cosmos-account.bicep@@ -0,0 +1,37 @@+metadata description = 'Creates an Azure Cosmos DB account.'+param name string+param location string = resourceGroup().location+param tags object = {}++param connectionStringKey string = 'AZURE-COSMOS-CONNECTION-STRING'++@allowed([ 'GlobalDocumentDB', 'MongoDB', 'Parse' ])+param kind string++resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' = {+ name: name+ kind: kind+ location: location+ tags: tags+ properties: {+ consistencyPolicy: { defaultConsistencyLevel: 'Session' }+ locations: [+ {+ locationName: location+ failoverPriority: 0+ isZoneRedundant: false+ }+ ]+ databaseAccountOfferType: 'Standard'+ enableAutomaticFailover: false+ enableMultipleWriteLocations: false+ apiProperties: (kind == 'MongoDB') ? { serverVersion: '4.0' } : {}+ capabilities: [ { name: 'EnableServerless' } ]+ }+}+++output connectionStringKey string = connectionStringKey+output endpoint string = cosmos.properties.documentEndpoint+output id string = cosmos.id+output name string = cosmos.namediff --git a/infra/core/database/cosmos/sql/cosmos-sql-account.bicep b/infra/core/database/cosmos/sql/cosmos-sql-account.bicepnew file mode 100644index 000000000..fee0f679e--- /dev/null+++ b/infra/core/database/cosmos/sql/cosmos-sql-account.bicep@@ -0,0 +1,19 @@+metadata description = 'Creates an Azure Cosmos DB for NoSQL account.'+param name string+param location string = resourceGroup().location+param tags object = {}++module cosmos '../../cosmos/cosmos-account.bicep' = {+ name: 'cosmos-account'+ params: {+ name: name+ location: location+ tags: tags+ kind: 'GlobalDocumentDB'+ }+}++output connectionStringKey string = cosmos.outputs.connectionStringKey+output endpoint string = cosmos.outputs.endpoint+output id string = cosmos.outputs.id+output name string = cosmos.outputs.namediff --git a/infra/core/database/cosmos/sql/cosmos-sql-db.bicep b/infra/core/database/cosmos/sql/cosmos-sql-db.bicepnew file mode 100644index 000000000..3c79064ec--- /dev/null+++ b/infra/core/database/cosmos/sql/cosmos-sql-db.bicep@@ -0,0 +1,72 @@+metadata description = 'Creates an Azure Cosmos DB for NoSQL account with a database.'+param accountName string+param databaseName string+param location string = resourceGroup().location+param tags object = {}++param containers array = []+param principalIds array = []++module cosmos 'cosmos-sql-account.bicep' = {+ name: 'cosmos-sql-account'+ params: {+ name: accountName+ location: location+ tags: tags+ }+}++resource database 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2022-05-15' = {+ name: '${accountName}/${databaseName}'+ properties: {+ resource: { id: databaseName }+ }++ resource list 'containers' = [for container in containers: {+ name: container.name+ properties: {+ resource: {+ id: container.id+ partitionKey: { paths: [ container.partitionKey ] }+ }+ options: {}+ }+ }]++ dependsOn: [+ cosmos+ ]+}++module roleDefinition 'cosmos-sql-role-def.bicep' = {+ name: 'cosmos-sql-role-definition'+ params: {+ accountName: accountName+ }+ dependsOn: [+ cosmos+ database+ ]+}++// We need batchSize(1) here because sql role assignments have to be done sequentially+@batchSize(1)+module userRole 'cosmos-sql-role-assign.bicep' = [for principalId in principalIds: if (!empty(principalId)) {+ name: 'cosmos-sql-user-role-${uniqueString(principalId)}'+ params: {+ accountName: accountName+ roleDefinitionId: roleDefinition.outputs.id+ principalId: principalId+ }+ dependsOn: [+ cosmos+ database+ ]+}]++output accountId string = cosmos.outputs.id+output accountName string = cosmos.outputs.name+output connectionStringKey string = cosmos.outputs.connectionStringKey+output databaseName string = databaseName+output endpoint string = cosmos.outputs.endpoint+output roleDefinitionId string = roleDefinition.outputs.iddiff --git a/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep b/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicepnew file mode 100644index 000000000..3949efef0--- /dev/null+++ b/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep@@ -0,0 +1,19 @@+metadata description = 'Creates a SQL role assignment under an Azure Cosmos DB account.'+param accountName string++param roleDefinitionId string+param principalId string = ''++resource role 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = {+ parent: cosmos+ name: guid(roleDefinitionId, principalId, cosmos.id)+ properties: {+ principalId: principalId+ roleDefinitionId: roleDefinitionId+ scope: cosmos.id+ }+}++resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = {+ name: accountName+}diff --git a/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep b/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicepnew file mode 100644index 000000000..778d6dc47--- /dev/null+++ b/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep@@ -0,0 +1,30 @@+metadata description = 'Creates a SQL role definition under an Azure Cosmos DB account.'+param accountName string++resource roleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2022-08-15' = {+ parent: cosmos+ name: guid(cosmos.id, accountName, 'sql-role')+ properties: {+ assignableScopes: [+ cosmos.id+ ]+ permissions: [+ {+ dataActions: [+ 'Microsoft.DocumentDB/databaseAccounts/readMetadata'+ 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*'+ 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*'+ ]+ notDataActions: []+ }+ ]+ roleName: 'Reader Writer'+ type: 'CustomRole'+ }+}++resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = {+ name: accountName+}++output id string = roleDefinition.iddiff --git a/infra/core/security/registry-access.bicep b/infra/core/security/registry-access.bicepnew file mode 100644index 000000000..5335efabc--- /dev/null+++ b/infra/core/security/registry-access.bicep@@ -0,0 +1,19 @@+metadata description = 'Assigns ACR Pull permissions to access an Azure Container Registry.'+param containerRegistryName string+param principalId string++var acrPullRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '7f951dda-4ed3-4680-a7ca-43fe172d538d')++resource aksAcrPull 'Microsoft.Authorization/roleAssignments@2022-04-01' = {+ scope: containerRegistry // Use when specifying a scope that is different than the deployment scope+ name: guid(subscription().id, resourceGroup().id, principalId, acrPullRole)+ properties: {+ roleDefinitionId: acrPullRole+ principalType: 'ServicePrincipal'+ principalId: principalId+ }+}++resource containerRegistry 'Microsoft.ContainerRegistry/registries@2022-02-01-preview' existing = {+ name: containerRegistryName+}diff --git a/infra/main.bicep b/infra/main.bicepindex 5e88f44f9..e7af7b64f 100644--- a/infra/main.bicep+++ b/infra/main.bicep@@ -30,6 +30,8 @@ param resourceGroupName string = ''param storageAccountName string = ''param containerAppsEnvironmentName string = ''param containerRegistryName string = ''+param ghFlowServiceName string = ''+param cosmosAccountName string = ''var aciShare = 'acishare'@@ -107,62 +109,110 @@ module qdrant './core/database/qdrant/qdrant-aca.bicep' = {}// Create an App Service Plan to group applications under the same payment plan and SKU-module appServicePlan './core/host/appserviceplan.bicep' = {- name: 'appserviceplan'+// module appServicePlan './core/host/appserviceplan.bicep' = {+// name: 'appserviceplan'+// scope: rg+// params: {+// name: !empty(appServicePlanName) ? appServicePlanName : '${abbrs.webServerFarms}${resourceToken}'+// location: location+// tags: tags+// sku: {+// name: 'EP1'+// tier: 'ElasticPremium'+// family: 'EP'+// }+// kind: 'elastic'+// reserved: false+// }+// }++// var appName = !empty(apiServiceName) ? apiServiceName : '${abbrs.webSitesFunctions}api-${resourceToken}'++// The application backend+// module skfunc './app/sk-func.bicep' = {+// name: 'skfunc'+// scope: rg+// params: {+// name: appName+// location: location+// tags: tags+// applicationInsightsName: monitoring.outputs.applicationInsightsName+// appServicePlanId: appServicePlan.outputs.id+// storageAccountName: storage.outputs.name+// appSettings: {+// SANDBOX_IMAGE: 'mcr.microsoft.com/dotnet/sdk:7.0'+// AzureWebJobsFeatureFlags: 'EnableHttpProxying'+// FUNCTIONS_FQDN: 'https://${appName}.azurewebsites.net'+// 'GithubOptions__AppKey': githubAppKey+// 'GithubOptions__AppId': githubAppId+// 'GithubOptions__InstallationId': githubAppInstallationId+// 'AzureOptions__SubscriptionId': subscription().subscriptionId+// 'AzureOptions__Location': location+// 'AzureOptions__ContainerInstancesResourceGroup': rg.name+// 'AzureOptions__FilesShareName': aciShare+// 'AzureOptions__FilesAccountName': storage.outputs.name+// 'OpenAIOptions__ServiceType': openAIServiceType+// 'OpenAIOptions__ServiceId': openAIServiceId+// 'OpenAIOptions__DeploymentOrModelId': openAIDeploymentId+// 'OpenAIOptions__EmbeddingDeploymentOrModelId': openAIEmbeddingId+// 'OpenAIOptions__Endpoint': openAIEndpoint+// 'OpenAIOptions__ApiKey': openAIKey+// 'QdrantOptions__Endpoint':'https://${qdrant.outputs.fqdn}'+// 'QdrantOptions__VectorSize':'1536'+// }+// }+// }+++// The application database+module cosmos './app/db.bicep' = {+ name: 'cosmos'scope: rgparams: {- name: !empty(appServicePlanName) ? appServicePlanName : '${abbrs.webServerFarms}${resourceToken}'+ accountName: !empty(cosmosAccountName) ? cosmosAccountName : '${abbrs.documentDBDatabaseAccounts}${resourceToken}'+ databaseName: 'devteam'location: locationtags: tags- sku: {- name: 'EP1'- tier: 'ElasticPremium'- family: 'EP'- }- kind: 'elastic'- reserved: false}}-var appName = !empty(apiServiceName) ? apiServiceName : '${abbrs.webSitesFunctions}api-${resourceToken}'--// The application backend-module skfunc './app/sk-func.bicep' = {- name: 'skfunc'+module ghFlow './app/gh-flow.bicep' = {+ name: 'gh-flow'scope: rgparams: {- name: appName+ name: !empty(ghFlowServiceName) ? ghFlowServiceName : '${abbrs.appContainerApps}ghflow-${resourceToken}'location: locationtags: tags+ identityName: '${abbrs.managedIdentityUserAssignedIdentities}ghflow-${resourceToken}'applicationInsightsName: monitoring.outputs.applicationInsightsName- appServicePlanId: appServicePlan.outputs.id+ containerAppsEnvironmentName: containerApps.outputs.environmentName+ containerRegistryName:containerApps.outputs.registryNamestorageAccountName: storage.outputs.name- appSettings: {- SANDBOX_IMAGE: 'mcr.microsoft.com/dotnet/sdk:7.0'- AzureWebJobsFeatureFlags: 'EnableHttpProxying'- FUNCTIONS_FQDN: 'https://${appName}.azurewebsites.net'- 'GithubOptions__AppKey': githubAppKey- 'GithubOptions__AppId': githubAppId- 'GithubOptions__InstallationId': githubAppInstallationId- 'AzureOptions__SubscriptionId': subscription().subscriptionId- 'AzureOptions__Location': location- 'AzureOptions__ContainerInstancesResourceGroup': rg.name- 'AzureOptions__FilesShareName': aciShare- 'AzureOptions__FilesAccountName': storage.outputs.name- 'OpenAIOptions__ServiceType': openAIServiceType- 'OpenAIOptions__ServiceId': openAIServiceId- 'OpenAIOptions__DeploymentOrModelId': openAIDeploymentId- 'OpenAIOptions__EmbeddingDeploymentOrModelId': openAIEmbeddingId- 'OpenAIOptions__Endpoint': openAIEndpoint- 'OpenAIOptions__ApiKey': openAIKey- 'QdrantOptions__Endpoint':'https://${qdrant.outputs.fqdn}'- 'QdrantOptions__VectorSize':'1536'- }+ aciShare: aciShare+ githubAppId: githubAppId+ githubAppInstallationId: githubAppInstallationId+ githubAppKey: githubAppKey+ openAIDeploymentId: openAIDeploymentId+ openAIEmbeddingId: openAIEmbeddingId+ openAIEndpoint: openAIEndpoint+ openAIKey: openAIKey+ openAIServiceId: openAIServiceId+ openAIServiceType: openAIServiceType+ qdrantEndpoint: 'https://${qdrant.outputs.fqdn}'+ rgName: rg.name+ cosmosAccountName: cosmos.outputs.accountName}}+// Data outputs+output AZURE_COSMOS_ENDPOINT string = cosmos.outputs.endpoint+output AZURE_COSMOS_CONNECTION_STRING_KEY string = cosmos.outputs.connectionStringKey+output AZURE_COSMOS_DATABASE_NAME string = cosmos.outputs.databaseName+// App outputsoutput APPLICATIONINSIGHTS_CONNECTION_STRING string = monitoring.outputs.applicationInsightsConnectionString+output AZURE_CONTAINER_ENVIRONMENT_NAME string = containerApps.outputs.environmentName+output AZURE_CONTAINER_REGISTRY_ENDPOINT string = containerApps.outputs.registryLoginServer+output AZURE_CONTAINER_REGISTRY_NAME string = containerApps.outputs.registryNameoutput AZURE_LOCATION string = locationoutput AZURE_TENANT_ID string = tenant().tenantId-diff --git a/sk-dev-team.sln b/sk-dev-team.slnindex 42943545f..2f3edd9f0 100644--- a/sk-dev-team.sln+++ b/sk-dev-team.sln@@ -21,9 +21,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libs", "libs", "{24EB6E3A-CEndProjectProject("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.SemanticKernel", "src\libs\Elsa.SemanticKernel\Elsa.SemanticKernel.csproj", "{1F6EE104-0B3F-49C1-BE3B-B93CAD18BAD0}"EndProject-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MS.AI.DevTeam", "src\libs\MS.AI.DevTeam\MS.AI.DevTeam.csproj", "{A064E523-718C-4464-B8AD-BC00BF2E358A}"+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.DevTeam", "src\libs\Microsoft.AI.DevTeam\Microsoft.AI.DevTeam.csproj", "{9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}"EndProject-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skills", "src\libs\skills\skills.csproj", "{3EAFB48F-FBF5-4362-8696-976D7E1EA309}"+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.DevTeam.Skills", "src\libs\Microsoft.AI.DevTeam.Skills\Microsoft.AI.DevTeam.Skills.csproj", "{FF3D28B0-9344-44AF-BEEA-260187BE435E}"EndProjectGlobalGlobalSection(SolutionProperties) = preSolution@@ -41,8 +41,8 @@ Global{F288CF45-81EF-4F57-ABAC-D7ABE894E7A0} = {4D8667EC-09BE-4CB1-A278-E1CCD83B62B0}{24EB6E3A-C080-4B27-8EA7-F6C91446B840} = {088E1138-FF7B-4179-AD37-4E3819C56D7E}{1F6EE104-0B3F-49C1-BE3B-B93CAD18BAD0} = {24EB6E3A-C080-4B27-8EA7-F6C91446B840}- {A064E523-718C-4464-B8AD-BC00BF2E358A} = {24EB6E3A-C080-4B27-8EA7-F6C91446B840}- {3EAFB48F-FBF5-4362-8696-976D7E1EA309} = {088E1138-FF7B-4179-AD37-4E3819C56D7E}+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1} = {24EB6E3A-C080-4B27-8EA7-F6C91446B840}+ {FF3D28B0-9344-44AF-BEEA-260187BE435E} = {24EB6E3A-C080-4B27-8EA7-F6C91446B840}EndGlobalSectionGlobalSection(SolutionConfigurationPlatforms) = preSolutionDebug|Any CPU = Debug|Any CPU@@ -125,29 +125,29 @@ Global{1F6EE104-0B3F-49C1-BE3B-B93CAD18BAD0}.Release|x64.Build.0 = Release|Any CPU{1F6EE104-0B3F-49C1-BE3B-B93CAD18BAD0}.Release|x86.ActiveCfg = Release|Any CPU{1F6EE104-0B3F-49C1-BE3B-B93CAD18BAD0}.Release|x86.Build.0 = Release|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Debug|Any CPU.Build.0 = Debug|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Debug|x64.ActiveCfg = Debug|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Debug|x64.Build.0 = Debug|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Debug|x86.ActiveCfg = Debug|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Debug|x86.Build.0 = Debug|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Release|Any CPU.ActiveCfg = Release|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Release|Any CPU.Build.0 = Release|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Release|x64.ActiveCfg = Release|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Release|x64.Build.0 = Release|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Release|x86.ActiveCfg = Release|Any CPU- {A064E523-718C-4464-B8AD-BC00BF2E358A}.Release|x86.Build.0 = Release|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Debug|Any CPU.Build.0 = Debug|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Debug|x64.ActiveCfg = Debug|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Debug|x64.Build.0 = Debug|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Debug|x86.ActiveCfg = Debug|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Debug|x86.Build.0 = Debug|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Release|Any CPU.ActiveCfg = Release|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Release|Any CPU.Build.0 = Release|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Release|x64.ActiveCfg = Release|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Release|x64.Build.0 = Release|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Release|x86.ActiveCfg = Release|Any CPU- {3EAFB48F-FBF5-4362-8696-976D7E1EA309}.Release|x86.Build.0 = Release|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Debug|x64.ActiveCfg = Debug|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Debug|x64.Build.0 = Debug|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Debug|x86.ActiveCfg = Debug|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Debug|x86.Build.0 = Debug|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Release|Any CPU.Build.0 = Release|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Release|x64.ActiveCfg = Release|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Release|x64.Build.0 = Release|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Release|x86.ActiveCfg = Release|Any CPU+ {9FA8DCFB-1726-42FB-B6CD-8AAC027810A1}.Release|x86.Build.0 = Release|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Debug|x64.ActiveCfg = Debug|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Debug|x64.Build.0 = Debug|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Debug|x86.ActiveCfg = Debug|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Debug|x86.Build.0 = Debug|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Release|Any CPU.ActiveCfg = Release|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Release|Any CPU.Build.0 = Release|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Release|x64.ActiveCfg = Release|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Release|x64.Build.0 = Release|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Release|x86.ActiveCfg = Release|Any CPU+ {FF3D28B0-9344-44AF-BEEA-260187BE435E}.Release|x86.Build.0 = Release|Any CPUEndGlobalSectionEndGlobaldiff --git a/src/apps/cli/Program.cs b/src/apps/cli/Program.csindex 5b04b8cc6..5d18ee5b1 100644--- a/src/apps/cli/Program.cs+++ b/src/apps/cli/Program.cs@@ -1,13 +1,12 @@using System.CommandLine;using System.Text.Json;+using Microsoft.AI.DevTeam.Skills;using Microsoft.Extensions.Logging;using Microsoft.SemanticKernel;using Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;using Microsoft.SemanticKernel.Connectors.Memory.Qdrant;using Microsoft.SemanticKernel.Memory;using Microsoft.SemanticKernel.Orchestration;-using Microsoft.SemanticKernel.Reliability;-using Microsoft.SKDevTeam;class Programdiff --git a/src/apps/cli/cli.csproj b/src/apps/cli/cli.csprojindex 9e17d7eae..d1bfcd0ad 100644--- a/src/apps/cli/cli.csproj+++ b/src/apps/cli/cli.csproj@@ -16,7 +16,7 @@<PackageReference Include="Microsoft.SemanticKernel" Version="0.24.230918.1-preview" /><PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.Qdrant" Version="0.24.230918.1-preview" /><PackageReference Include="Testcontainers" Version="3.2.0" />- <ProjectReference Include="..\..\libs\skills\skills.csproj" />+ <ProjectReference Include="..\..\libs\Microsoft.AI.DevTeam.Skills\Microsoft.AI.DevTeam.Skills.csproj" /></ItemGroup></Project>diff --git a/src/apps/gh-flow-df/Orchestrators/SubIssueOrchestration.cs b/src/apps/gh-flow-df/Orchestrators/SubIssueOrchestration.csindex ebacb2210..5028a972a 100644--- a/src/apps/gh-flow-df/Orchestrators/SubIssueOrchestration.cs+++ b/src/apps/gh-flow-df/Orchestrators/SubIssueOrchestration.cs@@ -1,6 +1,6 @@+using Microsoft.AI.DevTeam.Skills;using Microsoft.Azure.Functions.Worker;using Microsoft.DurableTask;-using Microsoft.SKDevTeam;namespace SK.DevTeam{@@ -128,7 +128,7 @@ namespace SK.DevTeamif (request.RunInSandbox){- var newRequest = new RunInSandboxRequest+ var newRequest = new RunInSandboxRequest{PrRequest = request,SanboxOrchestrationId = context.InstanceIddiff --git a/src/apps/gh-flow-df/Services/WebHookEventProcessor.cs b/src/apps/gh-flow-df/Services/WebHookEventProcessor.csindex ba35597c1..70168f5dd 100644--- a/src/apps/gh-flow-df/Services/WebHookEventProcessor.cs+++ b/src/apps/gh-flow-df/Services/WebHookEventProcessor.cs@@ -1,5 +1,6 @@using System.Net.Http.Json;using System.Text;+using Microsoft.AI.DevTeam.Skills;using Microsoft.Extensions.Logging;using Microsoft.SemanticKernel;using Microsoft.SemanticKernel.Orchestration;@@ -9,7 +10,6 @@ using Octokit.Webhooks.Events;using Octokit.Webhooks.Events.IssueComment;using Octokit.Webhooks.Events.Issues;using Octokit.Webhooks.Models;-using Microsoft.SKDevTeam;[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2007: Do not directly await a Task", Justification = "Durable functions")]public class SKWebHookEventProcessor : WebhookEventProcessordiff --git a/src/apps/gh-flow-df/gh-flow-df.csproj b/src/apps/gh-flow-df/gh-flow-df.csprojindex 2f57ec9f5..aba8a20b4 100644--- a/src/apps/gh-flow-df/gh-flow-df.csproj+++ b/src/apps/gh-flow-df/gh-flow-df.csproj@@ -37,7 +37,7 @@<PackageReference Include="Azure.Storage.Files.Shares" Version="12.16.0-beta.1" /><PackageReference Include="Azure.Data.Tables" Version="12.8.1" /><PackageReference Include="Azure.Identity" Version="1.10.0-beta.1" />- <ProjectReference Include="..\..\libs\skills\skills.csproj" />+ <ProjectReference Include="..\..\libs\Microsoft.AI.DevTeam.Skills\Microsoft.AI.DevTeam.Skills.csproj" /></ItemGroup>diff --git a/src/apps/gh-flow/Dockerfile b/src/apps/gh-flow/Dockerfilenew file mode 100644index 000000000..94041c3fa--- /dev/null+++ b/src/apps/gh-flow/Dockerfile@@ -0,0 +1,23 @@+FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base+WORKDIR /app+EXPOSE 5274+EXPOSE 11111+EXPOSE 30000++ENV ASPNETCORE_URLS=http://+:5274++FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build+ARG configuration=Release+COPY . .+RUN dotnet restore "src/apps/gh-flow/gh-flow.csproj"+WORKDIR "/src/apps/gh-flow"+RUN dotnet build "gh-flow.csproj" -c $configuration -o /app/build++FROM build AS publish+ARG configuration=Release+RUN dotnet publish "gh-flow.csproj" -c $configuration -o /app/publish++FROM base AS final+WORKDIR /app+COPY --from=publish /app/publish .+ENTRYPOINT ["dotnet", "gh-flow.dll"]\ No newline at end of filediff --git a/src/apps/gh-flow/Program.cs b/src/apps/gh-flow/Program.csindex 2976f4d93..c8a7da568 100644--- a/src/apps/gh-flow/Program.cs+++ b/src/apps/gh-flow/Program.cs@@ -1,12 +1,13 @@using System.Text.Json;+using Microsoft.AI.DevTeam;using Microsoft.Extensions.Options;using Microsoft.SemanticKernel;using Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;using Microsoft.SemanticKernel.Connectors.Memory.Qdrant;using Microsoft.SemanticKernel.Memory;-using MS.AI.DevTeam;using Octokit.Webhooks;using Octokit.Webhooks.AspNetCore;+using Orleans.Configuration;var builder = WebApplication.CreateBuilder(args);builder.Services.AddSingleton<WebhookEventProcessor, GithubWebHookProcessor>();@@ -49,29 +50,73 @@ builder.Services.AddSingleton<IManageGithub, GithubService>();builder.Host.UseOrleans(siloBuilder =>{- var connectionString = builder.Configuration.GetValue<string>("AzureOptions:CosmosConnectionString");- siloBuilder.UseCosmosReminderService( o =>++ if (builder.Environment.IsDevelopment()){- o.ConfigureCosmosClient(connectionString);- o.ContainerName = "devteam";- o.DatabaseName = "reminders";- o.IsResourceCreationEnabled = true;- });- siloBuilder.AddCosmosGrainStorage(- name: "messages",- configureOptions: o =>+ var connectionString = builder.Configuration.GetValue<string>("AzureOptions:CosmosConnectionString");+ siloBuilder.UseCosmosReminderService( o =>+ {+ o.ConfigureCosmosClient(connectionString);+ o.ContainerName = "reminders";+ o.DatabaseName = "devteam";+ o.IsResourceCreationEnabled = true;+ });+ siloBuilder.AddCosmosGrainStorage(+ name: "messages",+ configureOptions: o =>+ {+ o.ConfigureCosmosClient(connectionString);+ o.ContainerName = "persistence";+ o.DatabaseName = "devteam";+ o.IsResourceCreationEnabled = true;+ });+ siloBuilder.UseLocalhostClustering();+ }+ else+ {+ var cosmosDbconnectionString = builder.Configuration.GetValue<string>("AzureOptions:CosmosConnectionString");+ siloBuilder.Configure<ClusterOptions>(options =>{- o.ConfigureCosmosClient(connectionString);- o.ContainerName = "devteam";- o.DatabaseName = "persistence";- o.IsResourceCreationEnabled = true;+ options.ClusterId = "ai-dev-cluster";+ options.ServiceId = "ai-dev-cluster";});- siloBuilder.UseLocalhostClustering();+ siloBuilder.Configure<SiloMessagingOptions>(options =>+ {+ options.ResponseTimeout = TimeSpan.FromMinutes(3);+ options.SystemResponseTimeout = TimeSpan.FromMinutes(3);+ });+ siloBuilder.Configure<ClientMessagingOptions>(options =>+ {+ options.ResponseTimeout = TimeSpan.FromMinutes(3);+ });+ siloBuilder.UseCosmosClustering( o =>+ {+ o.ConfigureCosmosClient(cosmosDbconnectionString);+ o.ContainerName = "devteam";+ o.DatabaseName = "clustering";+ o.IsResourceCreationEnabled = true;+ });++ siloBuilder.UseCosmosReminderService( o =>+ {+ o.ConfigureCosmosClient(cosmosDbconnectionString);+ o.ContainerName = "devteam";+ o.DatabaseName = "reminders";+ o.IsResourceCreationEnabled = true;+ });+ siloBuilder.AddCosmosGrainStorage(+ name: "messages",+ configureOptions: o =>+ {+ o.ConfigureCosmosClient(cosmosDbconnectionString);+ o.ContainerName = "devteam";+ o.DatabaseName = "persistence";+ o.IsResourceCreationEnabled = true;+ });+ }+});---builder.Services.Configure<JsonSerializerOptions>(options =>{options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;diff --git a/src/apps/gh-flow/Services/GithubWebHookProcessor.cs b/src/apps/gh-flow/Services/GithubWebHookProcessor.csindex c9fb7a703..f873b73c7 100644--- a/src/apps/gh-flow/Services/GithubWebHookProcessor.cs+++ b/src/apps/gh-flow/Services/GithubWebHookProcessor.cs@@ -1,4 +1,5 @@-using MS.AI.DevTeam;+using Microsoft.AI.DevTeam;+using Microsoft.AI.DevTeam.Skills;using Octokit.Webhooks;using Octokit.Webhooks.Events;using Octokit.Webhooks.Events.IssueComment;@@ -71,7 +72,7 @@ public sealed class GithubWebHookProcessor : WebhookEventProcessor{await HandleClosingDevPlan(issueNumber, suffix, org, repo);}- else if (skillName == nameof(Dev) && functionName == nameof(Dev.Implement))+ else if (skillName == nameof(Developer) && functionName == nameof(Developer.Implement)){await HandleClosingDevImplement(issueNumber, suffix, org, repo);}@@ -206,7 +207,7 @@ public sealed class GithubWebHookProcessor : WebhookEventProcessorContent = plan});}- else if (skillName == nameof(Dev) && functionName == nameof(Dev.Implement))+ else if (skillName == nameof(Developer) && functionName == nameof(Developer.Implement)){var dev = _grains.GetGrain<IDevelopCode>(issueNumber, suffix);var code = await dev.GenerateCode(input);diff --git a/src/apps/gh-flow/appsettings.template.json b/src/apps/gh-flow/appsettings.template.jsonnew file mode 100644index 000000000..78d23c1f2--- /dev/null+++ b/src/apps/gh-flow/appsettings.template.json@@ -0,0 +1,41 @@+{+ "Logging": {+ "LogLevel": {+ "Default": "Information",+ "Microsoft.AspNetCore": "Warning"+ }+ },+ "ApplicationInsights": {+ "ConnectionString": ""+ },+ "AllowedHosts": "*",+ "SANDBOX_IMAGE" : "mcr.microsoft.com/dotnet/sdk:7.0",+ "GithubOptions" : {+ "AppKey": "",+ "AppId": "",+ "InstallationId": ""+ },+ "AzureOptions" : {+ "SubscriptionId":"",+ "Location":"",+ "ContainerInstancesResourceGroup":"",+ "FilesShareName":"",+ "FilesAccountName":"",+ "FilesAccountKey":"",+ "CosmosConnectionString":"",+ "SandboxImage" : "mcr.microsoft.com/dotnet/sdk:7.0",+ "ManagedIdentity": ""+ },+ "OpenAIOptions" : {+ "ServiceType":"AzureOpenAI",+ "ServiceId":"",+ "DeploymentOrModelId":"",+ "EmbeddingDeploymentOrModelId":"",+ "Endpoint":"",+ "ApiKey":""+ },+ "QdrantOptions" : {+ "Endpoint" : "http://qdrant:6333",+ "VectorSize" : "1536"+ }+}diff --git a/src/apps/gh-flow/gh-flow.csproj b/src/apps/gh-flow/gh-flow.csprojindex b81c957d3..f9716304a 100644--- a/src/apps/gh-flow/gh-flow.csproj+++ b/src/apps/gh-flow/gh-flow.csproj@@ -1,23 +1,27 @@-<Project Sdk="Microsoft.NET.Sdk.Web">-- <ItemGroup>- <ProjectReference Include="..\..\libs\MS.AI.DevTeam\MS.AI.DevTeam.csproj" />- </ItemGroup>-- <PropertyGroup>- <TargetFramework>net7.0</TargetFramework>- <Nullable>enable</Nullable>- <ImplicitUsings>enable</ImplicitUsings>- </PropertyGroup>-- <ItemGroup>- <PackageReference Include="Octokit.Webhooks.AspNetCore" Version="2.0.3" />- <PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.Qdrant" Version="0.24.230918.1-preview" />- <PackageReference Include="Microsoft.Orleans.Server" Version="7.2.1" />- <PackageReference Include="Microsoft.Orleans.Persistence.Cosmos" Version="7.2.1" />- <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />- <PackageReference Include="Microsoft.Orleans.Reminders.Cosmos" Version="7.2.1" />- </ItemGroup>---</Project>+<Project Sdk="Microsoft.NET.Sdk.Web">++ <ItemGroup>+ <ProjectReference Include="..\..\libs\Microsoft.AI.DevTeam\Microsoft.AI.DevTeam.csproj" />+ </ItemGroup>++ <PropertyGroup>+ <TargetFramework>net7.0</TargetFramework>+ <Nullable>enable</Nullable>+ <ImplicitUsings>enable</ImplicitUsings>+ <ServerGarbageCollection>true</ServerGarbageCollection>+ <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>+ <UserSecretsId>c073c86e-8483-4956-942f-331fd09172d4</UserSecretsId>+ </PropertyGroup>++ <ItemGroup>+ <PackageReference Include="Octokit.Webhooks.AspNetCore" Version="2.0.3" />+ <PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.Qdrant" Version="0.24.230918.1-preview" />+ <PackageReference Include="Microsoft.Orleans.Server" Version="7.2.1" />+ <PackageReference Include="Microsoft.Orleans.Persistence.Cosmos" Version="7.2.1" />+ <PackageReference Include="Microsoft.Orleans.Clustering.Cosmos" Version="7.2.1" />+ <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />+ <PackageReference Include="Microsoft.Orleans.Reminders.Cosmos" Version="7.2.1" />+ </ItemGroup>+++</Project>diff --git a/src/libs/Elsa.SemanticKernel/Activities/ActivityProviders/SemanticKernelSkillActivityProvider.cs b/src/libs/Elsa.SemanticKernel/Activities/ActivityProviders/SemanticKernelSkillActivityProvider.csindex c065dd7b0..a6d1ced74 100644--- a/src/libs/Elsa.SemanticKernel/Activities/ActivityProviders/SemanticKernelSkillActivityProvider.cs+++ b/src/libs/Elsa.SemanticKernel/Activities/ActivityProviders/SemanticKernelSkillActivityProvider.cs@@ -1,32 +1,18 @@using System;-using System.Collections;using System.Collections.Generic;-using System.Diagnostics.CodeAnalysis;using System.Linq;using System.Reflection;using System.Threading;using System.Threading.Tasks;-using Elsa;-using Elsa.Expressions.Models;using Elsa.Extensions;using Elsa.Workflows.Core;using Elsa.Workflows.Core.Contracts;using Elsa.Workflows.Core.Models;-using Elsa.Workflows.Management.Extensions;-using Elsa.Workflows.Core.Attributes;-using Elsa.Workflows.Core.Models;-using Elsa.Expressions.Models;-using Elsa.Extensions;-using Elsa.Http;+using Microsoft.AI.DevTeam.Skills;using Microsoft.Extensions.Logging;using Microsoft.SemanticKernel;-using Microsoft.SemanticKernel.Connectors.Memory.Qdrant;-using Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;-using Microsoft.SemanticKernel.Memory;using Microsoft.SemanticKernel.Orchestration;-using Microsoft.SemanticKernel.Reliability;using Microsoft.SemanticKernel.SkillDefinition;-using Microsoft.SKDevTeam;namespace Elsa.SemanticKernel;diff --git a/src/libs/Elsa.SemanticKernel/Activities/SemanticKernel.cs b/src/libs/Elsa.SemanticKernel/Activities/SemanticKernel.csindex 1a9d0d387..4ba5f8cbc 100644--- a/src/libs/Elsa.SemanticKernel/Activities/SemanticKernel.cs+++ b/src/libs/Elsa.SemanticKernel/Activities/SemanticKernel.cs@@ -5,23 +5,16 @@ using Elsa.Workflows.Core.Models;using JetBrains.Annotations;using Microsoft.Extensions.Logging;using Microsoft.SemanticKernel;-using Microsoft.SemanticKernel.Connectors.Memory.Qdrant;-using Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding;-using Microsoft.SemanticKernel.Memory;using Microsoft.SemanticKernel.Orchestration;-using Microsoft.SemanticKernel.Reliability;using Microsoft.SemanticKernel.SkillDefinition;-using Microsoft.SKDevTeam;using System;using System.Text;-using System.Collections;using System.Collections.Generic;-using System.Diagnostics.CodeAnalysis;using System.Linq;using System.Reflection;-using System.Threading;using System.Threading.Tasks;+using Microsoft.AI.DevTeam.Skills;namespace Elsa.SemanticKernel;diff --git a/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj b/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csprojindex a5e6f77ef..c6f821073 100644--- a/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj+++ b/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj@@ -23,7 +23,7 @@<PackageReference Include="AspNetCore.Authentication.ApiKey" Version="7.0.0" /><PackageReference Include="Microsoft.SemanticKernel" Version="0.24.230918.1-preview" /><PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.Qdrant" Version="0.24.230918.1-preview" />- <ProjectReference Include="..\skills\skills.csproj" />+ <ProjectReference Include="..\Microsoft.AI.DevTeam.Skills\Microsoft.AI.DevTeam.Skills.csproj" /></ItemGroup>diff --git a/src/libs/MS.AI.DevTeam/Actors/DevLead/DevLead.cs b/src/libs/MS.AI.DevTeam/Actors/DevLead/DevLead.csdeleted file mode 100644index 8563a21b8..000000000--- a/src/libs/MS.AI.DevTeam/Actors/DevLead/DevLead.cs+++ /dev/null@@ -1,47 +0,0 @@-namespace MS.AI.DevTeam;--public static class DevLead {- public static SemanticFunctionConfig Plan = new SemanticFunctionConfig- {- PromptTemplate = """- You are a Dev Lead for an application team, building the application described below.- Please break down the steps and modules required to develop the complete application, describe each step in detail.- Make prescriptive architecture, language, and frameowrk choices, do not provide a range of choices.- For each step or module then break down the steps or subtasks required to complete that step or module.- For each subtask write an LLM prompt that would be used to tell a model to write the coee that will accomplish that subtask. If the subtask involves taking action/running commands tell the model to write the script that will run those commands.- In each LLM prompt restrict the model from outputting other text that is not in the form of code or code comments.- Please output a JSON array data structure, in the precise schema shown below, with a list of steps and a description of each step, and the steps or subtasks that each requires, and the LLM prompts for each subtask.- Example:- {- "steps": [- {- "step": "1",- "description": "This is the first step",- "subtasks": [- {- "subtask": "Subtask 1",- "description": "This is the first subtask",- "prompt": "Write the code to do the first subtask"- },- {- "subtask": "Subtask 2",- "description": "This is the second subtask",- "prompt": "Write the code to do the second subtask"- }- ]- }- ]- }- Do not output any other text.- Input: {{$input}}- """,- Name = nameof(Plan),- SkillName = nameof(DevLead),- Description = "From a simple description of an application output a development plan for building the application.",- MaxTokens = 6500,- Temperature = 0.0,- TopP = 0.0,- PPenalty = 0.0,- FPenalty = 0.0- };-}\ No newline at end of filediff --git a/src/libs/MS.AI.DevTeam/Actors/Developer/Dev.cs b/src/libs/MS.AI.DevTeam/Actors/Developer/Dev.csdeleted file mode 100644index 607d7842d..000000000--- a/src/libs/MS.AI.DevTeam/Actors/Developer/Dev.cs+++ /dev/null@@ -1,45 +0,0 @@-namespace MS.AI.DevTeam;--public static class Dev {- public static SemanticFunctionConfig Implement = new SemanticFunctionConfig- {- PromptTemplate = """- You are a Developer for an application.- Please output the code required to accomplish the task assigned to you below and wrap it in a bash script that creates the files.- Do not use any IDE commands and do not build and run the code.- Make specific choices about implementation. Do not offer a range of options.- Use comments in the code to describe the intent. Do not include other text other than code and code comments.- Input: {{$input}}- """,- Name = nameof(Implement),- SkillName = nameof(Developer),- Description = "From a description of a coding task out put the code or scripts necessary to complete the task.",- MaxTokens = 6500,- Temperature = 0.0,- TopP = 0.0,- PPenalty = 0.0,- FPenalty = 0.0- };-- public static SemanticFunctionConfig Improve = new SemanticFunctionConfig- {- PromptTemplate = """- You are a Developer for an application. Your job is to imrove the code that you are given in the input below.- Please output a new version of code that fixes any problems with this version.- If there is an error message in the input you should fix that error in the code.- Wrap the code output up in a bash script that creates the necessary files by overwriting any previous files.- Do not use any IDE commands and do not build and run the code.- Make specific choices about implementation. Do not offer a range of options.- Use comments in the code to describe the intent. Do not include other text other than code and code comments.- Input: {{$input}}- """,- Name = nameof(Improve),- SkillName = nameof(Developer),- Description = "From a description of a coding task out put the code or scripts necessary to complete the task.",- MaxTokens = 6500,- Temperature = 0.0,- TopP = 0.0,- PPenalty = 0.0,- FPenalty = 0.0- };-}diff --git a/src/libs/MS.AI.DevTeam/Actors/ProductManager/PM.cs b/src/libs/MS.AI.DevTeam/Actors/ProductManager/PM.csdeleted file mode 100644index 5eac53072..000000000--- a/src/libs/MS.AI.DevTeam/Actors/ProductManager/PM.cs+++ /dev/null@@ -1,23 +0,0 @@-namespace MS.AI.DevTeam;--public static class PM-{- public static SemanticFunctionConfig Readme = new SemanticFunctionConfig- {- PromptTemplate = """- You are a program manager on a software development team. You are working on an app described below.- Based on the input below, and any dialog or other context, please output a raw README.MD markdown file documenting the main features of the app and the architecture or code organization.- Do not describe how to create the application.- Write the README as if it were documenting the features and architecture of the application. You may include instructions for how to run the application.- Input: {{$input}}- """,- Name = nameof(Readme),- SkillName = nameof(PM),- Description = "From a simple description output a README.md file for a GitHub repository.",- MaxTokens = 6500,- Temperature = 0.0,- TopP = 0.0,- PPenalty = 0.0,- FPenalty = 0.0- };-}diff --git a/src/libs/skills/Chat.cs b/src/libs/Microsoft.AI.DevTeam.Skills/Chat.cssimilarity index 94%rename from src/libs/skills/Chat.csrename to src/libs/Microsoft.AI.DevTeam.Skills/Chat.csindex da30e19b2..2f192a723 100644--- a/src/libs/skills/Chat.cs+++ b/src/libs/Microsoft.AI.DevTeam.Skills/Chat.cs@@ -1,4 +1,4 @@-namespace Microsoft.SKDevTeam;+namespace Microsoft.AI.DevTeam.Skills;public static class Chat{public static SemanticFunctionConfig ChatCompletion = new SemanticFunctionConfigdiff --git a/src/libs/skills/CodeExplainer.cs b/src/libs/Microsoft.AI.DevTeam.Skills/CodeExplainer.cssimilarity index 96%rename from src/libs/skills/CodeExplainer.csrename to src/libs/Microsoft.AI.DevTeam.Skills/CodeExplainer.csindex d7e493c74..ffba6a71e 100644--- a/src/libs/skills/CodeExplainer.cs+++ b/src/libs/Microsoft.AI.DevTeam.Skills/CodeExplainer.cs@@ -1,5 +1,5 @@-namespace Microsoft.SKDevTeam;+namespace Microsoft.AI.DevTeam.Skills;public static class CodeExplainer {public static SemanticFunctionConfig Explain = new SemanticFunctionConfig{diff --git a/src/libs/skills/DevLead.cs b/src/libs/Microsoft.AI.DevTeam.Skills/DevLead.cssimilarity index 98%rename from src/libs/skills/DevLead.csrename to src/libs/Microsoft.AI.DevTeam.Skills/DevLead.csindex 86467c6aa..e325af3df 100644--- a/src/libs/skills/DevLead.cs+++ b/src/libs/Microsoft.AI.DevTeam.Skills/DevLead.cs@@ -1,4 +1,4 @@-namespace Microsoft.SKDevTeam;+namespace Microsoft.AI.DevTeam.Skills;public static class DevLead {public static SemanticFunctionConfig Plan = new SemanticFunctionConfig{diff --git a/src/libs/skills/Developer.cs b/src/libs/Microsoft.AI.DevTeam.Skills/Developer.cssimilarity index 98%rename from src/libs/skills/Developer.csrename to src/libs/Microsoft.AI.DevTeam.Skills/Developer.csindex 0d072ed56..9a1db00d6 100644--- a/src/libs/skills/Developer.cs+++ b/src/libs/Microsoft.AI.DevTeam.Skills/Developer.cs@@ -1,5 +1,5 @@-namespace Microsoft.SKDevTeam;+namespace Microsoft.AI.DevTeam.Skills;public static class Developer {public static SemanticFunctionConfig Implement = new SemanticFunctionConfig{diff --git a/src/libs/skills/skills.csproj b/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csprojsimilarity index 88%rename from src/libs/skills/skills.csprojrename to src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csprojindex 2cb017c9f..11eebbb3e 100644--- a/src/libs/skills/skills.csproj+++ b/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csproj@@ -7,6 +7,6 @@</PropertyGroup><ItemGroup>- <PackageReference Include="Microsoft.SemanticKernel" Version="0.18.230725.3-preview" />+ <PackageReference Include="Microsoft.SemanticKernel" Version="0.24.230918.1-preview" /></ItemGroup></Project>diff --git a/src/libs/skills/PM.cs b/src/libs/Microsoft.AI.DevTeam.Skills/PM.cssimilarity index 97%rename from src/libs/skills/PM.csrename to src/libs/Microsoft.AI.DevTeam.Skills/PM.csindex 2eaca6610..dd4dcb247 100644--- a/src/libs/skills/PM.cs+++ b/src/libs/Microsoft.AI.DevTeam.Skills/PM.cs@@ -1,4 +1,4 @@-namespace Microsoft.SKDevTeam;+namespace Microsoft.AI.DevTeam.Skills;public static class PM{public static SemanticFunctionConfig BootstrapProject = new SemanticFunctionConfigdiff --git a/src/libs/MS.AI.DevTeam/Config/SemanticFunctionConfig.cs b/src/libs/Microsoft.AI.DevTeam.Skills/SemanticFunctionConfig.cssimilarity index 76%rename from src/libs/MS.AI.DevTeam/Config/SemanticFunctionConfig.csrename to src/libs/Microsoft.AI.DevTeam.Skills/SemanticFunctionConfig.csindex 1c61a8b0f..17a7ec8c3 100644--- a/src/libs/MS.AI.DevTeam/Config/SemanticFunctionConfig.cs+++ b/src/libs/Microsoft.AI.DevTeam.Skills/SemanticFunctionConfig.cs@@ -1,7 +1,7 @@using Microsoft.SemanticKernel;using Microsoft.SemanticKernel.SkillDefinition;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam.Skills;public class SemanticFunctionConfig{@@ -17,11 +17,13 @@ public class SemanticFunctionConfigpublic static SemanticFunctionConfig ForSkillAndFunction(string skillName, string functionName) =>(skillName, functionName) switch{+ (nameof(Chat), nameof(Chat.ChatCompletion)) => Chat.ChatCompletion,+ (nameof(PM), nameof(PM.BootstrapProject)) => PM.BootstrapProject,(nameof(PM), nameof(PM.Readme)) => PM.Readme,(nameof(DevLead), nameof(DevLead.Plan)) => DevLead.Plan,- // (nameof(CodeExplainer), nameof(CodeExplainer.Explain)) => CodeExplainer.Explain,- (nameof(Dev), nameof(Dev.Implement)) => Dev.Implement,- // (nameof(Developer), nameof(Developer.Improve)) => Developer.Improve,+ (nameof(CodeExplainer), nameof(CodeExplainer.Explain)) => CodeExplainer.Explain,+ (nameof(Developer), nameof(Developer.Implement)) => Developer.Implement,+ (nameof(Developer), nameof(Developer.Improve)) => Developer.Improve,_ => throw new ArgumentException($"Unable to find {skillName}.{functionName}")};}diff --git a/src/libs/MS.AI.DevTeam/Actors/Architect/Architect.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Architect/Architect.cssimilarity index 94%rename from src/libs/MS.AI.DevTeam/Actors/Architect/Architect.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Architect/Architect.csindex f12d90fe5..9b91239cf 100644--- a/src/libs/MS.AI.DevTeam/Actors/Architect/Architect.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Architect/Architect.cs@@ -1,6 +1,6 @@using Orleans.Runtime;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public class Architect : SemanticPersona, IArchitectSolutions{diff --git a/src/libs/MS.AI.DevTeam/Actors/Conductor/Conductor.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Conductor/Conductor.cssimilarity index 95%rename from src/libs/MS.AI.DevTeam/Actors/Conductor/Conductor.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Conductor/Conductor.csindex cae93b2ca..664e6b3ab 100644--- a/src/libs/MS.AI.DevTeam/Actors/Conductor/Conductor.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Conductor/Conductor.cs@@ -1,7 +1,8 @@+using Microsoft.AI.DevTeam.Skills;using Orleans.Concurrency;using Orleans.Runtime;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public class Conductor : Grain, IOrchestrateWorkflows{@@ -66,7 +67,7 @@ public class Conductor : Grain, IOrchestrateWorkflows{var issue = await _ghService.CreateIssue(new CreateIssueRequest{- Label = $"{nameof(Dev)}.{nameof(Dev.Implement)}",+ Label = $"{nameof(Developer)}.{nameof(Developer.Implement)}",Org = org,Repo = repo,Input = prompt,diff --git a/src/libs/MS.AI.DevTeam/Actors/Conductor/IOrchestrateWorkflows.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Conductor/IOrchestrateWorkflows.cssimilarity index 90%rename from src/libs/MS.AI.DevTeam/Actors/Conductor/IOrchestrateWorkflows.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Conductor/IOrchestrateWorkflows.csindex b23349310..c8dbf8352 100644--- a/src/libs/MS.AI.DevTeam/Actors/Conductor/IOrchestrateWorkflows.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Conductor/IOrchestrateWorkflows.cs@@ -1,6 +1,6 @@using Orleans.Concurrency;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public interface IOrchestrateWorkflows : IGrainWithIntegerCompoundKey{diff --git a/src/libs/MS.AI.DevTeam/Actors/DevLead/DeveloperLead.cs b/src/libs/Microsoft.AI.DevTeam/Actors/DevLead/DeveloperLead.cssimilarity index 95%rename from src/libs/MS.AI.DevTeam/Actors/DevLead/DeveloperLead.csrename to src/libs/Microsoft.AI.DevTeam/Actors/DevLead/DeveloperLead.csindex 033187aa8..d7755d791 100644--- a/src/libs/MS.AI.DevTeam/Actors/DevLead/DeveloperLead.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/DevLead/DeveloperLead.cs@@ -1,9 +1,10 @@+using Microsoft.AI.DevTeam.Skills;using Microsoft.SemanticKernel;using Microsoft.SemanticKernel.Orchestration;using Orleans.Runtime;using System.Text.Json;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public class DeveloperLead : SemanticPersona, ILeadDevelopment{private readonly IKernel _kernel;@@ -31,6 +32,7 @@ public class DeveloperLead : SemanticPersona, ILeadDevelopmentOrder = _state.State.History.Count + 1,UserType = ChatUserType.User});+ await AddWafContext(_kernel, ask, context);context.Set("input", ask);var result = await _kernel.RunAsync(context, function);diff --git a/src/libs/MS.AI.DevTeam/Actors/DevLead/ILeadDevelopment.cs b/src/libs/Microsoft.AI.DevTeam/Actors/DevLead/ILeadDevelopment.cssimilarity index 83%rename from src/libs/MS.AI.DevTeam/Actors/DevLead/ILeadDevelopment.csrename to src/libs/Microsoft.AI.DevTeam/Actors/DevLead/ILeadDevelopment.csindex 18cf4f324..6799956c0 100644--- a/src/libs/MS.AI.DevTeam/Actors/DevLead/ILeadDevelopment.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/DevLead/ILeadDevelopment.cs@@ -1,4 +1,4 @@-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public interface ILeadDevelopment: IGrainWithIntegerCompoundKey, IChatHistory{diff --git a/src/libs/MS.AI.DevTeam/Actors/Developer/Developer.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Developer/Developer.cssimilarity index 60%rename from src/libs/MS.AI.DevTeam/Actors/Developer/Developer.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Developer/Developer.csindex c062a6d62..5991196c9 100644--- a/src/libs/MS.AI.DevTeam/Actors/Developer/Developer.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Developer/Developer.cs@@ -1,43 +1,49 @@+using Microsoft.AI.DevTeam.Skills;using Microsoft.SemanticKernel;using Microsoft.SemanticKernel.Orchestration;using Orleans.Runtime;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;-public class Developer : SemanticPersona, IDevelopCode+public class Dev : SemanticPersona, IDevelopCode{private readonly IKernel _kernel;protected override string MemorySegment => "dev-memory";- public Developer(IKernel kernel, [PersistentState("state", "messages")]IPersistentState<ChatHistory> state) : base(state)+ public Dev(IKernel kernel, [PersistentState("state", "messages")]IPersistentState<ChatHistory> state) : base(state){_kernel = kernel;}public async Task<string> GenerateCode(string ask){- var function = _kernel.LoadFunction(nameof(Dev), nameof(Dev.Implement));+ var function = _kernel.LoadFunction(nameof(Developer), nameof(Developer.Implement));var context = new ContextVariables();if (_state.State.History == null) _state.State.History = new List<ChatHistoryItem>();- _state.State.History.Add(new ChatHistoryItem{+ _state.State.History.Add(new ChatHistoryItem+ {Message = ask,- Order = _state.State.History.Count+1,+ Order = _state.State.History.Count + 1,UserType = ChatUserType.User});+ await AddWafContext(_kernel, ask, context);context.Set("input", ask);var result = await _kernel.RunAsync(context, function);var resultMessage = result.ToString();- _state.State.History.Add(new ChatHistoryItem{+ _state.State.History.Add(new ChatHistoryItem+ {Message = resultMessage,- Order = _state.State.History.Count+1,+ Order = _state.State.History.Count + 1,UserType = ChatUserType.Agent});await _state.WriteStateAsync();-+return resultMessage;}++public Task<string> ReviewPlan(string plan){throw new NotImplementedException();diff --git a/src/libs/MS.AI.DevTeam/Actors/Developer/IDevelopCode.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Developer/IDevelopCode.cssimilarity index 83%rename from src/libs/MS.AI.DevTeam/Actors/Developer/IDevelopCode.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Developer/IDevelopCode.csindex bafb81ac9..027fa0878 100644--- a/src/libs/MS.AI.DevTeam/Actors/Developer/IDevelopCode.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Developer/IDevelopCode.cs@@ -1,4 +1,4 @@-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public interface IDevelopCode : IGrainWithIntegerCompoundKey, IChatHistory{diff --git a/src/libs/MS.AI.DevTeam/Actors/Lookup/ILookupMetadata.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Lookup/ILookupMetadata.cssimilarity index 83%rename from src/libs/MS.AI.DevTeam/Actors/Lookup/ILookupMetadata.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Lookup/ILookupMetadata.csindex 4bd1ba23c..e745035ae 100644--- a/src/libs/MS.AI.DevTeam/Actors/Lookup/ILookupMetadata.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Lookup/ILookupMetadata.cs@@ -1,4 +1,4 @@-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public interface ILookupMetadata : IGrainWithStringKey{diff --git a/src/libs/MS.AI.DevTeam/Actors/Lookup/Lookup.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Lookup/Lookup.cssimilarity index 93%rename from src/libs/MS.AI.DevTeam/Actors/Lookup/Lookup.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Lookup/Lookup.csindex d4c19da43..09973b151 100644--- a/src/libs/MS.AI.DevTeam/Actors/Lookup/Lookup.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Lookup/Lookup.cs@@ -1,6 +1,6 @@using Orleans.Runtime;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public class Lookup : Grain, ILookupMetadata{diff --git a/src/libs/MS.AI.DevTeam/Actors/ProductManager/IManageProduct.cs b/src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/IManageProduct.cssimilarity index 78%rename from src/libs/MS.AI.DevTeam/Actors/ProductManager/IManageProduct.csrename to src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/IManageProduct.csindex 9cc36ac6e..e9ca51f83 100644--- a/src/libs/MS.AI.DevTeam/Actors/ProductManager/IManageProduct.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/IManageProduct.cs@@ -1,4 +1,4 @@-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public interface IManageProduct : IGrainWithIntegerCompoundKey, IChatHistory{diff --git a/src/libs/MS.AI.DevTeam/Actors/ProductManager/ProductManager.cs b/src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/ProductManager.cssimilarity index 92%rename from src/libs/MS.AI.DevTeam/Actors/ProductManager/ProductManager.csrename to src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/ProductManager.csindex e29051bb2..4f4bde3ca 100644--- a/src/libs/MS.AI.DevTeam/Actors/ProductManager/ProductManager.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/ProductManager/ProductManager.cs@@ -1,8 +1,9 @@+using Microsoft.AI.DevTeam.Skills;using Microsoft.SemanticKernel;using Microsoft.SemanticKernel.Orchestration;using Orleans.Runtime;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public class ProductManager : SemanticPersona, IManageProduct{private readonly IKernel _kernel;@@ -24,6 +25,7 @@ public class ProductManager : SemanticPersona, IManageProductOrder = _state.State.History.Count + 1,UserType = ChatUserType.User});+ await AddWafContext(_kernel, ask, context);context.Set("input", ask);var result = await _kernel.RunAsync(context, function);diff --git a/src/libs/MS.AI.DevTeam/Actors/Sandbox/IManageSandbox.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Sandbox/IManageSandbox.cssimilarity index 86%rename from src/libs/MS.AI.DevTeam/Actors/Sandbox/IManageSandbox.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Sandbox/IManageSandbox.csindex d874fb952..16614955f 100644--- a/src/libs/MS.AI.DevTeam/Actors/Sandbox/IManageSandbox.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Sandbox/IManageSandbox.cs@@ -1,4 +1,4 @@-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public interface IManageSandbox : IGrainWithIntegerCompoundKey{diff --git a/src/libs/MS.AI.DevTeam/Actors/Sandbox/Sandbox.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Sandbox/Sandbox.cssimilarity index 95%rename from src/libs/MS.AI.DevTeam/Actors/Sandbox/Sandbox.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Sandbox/Sandbox.csindex 6a5f28675..68a90701d 100644--- a/src/libs/MS.AI.DevTeam/Actors/Sandbox/Sandbox.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Sandbox/Sandbox.cs@@ -1,7 +1,7 @@-namespace MS.AI.DevTeam;-using Orleans.Runtime;+using Orleans.Runtime;using Orleans.Timers;+namespace Microsoft.AI.DevTeam;public class Sandbox : Grain, IManageSandbox, IRemindable{private const string ReminderName = "SandboxRunReminder";diff --git a/src/libs/MS.AI.DevTeam/Actors/SemanticPersona.cs b/src/libs/Microsoft.AI.DevTeam/Actors/SemanticPersona.cssimilarity index 62%rename from src/libs/MS.AI.DevTeam/Actors/SemanticPersona.csrename to src/libs/Microsoft.AI.DevTeam/Actors/SemanticPersona.csindex 0bfb88adf..1ae539ad8 100644--- a/src/libs/MS.AI.DevTeam/Actors/SemanticPersona.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/SemanticPersona.cs@@ -1,5 +1,9 @@+using Microsoft.SemanticKernel;+using Microsoft.SemanticKernel.Orchestration;using Orleans.Runtime;+namespace Microsoft.AI.DevTeam;+public abstract class SemanticPersona : Grain, IChatHistory{public SemanticPersona(@@ -15,6 +19,18 @@ public abstract class SemanticPersona : Grain, IChatHistory{return _state.State.History.Last().Message;}++ protected async Task AddWafContext(IKernel kernel, string ask, ContextVariables context)+ {+ var interestingMemories = kernel.Memory.SearchAsync("waf-pages", ask, 2);+ var wafContext = "Consider the following architectural guidelines:";+ await foreach (var memory in interestingMemories)+ {+ wafContext += $"\n {memory.Metadata.Text}";+ }++ context.Set("wafContext", wafContext);+ }}public interface IChatHistorydiff --git a/src/libs/MS.AI.DevTeam/Actors/Tester/Tester.cs b/src/libs/Microsoft.AI.DevTeam/Actors/Tester/Tester.cssimilarity index 94%rename from src/libs/MS.AI.DevTeam/Actors/Tester/Tester.csrename to src/libs/Microsoft.AI.DevTeam/Actors/Tester/Tester.csindex 0b7466a60..e44abac9b 100644--- a/src/libs/MS.AI.DevTeam/Actors/Tester/Tester.cs+++ b/src/libs/Microsoft.AI.DevTeam/Actors/Tester/Tester.cs@@ -1,5 +1,7 @@using Orleans.Runtime;+namespace Microsoft.AI.DevTeam;+public class Tester : SemanticPersona, ITestCode{public Tester(diff --git a/src/libs/MS.AI.DevTeam/MS.AI.DevTeam.csproj b/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csprojsimilarity index 86%rename from src/libs/MS.AI.DevTeam/MS.AI.DevTeam.csprojrename to src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csprojindex 1dfa8f6dd..b3c2a1dd6 100644--- a/src/libs/MS.AI.DevTeam/MS.AI.DevTeam.csproj+++ b/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj@@ -19,4 +19,8 @@<PackageReference Include="Azure.Identity" Version="1.10.0-beta.1" /><PackageReference Include="Microsoft.Orleans.Reminders" Version="7.2.1" /></ItemGroup>++ <ItemGroup>+ <ProjectReference Include="..\..\libs\Microsoft.AI.DevTeam.Skills\Microsoft.AI.DevTeam.Skills.csproj" />+ </ItemGroup></Project>diff --git a/src/libs/MS.AI.DevTeam/Options/AzureOptions.cs b/src/libs/Microsoft.AI.DevTeam/Options/AzureOptions.cssimilarity index 89%rename from src/libs/MS.AI.DevTeam/Options/AzureOptions.csrename to src/libs/Microsoft.AI.DevTeam/Options/AzureOptions.csindex 362b1f883..437e9a18a 100644--- a/src/libs/MS.AI.DevTeam/Options/AzureOptions.cs+++ b/src/libs/Microsoft.AI.DevTeam/Options/AzureOptions.cs@@ -8,4 +8,5 @@ public class AzureOptionspublic string FilesAccountKey { get; set; }public string CosmosConnectionString { get; set; }public string SandboxImage { get; set; }+ public string ManagedIdentity { get; set; }}\ No newline at end of filediff --git a/src/libs/MS.AI.DevTeam/Options/GithubOptions.cs b/src/libs/Microsoft.AI.DevTeam/Options/GithubOptions.cssimilarity index 100%rename from src/libs/MS.AI.DevTeam/Options/GithubOptions.csrename to src/libs/Microsoft.AI.DevTeam/Options/GithubOptions.csdiff --git a/src/libs/MS.AI.DevTeam/Options/OpenAIOptions.cs b/src/libs/Microsoft.AI.DevTeam/Options/OpenAIOptions.cssimilarity index 100%rename from src/libs/MS.AI.DevTeam/Options/OpenAIOptions.csrename to src/libs/Microsoft.AI.DevTeam/Options/OpenAIOptions.csdiff --git a/src/libs/MS.AI.DevTeam/Options/QdrantOptions.cs b/src/libs/Microsoft.AI.DevTeam/Options/QdrantOptions.cssimilarity index 100%rename from src/libs/MS.AI.DevTeam/Options/QdrantOptions.csrename to src/libs/Microsoft.AI.DevTeam/Options/QdrantOptions.csdiff --git a/src/libs/MS.AI.DevTeam/Services/AzureService.cs b/src/libs/Microsoft.AI.DevTeam/Services/AzureService.cssimilarity index 93%rename from src/libs/MS.AI.DevTeam/Services/AzureService.csrename to src/libs/Microsoft.AI.DevTeam/Services/AzureService.csindex a23d1e94d..5326c285e 100644--- a/src/libs/MS.AI.DevTeam/Services/AzureService.cs+++ b/src/libs/Microsoft.AI.DevTeam/Services/AzureService.cs@@ -10,7 +10,7 @@ using Azure.Storage.Files.Shares;using Microsoft.Extensions.Options;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public class AzureService : IManageAzure{@@ -46,7 +46,10 @@ public class AzureService : IManageAzurepublic async Task RunInSandbox(SandboxRequest request){- var client = new ArmClient(new DefaultAzureCredential());+ var client = string.IsNullOrEmpty(_azSettings.ManagedIdentity) ?+ new ArmClient(new AzureCliCredential())+ : new ArmClient(new ManagedIdentityCredential(_azSettings.ManagedIdentity));+var runId = $"sk-sandbox-{request.Org}-{request.Repo}-{request.ParentIssueNumber}-{request.IssueNumber}";var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);var resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);diff --git a/src/libs/MS.AI.DevTeam/Services/GithubAuthService.cs b/src/libs/Microsoft.AI.DevTeam/Services/GithubAuthService.cssimilarity index 97%rename from src/libs/MS.AI.DevTeam/Services/GithubAuthService.csrename to src/libs/Microsoft.AI.DevTeam/Services/GithubAuthService.csindex 8bc01b88f..8752dcb97 100644--- a/src/libs/MS.AI.DevTeam/Services/GithubAuthService.cs+++ b/src/libs/Microsoft.AI.DevTeam/Services/GithubAuthService.cs@@ -1,6 +1,7 @@using Microsoft.Extensions.Options;using Octokit;+namespace Microsoft.AI.DevTeam;public class GithubAuthService{private readonly GithubOptions _githubSettings;diff --git a/src/libs/MS.AI.DevTeam/Services/GithubService.cs b/src/libs/Microsoft.AI.DevTeam/Services/GithubService.cssimilarity index 96%rename from src/libs/MS.AI.DevTeam/Services/GithubService.csrename to src/libs/Microsoft.AI.DevTeam/Services/GithubService.csindex 5666e12f7..05d313caf 100644--- a/src/libs/MS.AI.DevTeam/Services/GithubService.cs+++ b/src/libs/Microsoft.AI.DevTeam/Services/GithubService.cs@@ -6,7 +6,7 @@ using Octokit;using Octokit.Helpers;-namespace MS.AI.DevTeam;+namespace Microsoft.AI.DevTeam;public class GithubService : IManageGithub{diff --git a/src/libs/skills/SemanticFunctionConfig.cs b/src/libs/skills/SemanticFunctionConfig.csdeleted file mode 100644index 300ef3b59..000000000--- a/src/libs/skills/SemanticFunctionConfig.cs+++ /dev/null@@ -1,26 +0,0 @@-namespace Microsoft.SKDevTeam;--public class SemanticFunctionConfig-{- public string PromptTemplate { get; set; }- public string Name { get; set; }- public string SkillName { get; set; }- public string Description { get; set; }- public int MaxTokens { get; set; }- public double Temperature { get; set; }- public double TopP { get; set; }- public double PPenalty { get; set; }- public double FPenalty { get; set; }- public static SemanticFunctionConfig ForSkillAndFunction(string skillName, string functionName) =>- (skillName, functionName) switch- {- (nameof(Chat), nameof(Chat.ChatCompletion)) => Chat.ChatCompletion,- (nameof(PM), nameof(PM.BootstrapProject)) => PM.BootstrapProject,- (nameof(PM), nameof(PM.Readme)) => PM.Readme,- (nameof(DevLead), nameof(DevLead.Plan)) => DevLead.Plan,- (nameof(CodeExplainer), nameof(CodeExplainer.Explain)) => CodeExplainer.Explain,- (nameof(Developer), nameof(Developer.Implement)) => Developer.Implement,- (nameof(Developer), nameof(Developer.Improve)) => Developer.Improve,- _ => throw new ArgumentException($"Unable to find {skillName}.{functionName}")- };-}\ No newline at end of file