-
Notifications
You must be signed in to change notification settings - Fork 800
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
Python sample creation #1478
base: main
Are you sure you want to change the base?
Python sample creation #1478
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.
Copilot reviewed 73 out of 88 changed files in this pull request and generated 2 comments.
Files not reviewed (15)
- samples/bot-adaptive-card-actions/python/.gitignore: Language not supported
- samples/bot-adaptive-card-actions/python/.vscode/extensions.json: Language not supported
- samples/bot-adaptive-card-actions/python/.vscode/launch.json: Language not supported
- samples/bot-adaptive-card-actions/python/.vscode/settings.json: Language not supported
- samples/bot-adaptive-card-actions/python/.vscode/tasks.json: Language not supported
- samples/bot-adaptive-card-actions/python/appManifest/manifest.json: Language not supported
- samples/bot-adaptive-card-actions/python/assets/sample.json: Language not supported
- samples/bot-adaptive-card-actions/python/env/.env.local: Language not supported
- samples/bot-adaptive-card-actions/python/infra/azure.bicep: Language not supported
- samples/bot-adaptive-card-actions/python/infra/azure.parameters.json: Language not supported
- samples/bot-adaptive-card-actions/python/requirements.txt: Language not supported
- samples/bot-commands-menu/python/.gitignore: Language not supported
- samples/bot-commands-menu/python/.vscode/extensions.json: Language not supported
- samples/bot-adaptive-card-actions/python/teamsapp.yml: Evaluated as low risk
- samples/bot-adaptive-card-actions/python/bots/init.py: Evaluated as low risk
Comments suppressed due to low confidence (5)
samples/bot-adaptive-card-actions/python/app.py:42
- [nitpick] The error message could be more informative. Consider suggesting checking the logs for more details.
To continue to run this bot, please fix the bot source code.
samples/bot-adaptive-card-actions/python/config.py:14
- [nitpick] The placeholder value "<>" is ambiguous. It should be renamed to "YOUR_MICROSOFT_APP_ID" to make it clear that this value needs to be replaced with an actual environment variable.
APP_ID = os.environ.get("MicrosoftAppId", "<<MICROSOFT-APP-ID>>")
samples/bot-adaptive-card-actions/python/config.py:15
- [nitpick] The placeholder value "<>" is ambiguous. It should be renamed to "YOUR_MICROSOFT_APP_PASSWORD" to make it clear that this value needs to be replaced with an actual environment variable.
APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "<<MICROSOFT-APP-PASSWORD>>")
samples/bot-adaptive-card-actions/python/bots/adaptive_card_actions_bot.py:45
- Correct the typo in the message: 'Toggle Visible Card' should be 'ToggleVisibility Card' to match the command.
"**2** for Bot Suggested Actions, and **3** for Toggle Visible Card."
samples/bot-adaptive-card-actions/python/bots/adaptive_card_actions_bot.py:91
- [nitpick] The error message could be more descriptive, such as 'Please enter your name.'
"errorMessage": "Name is required"
# Listen for incoming requests on /api/messages. | ||
async def messages(req: Request) -> Response: | ||
# Main bot message handler. | ||
if "application/json" in req.headers["Content-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.
The content type check should handle cases where the 'Content-Type' header is missing or has a different casing. Consider using req.headers.get('Content-Type', '').lower() == 'application/json'.
if "application/json" in req.headers["Content-Type"]: | |
if req.headers.get('Content-Type', '').lower() == 'application/json': |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
|
||
async def send_data_on_card_actions(self, turn_context: TurnContext): | ||
if turn_context.activity.value: | ||
reply_text = f"Data Submitted: {turn_context.activity.value.get('name', 'N/A')}" |
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.
Add a null check for turn_context.activity.value
before accessing it to prevent potential runtime errors.
reply_text = f"Data Submitted: {turn_context.activity.value.get('name', 'N/A')}" | |
if turn_context.activity.value is not None: |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
No description provided.