microsoft-agents-hosting-fastapi 0.6.0.dev9__tar.gz → 0.6.0.dev11__tar.gz

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.
Files changed (23) hide show
  1. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/PKG-INFO +2 -2
  2. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/_start_agent_process.py +3 -2
  3. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/app/streaming/streaming_response.py +5 -5
  4. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/cloud_adapter.py +3 -2
  5. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents_hosting_fastapi.egg-info/PKG-INFO +2 -2
  6. microsoft_agents_hosting_fastapi-0.6.0.dev11/microsoft_agents_hosting_fastapi.egg-info/requires.txt +2 -0
  7. microsoft_agents_hosting_fastapi-0.6.0.dev9/microsoft_agents_hosting_fastapi.egg-info/requires.txt +0 -2
  8. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/LICENSE +0 -0
  9. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/__init__.py +0 -0
  10. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/agent_http_adapter.py +0 -0
  11. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/app/__init__.py +0 -0
  12. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/app/streaming/__init__.py +0 -0
  13. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/app/streaming/citation.py +0 -0
  14. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/app/streaming/citation_util.py +0 -0
  15. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/channel_service_route_table.py +0 -0
  16. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents/hosting/fastapi/jwt_authorization_middleware.py +0 -0
  17. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents_hosting_fastapi.egg-info/SOURCES.txt +0 -0
  18. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents_hosting_fastapi.egg-info/dependency_links.txt +0 -0
  19. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/microsoft_agents_hosting_fastapi.egg-info/top_level.txt +0 -0
  20. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/pyproject.toml +0 -0
  21. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/readme.md +0 -0
  22. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/setup.cfg +0 -0
  23. {microsoft_agents_hosting_fastapi-0.6.0.dev9 → microsoft_agents_hosting_fastapi-0.6.0.dev11}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-fastapi
3
- Version: 0.6.0.dev9
3
+ Version: 0.6.0.dev11
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.dev9
13
+ Requires-Dist: microsoft-agents-hosting-core==0.6.0.dev11
14
14
  Requires-Dist: fastapi>=0.104.0
15
15
  Dynamic: license-file
16
16
  Dynamic: requires-dist
@@ -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("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
@@ -80,7 +80,7 @@ class StreamingResponse:
80
80
  return
81
81
 
82
82
  if self._ended:
83
- raise RuntimeError("The stream has already ended.")
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("The stream has already ended.")
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("The stream has already ended.")
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("CloudAdapter.process: request can't be None")
67
+ raise TypeError(str(error_resources.RequestRequired))
67
68
  if not agent:
68
- raise TypeError("CloudAdapter.process: agent can't be None")
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.dev9
3
+ Version: 0.6.0.dev11
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.dev9
13
+ Requires-Dist: microsoft-agents-hosting-core==0.6.0.dev11
14
14
  Requires-Dist: fastapi>=0.104.0
15
15
  Dynamic: license-file
16
16
  Dynamic: requires-dist
@@ -0,0 +1,2 @@
1
+ microsoft-agents-hosting-core==0.6.0.dev11
2
+ fastapi>=0.104.0
@@ -1,2 +0,0 @@
1
- microsoft-agents-hosting-core==0.6.0.dev9
2
- fastapi>=0.104.0