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

refactor renaming agent base - 4667 #4669

Merged
merged 5 commits into from
Dec 12, 2024

Conversation

rysweet
Copy link
Collaborator

@rysweet rysweet commented Dec 12, 2024

Why are these changes needed?

small refactoring. Doesn't need to be named AgentBase, Its an agent and the class is abstract.

Related issue number

closes #4667

Checks

@rysweet rysweet requested a review from Copilot December 12, 2024 05: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 5 out of 13 changed files in this pull request and generated 1 suggestion.

Files not reviewed (8)
  • dotnet/samples/Hello/HelloAgent/Program.cs: Evaluated as low risk
  • dotnet/samples/Hello/HelloAgentState/Program.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Agents/AgentBase.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Agents/AgentBaseExtensions.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Agents/AgentRuntime.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/InferenceAgent.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Agents/Agents/AIAgent/SKAiAgent.cs: Evaluated as low risk
  • dotnet/src/Microsoft.AutoGen/Agents/Agents/IOAgent/IOAgent.cs: Evaluated as low risk
Comments skipped due to low confidence (3)

dotnet/src/Microsoft.AutoGen/Agents/Services/HostBuilderExtensions.cs:21

  • [nitpick] The generic type parameter TAgent should be renamed to TAgentBase to reflect the fact that it is constrained to types derived from Agent.
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TAgent>(this IHostApplicationBuilder builder, string typeName) where TAgent : Agent

dotnet/src/Microsoft.AutoGen/Agents/Services/Grpc/GrpcAgentWorker.cs:197

  • The cast to Agent may cause a runtime error if agentType does not inherit from Agent. Ensure that all agent types in _agentTypes inherit from the Agent class.
agent = (Agent)ActivatorUtilities.CreateInstance(_serviceProvider, agentType, context);

dotnet/src/Microsoft.AutoGen/Agents/Services/AgentWorker.cs:200

  • Casting to the new 'Agent' class may cause runtime issues if there are still references to 'AgentBase' elsewhere. Ensure all instances of 'AgentBase' are updated to 'Agent'.
agent = (Agent)ActivatorUtilities.CreateInstance(_serviceProvider, agentType, context);

@rysweet rysweet added the dotnet issues related to AutoGen.Net label Dec 12, 2024
@rysweet rysweet added this to the 0.4.0 milestone Dec 12, 2024
@kostapetan kostapetan merged commit c9ebe32 into main Dec 12, 2024
49 checks passed
@kostapetan kostapetan deleted the rysweet-4667-refactor-rename-AgentBase-to-Agent- branch December 12, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet issues related to AutoGen.Net
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move AgentBase -> Agent
3 participants