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

#2708 add Add a judgment to the graph constructor #2709

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

JeffreySu
Copy link

@JeffreySu JeffreySu commented May 17, 2024

Why are these changes needed?

Related issue number

#2708

Checks

@JeffreySu
Copy link
Author

@microsoft-github-policy-service agree

namespace AutoGen.Core.Tests
{
[TestClass()]
public class GraphTests
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you move this test to AutoGen.Tests project? That's where we usually put AutoGen.Core's tests

Copy link
Author

Choose a reason for hiding this comment

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

OK,I will move it.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

this.transitions.AddRange(transitions);
}

public Graph(IEnumerable<Transition>? transitions)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why transitions can be null in this case. Would it be better to simply does a null check and throw an exception when transitions is null in this constructor?

Copy link
Author

Choose a reason for hiding this comment

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

In some cases the external developer may pass in a null List Object. This is allowed at least at compile time, so it's a risk. Because in some cases you don't need to set up the transition when creating Graph entity, but dynamically configure it later, there is no need to create a new object in this case.

@LittleLittleCloud LittleLittleCloud added this to the AutoGen.Net 0.0.14 milestone May 17, 2024
@@ -35,12 +35,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.Mistral.Tests", "te
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoGen.SemanticKernel.Tests", "test\AutoGen.SemanticKernel.Tests\AutoGen.SemanticKernel.Tests.csproj", "{1DFABC4A-8458-4875-8DCB-59F3802DAC65}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why these changes are added

Copy link
Author

Choose a reason for hiding this comment

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

I think it's added by VS automatically. I haven't add any new project to the sln after removed the Core.Test project

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you revert this change

git checkout main dotnet/AutoGen.sln

@LittleLittleCloud LittleLittleCloud removed this from the AutoGen.Net 0.0.14 milestone May 28, 2024
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.

None yet

2 participants