-
Notifications
You must be signed in to change notification settings - Fork 53
Updated Teams AI Lib to comply with project specs and create a proper… #306
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the Teams AI Library by enhancing code maintainability, extensibility, and null safety while simplifying schema management. Key changes include making state management methods virtual for override support, replacing hardcoded schema requirements with reusable static arrays, and updating method calls to include cancellation tokens and proper null handling.
Reviewed Changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Models/OpenAIModel.cs | Updated null-forgiving operators, cancellation token usage, and static modifier changes. |
src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Models/ChatRole.cs and ChatMessage.cs | Adjusted method signatures and optimized collection access (Count property). |
src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Augmentations/MonologueAugmentation.cs | Replaced inline schema requirements with static arrays and streamlined section construction. |
src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Action/* | Applied nullability improvements, generic logger initialization, and updated attribute usage. |
src/libraries/Builder/Microsoft.Agents.Builder/State/TurnState.cs | Marked key state methods as virtual to facilitate extensibility. |
src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Action/ActionHandler.cs
Show resolved
Hide resolved
...es/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Augmentations/MonologueAugmentation.cs
Show resolved
Hide resolved
src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Action/ActionCollection.cs
Show resolved
Hide resolved
Added CA1854 to the NoWarn property in the project file to suppress warnings related to this specific code analysis rule, in addition to the existing warnings.
This commit introduces new features and improvements by adding essential lines of code while removing outdated or unnecessary sections. The changes aim to optimize the program's behavior and maintainability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem mostly about the various VS suggestions and improvements. I'm fine with all this but perhaps wait for Autumn review.
This pull request includes several updates to enhance code maintainability, improve null safety, and simplify schema management. Key changes include making methods in
TurnState
virtual for easier extensibility, replacing hardcoded schema requirements with reusable static fields, and addressing nullable reference types across multiple files.Enhancements to extensibility:
HasValue
,SetValue
, andDeleteValue
methods inTurnState
virtual to allow overriding in derived classes (src/libraries/Builder/Microsoft.Agents.Builder/State/TurnState.cs
). [1] [2]Improvements to schema management:
MonologueAugmentation
and related classes (src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Augmentations/MonologueAugmentation.cs
). [1] [2] [3] [4] [5]Null safety and type improvements:
ActionCollection
andActionHandler
to use nullable reference types, ensuring better handling of potential null values (src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Action/ActionCollection.cs
,src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Action/ActionHandler.cs
). [1] [2] [3] [4]!
) in various scenarios to address nullable warnings and improve code clarity. [1] [2]Additional updates:
#pragma
directives to suppress specific code analysis warnings, such as marking members as static and attributes withAttributeUsageAttribute
(src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Action/DefaultActions.cs
,src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Action/ActionParameterAttribute.cs
). [1] [2]DefaultActions
by utilizing generic type parameters (src/libraries/Extensions/Microsoft.Agents.Extensions.Teams.AI/AI/Action/DefaultActions.cs
).… nuget package.