diff --git a/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/cloud_adapter.py b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/cloud_adapter.py index 17aef2f3..234cd679 100644 --- a/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/cloud_adapter.py +++ b/libraries/microsoft-agents-hosting-aiohttp/microsoft_agents/hosting/aiohttp/cloud_adapter.py @@ -68,4 +68,5 @@ def _to_aiohttp_response(http_response: HttpResponse) -> Response: return Response( status=http_response.status_code, headers=http_response.headers, + content_type=http_response.content_type, ) diff --git a/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/__init__.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/__init__.py index be36ce81..2b9e817f 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/__init__.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/__init__.py @@ -133,7 +133,7 @@ "InputFile", "InputFileDownloader", "Query", - "Route", + "_Route", "RouteHandler", "TypingIndicator", "Citation", diff --git a/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/http/_http_request_protocol.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/http/_http_request_protocol.py index c3874987..0170c59f 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/http/_http_request_protocol.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/http/_http_request_protocol.py @@ -3,7 +3,7 @@ """Protocol for abstracting HTTP request objects across frameworks.""" -from typing import Protocol, Any, Optional +from typing import Protocol, Any, Optional, Mapping class HttpRequestProtocol(Protocol): @@ -19,7 +19,7 @@ def method(self) -> str: ... @property - def headers(self) -> dict[str, str]: + def headers(self) -> Mapping[str, str]: """Request headers.""" ... diff --git a/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/http/_http_response.py b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/http/_http_response.py index b1a5dc46..bfe1cab5 100644 --- a/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/http/_http_response.py +++ b/libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/http/_http_response.py @@ -4,7 +4,7 @@ """HTTP response abstraction.""" from dataclasses import dataclass -from typing import Any, Optional +from typing import Any @dataclass @@ -12,9 +12,9 @@ class HttpResponse: """Framework-agnostic HTTP response.""" status_code: int - body: Optional[Any] = None - headers: Optional[dict[str, str]] = None - content_type: Optional[str] = "application/json" + body: Any | None = None + headers: dict[str, str] | None = None + content_type: str | None = "application/json" class HttpResponseFactory: