microsoft-agents-hosting-aiohttp 0.6.0.dev9__py3-none-any.whl → 0.6.0.dev10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  from typing import Optional
2
2
  from aiohttp.web import Request, Response
3
+ from microsoft_agents.hosting.core import error_resources
3
4
  from microsoft_agents.hosting.core.app import AgentApplication
4
5
  from .cloud_adapter import CloudAdapter
5
6
 
@@ -15,9 +16,9 @@ async def start_agent_process(
15
16
  agent_application (AgentApplication): The agent application to run.
16
17
  """
17
18
  if not adapter:
18
- raise TypeError("start_agent_process: adapter can't be None")
19
+ raise TypeError(str(error_resources.AdapterRequired))
19
20
  if not agent_application:
20
- raise TypeError("start_agent_process: agent_application can't be None")
21
+ raise TypeError(str(error_resources.AgentApplicationRequired))
21
22
 
22
23
  # Start the agent application with the provided adapter
23
24
  return await adapter.process(
@@ -16,8 +16,8 @@ from microsoft_agents.activity import (
16
16
  SensitivityUsageInfo,
17
17
  )
18
18
 
19
- if TYPE_CHECKING:
20
- from microsoft_agents.hosting.core.turn_context import TurnContext
19
+ from microsoft_agents.hosting.core import error_resources
20
+ from microsoft_agents.hosting.core.turn_context import TurnContext
21
21
 
22
22
  from .citation import Citation
23
23
  from .citation_util import CitationUtil
@@ -99,7 +99,7 @@ class StreamingResponse:
99
99
  return
100
100
 
101
101
  if self._ended:
102
- raise RuntimeError("The stream has already ended.")
102
+ raise RuntimeError(str(error_resources.StreamAlreadyEnded))
103
103
 
104
104
  # Queue a typing activity
105
105
  def create_activity():
@@ -135,7 +135,7 @@ class StreamingResponse:
135
135
  if self._cancelled:
136
136
  return
137
137
  if self._ended:
138
- raise RuntimeError("The stream has already ended.")
138
+ raise RuntimeError(str(error_resources.StreamAlreadyEnded))
139
139
 
140
140
  # Update full message text
141
141
  self._message += text
@@ -151,7 +151,7 @@ class StreamingResponse:
151
151
  Ends the stream by sending the final message to the client.
152
152
  """
153
153
  if self._ended:
154
- raise RuntimeError("The stream has already ended.")
154
+ raise RuntimeError(str(error_resources.StreamAlreadyEnded))
155
155
 
156
156
  # Queue final message
157
157
  self._ended = True
@@ -12,6 +12,7 @@ from aiohttp.web import (
12
12
  HTTPUnauthorized,
13
13
  HTTPUnsupportedMediaType,
14
14
  )
15
+ from microsoft_agents.hosting.core import error_resources
15
16
  from microsoft_agents.hosting.core.authorization import (
16
17
  ClaimsIdentity,
17
18
  Connections,
@@ -70,9 +71,9 @@ class CloudAdapter(ChannelServiceAdapter, AgentHttpAdapter):
70
71
 
71
72
  async def process(self, request: Request, agent: Agent) -> Optional[Response]:
72
73
  if not request:
73
- raise TypeError("CloudAdapter.process: request can't be None")
74
+ raise TypeError(str(error_resources.RequestRequired))
74
75
  if not agent:
75
- raise TypeError("CloudAdapter.process: agent can't be None")
76
+ raise TypeError(str(error_resources.AgentRequired))
76
77
 
77
78
  if request.method == "POST":
78
79
  # Deserialize the incoming Activity
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-aiohttp
3
- Version: 0.6.0.dev9
3
+ Version: 0.6.0.dev10
4
4
  Summary: Integration library for Microsoft Agents with aiohttp
5
5
  Author: Microsoft Corporation
6
6
  License-Expression: MIT
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: microsoft-agents-hosting-core==0.6.0.dev9
18
+ Requires-Dist: microsoft-agents-hosting-core==0.6.0.dev10
19
19
  Requires-Dist: aiohttp>=3.11.11
20
20
  Dynamic: license-file
21
21
  Dynamic: requires-dist
@@ -1,16 +1,16 @@
1
1
  microsoft_agents/hosting/aiohttp/__init__.py,sha256=MiCeImORsTFi9V2n-MIWJA53GzroDd-54G_UoH_5U0Y,664
2
- microsoft_agents/hosting/aiohttp/_start_agent_process.py,sha256=f-BGLGlKgfGpxihuOKWmg9Zrnw8EF0wqOwMVdGPmIWM,909
2
+ microsoft_agents/hosting/aiohttp/_start_agent_process.py,sha256=RqKjQrYGRlzp05ssropmKCwI7T4j-glQP1zJtuOHBI0,950
3
3
  microsoft_agents/hosting/aiohttp/agent_http_adapter.py,sha256=U6GQVPPj-Vi2Kan8i2LDrRtU-M9FpfXUzFqzOqvVYoI,444
4
4
  microsoft_agents/hosting/aiohttp/channel_service_route_table.py,sha256=3JNmK63j0ELgqUAtqsOXFjajhRTMgf29cIGwLCDwnLE,6745
5
- microsoft_agents/hosting/aiohttp/cloud_adapter.py,sha256=3WWi4xxEFw8c9XTYp_MVUt3JlbzGJRwVEJ-aky-W_is,3842
5
+ microsoft_agents/hosting/aiohttp/cloud_adapter.py,sha256=UzSoZPGNI9VVY9vQx5E6BMgJAa0x2UUmuW2JGEiX9bc,3882
6
6
  microsoft_agents/hosting/aiohttp/jwt_authorization_middleware.py,sha256=26r7lK-umiohc5H7mC-m0yeHr-Tq7DoALO1ea0pi714,2327
7
7
  microsoft_agents/hosting/aiohttp/app/__init__.py,sha256=TioskqZet16twXOsI3X2snyLzmuyeKNtN2dySD1Xw7s,253
8
8
  microsoft_agents/hosting/aiohttp/app/streaming/__init__.py,sha256=G_VGmQ0m6TkHZsHjRV5HitaCOt2EBEjENIoBYabJMqM,292
9
9
  microsoft_agents/hosting/aiohttp/app/streaming/citation.py,sha256=ZGaMUOWxxoMplwRrkFsjnK7Z12V6rT5odE7qZCu-mP8,498
10
10
  microsoft_agents/hosting/aiohttp/app/streaming/citation_util.py,sha256=c95c3Y3genmFc0vSXppPaD1-ShFohAV1UABZnyJS_BQ,2478
11
- microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py,sha256=vRF3s3MaInb6ITU-ibfbsjIdLEcje0fsFG8n11dSYJ4,13833
12
- microsoft_agents_hosting_aiohttp-0.6.0.dev9.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
13
- microsoft_agents_hosting_aiohttp-0.6.0.dev9.dist-info/METADATA,sha256=0Ed7eEK1kH6VY8uBGogZYHeXYa63dU-YtjclC6ozuLE,8378
14
- microsoft_agents_hosting_aiohttp-0.6.0.dev9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- microsoft_agents_hosting_aiohttp-0.6.0.dev9.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
16
- microsoft_agents_hosting_aiohttp-0.6.0.dev9.dist-info/RECORD,,
11
+ microsoft_agents/hosting/aiohttp/app/streaming/streaming_response.py,sha256=ER_6Yrmqgs8M7NFe98zFUOXwD5BsfNDVGQsX5DDtLxU,13893
12
+ microsoft_agents_hosting_aiohttp-0.6.0.dev10.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
13
+ microsoft_agents_hosting_aiohttp-0.6.0.dev10.dist-info/METADATA,sha256=CdBphd4bmVLgqZNNCFwTroPzVwloXRvKSAAHWoN7tzo,8380
14
+ microsoft_agents_hosting_aiohttp-0.6.0.dev10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ microsoft_agents_hosting_aiohttp-0.6.0.dev10.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
16
+ microsoft_agents_hosting_aiohttp-0.6.0.dev10.dist-info/RECORD,,