Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rysweet 5207 net runtime interface to match python add registration to interface and inmemoryruntime #5215

Conversation

rysweet
Copy link
Collaborator

@rysweet rysweet commented Jan 27, 2025

  • add Registry abstractions and Registry Storage to Core/Contracts
  • brings Grpc in line with these abstractions
  • add registeragenttype to in memory runtime. Note it's not necessary to call this because we register all the agents with reflection unless you tell the runtime not to.....

Why are these changes needed?

Bringing the .NET more in line with the python

Related issue number

close #5207

Checks

@rysweet rysweet marked this pull request as draft January 27, 2025 04:00
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.08%. Comparing base (e582072) to head (4e92ec2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5215   +/-   ##
=======================================
  Coverage   70.08%   70.08%           
=======================================
  Files         179      179           
  Lines       11619    11619           
=======================================
  Hits         8143     8143           
  Misses       3476     3476           
Flag Coverage Δ
unittests 70.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rysweet rysweet marked this pull request as ready for review January 27, 2025 07:50
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 12 out of 27 changed files in this pull request and generated 5 comments.

Files not reviewed (15)
  • dotnet/.editorconfig: Language not supported
  • dotnet/samples/Hello/HelloAgent/registry.json: Language not supported
  • dotnet/src/Microsoft.AutoGen/Core/IAgentRuntime.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Contracts/IAgent.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Runtime.Grpc/Abstractions/IGatewayRegistry.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Runtime.Grpc/Abstractions/IRegistryGrain.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Runtime.Grpc/Services/Grpc/GrpcGateway.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Core.Grpc/GrpcAgentRuntime.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Core/UninitializedAgentWorker.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Core/HostBuilderExtensions.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Core/Agent.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Core.Grpc/GrpcAgentWorkerHostBuilderExtension.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Core/AgentRuntime.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Core/AgentRuntimeBase.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Contracts/IRegistry.cs: Evaluated as low risk
Comments suppressed due to low confidence (5)

dotnet/src/Microsoft.AutoGen/Core/Registry.cs:41

  • The use of '[]' to initialize collections is not valid C# syntax. It should be corrected to 'new List()'.
agents.AddRange(eventHandlingAgents.ToList());

dotnet/src/Microsoft.AutoGen/Core/Registry.cs:45

  • The use of '[]' to initialize collections is not valid C# syntax. It should be corrected to 'new List()'.
agents.AddRange(combo.ToList());

dotnet/src/Microsoft.AutoGen/Core/Registry.cs:57

  • The use of '[]' to initialize collections is not valid C# syntax. It should be corrected to 'new List()'.
agents.Add(agentType);

dotnet/src/Microsoft.AutoGen/Core/Registry.cs:106

  • The method 'WriteStateAsync' should be awaited to ensure proper async operation.
return await WriteStateAsync(State, cancellationToken).ConfigureAwait(false);

dotnet/src/Microsoft.AutoGen/Contracts/IAgentRuntime.cs:33

  • The method RuntimeSendRequestAsync has a comment indicating it will be removed in favor of send_message. This is confusing and should be clarified or removed.
ValueTask RuntimeSendRequestAsync(IAgent agent, RpcRequest request, CancellationToken cancellationToken = default);

dotnet/src/Microsoft.AutoGen/Core/RegsitryStorage.cs Outdated Show resolved Hide resolved
dotnet/src/Microsoft.AutoGen/Core/RegsitryStorage.cs Outdated Show resolved Hide resolved
dotnet/src/Microsoft.AutoGen/Core/Registry.cs Show resolved Hide resolved
dotnet/src/Microsoft.AutoGen/Core/Registry.cs Show resolved Hide resolved
@rysweet rysweet enabled auto-merge (squash) January 27, 2025 08:21
@rysweet rysweet merged commit 0aed066 into main Jan 27, 2025
66 checks passed
@rysweet rysweet deleted the rysweet-5207-net-runtime-interface-to-match-python---add-registration-to-interface-and-inmemoryruntime branch January 27, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.NET runtime interface to match python - add registration to interface and InMemoryRuntime
2 participants