A programming framework for agentic AI
eventhubs streaming
Kosta Petana3a3fcab4097
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfileindex 3aacb89db..cb7c250a4 100644--- a/.devcontainer/Dockerfile+++ b/.devcontainer/Dockerfile@@ -1,11 +1,5 @@-FROM mcr.microsoft.com/devcontainers/dotnet:0-7.0+FROM mcr.microsoft.com/devcontainers/dotnet:8.0# Install the xz-utils packageRUN apt-get update && apt-get install -y xz-utils ca-certificates curl gnupg-RUN 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\ No newline at end of file+RUN curl -fsSL https://aka.ms/install-azd.sh | bash\ No newline at end of filediff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.jsonindex c0a345e21..7a9468127 100644--- a/.devcontainer/devcontainer.json+++ b/.devcontainer/devcontainer.json@@ -18,8 +18,7 @@},"ghcr.io/azure/azure-dev/azd:0": {"version": "stable"- },- "ghcr.io/jlaundry/devcontainer-features/azure-functions-core-tools:1": {}+ }},"postCreateCommand": "bash .devcontainer/startup.sh","hostRequirements": {diff --git a/src/apps/WorkflowsApp/WorkflowsApp.csproj b/src/apps/WorkflowsApp/WorkflowsApp.csprojindex 413793f84..91a86e335 100644--- a/src/apps/WorkflowsApp/WorkflowsApp.csproj+++ b/src/apps/WorkflowsApp/WorkflowsApp.csproj@@ -1,7 +1,7 @@<Project Sdk="Microsoft.NET.Sdk.Web"><PropertyGroup>- <TargetFramework>net7.0</TargetFramework>+ <TargetFramework>net8.0</TargetFramework><Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings></PropertyGroup>diff --git a/src/apps/cli/cli.csproj b/src/apps/cli/cli.csprojindex b930ed06f..5edeb9bc6 100644--- a/src/apps/cli/cli.csproj+++ b/src/apps/cli/cli.csproj@@ -2,7 +2,7 @@<PropertyGroup><OutputType>Exe</OutputType>- <TargetFramework>net7.0</TargetFramework>+ <TargetFramework>net8.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup>diff --git a/src/apps/gh-flow-df/gh-flow-df.csproj b/src/apps/gh-flow-df/gh-flow-df.csprojindex 07d73342f..892e46dcf 100644--- a/src/apps/gh-flow-df/gh-flow-df.csproj+++ b/src/apps/gh-flow-df/gh-flow-df.csproj@@ -6,7 +6,7 @@</PropertyGroup><PropertyGroup>- <TargetFramework>net7.0</TargetFramework>+ <TargetFramework>net8.0</TargetFramework><RootNamespace></RootNamespace><AzureFunctionsVersion>v4</AzureFunctionsVersion><OutputType>Exe</OutputType>diff --git a/src/apps/gh-flow/Program.cs b/src/apps/gh-flow/Program.csindex 19db7a65d..c08ecb94a 100644--- a/src/apps/gh-flow/Program.cs+++ b/src/apps/gh-flow/Program.cs@@ -63,19 +63,27 @@ builder.Services.AddSingleton<IAnalyzeCode, CodeAnalyzer>();builder.Host.UseOrleans(siloBuilder =>{-+if (builder.Environment.IsDevelopment()){var connectionString = builder.Configuration.GetValue<string>("AzureOptions:CosmosConnectionString");- siloBuilder.AddMemoryStreams("StreamProvider")- .AddMemoryGrainStorage("PubSubStore");;- siloBuilder.UseCosmosReminderService( o =>+ //siloBuilder.AddMemoryStreams("StreamProvider");+ siloBuilder.UseCosmosReminderService(o =>{- o.ConfigureCosmosClient(connectionString);- o.ContainerName = "reminders";- o.DatabaseName = "devteam";- o.IsResourceCreationEnabled = true;+ o.ConfigureCosmosClient(connectionString);+ o.ContainerName = "reminders";+ o.DatabaseName = "devteam";+ o.IsResourceCreationEnabled = true;});+ siloBuilder.AddCosmosGrainStorage(+ name: "PubSubStore",+ configureOptions: o =>+ {+ o.ConfigureCosmosClient(connectionString);+ o.ContainerName = "pubsubstore";+ o.DatabaseName = "pubsub";+ o.IsResourceCreationEnabled = true;+ });siloBuilder.AddCosmosGrainStorage(name: "messages",configureOptions: o =>@@ -85,7 +93,26 @@ builder.Host.UseOrleans(siloBuilder =>o.DatabaseName = "devteam";o.IsResourceCreationEnabled = true;});- siloBuilder.UseLocalhostClustering();+ var ehConnectionString = builder.Configuration.GetValue<string>("AzureOptions:EventHubsConnectionString");+ var storageConnectionString = builder.Configuration.GetValue<string>("AzureOptions:StorageAccountConnectionString");++ siloBuilder.UseLocalhostClustering()+ .AddEventHubStreams("StreamProvider", (ISiloEventHubStreamConfigurator configurator) =>+ {+ configurator.ConfigureEventHub(builder => builder.Configure(options =>+ {+ options.ConfigureEventHubConnection(+ ehConnectionString,+ "sk-dev-team",+ "$Default");+ }));+ configurator.UseAzureTableCheckpointer(+ builder => builder.Configure(options =>+ {+ options.ConfigureTableServiceClient(storageConnectionString);+ options.PersistInterval = TimeSpan.FromSeconds(10);+ }));+ }); ;}else{@@ -100,24 +127,24 @@ builder.Host.UseOrleans(siloBuilder =>options.ResponseTimeout = TimeSpan.FromMinutes(3);options.SystemResponseTimeout = TimeSpan.FromMinutes(3);});- siloBuilder.Configure<ClientMessagingOptions>(options =>- {- options.ResponseTimeout = TimeSpan.FromMinutes(3);- });- siloBuilder.UseCosmosClustering( o =>+ 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 =>++ siloBuilder.UseCosmosReminderService(o =>{- o.ConfigureCosmosClient(cosmosDbconnectionString);- o.ContainerName = "devteam";- o.DatabaseName = "reminders";- o.IsResourceCreationEnabled = true;+ o.ConfigureCosmosClient(cosmosDbconnectionString);+ o.ContainerName = "devteam";+ o.DatabaseName = "reminders";+ o.IsResourceCreationEnabled = true;});siloBuilder.AddCosmosGrainStorage(name: "messages",@@ -130,8 +157,8 @@ builder.Host.UseOrleans(siloBuilder =>});//TODO: Add streaming here- }-+ }+});builder.Services.Configure<JsonSerializerOptions>(options =>@@ -189,7 +216,8 @@ static IKernel CreateKernel(IServiceProvider provider)return new KernelBuilder().WithLoggerFactory(loggerFactory).WithAzureChatCompletionService(openAiConfig.DeploymentOrModelId, openAIClient)- .WithRetryBasic(new BasicRetryConfig {+ .WithRetryBasic(new BasicRetryConfig+ {MaxRetryCount = 5,UseExponentialBackoff = true}).Build();diff --git a/src/apps/gh-flow/Services/GithubWebHookProcessor.cs b/src/apps/gh-flow/Services/GithubWebHookProcessor.csindex 376fe14dc..b3e82062f 100644--- a/src/apps/gh-flow/Services/GithubWebHookProcessor.cs+++ b/src/apps/gh-flow/Services/GithubWebHookProcessor.cs@@ -74,7 +74,7 @@ public sealed class GithubWebHookProcessor : WebhookEventProcessorawait HandleNewAsk(issueNumber, skillName, functionName, suffix, input, org, repo);}}- catch (System.Exception)+ catch (System.Exception ex){_logger.LogError("Processing issue comment event");}diff --git a/src/apps/gh-flow/gh-flow.csproj b/src/apps/gh-flow/gh-flow.csprojindex cc7e902d1..d2120dcb9 100644--- a/src/apps/gh-flow/gh-flow.csproj+++ b/src/apps/gh-flow/gh-flow.csproj@@ -5,7 +5,7 @@</ItemGroup><PropertyGroup>- <TargetFramework>net7.0</TargetFramework>+ <TargetFramework>net8.0</TargetFramework><Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings><ServerGarbageCollection>true</ServerGarbageCollection>@@ -16,12 +16,13 @@<ItemGroup><PackageReference Include="Octokit.Webhooks.AspNetCore" Version="2.0.3" /><PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.Qdrant" Version="1.0.0-beta5" />- <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.Orleans.Server" Version="8.0.0" />+ <PackageReference Include="Microsoft.Orleans.Persistence.Cosmos" Version="8.0.0" />+ <PackageReference Include="Microsoft.Orleans.Clustering.Cosmos" Version="8.0.0" /><PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />- <PackageReference Include="Microsoft.Orleans.Reminders.Cosmos" Version="7.2.1" />+ <PackageReference Include="Microsoft.Orleans.Reminders.Cosmos" Version="8.0.0" /><PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />+ <PackageReference Include="Microsoft.Orleans.Streaming.EventHubs" Version="8.0.0" /></ItemGroup>diff --git a/src/apps/seed-memory/seed-memory.csproj b/src/apps/seed-memory/seed-memory.csprojindex e73fad29e..fd33f7cca 100644--- a/src/apps/seed-memory/seed-memory.csproj+++ b/src/apps/seed-memory/seed-memory.csproj@@ -2,7 +2,7 @@<PropertyGroup><OutputType>Exe</OutputType>- <TargetFramework>net7.0</TargetFramework>+ <TargetFramework>net8.0</TargetFramework><RootNamespace>waf_import</RootNamespace><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable>diff --git a/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj b/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csprojindex 85445d758..c74693d35 100644--- a/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj+++ b/src/libs/Elsa.SemanticKernel/Elsa.SemanticKernel.csproj@@ -1,7 +1,7 @@<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup>- <TargetFrameworks>net7.0</TargetFrameworks>+ <TargetFrameworks>net8.0</TargetFrameworks><Description>Activities for calling Semantic Kernel SDK</Description>diff --git a/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csproj b/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csprojindex fb2eeb6a7..d54d803d5 100644--- a/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csproj+++ b/src/libs/Microsoft.AI.DevTeam.Skills/Microsoft.AI.DevTeam.Skills.csproj@@ -1,7 +1,7 @@<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup>- <TargetFramework>net7.0</TargetFramework>+ <TargetFramework>net8.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup>diff --git a/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj b/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csprojindex be95cfbdb..ea740822b 100644--- a/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj+++ b/src/libs/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj@@ -1,15 +1,15 @@<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup>- <TargetFramework>net7.0</TargetFramework>+ <TargetFramework>net8.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable></PropertyGroup><ItemGroup>- <PackageReference Include="Microsoft.Orleans.Sdk" Version="7.2.1" />- <PackageReference Include="Microsoft.Orleans.Runtime" Version="7.2.1" />- <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />+ <PackageReference Include="Microsoft.Orleans.Sdk" Version="8.0.0" />+ <PackageReference Include="Microsoft.Orleans.Runtime" Version="8.0.0" />+ <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" /><PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-beta5" /><PackageReference Include="Octokit" Version="7.1.0" /><PackageReference Include="GitHubJwt" Version="0.0.6" />@@ -17,8 +17,8 @@<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" />- <PackageReference Include="Microsoft.Orleans.Reminders" Version="7.2.1" />- <PackageReference Include="Microsoft.Orleans.Streaming" Version="7.2.1" />+ <PackageReference Include="Microsoft.Orleans.Reminders" Version="8.0.0" />+ <PackageReference Include="Microsoft.Orleans.Streaming" Version="8.0.0" /></ItemGroup><ItemGroup>