microsoft-agents-hosting-core 0.4.0.dev16__py3-none-any.whl → 0.5.0__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/core/__init__.py +2 -1
- microsoft_agents/hosting/core/_oauth/__init__.py +3 -0
- microsoft_agents/hosting/core/_oauth/_flow_state.py +2 -2
- microsoft_agents/hosting/core/_oauth/_oauth_flow.py +26 -23
- microsoft_agents/hosting/core/activity_handler.py +20 -17
- microsoft_agents/hosting/core/app/__init__.py +2 -1
- microsoft_agents/hosting/core/app/_routes/__init__.py +13 -0
- microsoft_agents/hosting/core/app/_routes/_route.py +89 -0
- microsoft_agents/hosting/core/app/_routes/_route_list.py +32 -0
- microsoft_agents/hosting/core/app/_routes/route_rank.py +14 -0
- microsoft_agents/hosting/core/app/_type_defs.py +15 -0
- microsoft_agents/hosting/core/app/agent_application.py +116 -52
- microsoft_agents/hosting/core/app/input_file.py +15 -11
- microsoft_agents/hosting/core/app/oauth/__init__.py +4 -0
- microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +5 -0
- microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +9 -4
- microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +6 -4
- microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +14 -9
- microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +4 -0
- microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +5 -0
- microsoft_agents/hosting/core/app/oauth/auth_handler.py +4 -2
- microsoft_agents/hosting/core/app/oauth/authorization.py +43 -20
- microsoft_agents/hosting/core/app/state/state.py +50 -6
- microsoft_agents/hosting/core/app/typing_indicator.py +51 -27
- microsoft_agents/hosting/core/authorization/access_token_provider_base.py +4 -1
- microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +3 -0
- microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +4 -1
- microsoft_agents/hosting/core/authorization/auth_types.py +3 -0
- microsoft_agents/hosting/core/authorization/connections.py +3 -0
- microsoft_agents/hosting/core/authorization/jwt_token_validator.py +9 -4
- microsoft_agents/hosting/core/channel_adapter.py +9 -9
- microsoft_agents/hosting/core/channel_api_handler_protocol.py +3 -0
- microsoft_agents/hosting/core/channel_service_adapter.py +65 -10
- microsoft_agents/hosting/core/channel_service_client_factory_base.py +3 -0
- microsoft_agents/hosting/core/client/agent_conversation_reference.py +3 -0
- microsoft_agents/hosting/core/client/channel_factory_protocol.py +3 -0
- microsoft_agents/hosting/core/client/channel_host_protocol.py +3 -0
- microsoft_agents/hosting/core/client/channel_info_protocol.py +3 -0
- microsoft_agents/hosting/core/client/channel_protocol.py +3 -0
- microsoft_agents/hosting/core/client/channels_configuration.py +3 -0
- microsoft_agents/hosting/core/client/configuration_channel_host.py +3 -0
- microsoft_agents/hosting/core/client/conversation_constants.py +3 -0
- microsoft_agents/hosting/core/client/conversation_id_factory.py +3 -0
- microsoft_agents/hosting/core/client/conversation_id_factory_options.py +3 -0
- microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +3 -0
- microsoft_agents/hosting/core/client/http_agent_channel.py +3 -0
- microsoft_agents/hosting/core/client/http_agent_channel_factory.py +3 -0
- microsoft_agents/hosting/core/connector/client/connector_client.py +1 -4
- microsoft_agents/hosting/core/connector/client/user_token_client.py +40 -43
- microsoft_agents/hosting/core/connector/user_token_base.py +77 -1
- microsoft_agents/hosting/core/connector/user_token_client_base.py +3 -0
- microsoft_agents/hosting/core/rest_channel_service_client_factory.py +3 -0
- microsoft_agents/hosting/core/state/agent_state.py +16 -20
- microsoft_agents/hosting/core/storage/error_handling.py +3 -0
- microsoft_agents/hosting/core/storage/memory_storage.py +3 -0
- microsoft_agents/hosting/core/storage/storage.py +3 -0
- microsoft_agents/hosting/core/storage/store_item.py +3 -0
- microsoft_agents/hosting/core/storage/transcript_file_store.py +1 -5
- microsoft_agents/hosting/core/turn_context.py +2 -1
- microsoft_agents_hosting_core-0.5.0.dist-info/METADATA +191 -0
- {microsoft_agents_hosting_core-0.4.0.dev16.dist-info → microsoft_agents_hosting_core-0.5.0.dist-info}/RECORD +64 -59
- microsoft_agents_hosting_core-0.5.0.dist-info/licenses/LICENSE +21 -0
- microsoft_agents/hosting/core/app/route.py +0 -32
- microsoft_agents_hosting_core-0.4.0.dev16.dist-info/METADATA +0 -16
- {microsoft_agents_hosting_core-0.4.0.dev16.dist-info → microsoft_agents_hosting_core-0.5.0.dist-info}/WHEEL +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16.dist-info → microsoft_agents_hosting_core-0.5.0.dist-info}/top_level.txt +0 -0
|
@@ -68,11 +68,11 @@ class AgentState:
|
|
|
68
68
|
|
|
69
69
|
def __init__(self, storage: Storage, context_service_key: str):
|
|
70
70
|
"""
|
|
71
|
-
Initializes a new instance of the :class:`AgentState` class.
|
|
71
|
+
Initializes a new instance of the :class:`microsoft_agents.hosting.core.state.agent_state.AgentState` class.
|
|
72
72
|
|
|
73
73
|
:param storage: The storage layer this state management object will use to store and retrieve state
|
|
74
74
|
:type storage: :class:`microsoft_agents.hosting.core.storage.Storage`
|
|
75
|
-
:param context_service_key: The key for the state cache for this :class:`AgentState`
|
|
75
|
+
:param context_service_key: The key for the state cache for this :class:`microsoft_agents.hosting.core.state.agent_state.AgentState`
|
|
76
76
|
:type context_service_key: str
|
|
77
77
|
|
|
78
78
|
.. remarks::
|
|
@@ -93,19 +93,19 @@ class AgentState:
|
|
|
93
93
|
from the turn context.
|
|
94
94
|
|
|
95
95
|
:param turn_context: The context object for this turn.
|
|
96
|
-
:type turn_context: :class:`TurnContext`
|
|
96
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
97
97
|
:return: The cached agent state instance.
|
|
98
98
|
"""
|
|
99
99
|
return turn_context.turn_state.get(self._context_service_key)
|
|
100
100
|
|
|
101
101
|
def create_property(self, name: str) -> StatePropertyAccessor:
|
|
102
102
|
"""
|
|
103
|
-
Creates a property definition and registers it with this :class:`AgentState`.
|
|
103
|
+
Creates a property definition and registers it with this :class:`microsoft_agents.hosting.core.state.agent_state.AgentState`.
|
|
104
104
|
|
|
105
105
|
:param name: The name of the property
|
|
106
106
|
:type name: str
|
|
107
107
|
:return: If successful, the state property accessor created
|
|
108
|
-
:rtype: :class:`StatePropertyAccessor`
|
|
108
|
+
:rtype: :class:`microsoft_agents.hosting.core.state.state_property_accessor.StatePropertyAccessor`
|
|
109
109
|
"""
|
|
110
110
|
if not name or not name.strip():
|
|
111
111
|
raise ValueError(
|
|
@@ -123,7 +123,7 @@ class AgentState:
|
|
|
123
123
|
Reads the current state object and caches it in the context object for this turn.
|
|
124
124
|
|
|
125
125
|
:param turn_context: The context object for this turn
|
|
126
|
-
:type turn_context: :class:`TurnContext`
|
|
126
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
127
127
|
:param force: Optional, true to bypass the cache
|
|
128
128
|
:type force: bool
|
|
129
129
|
"""
|
|
@@ -141,7 +141,7 @@ class AgentState:
|
|
|
141
141
|
If the state has changed, it saves the state cached in the current context for this turn.
|
|
142
142
|
|
|
143
143
|
:param turn_context: The context object for this turn
|
|
144
|
-
:type turn_context: :class:`TurnContext`
|
|
144
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
145
145
|
:param force: Optional, true to save state to storage whether or not there are changes
|
|
146
146
|
:type force: bool
|
|
147
147
|
"""
|
|
@@ -157,7 +157,7 @@ class AgentState:
|
|
|
157
157
|
Clears any state currently stored in this state scope.
|
|
158
158
|
|
|
159
159
|
:param turn_context: The context object for this turn
|
|
160
|
-
:type turn_context: :class:`TurnContext`
|
|
160
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
161
161
|
|
|
162
162
|
:return: None
|
|
163
163
|
|
|
@@ -174,7 +174,7 @@ class AgentState:
|
|
|
174
174
|
Deletes any state currently stored in this state scope.
|
|
175
175
|
|
|
176
176
|
:param turn_context: The context object for this turn
|
|
177
|
-
:type turn_context: :class:`TurnContext`
|
|
177
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
178
178
|
|
|
179
179
|
:return: None
|
|
180
180
|
"""
|
|
@@ -200,7 +200,7 @@ class AgentState:
|
|
|
200
200
|
Gets the value of the specified property in the turn context.
|
|
201
201
|
|
|
202
202
|
:param turn_context: The context object for this turn
|
|
203
|
-
:type turn_context: :class:`TurnContext`
|
|
203
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
204
204
|
:param property_name: The property name
|
|
205
205
|
:type property_name: str
|
|
206
206
|
|
|
@@ -235,8 +235,6 @@ class AgentState:
|
|
|
235
235
|
"""
|
|
236
236
|
Deletes a property from the state cache in the turn context.
|
|
237
237
|
|
|
238
|
-
:param turn_context: The context object for this turn
|
|
239
|
-
:type turn_context: :class:`TurnContext`
|
|
240
238
|
:param property_name: The name of the property to delete
|
|
241
239
|
:type property_name: str
|
|
242
240
|
|
|
@@ -254,8 +252,6 @@ class AgentState:
|
|
|
254
252
|
"""
|
|
255
253
|
Sets a property to the specified value in the turn context.
|
|
256
254
|
|
|
257
|
-
:param turn_context: The context object for this turn
|
|
258
|
-
:type turn_context: :class:`TurnContext`
|
|
259
255
|
:param property_name: The property name
|
|
260
256
|
:type property_name: str
|
|
261
257
|
:param value: The value to assign to the property
|
|
@@ -272,15 +268,15 @@ class AgentState:
|
|
|
272
268
|
|
|
273
269
|
class BotStatePropertyAccessor(StatePropertyAccessor):
|
|
274
270
|
"""
|
|
275
|
-
Defines methods for accessing a state property created in a :class:`AgentState` object.
|
|
271
|
+
Defines methods for accessing a state property created in a :class:`microsoft_agents.hosting.core.state.agent_state.AgentState` object.
|
|
276
272
|
"""
|
|
277
273
|
|
|
278
274
|
def __init__(self, agent_state: AgentState, name: str):
|
|
279
275
|
"""
|
|
280
|
-
Initializes a new instance of the :class:`BotStatePropertyAccessor` class.
|
|
276
|
+
Initializes a new instance of the :class:`microsoft_agents.hosting.core.state.agent_state.BotStatePropertyAccessor` class.
|
|
281
277
|
|
|
282
278
|
:param agent_state: The state object to access
|
|
283
|
-
:type agent_state: :class:`AgentState`
|
|
279
|
+
:type agent_state: :class:`microsoft_agents.hosting.core.state.agent_state.AgentState`
|
|
284
280
|
:param name: The name of the state property to access
|
|
285
281
|
:type name: str
|
|
286
282
|
|
|
@@ -304,7 +300,7 @@ class BotStatePropertyAccessor(StatePropertyAccessor):
|
|
|
304
300
|
Deletes the property.
|
|
305
301
|
|
|
306
302
|
:param turn_context: The context object for this turn
|
|
307
|
-
:type turn_context: :class:`TurnContext`
|
|
303
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
308
304
|
"""
|
|
309
305
|
await self._agent_state.load(turn_context, False)
|
|
310
306
|
self._agent_state.delete_value(self._name)
|
|
@@ -320,7 +316,7 @@ class BotStatePropertyAccessor(StatePropertyAccessor):
|
|
|
320
316
|
Gets the property value.
|
|
321
317
|
|
|
322
318
|
:param turn_context: The context object for this turn
|
|
323
|
-
:type turn_context: :class:`TurnContext`
|
|
319
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
324
320
|
:param default_value_or_factory: Defines the default value for the property
|
|
325
321
|
"""
|
|
326
322
|
await self._agent_state.load(turn_context, False)
|
|
@@ -355,7 +351,7 @@ class BotStatePropertyAccessor(StatePropertyAccessor):
|
|
|
355
351
|
Sets the property value.
|
|
356
352
|
|
|
357
353
|
:param turn_context: The context object for this turn
|
|
358
|
-
:type turn_context: :class:`TurnContext`
|
|
354
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
359
355
|
|
|
360
356
|
:param value: The value to assign to the property
|
|
361
357
|
"""
|
|
@@ -71,7 +71,7 @@ class FileTranscriptStore(TranscriptLogger):
|
|
|
71
71
|
def _write() -> None:
|
|
72
72
|
# Normalize to a dict to ensure json serializable content.
|
|
73
73
|
if not activity.timestamp:
|
|
74
|
-
activity.timestamp =
|
|
74
|
+
activity.timestamp = datetime.now(timezone.utc)
|
|
75
75
|
|
|
76
76
|
with open(file_path, "a", encoding="utf-8", newline="\n") as f:
|
|
77
77
|
f.write(activity.model_dump_json(exclude_none=True, exclude_unset=True))
|
|
@@ -261,7 +261,3 @@ def _to_plain_dict(activity: Activity) -> Dict[str, Any]:
|
|
|
261
261
|
"conversation": {"id": conversation_id},
|
|
262
262
|
"text": getattr(activity, "text", None),
|
|
263
263
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
def _utc_iso_now() -> str:
|
|
267
|
-
return datetime.now(timezone.utc).isoformat()
|
|
@@ -18,6 +18,7 @@ from microsoft_agents.activity import (
|
|
|
18
18
|
ResourceResponse,
|
|
19
19
|
DeliveryModes,
|
|
20
20
|
)
|
|
21
|
+
from microsoft_agents.activity.entity.entity_types import EntityTypes
|
|
21
22
|
from microsoft_agents.hosting.core.authorization.claims_identity import ClaimsIdentity
|
|
22
23
|
|
|
23
24
|
|
|
@@ -428,7 +429,7 @@ class TurnContext(TurnContextProtocol):
|
|
|
428
429
|
result: list[Mention] = []
|
|
429
430
|
if activity.entities is not None:
|
|
430
431
|
for entity in activity.entities:
|
|
431
|
-
if entity.type.lower() ==
|
|
432
|
+
if entity.type.lower() == EntityTypes.MENTION:
|
|
432
433
|
result.append(entity)
|
|
433
434
|
|
|
434
435
|
return result
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: microsoft-agents-hosting-core
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: Core library for Microsoft Agents
|
|
5
|
+
Author: Microsoft Corporation
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/microsoft/Agents
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: microsoft-agents-activity==0.5.0
|
|
19
|
+
Requires-Dist: pyjwt>=2.10.1
|
|
20
|
+
Requires-Dist: isodate>=0.6.1
|
|
21
|
+
Requires-Dist: azure-core>=1.30.0
|
|
22
|
+
Requires-Dist: python-dotenv>=1.1.1
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: requires-dist
|
|
25
|
+
|
|
26
|
+
# Microsoft Agents Hosting Core
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/microsoft-agents-hosting-core/)
|
|
29
|
+
|
|
30
|
+
The core hosting library for Microsoft 365 Agents SDK. This library provides the fundamental building blocks for creating conversational AI agents, including activity processing, state management, authentication, and channel communication.
|
|
31
|
+
|
|
32
|
+
This is the heart of the Microsoft 365 Agents SDK - think of it as the engine that powers your conversational agents. It handles the complex orchestration of conversations, manages state across turns, and provides the infrastructure needed to build production-ready agents that work across Microsoft 365 platforms.
|
|
33
|
+
|
|
34
|
+
# What is this?
|
|
35
|
+
This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehensive framework for building enterprise-grade conversational AI agents. The SDK enables developers to create intelligent agents that work across multiple platforms including Microsoft Teams, M365 Copilot, Copilot Studio, and web chat, with support for third-party integrations like Slack, Facebook Messenger, and Twilio.
|
|
36
|
+
|
|
37
|
+
## Release Notes
|
|
38
|
+
<table style="width:100%">
|
|
39
|
+
<tr>
|
|
40
|
+
<th style="width:20%">Version</th>
|
|
41
|
+
<th style="width:20%">Date</th>
|
|
42
|
+
<th style="width:60%">Release Notes</th>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr>
|
|
45
|
+
<td>0.5.0</td>
|
|
46
|
+
<td>2025-10-22</td>
|
|
47
|
+
<td>
|
|
48
|
+
<a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md">
|
|
49
|
+
0.5.0 Release Notes
|
|
50
|
+
</a>
|
|
51
|
+
</td>
|
|
52
|
+
</tr>
|
|
53
|
+
</table>
|
|
54
|
+
|
|
55
|
+
## Packages Overview
|
|
56
|
+
|
|
57
|
+
We offer the following PyPI packages to create conversational experiences based on Agents:
|
|
58
|
+
|
|
59
|
+
| Package Name | PyPI Version | Description |
|
|
60
|
+
|--------------|-------------|-------------|
|
|
61
|
+
| `microsoft-agents-activity` | [](https://pypi.org/project/microsoft-agents-activity/) | Types and validators implementing the Activity protocol spec. |
|
|
62
|
+
| `microsoft-agents-hosting-core` | [](https://pypi.org/project/microsoft-agents-hosting-core/) | Core library for Microsoft Agents hosting. |
|
|
63
|
+
| `microsoft-agents-hosting-aiohttp` | [](https://pypi.org/project/microsoft-agents-hosting-aiohttp/) | Configures aiohttp to run the Agent. |
|
|
64
|
+
| `microsoft-agents-hosting-teams` | [](https://pypi.org/project/microsoft-agents-hosting-teams/) | Provides classes to host an Agent for Teams. |
|
|
65
|
+
| `microsoft-agents-storage-blob` | [](https://pypi.org/project/microsoft-agents-storage-blob/) | Extension to use Azure Blob as storage. |
|
|
66
|
+
| `microsoft-agents-storage-cosmos` | [](https://pypi.org/project/microsoft-agents-storage-cosmos/) | Extension to use CosmosDB as storage. |
|
|
67
|
+
| `microsoft-agents-authentication-msal` | [](https://pypi.org/project/microsoft-agents-authentication-msal/) | MSAL-based authentication for Microsoft Agents. |
|
|
68
|
+
|
|
69
|
+
Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:
|
|
70
|
+
|
|
71
|
+
| Package Name | PyPI Version | Description |
|
|
72
|
+
|--------------|-------------|-------------|
|
|
73
|
+
| `microsoft-agents-copilotstudio-client` | [](https://pypi.org/project/microsoft-agents-copilotstudio-client/) | Direct to Engine client to interact with Agents created in CopilotStudio |
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## Installation
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pip install microsoft-agents-hosting-core
|
|
80
|
+
```
|
|
81
|
+
## Simple Echo Agent
|
|
82
|
+
See the [Quickstart sample](https://github.com/microsoft/Agents/tree/main/samples/python/quickstart) for full working code.
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
agents_sdk_config = load_configuration_from_env(environ)
|
|
86
|
+
|
|
87
|
+
STORAGE = MemoryStorage()
|
|
88
|
+
CONNECTION_MANAGER = MsalConnectionManager(**agents_sdk_config)
|
|
89
|
+
ADAPTER = CloudAdapter(connection_manager=CONNECTION_MANAGER)
|
|
90
|
+
AUTHORIZATION = Authorization(STORAGE, CONNECTION_MANAGER, **agents_sdk_config)
|
|
91
|
+
|
|
92
|
+
AGENT_APP = AgentApplication[TurnState](
|
|
93
|
+
storage=STORAGE, adapter=ADAPTER, authorization=AUTHORIZATION, **agents_sdk_config
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
@AGENT_APP.activity("message")
|
|
97
|
+
async def on_message(context: TurnContext, state: TurnState):
|
|
98
|
+
await context.send_activity(f"You said: {context.activity.text}")
|
|
99
|
+
|
|
100
|
+
...
|
|
101
|
+
|
|
102
|
+
start_server(
|
|
103
|
+
agent_application=AGENT_APP,
|
|
104
|
+
auth_configuration=CONNECTION_MANAGER.get_default_connection_configuration(),
|
|
105
|
+
)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Core Concepts
|
|
109
|
+
|
|
110
|
+
### AgentApplication vs ActivityHandler
|
|
111
|
+
|
|
112
|
+
**AgentApplication** - Modern, fluent API for building agents:
|
|
113
|
+
- Decorator-based routing (`@agent_app.activity("message")`)
|
|
114
|
+
- Built-in state management and middleware
|
|
115
|
+
- AI-ready with authorization support
|
|
116
|
+
- Type-safe with generics
|
|
117
|
+
|
|
118
|
+
**ActivityHandler** - Traditional inheritance-based approach:
|
|
119
|
+
- Override methods for different activity types
|
|
120
|
+
- More familiar to Bot Framework developers
|
|
121
|
+
- Lower-level control over activity processing
|
|
122
|
+
|
|
123
|
+
### Route-based Message Handling
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
@AGENT_APP.message(re.compile(r"^hello$"))
|
|
127
|
+
async def on_hello(context: TurnContext, _state: TurnState):
|
|
128
|
+
await context.send_activity("Hello!")
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
@AGENT_APP.activity("message")
|
|
132
|
+
async def on_message(context: TurnContext, _state: TurnState):
|
|
133
|
+
await context.send_activity(f"you said: {context.activity.text}")
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Error Handling
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
@AGENT_APP.error
|
|
140
|
+
async def on_error(context: TurnContext, error: Exception):
|
|
141
|
+
# NOTE: In production environment, you should consider logging this to Azure
|
|
142
|
+
# application insights.
|
|
143
|
+
print(f"\n [on_turn_error] unhandled error: {error}", file=sys.stderr)
|
|
144
|
+
traceback.print_exc()
|
|
145
|
+
|
|
146
|
+
# Send a message to the user
|
|
147
|
+
await context.send_activity("The bot encountered an error or bug.")
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
## Key Classes Reference
|
|
152
|
+
|
|
153
|
+
### Core Classes
|
|
154
|
+
- **`AgentApplication`** - Main application class with fluent API
|
|
155
|
+
- **`ActivityHandler`** - Base class for inheritance-based agents
|
|
156
|
+
- **`TurnContext`** - Context for each conversation turn
|
|
157
|
+
- **`TurnState`** - State management across conversation turns
|
|
158
|
+
|
|
159
|
+
### State Management
|
|
160
|
+
- **`ConversationState`** - Conversation-scoped state
|
|
161
|
+
- **`UserState`** - User-scoped state across conversations
|
|
162
|
+
- **`TempState`** - Temporary state for current turn
|
|
163
|
+
- **`MemoryStorage`** - In-memory storage (development)
|
|
164
|
+
|
|
165
|
+
### Messaging
|
|
166
|
+
- **`MessageFactory`** - Create different types of messages
|
|
167
|
+
- **`CardFactory`** - Create rich card attachments
|
|
168
|
+
- **`InputFile`** - Handle file attachments
|
|
169
|
+
|
|
170
|
+
### Authorization
|
|
171
|
+
- **`Authorization`** - Authentication and authorization manager
|
|
172
|
+
- **`ClaimsIdentity`** - User identity and claims
|
|
173
|
+
|
|
174
|
+
# Quick Links
|
|
175
|
+
|
|
176
|
+
- 📦 [All SDK Packages on PyPI](https://pypi.org/search/?q=microsoft-agents)
|
|
177
|
+
- 📖 [Complete Documentation](https://aka.ms/agents)
|
|
178
|
+
- 💡 [Python Samples Repository](https://github.com/microsoft/Agents/tree/main/samples/python)
|
|
179
|
+
- 🐛 [Report Issues](https://github.com/microsoft/Agents-for-python/issues)
|
|
180
|
+
|
|
181
|
+
# Sample Applications
|
|
182
|
+
|
|
183
|
+
|Name|Description|README|
|
|
184
|
+
|----|----|----|
|
|
185
|
+
|Quickstart|Simplest agent|[Quickstart](https://github.com/microsoft/Agents/blob/main/samples/python/quickstart/README.md)|
|
|
186
|
+
|Auto Sign In|Simple OAuth agent using Graph and GitHub|[auto-signin](https://github.com/microsoft/Agents/blob/main/samples/python/auto-signin/README.md)|
|
|
187
|
+
|OBO Authorization|OBO flow to access a Copilot Studio Agent|[obo-authorization](https://github.com/microsoft/Agents/blob/main/samples/python/obo-authorization/README.md)|
|
|
188
|
+
|Semantic Kernel Integration|A weather agent built with Semantic Kernel|[semantic-kernel-multiturn](https://github.com/microsoft/Agents/blob/main/samples/python/semantic-kernel-multiturn/README.md)|
|
|
189
|
+
|Streaming Agent|Streams OpenAI responses|[azure-ai-streaming](https://github.com/microsoft/Agents/blob/main/samples/python/azureai-streaming/README.md)|
|
|
190
|
+
|Copilot Studio Client|Console app to consume a Copilot Studio Agent|[copilotstudio-client](https://github.com/microsoft/Agents/blob/main/samples/python/copilotstudio-client/README.md)|
|
|
191
|
+
|Cards Agent|Agent that uses rich cards to enhance conversation design |[cards](https://github.com/microsoft/Agents/blob/main/samples/python/cards/README.md)|
|
|
@@ -1,93 +1,98 @@
|
|
|
1
|
-
microsoft_agents/hosting/core/__init__.py,sha256=
|
|
2
|
-
microsoft_agents/hosting/core/activity_handler.py,sha256=
|
|
1
|
+
microsoft_agents/hosting/core/__init__.py,sha256=EN6Et-e7n5n_nhXy5ZKNiRtjMfEgWkoNri_gk8KEYLw,4862
|
|
2
|
+
microsoft_agents/hosting/core/activity_handler.py,sha256=JTzKnT-9yJpTQpiCxJNXrXe1Z9NKt0egofV0NLlJZy0,27082
|
|
3
3
|
microsoft_agents/hosting/core/agent.py,sha256=K8v84y8ULP7rbcMKg8LxaM3haAq7f1oHFCLy3AAphQE,574
|
|
4
4
|
microsoft_agents/hosting/core/card_factory.py,sha256=UDmPEpOk2SpEr9ShN9Q0CiaI_GTD3qjHgkDMOWinW9I,6926
|
|
5
|
-
microsoft_agents/hosting/core/channel_adapter.py,sha256=
|
|
6
|
-
microsoft_agents/hosting/core/channel_api_handler_protocol.py,sha256=
|
|
7
|
-
microsoft_agents/hosting/core/channel_service_adapter.py,sha256=
|
|
8
|
-
microsoft_agents/hosting/core/channel_service_client_factory_base.py,sha256=
|
|
5
|
+
microsoft_agents/hosting/core/channel_adapter.py,sha256=LVHSueET6kzv-N_OCdl3F0yL4-OvZCMKMsj5tpPzZD0,10396
|
|
6
|
+
microsoft_agents/hosting/core/channel_api_handler_protocol.py,sha256=RO59hiOYx7flQVWhX6VGvfpFPoKVkdT_la-7WhUl8UM,4506
|
|
7
|
+
microsoft_agents/hosting/core/channel_service_adapter.py,sha256=MmnEy4350udEffCNfr8foE8VScKmrYnSmoXh_Ghoqvg,20480
|
|
8
|
+
microsoft_agents/hosting/core/channel_service_client_factory_base.py,sha256=ArMAUt84Kzq17Oyqz6o8HZrc01UqAAmNCSBTShv3rgk,1704
|
|
9
9
|
microsoft_agents/hosting/core/message_factory.py,sha256=F9QJBF4yBupHXxOW984ZzZomVEG57t9IUnTHwub-lX0,7822
|
|
10
10
|
microsoft_agents/hosting/core/middleware_set.py,sha256=TBsBs4KwAfKyHlQTlG4bl1y5UjkBzeMDs5w7LNB-Bi4,2585
|
|
11
|
-
microsoft_agents/hosting/core/rest_channel_service_client_factory.py,sha256=
|
|
12
|
-
microsoft_agents/hosting/core/turn_context.py,sha256=
|
|
13
|
-
microsoft_agents/hosting/core/_oauth/__init__.py,sha256=
|
|
14
|
-
microsoft_agents/hosting/core/_oauth/_flow_state.py,sha256=
|
|
11
|
+
microsoft_agents/hosting/core/rest_channel_service_client_factory.py,sha256=afLeWgLz9N417Egc_6LBfnYNiuuwTEcSBefeOvTQ_H4,6217
|
|
12
|
+
microsoft_agents/hosting/core/turn_context.py,sha256=muA8S4R6Xxja5it7DiFqr5J5zmttwDN-Mj5_SDdxZ4A,14874
|
|
13
|
+
microsoft_agents/hosting/core/_oauth/__init__.py,sha256=sU1HsIXbETRYwnudtFc6GrNbM6C3oYjmruqXc6kIAFw,405
|
|
14
|
+
microsoft_agents/hosting/core/_oauth/_flow_state.py,sha256=BQbXn0a3Fw4aozS-WSjL0Y7vEdb4eua1ZitSr0qZ6bE,2207
|
|
15
15
|
microsoft_agents/hosting/core/_oauth/_flow_storage_client.py,sha256=1MLD8m_qw0jSLqsyNaaWHm7aFkdjNWOE7xhV1rfbU64,3413
|
|
16
|
-
microsoft_agents/hosting/core/_oauth/_oauth_flow.py,sha256=
|
|
17
|
-
microsoft_agents/hosting/core/app/__init__.py,sha256=
|
|
18
|
-
microsoft_agents/hosting/core/app/
|
|
16
|
+
microsoft_agents/hosting/core/_oauth/_oauth_flow.py,sha256=vgg_sQLYr83YA0F7aQ1K5j8vEATw7ZS151ODkpCGYAM,12211
|
|
17
|
+
microsoft_agents/hosting/core/app/__init__.py,sha256=GZQdog7BBMA8uD9iaRMNeRJf12rJZB3bAKFAD8Y8dVo,1228
|
|
18
|
+
microsoft_agents/hosting/core/app/_type_defs.py,sha256=b5VZFWnQ5ONUZMtFxw7Q-mbbxIUSJ7RXcCXjqdHwSQw,438
|
|
19
|
+
microsoft_agents/hosting/core/app/agent_application.py,sha256=yYAVFkn4VWO5ZzrXdGFR4UheYMD5xP28HCxWPeJz8wA,31560
|
|
19
20
|
microsoft_agents/hosting/core/app/app_error.py,sha256=JgYBgv2EKe9Q2TFi5FeG_RneulBEa5SyBpWSF-duBzE,301
|
|
20
21
|
microsoft_agents/hosting/core/app/app_options.py,sha256=P3XTFFuQCnEcHixfdmr5RPG-Wli4c1VSmCMRKVBBLsw,2792
|
|
21
|
-
microsoft_agents/hosting/core/app/input_file.py,sha256=
|
|
22
|
+
microsoft_agents/hosting/core/app/input_file.py,sha256=AEzVAnAPO1V7MWDI_uoZfcYY8Oog3XgvEpAeO-tATeY,1546
|
|
22
23
|
microsoft_agents/hosting/core/app/query.py,sha256=lToDWFG7exUyPC5zxvna89013fDPKrUGOI8jyWFoUYk,328
|
|
23
|
-
microsoft_agents/hosting/core/app/
|
|
24
|
-
microsoft_agents/hosting/core/app/
|
|
25
|
-
microsoft_agents/hosting/core/app/
|
|
26
|
-
microsoft_agents/hosting/core/app/
|
|
27
|
-
microsoft_agents/hosting/core/app/
|
|
28
|
-
microsoft_agents/hosting/core/app/oauth/
|
|
29
|
-
microsoft_agents/hosting/core/app/oauth/
|
|
30
|
-
microsoft_agents/hosting/core/app/oauth/
|
|
31
|
-
microsoft_agents/hosting/core/app/oauth/
|
|
32
|
-
microsoft_agents/hosting/core/app/oauth/
|
|
33
|
-
microsoft_agents/hosting/core/app/oauth/_handlers/
|
|
24
|
+
microsoft_agents/hosting/core/app/typing_indicator.py,sha256=LwwuSJC2KXclO6GkSg0P80MUsf6ClQFzOyx3SSI9Yd0,2460
|
|
25
|
+
microsoft_agents/hosting/core/app/_routes/__init__.py,sha256=faz05Hk5Z1IGIXUwXljohym0lzE8nW3CbTpXlE-VcB0,300
|
|
26
|
+
microsoft_agents/hosting/core/app/_routes/_route.py,sha256=gs5XVi74H1wzDShpZd9ZXVDrREjricFYVPz10XrK06c,2669
|
|
27
|
+
microsoft_agents/hosting/core/app/_routes/_route_list.py,sha256=fe1-wmFaJJqYkWFcbNhJ9OMH954TneQR0-uoxyKQVlU,874
|
|
28
|
+
microsoft_agents/hosting/core/app/_routes/route_rank.py,sha256=-UwmLMCtgLT2cWnWvLfE2puV0RuQfI2m3WyEvkBkSBg,324
|
|
29
|
+
microsoft_agents/hosting/core/app/oauth/__init__.py,sha256=eHx-vmW2Ew8HULSfvAmV8F9TBXXLcTPsBe3XP4JEDdY,556
|
|
30
|
+
microsoft_agents/hosting/core/app/oauth/_sign_in_response.py,sha256=H5VBX69WiYXGALzCDVnF_-Y0brbafbJgfF4mS2wZSr0,851
|
|
31
|
+
microsoft_agents/hosting/core/app/oauth/_sign_in_state.py,sha256=lC2otIFcQthAZ8kqkYxV3wLBPOqzW9MRVUbdqQPtEdM,1159
|
|
32
|
+
microsoft_agents/hosting/core/app/oauth/auth_handler.py,sha256=KyhEfpKtoVKcapOt4szpDdbgk_KSwXF46GGOeJrmsRI,3464
|
|
33
|
+
microsoft_agents/hosting/core/app/oauth/authorization.py,sha256=_sdCZcZ7iciwTZqXTHFOK4vWWbCgSIDv3it30fzPI8w,18246
|
|
34
|
+
microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py,sha256=ZQuXF-IZrJv_hOgt-sdRFAUyIpRXaYqYBuyEJWJRcfU,376
|
|
35
|
+
microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py,sha256=W36Y1m0zFaRmdt-cL3ZKoHxx95y0O7YJF9D0cXx_s24,4185
|
|
36
|
+
microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py,sha256=o_pn5ZO7O-YvcC5NGlUgcCmVLD-f6KwQ5CRIsPp8zQE,10186
|
|
37
|
+
microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py,sha256=4EgZxSMoymgap54xhoEQH0UIEBap-mMCiP6eFeanr3A,7253
|
|
34
38
|
microsoft_agents/hosting/core/app/state/__init__.py,sha256=aL_8GB7_de8LUSEOgTJQFRx1kvgvJHHJVv7nWAoRPmU,331
|
|
35
39
|
microsoft_agents/hosting/core/app/state/conversation_state.py,sha256=LfcSwvhaU0JeAahwg9YA9uz0kKHa9c6Y3XBAWqwuMg0,1593
|
|
36
|
-
microsoft_agents/hosting/core/app/state/state.py,sha256
|
|
40
|
+
microsoft_agents/hosting/core/app/state/state.py,sha256=Q1GMGTdIGpu5Z4_6HPCfhJaD265oBlv6DMNNBCUyG3U,7372
|
|
37
41
|
microsoft_agents/hosting/core/app/state/temp_state.py,sha256=Oh7K5-uYf50Z-lBXqttSMl2N1lRakktOmjLlIAKcEsM,3501
|
|
38
42
|
microsoft_agents/hosting/core/app/state/turn_state.py,sha256=rEIRkwBsn3MPbrfKNjX8XqqbF-4THepMXU75KvDsBvM,9868
|
|
39
43
|
microsoft_agents/hosting/core/authorization/__init__.py,sha256=pOTmTJFS5CMPEcHRadBTgrbWUP5lOIxsPMgTreFq7mw,634
|
|
40
|
-
microsoft_agents/hosting/core/authorization/access_token_provider_base.py,sha256=
|
|
41
|
-
microsoft_agents/hosting/core/authorization/agent_auth_configuration.py,sha256=
|
|
42
|
-
microsoft_agents/hosting/core/authorization/anonymous_token_provider.py,sha256=
|
|
43
|
-
microsoft_agents/hosting/core/authorization/auth_types.py,sha256=
|
|
44
|
+
microsoft_agents/hosting/core/authorization/access_token_provider_base.py,sha256=Z0nGkfOUSIBvJSFjGGNQEd1-upqZVjT6eSXsqsFa2Cc,1646
|
|
45
|
+
microsoft_agents/hosting/core/authorization/agent_auth_configuration.py,sha256=meLUO0Mwb9SBr01dLvYS9q3xuZyndCsb_gIx0r7__Sk,2944
|
|
46
|
+
microsoft_agents/hosting/core/authorization/anonymous_token_provider.py,sha256=44XKaSLJFZj4hCSAdWAtW1R31M5QCZVaFKJaxcwx5h4,1076
|
|
47
|
+
microsoft_agents/hosting/core/authorization/auth_types.py,sha256=Fg_ywEItm3xL_DBUNzi0QsfDPVY5S3HlAiNw6I2SW64,374
|
|
44
48
|
microsoft_agents/hosting/core/authorization/authentication_constants.py,sha256=ABEwosDCMYhubDiGrD8QULboTkACqDvNp_x_XBPt6dQ,4618
|
|
45
49
|
microsoft_agents/hosting/core/authorization/claims_identity.py,sha256=ttnJpQx-2uAlwby_xRRmyHmyUPjzQjW86GO9FVzZK3Y,2501
|
|
46
|
-
microsoft_agents/hosting/core/authorization/connections.py,sha256=
|
|
47
|
-
microsoft_agents/hosting/core/authorization/jwt_token_validator.py,sha256=
|
|
50
|
+
microsoft_agents/hosting/core/authorization/connections.py,sha256=f_NQpuJzhCBNZLk56SK4kvb_V_g2x2XMnFwWbYyDX_s,1247
|
|
51
|
+
microsoft_agents/hosting/core/authorization/jwt_token_validator.py,sha256=b440T7y1tM7gPUQZ27EA3SgNiaEupxz56E6773gL5Zo,2025
|
|
48
52
|
microsoft_agents/hosting/core/client/__init__.py,sha256=HMWtSUXu1akaX6qtDx412Lr8vLi5SEslc-DYrvZAPWs,1299
|
|
49
|
-
microsoft_agents/hosting/core/client/agent_conversation_reference.py,sha256=
|
|
50
|
-
microsoft_agents/hosting/core/client/channel_factory_protocol.py,sha256=
|
|
51
|
-
microsoft_agents/hosting/core/client/channel_host_protocol.py,sha256=
|
|
52
|
-
microsoft_agents/hosting/core/client/channel_info_protocol.py,sha256=
|
|
53
|
-
microsoft_agents/hosting/core/client/channel_protocol.py,sha256=
|
|
54
|
-
microsoft_agents/hosting/core/client/channels_configuration.py,sha256=
|
|
55
|
-
microsoft_agents/hosting/core/client/configuration_channel_host.py,sha256=
|
|
56
|
-
microsoft_agents/hosting/core/client/conversation_constants.py,sha256=
|
|
57
|
-
microsoft_agents/hosting/core/client/conversation_id_factory.py,sha256=
|
|
58
|
-
microsoft_agents/hosting/core/client/conversation_id_factory_options.py,sha256=
|
|
59
|
-
microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py,sha256=
|
|
60
|
-
microsoft_agents/hosting/core/client/http_agent_channel.py,sha256=
|
|
61
|
-
microsoft_agents/hosting/core/client/http_agent_channel_factory.py,sha256=
|
|
53
|
+
microsoft_agents/hosting/core/client/agent_conversation_reference.py,sha256=3Zf3IGbJVWv4pF6kA6vtWkpV3Ap3z6jVkimeEtFMvJI,288
|
|
54
|
+
microsoft_agents/hosting/core/client/channel_factory_protocol.py,sha256=r270WJwySugnzY4AITT8oSRQHKqeqYAknkmD2eq_CqA,394
|
|
55
|
+
microsoft_agents/hosting/core/client/channel_host_protocol.py,sha256=jLJvNkOPFdWQUBK9CioGEDUm-PSfiEsC9k2t71jkcGA,776
|
|
56
|
+
microsoft_agents/hosting/core/client/channel_info_protocol.py,sha256=2KuQnQP5ndP5r_mxNc6VAYTsT3gLIORbG1WkrOn5rv8,279
|
|
57
|
+
microsoft_agents/hosting/core/client/channel_protocol.py,sha256=aZ_gqsL_mNRKDijPBnpS7MdkDjlQKiJjnBD9oy_VqVo,587
|
|
58
|
+
microsoft_agents/hosting/core/client/channels_configuration.py,sha256=CwDba8Gnkf5QKiqfOmhWAgzKpnpLfI82vuSprJnECKw,1084
|
|
59
|
+
microsoft_agents/hosting/core/client/configuration_channel_host.py,sha256=RhTts12p-HWttyREOJ1mFqJIEj1Rg-UFXdTVeIYL_7s,2510
|
|
60
|
+
microsoft_agents/hosting/core/client/conversation_constants.py,sha256=kupyCwqxb4PStM9JNSz4E7X97jEhXGKF_l6Cu5WUQrU,213
|
|
61
|
+
microsoft_agents/hosting/core/client/conversation_id_factory.py,sha256=iwIPUlpWiLOwwAB92fdkHQdgXD85LUOatLHtqL3iIi8,2592
|
|
62
|
+
microsoft_agents/hosting/core/client/conversation_id_factory_options.py,sha256=rDZg-hPtTjrHxknYHHgegmYaVm2gvYuNawrB6mjOa4U,633
|
|
63
|
+
microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py,sha256=fjQawuVwiQm-pdDMDZBUIdlnKyPe1gg-0tN3fNxrMr8,1323
|
|
64
|
+
microsoft_agents/hosting/core/client/http_agent_channel.py,sha256=2D2sjw8HtZvp_43xDjTLXp6_DLNrXziYhNmob14RwCM,3634
|
|
65
|
+
microsoft_agents/hosting/core/client/http_agent_channel_factory.py,sha256=ESY2EJwZMdSAa5I06pFHc89vO5Lflp86O6wJAnfz2qI,523
|
|
62
66
|
microsoft_agents/hosting/core/connector/__init__.py,sha256=Dkc1GAviMYXw5BFvP6xgVhrb1UJUuLiHbfEkjminnOc,522
|
|
63
67
|
microsoft_agents/hosting/core/connector/agent_sign_in_base.py,sha256=Bk3Ssg3ilk1Ld2mSjsCYgfqvy6pq1us9Ja2j4lF7CTc,647
|
|
64
68
|
microsoft_agents/hosting/core/connector/attachments_base.py,sha256=eqr5dbrc7oE77xeFfr-5UIi4gkDvOp5zWbZ02Qb4IDI,507
|
|
65
69
|
microsoft_agents/hosting/core/connector/connector_client_base.py,sha256=DKog6C1Z8V9r_Lp-IvXUiAbJN_iJMFary5FvejjHlaw,583
|
|
66
70
|
microsoft_agents/hosting/core/connector/conversations_base.py,sha256=fM5PCDaSkxMPatNo4WTcbjxLfrHydd51WX9_2_2F-DM,3754
|
|
67
71
|
microsoft_agents/hosting/core/connector/get_product_info.py,sha256=SDxPqBCzzQLEUsaZ4S9lB95ibo9LMGd1-K5Uf7vcAwo,962
|
|
68
|
-
microsoft_agents/hosting/core/connector/user_token_base.py,sha256=
|
|
69
|
-
microsoft_agents/hosting/core/connector/user_token_client_base.py,sha256=
|
|
72
|
+
microsoft_agents/hosting/core/connector/user_token_base.py,sha256=h_l5D1SghN2RrUkFcKWQhCHlO9r7akMbzsm2x8MvomI,3639
|
|
73
|
+
microsoft_agents/hosting/core/connector/user_token_client_base.py,sha256=dfUTUsBNOzWze9_JldAeLe73sydSDzlKyMKMvj48g2E,471
|
|
70
74
|
microsoft_agents/hosting/core/connector/client/__init__.py,sha256=6JdKhmm7btmo0omxMBd8PJbtGFk0cnMwVUoStyW7Ft0,143
|
|
71
|
-
microsoft_agents/hosting/core/connector/client/connector_client.py,sha256=
|
|
72
|
-
microsoft_agents/hosting/core/connector/client/user_token_client.py,sha256=
|
|
75
|
+
microsoft_agents/hosting/core/connector/client/connector_client.py,sha256=nnKlXw98lB_eoTYMaHKc7PtxSKW3G6jUxCPFe4pdjSI,23398
|
|
76
|
+
microsoft_agents/hosting/core/connector/client/user_token_client.py,sha256=1ey1mqV7pkC94Xl36PVrx5TOyumJQbpscbm2W9uvpHs,10609
|
|
73
77
|
microsoft_agents/hosting/core/connector/teams/__init__.py,sha256=3ZMPGYyZ15EwvfQzfJJQy1J58oIt4InSxibl3BN6R54,100
|
|
74
78
|
microsoft_agents/hosting/core/connector/teams/teams_connector_client.py,sha256=XGQDTYHrA_I9n9JlxGST5eesjsFhz2dnSaMSuyoFnKU,12676
|
|
75
79
|
microsoft_agents/hosting/core/state/__init__.py,sha256=yckKi1wg_86ng-DL9Q3R49QiWKvNjPkVNk6HClWgVrY,208
|
|
76
|
-
microsoft_agents/hosting/core/state/agent_state.py,sha256=
|
|
80
|
+
microsoft_agents/hosting/core/state/agent_state.py,sha256=uboptWaC3VrSGTnXIzaO38XUqOT-ITW6EhJxuGMtKWs,13724
|
|
77
81
|
microsoft_agents/hosting/core/state/state_property_accessor.py,sha256=kpiNnzkZ6el-oRITRbRkk1Faa_CPFxpJQdvSGxIJP70,1392
|
|
78
82
|
microsoft_agents/hosting/core/state/user_state.py,sha256=zEigX-sroNAyoQAxQjG1OgmJQKjk1zOkdeqylFg7M2E,1484
|
|
79
83
|
microsoft_agents/hosting/core/storage/__init__.py,sha256=Df_clI0uMRgcr4Td-xkP83bU_mGae7_gRMhtVDPZDmE,729
|
|
80
84
|
microsoft_agents/hosting/core/storage/_type_aliases.py,sha256=VCKtjiCBrhEsGSm3zVVSSccdoiY02GYhABvrLjhAcz8,72
|
|
81
|
-
microsoft_agents/hosting/core/storage/error_handling.py,sha256=
|
|
82
|
-
microsoft_agents/hosting/core/storage/memory_storage.py,sha256=
|
|
83
|
-
microsoft_agents/hosting/core/storage/storage.py,sha256=
|
|
84
|
-
microsoft_agents/hosting/core/storage/store_item.py,sha256=
|
|
85
|
-
microsoft_agents/hosting/core/storage/transcript_file_store.py,sha256=
|
|
85
|
+
microsoft_agents/hosting/core/storage/error_handling.py,sha256=kTMQ68GxL4GgVKpo3SexzyRARLw6UbsVhHU723XxIck,1360
|
|
86
|
+
microsoft_agents/hosting/core/storage/memory_storage.py,sha256=5AZ2QQ3TagVCHCKp0GEVAIuDswDGHgbgnUZgS9YbPAI,2448
|
|
87
|
+
microsoft_agents/hosting/core/storage/storage.py,sha256=bt93jItMQKC9NJlcmxPtcE67MvnibolcFwvV1LFwliI,3322
|
|
88
|
+
microsoft_agents/hosting/core/storage/store_item.py,sha256=rjtzB5yufsKuY1O5PjCqWHjjmO6UiORwkzpwbsaxp_4,371
|
|
89
|
+
microsoft_agents/hosting/core/storage/transcript_file_store.py,sha256=eJdcU6BgMbvFYunWul2CZURH762HmUr11iUN7NgvZek,10045
|
|
86
90
|
microsoft_agents/hosting/core/storage/transcript_info.py,sha256=5VN32j99tshChAffvuZ6D3GH3ABCZsQGHC_bYDAwFOk,328
|
|
87
91
|
microsoft_agents/hosting/core/storage/transcript_logger.py,sha256=_atDk3CJ05fIVMhlWGNa91IiM9bGLmOhasFko8Lxjhk,8237
|
|
88
92
|
microsoft_agents/hosting/core/storage/transcript_memory_store.py,sha256=v1Ud9LSs8m5c9_Fa8i49SuAjw80dX1hDciqbRduDEOE,6444
|
|
89
93
|
microsoft_agents/hosting/core/storage/transcript_store.py,sha256=ka74o0WvI5GhMZcFqSxVdamBhGzZcDZe6VNkG-sMy74,1944
|
|
90
|
-
microsoft_agents_hosting_core-0.
|
|
91
|
-
microsoft_agents_hosting_core-0.
|
|
92
|
-
microsoft_agents_hosting_core-0.
|
|
93
|
-
microsoft_agents_hosting_core-0.
|
|
94
|
+
microsoft_agents_hosting_core-0.5.0.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
|
|
95
|
+
microsoft_agents_hosting_core-0.5.0.dist-info/METADATA,sha256=4ompSPMI8GFDYDA82PHNL2KtLd8uv8b96dgyBLE260k,9232
|
|
96
|
+
microsoft_agents_hosting_core-0.5.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
97
|
+
microsoft_agents_hosting_core-0.5.0.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
|
|
98
|
+
microsoft_agents_hosting_core-0.5.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
Licensed under the MIT License.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
from __future__ import annotations
|
|
7
|
-
|
|
8
|
-
from typing import Awaitable, Callable, Generic, List, TypeVar
|
|
9
|
-
|
|
10
|
-
from microsoft_agents.hosting.core import TurnContext
|
|
11
|
-
from .state import TurnState
|
|
12
|
-
|
|
13
|
-
StateT = TypeVar("StateT", bound=TurnState)
|
|
14
|
-
RouteHandler = Callable[[TurnContext, StateT], Awaitable[None]]
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class Route(Generic[StateT]):
|
|
18
|
-
selector: Callable[[TurnContext], bool]
|
|
19
|
-
handler: RouteHandler[StateT]
|
|
20
|
-
is_invoke: bool
|
|
21
|
-
|
|
22
|
-
def __init__(
|
|
23
|
-
self,
|
|
24
|
-
selector: Callable[[TurnContext], bool],
|
|
25
|
-
handler: RouteHandler,
|
|
26
|
-
is_invoke: bool = False,
|
|
27
|
-
auth_handlers: List[str] = None,
|
|
28
|
-
) -> None:
|
|
29
|
-
self.selector = selector
|
|
30
|
-
self.handler = handler
|
|
31
|
-
self.is_invoke = is_invoke
|
|
32
|
-
self.auth_handlers = auth_handlers or []
|