microsoft-agents-hosting-fastapi 0.6.0.dev8__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.
- microsoft_agents/hosting/fastapi/_start_agent_process.py +3 -2
- microsoft_agents/hosting/fastapi/app/streaming/streaming_response.py +5 -5
- microsoft_agents/hosting/fastapi/cloud_adapter.py +3 -2
- {microsoft_agents_hosting_fastapi-0.6.0.dev8.dist-info → microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info}/METADATA +2 -2
- {microsoft_agents_hosting_fastapi-0.6.0.dev8.dist-info → microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info}/RECORD +8 -8
- {microsoft_agents_hosting_fastapi-0.6.0.dev8.dist-info → microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info}/WHEEL +0 -0
- {microsoft_agents_hosting_fastapi-0.6.0.dev8.dist-info → microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info}/licenses/LICENSE +0 -0
- {microsoft_agents_hosting_fastapi-0.6.0.dev8.dist-info → microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
from fastapi 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(
|
|
19
|
+
raise TypeError(str(error_resources.AdapterRequired))
|
|
19
20
|
if not agent_application:
|
|
20
|
-
raise TypeError(
|
|
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
|
-
|
|
20
|
-
|
|
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
|
|
@@ -80,7 +80,7 @@ class StreamingResponse:
|
|
|
80
80
|
return
|
|
81
81
|
|
|
82
82
|
if self._ended:
|
|
83
|
-
raise RuntimeError(
|
|
83
|
+
raise RuntimeError(str(error_resources.StreamAlreadyEnded))
|
|
84
84
|
|
|
85
85
|
# Queue a typing activity
|
|
86
86
|
def create_activity():
|
|
@@ -116,7 +116,7 @@ class StreamingResponse:
|
|
|
116
116
|
if self._cancelled:
|
|
117
117
|
return
|
|
118
118
|
if self._ended:
|
|
119
|
-
raise RuntimeError(
|
|
119
|
+
raise RuntimeError(str(error_resources.StreamAlreadyEnded))
|
|
120
120
|
|
|
121
121
|
# Update full message text
|
|
122
122
|
self._message += text
|
|
@@ -132,7 +132,7 @@ class StreamingResponse:
|
|
|
132
132
|
Ends the stream by sending the final message to the client.
|
|
133
133
|
"""
|
|
134
134
|
if self._ended:
|
|
135
|
-
raise RuntimeError(
|
|
135
|
+
raise RuntimeError(str(error_resources.StreamAlreadyEnded))
|
|
136
136
|
|
|
137
137
|
# Queue final message
|
|
138
138
|
self._ended = True
|
|
@@ -5,6 +5,7 @@ from typing import Optional
|
|
|
5
5
|
|
|
6
6
|
from fastapi import Request, Response, HTTPException
|
|
7
7
|
from fastapi.responses import JSONResponse
|
|
8
|
+
from microsoft_agents.hosting.core import error_resources
|
|
8
9
|
from microsoft_agents.hosting.core.authorization import (
|
|
9
10
|
ClaimsIdentity,
|
|
10
11
|
Connections,
|
|
@@ -63,9 +64,9 @@ class CloudAdapter(ChannelServiceAdapter, AgentHttpAdapter):
|
|
|
63
64
|
|
|
64
65
|
async def process(self, request: Request, agent: Agent) -> Optional[Response]:
|
|
65
66
|
if not request:
|
|
66
|
-
raise TypeError(
|
|
67
|
+
raise TypeError(str(error_resources.RequestRequired))
|
|
67
68
|
if not agent:
|
|
68
|
-
raise TypeError(
|
|
69
|
+
raise TypeError(str(error_resources.AgentRequired))
|
|
69
70
|
|
|
70
71
|
if request.method == "POST":
|
|
71
72
|
# Deserialize the incoming Activity
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-fastapi
|
|
3
|
-
Version: 0.6.0.
|
|
3
|
+
Version: 0.6.0.dev10
|
|
4
4
|
Summary: Integration library for Microsoft Agents with FastAPI
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -10,7 +10,7 @@ Classifier: Operating System :: OS Independent
|
|
|
10
10
|
Requires-Python: >=3.10
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
|
-
Requires-Dist: microsoft-agents-hosting-core==0.6.0.
|
|
13
|
+
Requires-Dist: microsoft-agents-hosting-core==0.6.0.dev10
|
|
14
14
|
Requires-Dist: fastapi>=0.104.0
|
|
15
15
|
Dynamic: license-file
|
|
16
16
|
Dynamic: requires-dist
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
microsoft_agents/hosting/fastapi/__init__.py,sha256=9IuCCWHY4FEPGAzv9uEyob0irIbMqAomjjiYKs95NPA,592
|
|
2
|
-
microsoft_agents/hosting/fastapi/_start_agent_process.py,sha256=
|
|
2
|
+
microsoft_agents/hosting/fastapi/_start_agent_process.py,sha256=u4aTpiPYzhcOPD1nJjVD1stRFGmsysAE3QS8vOV_37c,946
|
|
3
3
|
microsoft_agents/hosting/fastapi/agent_http_adapter.py,sha256=40fi8bPXzXMGMAdeK1NDT34RSbKP--jLzBvRJ159-BQ,427
|
|
4
4
|
microsoft_agents/hosting/fastapi/channel_service_route_table.py,sha256=NHt5958_SpcT1O6tTSPuTtZX0R196IAcDUr5gWuTYZ4,7113
|
|
5
|
-
microsoft_agents/hosting/fastapi/cloud_adapter.py,sha256=
|
|
5
|
+
microsoft_agents/hosting/fastapi/cloud_adapter.py,sha256=wg9wFjRvEvM1scD8lqBASXhcoGlsssB8cxfKMROp-Co,4028
|
|
6
6
|
microsoft_agents/hosting/fastapi/jwt_authorization_middleware.py,sha256=YMLqoXrUcC5klaLiKT4uP_dF7Tz1KbsVJjL2PvWgkLQ,2600
|
|
7
7
|
microsoft_agents/hosting/fastapi/app/__init__.py,sha256=TioskqZet16twXOsI3X2snyLzmuyeKNtN2dySD1Xw7s,253
|
|
8
8
|
microsoft_agents/hosting/fastapi/app/streaming/__init__.py,sha256=G_VGmQ0m6TkHZsHjRV5HitaCOt2EBEjENIoBYabJMqM,292
|
|
9
9
|
microsoft_agents/hosting/fastapi/app/streaming/citation.py,sha256=ZGaMUOWxxoMplwRrkFsjnK7Z12V6rT5odE7qZCu-mP8,498
|
|
10
10
|
microsoft_agents/hosting/fastapi/app/streaming/citation_util.py,sha256=c95c3Y3genmFc0vSXppPaD1-ShFohAV1UABZnyJS_BQ,2478
|
|
11
|
-
microsoft_agents/hosting/fastapi/app/streaming/streaming_response.py,sha256=
|
|
12
|
-
microsoft_agents_hosting_fastapi-0.6.0.
|
|
13
|
-
microsoft_agents_hosting_fastapi-0.6.0.
|
|
14
|
-
microsoft_agents_hosting_fastapi-0.6.0.
|
|
15
|
-
microsoft_agents_hosting_fastapi-0.6.0.
|
|
16
|
-
microsoft_agents_hosting_fastapi-0.6.0.
|
|
11
|
+
microsoft_agents/hosting/fastapi/app/streaming/streaming_response.py,sha256=c5jytVvOIV3f1zKWxpFFxvCS6nR_8mi7bhv5pYusIGw,13325
|
|
12
|
+
microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info/licenses/LICENSE,sha256=oDrK6gJRdwYynx5l4UtyDa2nX_D1WWkvionBYrCebek,1073
|
|
13
|
+
microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info/METADATA,sha256=551AnrOjj969pzpaRpulU_t6ZB1D6tmBp-kp1AVyO5k,1433
|
|
14
|
+
microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
+
microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
|
|
16
|
+
microsoft_agents_hosting_fastapi-0.6.0.dev10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|