Skip to content

Comments

Proactive sample WIP#213

Merged
axelsrz merged 3 commits intomainfrom
users/axsuarez/proactive-test
Oct 31, 2025
Merged

Proactive sample WIP#213
axelsrz merged 3 commits intomainfrom
users/axsuarez/proactive-test

Conversation

@axelsrz
Copy link
Member

@axelsrz axelsrz commented Oct 30, 2025

This pull request introduces a new end-to-end sample for proactive messaging in Microsoft Teams using the Microsoft 365 Agents Python SDK. It adds a new agent implementation, configuration template, documentation, and supporting code to demonstrate how to start and continue 1:1 conversations with users in Teams via HTTP endpoints. Additionally, it refactors the existing empty agent sample to use a more robust configuration and authentication pattern.

Proactive messaging sample additions:

  • Added a new sample agent, proactive_messaging_agent.py, that provides two HTTP endpoints for creating conversations and sending proactive messages in Teams. This includes all supporting logic for configuration, error handling, and message delivery.
  • Created a comprehensive README.md describing the sample, setup steps, environment variables, and usage instructions for local testing.
  • Updated env.TEMPLATE to include all necessary environment variables for proactive messaging, such as bot ID, agent ID, tenant ID, and service URL.

Improvements to agent initialization and authentication:

  • Refactored emtpy_agent.py to load configuration from environment variables, initialize the connection manager, storage, adapter, and authorization, and pass these to the agent application for more robust and flexible setup.
  • Updated the agent server startup in emtpy_agent.py to use the connection manager's default configuration for authentication, ensuring proper token validation and connection handling.

Copilot AI review requested due to automatic review settings October 30, 2025 04:04
Copy link
Contributor

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.

Pull Request Overview

This PR adds a new proactive messaging sample for Microsoft Teams, demonstrating how to programmatically start conversations and send proactive messages. It also updates the empty agent sample with proper configuration setup and adds comprehensive documentation for the proactive messaging functionality.

  • Adds a new proactive_messaging_agent.py sample with endpoints for creating Teams conversations and sending proactive messages
  • Updates emtpy_agent.py with proper SDK configuration, connection manager, and authorization setup
  • Extends env.TEMPLATE with proactive messaging configuration variables
  • Adds detailed documentation in README.md explaining setup, prerequisites, and usage examples

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
test_samples/app_style/proactive_messaging_agent.py New file implementing proactive messaging sample with HTTP endpoints for creating conversations and sending messages to Teams
test_samples/app_style/emtpy_agent.py Updated to use proper SDK configuration with connection manager, authorization, and configuration loading from environment
test_samples/app_style/env.TEMPLATE Added proactive messaging configuration variables for bot id, agent id, tenant id, and service URL
test_samples/app_style/README.md New documentation explaining the proactive messaging sample, prerequisites, setup steps, and usage examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings October 31, 2025 07:25
Copy link
Contributor

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.

Pull Request Overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

test_samples/app_style/echo_proactive_agent.py:208

  • The global variable 'SERVICE_INSTANCE' is not used.
    SERVICE_INSTANCE = echo_service

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@axelsrz axelsrz marked this pull request as ready for review October 31, 2025 07:40
@axelsrz axelsrz requested a review from a team as a code owner October 31, 2025 07:40
@axelsrz axelsrz enabled auto-merge (squash) October 31, 2025 07:41
@axelsrz axelsrz disabled auto-merge October 31, 2025 07:44
@axelsrz axelsrz merged commit 7078453 into main Oct 31, 2025
16 checks passed
@axelsrz axelsrz deleted the users/axsuarez/proactive-test branch October 31, 2025 07:44
axelsrz added a commit that referenced this pull request Oct 31, 2025
* Proactive sample WIP

* Proactive echo in teams WIP

* Small fixes for proactive with experimental sample
axelsrz added a commit that referenced this pull request Oct 31, 2025
* Update parameter type hints and documentation across multiple files for clarity and consistency. (#207)

* Update parameter type hints and documentation across multiple files for clarity and consistency.

Fixes all 43 errors identified in issue #204

* Update libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_adapter.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Chris Mullins <chmullins@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Proactive sample WIP (#213)

* Proactive sample WIP

* Proactive echo in teams WIP

* Small fixes for proactive with experimental sample

---------

Co-authored-by: Chris Mullins <cleemullins@users.noreply.github.com>
Co-authored-by: Chris Mullins <chmullins@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI mentioned this pull request Dec 2, 2025
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.

1 participant