Skip to content

Fastapi integration package#176

Merged
axelsrz merged 24 commits intomainfrom
users/axsuarez/fast-api-integration
Oct 27, 2025
Merged

Fastapi integration package#176
axelsrz merged 24 commits intomainfrom
users/axsuarez/fast-api-integration

Conversation

@axelsrz
Copy link
Member

@axelsrz axelsrz commented Oct 16, 2025

This pull request introduces the initial implementation of the microsoft-agents-hosting-fastapi library, providing FastAPI-based hosting capabilities for Microsoft Agents. The changes establish the package structure, core streaming response functionality, and utilities for handling citations and feedback in conversational AI scenarios.

Key additions and features include:

Core Streaming and Citation Functionality:

  • Implements the StreamingResponse class, enabling chunked and interactive streaming of messages, citations, and feedback to clients, with support for Teams and Direct Line channels (streaming_response.py).
  • Adds utility classes for citation handling, including the Citation dataclass and CitationUtil for formatting and extracting citations from text (citation.py, citation_util.py). [1] [2]

FastAPI Hosting Adapters and Process Management:

  • Defines the AgentHttpAdapter protocol for handling HTTP requests to agents, and provides the start_agent_process async function to bootstrap agent processes with adapters (agent_http_adapter.py, _start_agent_process.py). [1] [2]

Package Structure and Metadata:

  • Establishes the package structure with __init__.py files and sets up exports for all major components (__init__.py in relevant directories). [1] [2] [3] [4] [5]
  • Adds an MIT license file for open source compliance.

These changes lay the groundwork for FastAPI-based hosting of Microsoft Agents with robust streaming and citation capabilities.

Copilot AI review requested due to automatic review settings October 16, 2025 16:23
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 pull request introduces the initial implementation of the microsoft-agents-hosting-fastapi library, providing FastAPI-based hosting capabilities for Microsoft Agents with robust streaming, citation handling, and authorization features.

Key changes include:

  • Implementation of streaming response functionality with support for Teams and Direct Line channels
  • JWT authorization middleware and dependency injection patterns for FastAPI
  • Channel service API endpoints and cloud adapter for processing agent activities

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
setup.py Package configuration with FastAPI dependency
pyproject.toml Project metadata and build configuration
readme.md Documentation with usage examples
streaming_response.py Core streaming functionality for chunked responses
citation.py & citation_util.py Citation handling utilities and data structures
jwt_authorization_middleware.py JWT authentication middleware for FastAPI
cloud_adapter.py HTTP adapter for processing agent activities
channel_service_route_table.py API route definitions for channel service
agent_http_adapter.py Protocol definition for HTTP adapters
_start_agent_process.py Function to bootstrap agent processes
init.py files Package structure and exports
LICENSE MIT license file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…rough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings October 16, 2025 18:13
…sting/fastapi/app/streaming/streaming_response.py

Co-authored-by: Copilot <[email protected]>
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 17 out of 17 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 22, 2025 00:01
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 24 out of 24 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 24, 2025 22:47
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 28 out of 28 changed files in this pull request and generated 9 comments.


💡 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 24, 2025 22:51
@axelsrz axelsrz requested a review from a team as a code owner October 24, 2025 22:51
Copilot AI review requested due to automatic review settings October 24, 2025 22:51
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 28 out of 28 changed files in this pull request and generated 2 comments.


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

Copilot AI review requested due to automatic review settings October 27, 2025 20:57
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 25 out of 25 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

libraries/microsoft-agents-hosting-fastapi/microsoft_agents/hosting/fastapi/app/streaming/streaming_response.py:1

  • The magic number 477 should be extracted to a named constant (e.g., MAX_CITATION_ABSTRACT_LENGTH) to improve code readability and maintainability.
# Copyright (c) Microsoft Corporation. All rights reserved.

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

Copilot AI review requested due to automatic review settings October 27, 2025 21:03
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 25 out of 25 changed files in this pull request and generated 4 comments.


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

Copilot AI review requested due to automatic review settings October 27, 2025 21:05
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 25 out of 25 changed files in this pull request and generated 5 comments.


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

Copilot AI review requested due to automatic review settings October 27, 2025 21:06
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 25 out of 25 changed files in this pull request and generated no new comments.


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

rodrigobr-msft
rodrigobr-msft previously approved these changes Oct 27, 2025
Copilot AI review requested due to automatic review settings October 27, 2025 21:14
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 25 out of 25 changed files in this pull request and generated 3 comments.


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

Copilot AI review requested due to automatic review settings October 27, 2025 21: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 25 out of 25 changed files in this pull request and generated 3 comments.


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

…sting/fastapi/app/streaming/streaming_response.py

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings October 27, 2025 21:26
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 25 out of 25 changed files in this pull request and generated no new comments.


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

@axelsrz axelsrz merged commit 541fe76 into main Oct 27, 2025
10 checks passed
@axelsrz axelsrz deleted the users/axsuarez/fast-api-integration branch October 27, 2025 21:35
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.

2 participants