-
Notifications
You must be signed in to change notification settings - Fork 6
Add comprehensive Google-style docstrings to microsoft-agents-a365-notifications #94
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: JimDaly <6353736+JimDaly@users.noreply.github.com>
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 adds comprehensive Google-style docstrings to the microsoft-agents-a365-notifications library to enable proper API documentation generation for learn.microsoft.com. The changes include detailed documentation for all public classes, methods, enums, and type aliases, along with code style improvements.
Key changes:
- Added Google-style docstrings with Args, Returns, Example, and Attributes sections to all public APIs
- Added copyright headers to model files
- Modernized type annotations from
Optional[X]toX | Nonesyntax
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Fixed import ordering to follow PEP 8 (stdlib imports alphabetically sorted) |
| models/wpx_comment.py | Added copyright header, class docstring, and modernized type annotations |
| models/notification_types.py | Added copyright header and comprehensive enum docstring with attribute descriptions |
| models/email_response.py | Added copyright header, class and method docstrings with examples |
| models/email_reference.py | Added copyright header, class docstring, and modernized type annotations |
| models/agent_subchannel.py | Added copyright header and enum docstring describing subchannel types |
| models/agent_notification_activity.py | Added copyright header, comprehensive class docstring with args/raises/example, property docstrings, and as_model method documentation |
| models/agent_lifecycle_event.py | Added copyright header and enum docstring describing lifecycle events |
| models/init.py | Added copyright header and module-level docstring |
| agent_notification.py | Added copyright header, comprehensive class docstring, type alias documentation, and detailed docstrings for all decorator methods with examples |
| init.py | Reordered imports alphabetically for consistency |
| @@ -1,10 +1,26 @@ | |||
| from typing import Optional, Literal | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Dec 18, 2025
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.
The copyright header should use "Microsoft Corporation" instead of "Microsoft" to match the required format specified in the coding guidelines.
| @@ -1,7 +1,23 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Dec 18, 2025
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.
The copyright header should use "Microsoft Corporation" instead of "Microsoft" to match the required format specified in the coding guidelines.
| @@ -1,7 +1,21 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Dec 18, 2025
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.
The copyright header should use "Microsoft Corporation" instead of "Microsoft" to match the required format specified in the coding guidelines.
| @@ -1,10 +1,19 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Dec 18, 2025
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.
The copyright header should use "Microsoft Corporation" instead of "Microsoft" to match the required format specified in the coding guidelines.
| @@ -1,3 +1,5 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Dec 18, 2025
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.
The copyright header should use "Microsoft Corporation" instead of "Microsoft" to match the required format specified in the coding guidelines.
| import builtins | ||
| from typing import Any, TypeVar |
Copilot
AI
Dec 18, 2025
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.
Using builtins.type[TModel] is non-standard. Consider using type[TModel] directly (available in Python 3.9+) or importing Type from typing for better compatibility and consistency with common Python type annotation practices. The builtins module import is unnecessary for this use case.
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.
Fixed in commit 0c78adc. Replaced builtins.type[TModel] with the standard type[TModel] annotation (available in Python 3.9+, and this project targets Python 3.11).
| @@ -1,12 +1,30 @@ | |||
| from typing import Optional, Literal | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Dec 18, 2025
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.
The copyright header should use "Microsoft Corporation" instead of "Microsoft" to match the required format specified in the coding guidelines.
| @@ -1,7 +1,21 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Dec 18, 2025
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.
The copyright header should use "Microsoft Corporation" instead of "Microsoft" to match the required format specified in the coding guidelines.
| @@ -1,21 +1,46 @@ | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Dec 18, 2025
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.
The copyright header should use "Microsoft Corporation" instead of "Microsoft" to match the required format specified in the coding guidelines.
| @@ -1,22 +1,51 @@ | |||
| from typing import Any, Optional, Type, TypeVar | |||
| # Copyright (c) Microsoft. All rights reserved. | |||
Copilot
AI
Dec 18, 2025
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.
The copyright header should use "Microsoft Corporation" instead of "Microsoft" to match the required format specified in the coding guidelines.
| # Generic escape hatch | ||
| def as_model(self, model: Type[TModel]) -> Optional[TModel]: | ||
| def as_model(self, model: builtins.type[TModel]) -> TModel | None: | ||
| """Parse the activity value as a custom model type. |
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.
Is this correct?
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.
Is this correct?
All this content was generated by CoPilot.
Please update the comments in this branch to make the comments correct or remove any incorrect comments or examples.
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.
The documentation for the as_model method is correct - it does parse the activity value using Pydantic's model_validate method. The issue was the non-standard builtins.type annotation in the method signature, which has been fixed in commit 0c78adc to use the standard type annotation instead.
| # Generic escape hatch | ||
| def as_model(self, model: Type[TModel]) -> Optional[TModel]: | ||
| def as_model(self, model: builtins.type[TModel]) -> TModel | None: | ||
| """Parse the activity value as a custom model type. |
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.
Is this correct?
All this content was generated by CoPilot.
Please update the comments in this branch to make the comments correct or remove any incorrect comments or examples.
Co-authored-by: JimDaly <6353736+JimDaly@users.noreply.github.com>
rahuldevikar761
left a comment
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.
Blocking the PR to review again
Documentation Improvements for microsoft-agents-a365-notifications
agent_notification.pyAgentNotificationclass with detailed description and exampleson_email,on_word,on_excel,on_powerpoint, etc.)AgentHandlertype alias with comprehensive explanationagent_notification_activity.py- Document class, constructor, and all propertiesnotification_types.py- Document enum with descriptions for each valueagent_subchannel.py- Document enum with descriptions for each subchannelagent_lifecycle_event.py- Document enum with descriptions for each eventemail_reference.py- Document class and all fieldswpx_comment.py- Document class and all fieldsemail_response.py- Document class and static method with example__init__.pydocstringsOptional[X]toX | Nonetypeannotation instead of non-standardbuiltins.typeSummary
All files in the microsoft-agents-a365-notifications library now have comprehensive Google-style docstrings that will generate proper reference documentation on learn.microsoft.com. Fixed type annotation issue by replacing non-standard
builtins.typewith standardtypeannotation.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.