microsoft-agents-hosting-core 0.5.0.dev3__py3-none-any.whl → 0.5.0.dev7__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/activity_handler.py +8 -6
- microsoft_agents/hosting/core/app/agent_application.py +28 -3
- microsoft_agents/hosting/core/app/oauth/authorization.py +38 -20
- microsoft_agents/hosting/core/app/state/state.py +50 -6
- microsoft_agents/hosting/core/channel_service_adapter.py +64 -6
- microsoft_agents_hosting_core-0.5.0.dev7.dist-info/METADATA +168 -0
- {microsoft_agents_hosting_core-0.5.0.dev3.dist-info → microsoft_agents_hosting_core-0.5.0.dev7.dist-info}/RECORD +10 -9
- microsoft_agents_hosting_core-0.5.0.dev7.dist-info/licenses/LICENSE +21 -0
- microsoft_agents_hosting_core-0.5.0.dev3.dist-info/METADATA +0 -16
- {microsoft_agents_hosting_core-0.5.0.dev3.dist-info → microsoft_agents_hosting_core-0.5.0.dev7.dist-info}/WHEEL +0 -0
- {microsoft_agents_hosting_core-0.5.0.dev3.dist-info → microsoft_agents_hosting_core-0.5.0.dev7.dist-info}/top_level.txt +0 -0
|
@@ -176,7 +176,7 @@ class ActivityHandler(Agent):
|
|
|
176
176
|
|
|
177
177
|
:param members_added: A list of all the members added to the conversation, as described by the
|
|
178
178
|
conversation update activity
|
|
179
|
-
:type members_added: list[ChannelAccount]
|
|
179
|
+
:type members_added: list[:class:`microsoft_agents.activity.ChannelAccount`]
|
|
180
180
|
:param turn_context: The context object for this turn
|
|
181
181
|
:type turn_context: :class:`microsoft_agents.activity.TurnContextProtocol`
|
|
182
182
|
:returns: A task that represents the work queued to execute
|
|
@@ -195,9 +195,9 @@ class ActivityHandler(Agent):
|
|
|
195
195
|
Override this method in a derived class to provide logic for when members other than the agent leave
|
|
196
196
|
the conversation. You can add your agent's good-bye logic.
|
|
197
197
|
|
|
198
|
-
:param
|
|
198
|
+
:param members_removed: A list of all the members removed from the conversation, as described by the
|
|
199
199
|
conversation update activity
|
|
200
|
-
:type
|
|
200
|
+
:type members_removed: list[:class:`microsoft_agents.activity.ChannelAccount`]
|
|
201
201
|
:param turn_context: The context object for this turn
|
|
202
202
|
:type turn_context: :class:`microsoft_agents.activity.TurnContextProtocol`
|
|
203
203
|
:returns: A task that represents the work queued to execute
|
|
@@ -260,7 +260,7 @@ class ActivityHandler(Agent):
|
|
|
260
260
|
are added to the conversation.
|
|
261
261
|
|
|
262
262
|
:param message_reactions: The list of reactions added
|
|
263
|
-
:type message_reactions: list[MessageReaction]
|
|
263
|
+
:type message_reactions: list[:class:`microsoft_agents.activity.MessageReaction`]
|
|
264
264
|
:param turn_context: The context object for this turn
|
|
265
265
|
:type turn_context: :class:`microsoft_agents.activity.TurnContextProtocol`
|
|
266
266
|
:returns: A task that represents the work queued to execute
|
|
@@ -285,7 +285,7 @@ class ActivityHandler(Agent):
|
|
|
285
285
|
are removed from the conversation.
|
|
286
286
|
|
|
287
287
|
:param message_reactions: The list of reactions removed
|
|
288
|
-
:type message_reactions: list[MessageReaction]
|
|
288
|
+
:type message_reactions: list[:class:`microsoft_agents.activity.MessageReaction`]
|
|
289
289
|
:param turn_context: The context object for this turn
|
|
290
290
|
:type turn_context: :class:`microsoft_agents.activity.TurnContextProtocol`
|
|
291
291
|
|
|
@@ -459,6 +459,7 @@ class ActivityHandler(Agent):
|
|
|
459
459
|
:type turn_context: :class:`microsoft_agents.activity.TurnContextProtocol`
|
|
460
460
|
|
|
461
461
|
:returns: A task that represents the work queued to execute
|
|
462
|
+
:rtype: Optional[:class:`microsoft_agents.activity.InvokeResponse`]
|
|
462
463
|
"""
|
|
463
464
|
try:
|
|
464
465
|
if (
|
|
@@ -510,8 +511,9 @@ class ActivityHandler(Agent):
|
|
|
510
511
|
:param turn_context: A context object for this turn.
|
|
511
512
|
:type turn_context: :class:`microsoft_agents.activity.TurnContextProtocol`
|
|
512
513
|
:param invoke_value: A string-typed object from the incoming activity's value.
|
|
513
|
-
:type invoke_value: :class:`microsoft_agents.activity.
|
|
514
|
+
:type invoke_value: :class:`microsoft_agents.activity.AdaptiveCardInvokeValue`
|
|
514
515
|
:return: The HealthCheckResponse object
|
|
516
|
+
:rtype: :class:`microsoft_agents.activity.AdaptiveCardInvokeResponse`
|
|
515
517
|
"""
|
|
516
518
|
raise _InvokeResponseException(HTTPStatus.NOT_IMPLEMENTED)
|
|
517
519
|
|
|
@@ -83,6 +83,15 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
83
83
|
) -> None:
|
|
84
84
|
"""
|
|
85
85
|
Creates a new AgentApplication instance.
|
|
86
|
+
|
|
87
|
+
:param options: Configuration options for the application.
|
|
88
|
+
:type options: Optional[:class:`microsoft_agents.hosting.core.app.app_options.ApplicationOptions`]
|
|
89
|
+
:param connection_manager: OAuth connection manager.
|
|
90
|
+
:type connection_manager: Optional[:class:`microsoft_agents.hosting.core.authorization.Connections`]
|
|
91
|
+
:param authorization: Authorization manager for handling authentication flows.
|
|
92
|
+
:type authorization: Optional[:class:`microsoft_agents.hosting.core.app.oauth.Authorization`]
|
|
93
|
+
:param kwargs: Additional configuration parameters.
|
|
94
|
+
:type kwargs: Any
|
|
86
95
|
"""
|
|
87
96
|
self.typing = TypingIndicator()
|
|
88
97
|
self._route_list = _RouteList[StateT]()
|
|
@@ -161,6 +170,10 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
161
170
|
def adapter(self) -> ChannelServiceAdapter:
|
|
162
171
|
"""
|
|
163
172
|
The bot's adapter.
|
|
173
|
+
|
|
174
|
+
:return: The channel service adapter for the bot.
|
|
175
|
+
:rtype: :class:`microsoft_agents.hosting.core.channel_service_adapter.ChannelServiceAdapter`
|
|
176
|
+
:raises ApplicationError: If the adapter is not configured.
|
|
164
177
|
"""
|
|
165
178
|
|
|
166
179
|
if not self._adapter:
|
|
@@ -181,6 +194,10 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
181
194
|
def auth(self) -> Authorization:
|
|
182
195
|
"""
|
|
183
196
|
The application's authentication manager
|
|
197
|
+
|
|
198
|
+
:return: The authentication manager for handling OAuth flows.
|
|
199
|
+
:rtype: :class:`microsoft_agents.hosting.core.app.oauth.Authorization`
|
|
200
|
+
:raises ApplicationError: If authentication is not configured.
|
|
184
201
|
"""
|
|
185
202
|
if not self._auth:
|
|
186
203
|
logger.error(
|
|
@@ -200,6 +217,9 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
200
217
|
def options(self) -> ApplicationOptions:
|
|
201
218
|
"""
|
|
202
219
|
The application's configured options.
|
|
220
|
+
|
|
221
|
+
:return: The configuration options for the application.
|
|
222
|
+
:rtype: :class:`microsoft_agents.hosting.core.app.app_options.ApplicationOptions`
|
|
203
223
|
"""
|
|
204
224
|
return self._options
|
|
205
225
|
|
|
@@ -217,16 +237,16 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
217
237
|
Routes are ordered by: is_agentic, is_invoke, rank (lower is higher priority), in that order.
|
|
218
238
|
|
|
219
239
|
:param selector: A function that takes a TurnContext and returns a boolean indicating whether the route should be selected.
|
|
220
|
-
:type selector: RouteSelector
|
|
240
|
+
:type selector: :class:`microsoft_agents.hosting.core.app._type_defs.RouteSelector`
|
|
221
241
|
:param handler: A function that takes a TurnContext and a TurnState and returns an Awaitable.
|
|
222
|
-
:type handler: RouteHandler[StateT]
|
|
242
|
+
:type handler: :class:`microsoft_agents.hosting.core.app._type_defs.RouteHandler`[StateT]
|
|
223
243
|
:param is_invoke: Whether the route is for an invoke activity, defaults to False
|
|
224
244
|
:type is_invoke: bool, Optional
|
|
225
245
|
:param is_agentic: Whether the route is for an agentic request, defaults to False. For agentic requests
|
|
226
246
|
the selector will include a new check for `context.activity.is_agentic_request()`.
|
|
227
247
|
:type is_agentic: bool, Optional
|
|
228
248
|
:param rank: The rank of the route, defaults to RouteRank.DEFAULT
|
|
229
|
-
:type rank: RouteRank
|
|
249
|
+
:type rank: :class:`microsoft_agents.hosting.core.app._routes.RouteRank`, Optional
|
|
230
250
|
:param auth_handlers: A list of authentication handler IDs to use for this route, defaults to None
|
|
231
251
|
:type auth_handlers: Optional[list[str]], Optional
|
|
232
252
|
:raises ApplicationError: If the selector or handler are not valid.
|
|
@@ -706,6 +726,11 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
706
726
|
def parse_env_vars_configuration(vars: dict[str, Any]) -> dict:
|
|
707
727
|
"""
|
|
708
728
|
Parses environment variables and returns a dictionary with the relevant configuration.
|
|
729
|
+
|
|
730
|
+
:param vars: Dictionary of environment variable names and values.
|
|
731
|
+
:type vars: dict[str, Any]
|
|
732
|
+
:return: Parsed configuration dictionary with nested structure.
|
|
733
|
+
:rtype: dict
|
|
709
734
|
"""
|
|
710
735
|
result = {}
|
|
711
736
|
for key, value in vars.items():
|
|
@@ -55,11 +55,11 @@ class Authorization:
|
|
|
55
55
|
only if auth_handlers is empty or None.
|
|
56
56
|
|
|
57
57
|
:param storage: The storage system to use for state management.
|
|
58
|
-
:type storage: Storage
|
|
58
|
+
:type storage: :class:`microsoft_agents.hosting.core.storage.Storage`
|
|
59
59
|
:param connection_manager: The connection manager for OAuth providers.
|
|
60
|
-
:type connection_manager: Connections
|
|
60
|
+
:type connection_manager: :class:`microsoft_agents.hosting.core.authorization.Connections`
|
|
61
61
|
:param auth_handlers: Configuration for OAuth providers.
|
|
62
|
-
:type auth_handlers: dict[str, AuthHandler], Optional
|
|
62
|
+
:type auth_handlers: dict[str, :class:`microsoft_agents.hosting.core.app.oauth.auth_handler.AuthHandler`], Optional
|
|
63
63
|
:raises ValueError: When storage is None or no auth handlers provided.
|
|
64
64
|
"""
|
|
65
65
|
if not storage:
|
|
@@ -105,7 +105,7 @@ class Authorization:
|
|
|
105
105
|
it initializes an instance of each variant that is referenced.
|
|
106
106
|
|
|
107
107
|
:param auth_handlers: A dictionary of auth handler configurations.
|
|
108
|
-
:type auth_handlers: dict[str, AuthHandler]
|
|
108
|
+
:type auth_handlers: dict[str, :class:`microsoft_agents.hosting.core.app.oauth.auth_handler.AuthHandler`]
|
|
109
109
|
"""
|
|
110
110
|
for name, auth_handler in self._handler_settings.items():
|
|
111
111
|
auth_type = auth_handler.auth_type
|
|
@@ -126,26 +126,42 @@ class Authorization:
|
|
|
126
126
|
can be used to inspect or manipulate the state directly if needed.
|
|
127
127
|
|
|
128
128
|
:param context: The turn context for the current turn of conversation.
|
|
129
|
-
:type context: TurnContext
|
|
129
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
130
130
|
:return: A unique (across other values of channel_id and user_id) key for the sign-in state.
|
|
131
131
|
:rtype: str
|
|
132
132
|
"""
|
|
133
133
|
return f"auth:_SignInState:{context.activity.channel_id}:{context.activity.from_property.id}"
|
|
134
134
|
|
|
135
135
|
async def _load_sign_in_state(self, context: TurnContext) -> Optional[_SignInState]:
|
|
136
|
-
"""Load the sign-in state from storage for the given context.
|
|
136
|
+
"""Load the sign-in state from storage for the given context.
|
|
137
|
+
|
|
138
|
+
:param context: The turn context for the current turn of conversation.
|
|
139
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
140
|
+
:return: The sign-in state if found, None otherwise.
|
|
141
|
+
:rtype: Optional[:class:`microsoft_agents.hosting.core.app.oauth._sign_in_state._SignInState`]
|
|
142
|
+
"""
|
|
137
143
|
key = self._sign_in_state_key(context)
|
|
138
144
|
return (await self._storage.read([key], target_cls=_SignInState)).get(key)
|
|
139
145
|
|
|
140
146
|
async def _save_sign_in_state(
|
|
141
147
|
self, context: TurnContext, state: _SignInState
|
|
142
148
|
) -> None:
|
|
143
|
-
"""Save the sign-in state to storage for the given context.
|
|
149
|
+
"""Save the sign-in state to storage for the given context.
|
|
150
|
+
|
|
151
|
+
:param context: The turn context for the current turn of conversation.
|
|
152
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
153
|
+
:param state: The sign-in state to save.
|
|
154
|
+
:type state: :class:`microsoft_agents.hosting.core.app.oauth._sign_in_state._SignInState`
|
|
155
|
+
"""
|
|
144
156
|
key = self._sign_in_state_key(context)
|
|
145
157
|
await self._storage.write({key: state})
|
|
146
158
|
|
|
147
159
|
async def _delete_sign_in_state(self, context: TurnContext) -> None:
|
|
148
|
-
"""Delete the sign-in state from storage for the given context.
|
|
160
|
+
"""Delete the sign-in state from storage for the given context.
|
|
161
|
+
|
|
162
|
+
:param context: The turn context for the current turn of conversation.
|
|
163
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
164
|
+
"""
|
|
149
165
|
key = self._sign_in_state_key(context)
|
|
150
166
|
await self._storage.delete([key])
|
|
151
167
|
|
|
@@ -179,7 +195,7 @@ class Authorization:
|
|
|
179
195
|
:param handler_id: The ID of the auth handler to resolve.
|
|
180
196
|
:type handler_id: str
|
|
181
197
|
:return: The corresponding AuthorizationHandler instance.
|
|
182
|
-
:rtype:
|
|
198
|
+
:rtype: :class:`microsoft_agents.hosting.core.app.oauth._handlers._AuthorizationHandler`
|
|
183
199
|
:raises ValueError: If the handler ID is not recognized or not configured.
|
|
184
200
|
"""
|
|
185
201
|
if handler_id not in self._handlers:
|
|
@@ -200,13 +216,13 @@ class Authorization:
|
|
|
200
216
|
Storage is updated as needed with _SignInState data for caching purposes.
|
|
201
217
|
|
|
202
218
|
:param context: The turn context for the current turn of conversation.
|
|
203
|
-
:type context: TurnContext
|
|
219
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
204
220
|
:param state: The turn state for the current turn of conversation.
|
|
205
|
-
:type state: TurnState
|
|
221
|
+
:type state: :class:`microsoft_agents.hosting.core.app.state.turn_state.TurnState`
|
|
206
222
|
:param auth_handler_id: The ID of the auth handler to use for sign-in. If None, the first handler will be used.
|
|
207
223
|
:type auth_handler_id: str
|
|
208
224
|
:return: A _SignInResponse indicating the result of the sign-in attempt.
|
|
209
|
-
:rtype: _SignInResponse
|
|
225
|
+
:rtype: :class:`microsoft_agents.hosting.core.app.oauth._sign_in_response._SignInResponse`
|
|
210
226
|
"""
|
|
211
227
|
|
|
212
228
|
auth_handler_id = auth_handler_id or self._default_handler_id
|
|
@@ -250,7 +266,7 @@ class Authorization:
|
|
|
250
266
|
"""Attempts to sign out the user from a specified auth handler or the default handler.
|
|
251
267
|
|
|
252
268
|
:param context: The turn context for the current turn of conversation.
|
|
253
|
-
:type context: TurnContext
|
|
269
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
254
270
|
:param auth_handler_id: The ID of the auth handler to sign out from. If None, sign out from all handlers.
|
|
255
271
|
:type auth_handler_id: Optional[str]
|
|
256
272
|
:return: None
|
|
@@ -272,11 +288,11 @@ class Authorization:
|
|
|
272
288
|
from the cached _SignInState.
|
|
273
289
|
|
|
274
290
|
:param context: The context object for the current turn.
|
|
275
|
-
:type context: TurnContext
|
|
291
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
276
292
|
:param state: The turn state for the current turn.
|
|
277
|
-
:type state: TurnState
|
|
293
|
+
:type state: :class:`microsoft_agents.hosting.core.app.state.turn_state.TurnState`
|
|
278
294
|
:return: A tuple indicating whether the turn should be skipped and the continuation activity if applicable.
|
|
279
|
-
:rtype: tuple[bool, Optional[Activity]]
|
|
295
|
+
:rtype: tuple[bool, Optional[:class:`microsoft_agents.activity.Activity`]]
|
|
280
296
|
"""
|
|
281
297
|
sign_in_state = await self._load_sign_in_state(context)
|
|
282
298
|
|
|
@@ -306,11 +322,11 @@ class Authorization:
|
|
|
306
322
|
The token is taken from cache, so this does not initiate nor continue a sign-in flow.
|
|
307
323
|
|
|
308
324
|
:param context: The context object for the current turn.
|
|
309
|
-
:type context: TurnContext
|
|
325
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
310
326
|
:param auth_handler_id: The ID of the auth handler to get the token for.
|
|
311
327
|
:type auth_handler_id: str
|
|
312
328
|
:return: The token response from the OAuth provider.
|
|
313
|
-
:rtype: TokenResponse
|
|
329
|
+
:rtype: :class:`microsoft_agents.activity.TokenResponse`
|
|
314
330
|
"""
|
|
315
331
|
return await self.exchange_token(context, auth_handler_id=auth_handler_id)
|
|
316
332
|
|
|
@@ -324,7 +340,7 @@ class Authorization:
|
|
|
324
340
|
"""Exchanges or refreshes the token for a specific auth handler or the default handler.
|
|
325
341
|
|
|
326
342
|
:param context: The context object for the current turn.
|
|
327
|
-
:type context: TurnContext
|
|
343
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
328
344
|
:param scopes: The scopes to request during the token exchange or refresh. Defaults
|
|
329
345
|
to the list given in the AuthHandler configuration if None.
|
|
330
346
|
:type scopes: Optional[list[str]]
|
|
@@ -335,7 +351,7 @@ class Authorization:
|
|
|
335
351
|
the connection defined in the AuthHandler configuration will be used.
|
|
336
352
|
:type exchange_connection: Optional[str]
|
|
337
353
|
:return: The token response from the OAuth provider.
|
|
338
|
-
:rtype: TokenResponse
|
|
354
|
+
:rtype: :class:`microsoft_agents.activity.TokenResponse`
|
|
339
355
|
:raises ValueError: If the specified auth handler ID is not recognized or not configured.
|
|
340
356
|
"""
|
|
341
357
|
|
|
@@ -376,6 +392,7 @@ class Authorization:
|
|
|
376
392
|
Sets a handler to be called when sign-in is successfully completed.
|
|
377
393
|
|
|
378
394
|
:param handler: The handler function to call on successful sign-in.
|
|
395
|
+
:type handler: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`, :class:`microsoft_agents.hosting.core.app.state.turn_state.TurnState`, Optional[str]], Awaitable[None]]
|
|
379
396
|
"""
|
|
380
397
|
self._sign_in_success_handler = handler
|
|
381
398
|
|
|
@@ -387,5 +404,6 @@ class Authorization:
|
|
|
387
404
|
Sets a handler to be called when sign-in fails.
|
|
388
405
|
|
|
389
406
|
:param handler: The handler function to call on sign-in failure.
|
|
407
|
+
:type handler: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`, :class:`microsoft_agents.hosting.core.app.state.turn_state.TurnState`, Optional[str]], Awaitable[None]]
|
|
390
408
|
"""
|
|
391
409
|
self._sign_in_failure_handler = handler
|
|
@@ -97,9 +97,10 @@ class State(dict[str, StoreItem], ABC):
|
|
|
97
97
|
"""
|
|
98
98
|
Saves The State to Storage
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
:param _context: the turn context.
|
|
101
|
+
:type _context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
102
|
+
:param storage: storage to save to.
|
|
103
|
+
:type storage: Optional[:class:`microsoft_agents.hosting.core.storage.Storage`]
|
|
103
104
|
"""
|
|
104
105
|
|
|
105
106
|
if not storage or self.__key__ == "":
|
|
@@ -126,13 +127,24 @@ class State(dict[str, StoreItem], ABC):
|
|
|
126
127
|
"""
|
|
127
128
|
Loads The State from Storage
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
:param context: the turn context.
|
|
131
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
132
|
+
:param storage: storage to read from.
|
|
133
|
+
:type storage: Optional[:class:`microsoft_agents.hosting.core.storage.Storage`]
|
|
134
|
+
:return: The loaded state instance.
|
|
135
|
+
:rtype: :class:`microsoft_agents.hosting.core.app.state.state.State`
|
|
132
136
|
"""
|
|
133
137
|
return cls()
|
|
134
138
|
|
|
135
139
|
def create_property(self, name: str) -> _StatePropertyAccessor:
|
|
140
|
+
"""
|
|
141
|
+
Create a property accessor for the given name.
|
|
142
|
+
|
|
143
|
+
:param name: The name of the property.
|
|
144
|
+
:type name: str
|
|
145
|
+
:return: A state property accessor for the named property.
|
|
146
|
+
:rtype: :class:`microsoft_agents.hosting.core.state.state_property_accessor.StatePropertyAccessor`
|
|
147
|
+
"""
|
|
136
148
|
return StatePropertyAccessor(self, name)
|
|
137
149
|
|
|
138
150
|
def __setitem__(self, key: str, item: Any) -> None:
|
|
@@ -180,6 +192,14 @@ class StatePropertyAccessor(_StatePropertyAccessor):
|
|
|
180
192
|
_state: State
|
|
181
193
|
|
|
182
194
|
def __init__(self, state: State, name: str) -> None:
|
|
195
|
+
"""
|
|
196
|
+
Initialize the StatePropertyAccessor.
|
|
197
|
+
|
|
198
|
+
:param state: The state object to access properties from.
|
|
199
|
+
:type state: :class:`microsoft_agents.hosting.core.app.state.state.State`
|
|
200
|
+
:param name: The name of the property to access.
|
|
201
|
+
:type name: str
|
|
202
|
+
"""
|
|
183
203
|
self._name = name
|
|
184
204
|
self._state = state
|
|
185
205
|
|
|
@@ -190,6 +210,16 @@ class StatePropertyAccessor(_StatePropertyAccessor):
|
|
|
190
210
|
Union[Any, Callable[[], Optional[Any]]]
|
|
191
211
|
] = None,
|
|
192
212
|
) -> Optional[Any]:
|
|
213
|
+
"""
|
|
214
|
+
Get the property value from the state.
|
|
215
|
+
|
|
216
|
+
:param turn_context: The turn context.
|
|
217
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
218
|
+
:param default_value_or_factory: Default value or factory function to use if property doesn't exist.
|
|
219
|
+
:type default_value_or_factory: Optional[Union[Any, Callable[[], Optional[Any]]]]
|
|
220
|
+
:return: The property value or default value if not found.
|
|
221
|
+
:rtype: Optional[Any]
|
|
222
|
+
"""
|
|
193
223
|
value = self._state[self._name] if self._name in self._state else None
|
|
194
224
|
|
|
195
225
|
if value is None and default_value_or_factory is not None:
|
|
@@ -201,7 +231,21 @@ class StatePropertyAccessor(_StatePropertyAccessor):
|
|
|
201
231
|
return value
|
|
202
232
|
|
|
203
233
|
async def delete(self, turn_context: TurnContext) -> None:
|
|
234
|
+
"""
|
|
235
|
+
Delete the property from the state.
|
|
236
|
+
|
|
237
|
+
:param turn_context: The turn context.
|
|
238
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
239
|
+
"""
|
|
204
240
|
del self._state[self._name]
|
|
205
241
|
|
|
206
242
|
async def set(self, turn_context: TurnContext, value: Any) -> None:
|
|
243
|
+
"""
|
|
244
|
+
Set the property value in the state.
|
|
245
|
+
|
|
246
|
+
:param turn_context: The turn context.
|
|
247
|
+
:type turn_context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
248
|
+
:param value: The value to set for the property.
|
|
249
|
+
:type value: Any
|
|
250
|
+
"""
|
|
207
251
|
self._state[self._name] = value
|
|
@@ -44,12 +44,29 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
44
44
|
_AGENT_CONNECTOR_CLIENT_KEY = "ConnectorClient"
|
|
45
45
|
|
|
46
46
|
def __init__(self, channel_service_client_factory: ChannelServiceClientFactoryBase):
|
|
47
|
+
"""
|
|
48
|
+
Initialize the ChannelServiceAdapter.
|
|
49
|
+
|
|
50
|
+
:param channel_service_client_factory: The factory for creating channel service clients.
|
|
51
|
+
:type channel_service_client_factory: :class:`microsoft_agents.hosting.core.channel_service_client_factory_base.ChannelServiceClientFactoryBase`
|
|
52
|
+
"""
|
|
47
53
|
super().__init__()
|
|
48
54
|
self._channel_service_client_factory = channel_service_client_factory
|
|
49
55
|
|
|
50
56
|
async def send_activities(
|
|
51
57
|
self, context: TurnContext, activities: list[Activity]
|
|
52
58
|
) -> list[ResourceResponse]:
|
|
59
|
+
"""
|
|
60
|
+
Send a list of activities to the conversation.
|
|
61
|
+
|
|
62
|
+
:param context: The turn context for this conversation turn.
|
|
63
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
64
|
+
:param activities: The list of activities to send.
|
|
65
|
+
:type activities: list[:class:`microsoft_agents.activity.Activity`]
|
|
66
|
+
:return: List of resource responses for the sent activities.
|
|
67
|
+
:rtype: list[:class:`microsoft_agents.activity.ResourceResponse`]
|
|
68
|
+
:raises TypeError: If context or activities are None/invalid.
|
|
69
|
+
"""
|
|
53
70
|
if not context:
|
|
54
71
|
raise TypeError("Expected TurnContext but got None instead")
|
|
55
72
|
|
|
@@ -102,6 +119,17 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
102
119
|
return responses
|
|
103
120
|
|
|
104
121
|
async def update_activity(self, context: TurnContext, activity: Activity):
|
|
122
|
+
"""
|
|
123
|
+
Update an existing activity in the conversation.
|
|
124
|
+
|
|
125
|
+
:param context: The turn context for this conversation turn.
|
|
126
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
127
|
+
:param activity: The activity to update.
|
|
128
|
+
:type activity: :class:`microsoft_agents.activity.Activity`
|
|
129
|
+
:return: Resource response for the updated activity.
|
|
130
|
+
:rtype: :class:`microsoft_agents.activity.ResourceResponse`
|
|
131
|
+
:raises TypeError: If context or activity are None/invalid.
|
|
132
|
+
"""
|
|
105
133
|
if not context:
|
|
106
134
|
raise TypeError("Expected TurnContext but got None instead")
|
|
107
135
|
|
|
@@ -122,6 +150,15 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
122
150
|
async def delete_activity(
|
|
123
151
|
self, context: TurnContext, reference: ConversationReference
|
|
124
152
|
):
|
|
153
|
+
"""
|
|
154
|
+
Delete an activity from the conversation.
|
|
155
|
+
|
|
156
|
+
:param context: The turn context for this conversation turn.
|
|
157
|
+
:type context: :class:`microsoft_agents.hosting.core.turn_context.TurnContext`
|
|
158
|
+
:param reference: Reference to the conversation and activity to delete.
|
|
159
|
+
:type reference: :class:`microsoft_agents.activity.ConversationReference`
|
|
160
|
+
:raises TypeError: If context or reference are None/invalid.
|
|
161
|
+
"""
|
|
125
162
|
if not context:
|
|
126
163
|
raise TypeError("Expected TurnContext but got None instead")
|
|
127
164
|
|
|
@@ -155,9 +192,9 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
155
192
|
and is generally found in the `MicrosoftAppId` parameter in `config.py`.
|
|
156
193
|
:type agent_app_id: str
|
|
157
194
|
:param continuation_activity: The activity to continue the conversation with.
|
|
158
|
-
:type continuation_activity: Activity
|
|
195
|
+
:type continuation_activity: :class:`microsoft_agents.activity.Activity`
|
|
159
196
|
:param callback: The method to call for the resulting agent turn.
|
|
160
|
-
:type callback: Callable[[TurnContext], Awaitable]
|
|
197
|
+
:type callback: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`], Awaitable]
|
|
161
198
|
"""
|
|
162
199
|
if not callable:
|
|
163
200
|
raise TypeError(
|
|
@@ -182,6 +219,18 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
182
219
|
callback: Callable[[TurnContext], Awaitable],
|
|
183
220
|
audience: str = None,
|
|
184
221
|
):
|
|
222
|
+
"""
|
|
223
|
+
Continue a conversation with the provided claims identity.
|
|
224
|
+
|
|
225
|
+
:param claims_identity: The claims identity for the conversation.
|
|
226
|
+
:type claims_identity: :class:`microsoft_agents.hosting.core.authorization.ClaimsIdentity`
|
|
227
|
+
:param continuation_activity: The activity to continue the conversation with.
|
|
228
|
+
:type continuation_activity: :class:`microsoft_agents.activity.Activity`
|
|
229
|
+
:param callback: The method to call for the resulting agent turn.
|
|
230
|
+
:type callback: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`], Awaitable]
|
|
231
|
+
:param audience: The audience for the conversation.
|
|
232
|
+
:type audience: Optional[str]
|
|
233
|
+
"""
|
|
185
234
|
return await self.process_proactive(
|
|
186
235
|
claims_identity, continuation_activity, audience, callback
|
|
187
236
|
)
|
|
@@ -299,14 +348,15 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
299
348
|
"""
|
|
300
349
|
Creates a turn context and runs the middleware pipeline for an incoming activity.
|
|
301
350
|
|
|
302
|
-
:param
|
|
303
|
-
:type
|
|
351
|
+
:param claims_identity: The claims identity of the agent.
|
|
352
|
+
:type claims_identity: :class:`microsoft_agents.hosting.core.authorization.ClaimsIdentity`
|
|
304
353
|
:param activity: The incoming activity
|
|
305
|
-
:type activity: Activity
|
|
354
|
+
:type activity: :class:`microsoft_agents.activity.Activity`
|
|
306
355
|
:param callback: The callback to execute at the end of the adapter's middleware pipeline.
|
|
307
|
-
:type callback: Callable[[TurnContext], Awaitable]
|
|
356
|
+
:type callback: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`], Awaitable]
|
|
308
357
|
|
|
309
358
|
:return: A task that represents the work queued to execute.
|
|
359
|
+
:rtype: Optional[:class:`microsoft_agents.activity.InvokeResponse`]
|
|
310
360
|
|
|
311
361
|
.. remarks::
|
|
312
362
|
This class processes an activity received by the agents web server. This includes any messages
|
|
@@ -372,6 +422,14 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
372
422
|
return self._process_turn_results(context)
|
|
373
423
|
|
|
374
424
|
def create_claims_identity(self, agent_app_id: str = "") -> ClaimsIdentity:
|
|
425
|
+
"""
|
|
426
|
+
Create a claims identity for the given agent app ID.
|
|
427
|
+
|
|
428
|
+
:param agent_app_id: The agent application ID.
|
|
429
|
+
:type agent_app_id: str
|
|
430
|
+
:return: A claims identity for the agent.
|
|
431
|
+
:rtype: :class:`microsoft_agents.hosting.core.authorization.ClaimsIdentity`
|
|
432
|
+
"""
|
|
375
433
|
return ClaimsIdentity(
|
|
376
434
|
{
|
|
377
435
|
AuthenticationConstants.AUDIENCE_CLAIM: agent_app_id,
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: microsoft-agents-hosting-core
|
|
3
|
+
Version: 0.5.0.dev7
|
|
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: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: microsoft-agents-activity==0.5.0.dev7
|
|
14
|
+
Requires-Dist: pyjwt>=2.10.1
|
|
15
|
+
Requires-Dist: isodate>=0.6.1
|
|
16
|
+
Requires-Dist: azure-core>=1.30.0
|
|
17
|
+
Requires-Dist: python-dotenv>=1.1.1
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
Dynamic: requires-dist
|
|
20
|
+
|
|
21
|
+
# Microsoft Agents Hosting Core
|
|
22
|
+
|
|
23
|
+
[](https://pypi.org/project/microsoft-agents-hosting-core/)
|
|
24
|
+
|
|
25
|
+
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.
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
# What is this?
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
## Packages Overview
|
|
33
|
+
|
|
34
|
+
We offer the following PyPI packages to create conversational experiences based on Agents:
|
|
35
|
+
|
|
36
|
+
| Package Name | PyPI Version | Description |
|
|
37
|
+
|--------------|-------------|-------------|
|
|
38
|
+
| `microsoft-agents-activity` | [](https://pypi.org/project/microsoft-agents-activity/) | Types and validators implementing the Activity protocol spec. |
|
|
39
|
+
| `microsoft-agents-hosting-core` | [](https://pypi.org/project/microsoft-agents-hosting-core/) | Core library for Microsoft Agents hosting. |
|
|
40
|
+
| `microsoft-agents-hosting-aiohttp` | [](https://pypi.org/project/microsoft-agents-hosting-aiohttp/) | Configures aiohttp to run the Agent. |
|
|
41
|
+
| `microsoft-agents-hosting-teams` | [](https://pypi.org/project/microsoft-agents-hosting-teams/) | Provides classes to host an Agent for Teams. |
|
|
42
|
+
| `microsoft-agents-storage-blob` | [](https://pypi.org/project/microsoft-agents-storage-blob/) | Extension to use Azure Blob as storage. |
|
|
43
|
+
| `microsoft-agents-storage-cosmos` | [](https://pypi.org/project/microsoft-agents-storage-cosmos/) | Extension to use CosmosDB as storage. |
|
|
44
|
+
| `microsoft-agents-authentication-msal` | [](https://pypi.org/project/microsoft-agents-authentication-msal/) | MSAL-based authentication for Microsoft Agents. |
|
|
45
|
+
|
|
46
|
+
Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:
|
|
47
|
+
|
|
48
|
+
| Package Name | PyPI Version | Description |
|
|
49
|
+
|--------------|-------------|-------------|
|
|
50
|
+
| `microsoft-agents-copilotstudio-client` | [](https://pypi.org/project/microsoft-agents-copilotstudio-client/) | Direct to Engine client to interact with Agents created in CopilotStudio |
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install microsoft-agents-hosting-core
|
|
57
|
+
```
|
|
58
|
+
## Simple Echo Agent
|
|
59
|
+
See the [Quickstart sample](https://github.com/microsoft/Agents/tree/main/samples/python/quickstart) for full working code.
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
agents_sdk_config = load_configuration_from_env(environ)
|
|
63
|
+
|
|
64
|
+
STORAGE = MemoryStorage()
|
|
65
|
+
CONNECTION_MANAGER = MsalConnectionManager(**agents_sdk_config)
|
|
66
|
+
ADAPTER = CloudAdapter(connection_manager=CONNECTION_MANAGER)
|
|
67
|
+
AUTHORIZATION = Authorization(STORAGE, CONNECTION_MANAGER, **agents_sdk_config)
|
|
68
|
+
|
|
69
|
+
AGENT_APP = AgentApplication[TurnState](
|
|
70
|
+
storage=STORAGE, adapter=ADAPTER, authorization=AUTHORIZATION, **agents_sdk_config
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
@AGENT_APP.activity("message")
|
|
74
|
+
async def on_message(context: TurnContext, state: TurnState):
|
|
75
|
+
await context.send_activity(f"You said: {context.activity.text}")
|
|
76
|
+
|
|
77
|
+
...
|
|
78
|
+
|
|
79
|
+
start_server(
|
|
80
|
+
agent_application=AGENT_APP,
|
|
81
|
+
auth_configuration=CONNECTION_MANAGER.get_default_connection_configuration(),
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Core Concepts
|
|
86
|
+
|
|
87
|
+
### AgentApplication vs ActivityHandler
|
|
88
|
+
|
|
89
|
+
**AgentApplication** - Modern, fluent API for building agents:
|
|
90
|
+
- Decorator-based routing (`@agent_app.activity("message")`)
|
|
91
|
+
- Built-in state management and middleware
|
|
92
|
+
- AI-ready with authorization support
|
|
93
|
+
- Type-safe with generics
|
|
94
|
+
|
|
95
|
+
**ActivityHandler** - Traditional inheritance-based approach:
|
|
96
|
+
- Override methods for different activity types
|
|
97
|
+
- More familiar to Bot Framework developers
|
|
98
|
+
- Lower-level control over activity processing
|
|
99
|
+
|
|
100
|
+
### Route-based Message Handling
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
@AGENT_APP.message(re.compile(r"^hello$"))
|
|
104
|
+
async def on_hello(context: TurnContext, _state: TurnState):
|
|
105
|
+
await context.send_activity("Hello!")
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
@AGENT_APP.activity("message")
|
|
109
|
+
async def on_message(context: TurnContext, _state: TurnState):
|
|
110
|
+
await context.send_activity(f"you said: {context.activity.text}")
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Error Handling
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
@AGENT_APP.error
|
|
117
|
+
async def on_error(context: TurnContext, error: Exception):
|
|
118
|
+
# NOTE: In production environment, you should consider logging this to Azure
|
|
119
|
+
# application insights.
|
|
120
|
+
print(f"\n [on_turn_error] unhandled error: {error}", file=sys.stderr)
|
|
121
|
+
traceback.print_exc()
|
|
122
|
+
|
|
123
|
+
# Send a message to the user
|
|
124
|
+
await context.send_activity("The bot encountered an error or bug.")
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
## Key Classes Reference
|
|
129
|
+
|
|
130
|
+
### Core Classes
|
|
131
|
+
- **`AgentApplication`** - Main application class with fluent API
|
|
132
|
+
- **`ActivityHandler`** - Base class for inheritance-based agents
|
|
133
|
+
- **`TurnContext`** - Context for each conversation turn
|
|
134
|
+
- **`TurnState`** - State management across conversation turns
|
|
135
|
+
|
|
136
|
+
### State Management
|
|
137
|
+
- **`ConversationState`** - Conversation-scoped state
|
|
138
|
+
- **`UserState`** - User-scoped state across conversations
|
|
139
|
+
- **`TempState`** - Temporary state for current turn
|
|
140
|
+
- **`MemoryStorage`** - In-memory storage (development)
|
|
141
|
+
|
|
142
|
+
### Messaging
|
|
143
|
+
- **`MessageFactory`** - Create different types of messages
|
|
144
|
+
- **`CardFactory`** - Create rich card attachments
|
|
145
|
+
- **`InputFile`** - Handle file attachments
|
|
146
|
+
|
|
147
|
+
### Authorization
|
|
148
|
+
- **`Authorization`** - Authentication and authorization manager
|
|
149
|
+
- **`ClaimsIdentity`** - User identity and claims
|
|
150
|
+
|
|
151
|
+
# Quick Links
|
|
152
|
+
|
|
153
|
+
- 📦 [All SDK Packages on PyPI](https://pypi.org/search/?q=microsoft-agents)
|
|
154
|
+
- 📖 [Complete Documentation](https://aka.ms/agents)
|
|
155
|
+
- 💡 [Python Samples Repository](https://github.com/microsoft/Agents/tree/main/samples/python)
|
|
156
|
+
- 🐛 [Report Issues](https://github.com/microsoft/Agents-for-python/issues)
|
|
157
|
+
|
|
158
|
+
# Sample Applications
|
|
159
|
+
|
|
160
|
+
|Name|Description|README|
|
|
161
|
+
|----|----|----|
|
|
162
|
+
|Quickstart|Simplest agent|[Quickstart](https://github.com/microsoft/Agents/blob/main/samples/python/quickstart/README.md)|
|
|
163
|
+
|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)|
|
|
164
|
+
|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)|
|
|
165
|
+
|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)|
|
|
166
|
+
|Streaming Agent|Streams OpenAI responses|[azure-ai-streaming](https://github.com/microsoft/Agents/blob/main/samples/python/azureai-streaming/README.md)|
|
|
167
|
+
|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)|
|
|
168
|
+
|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,10 +1,10 @@
|
|
|
1
1
|
microsoft_agents/hosting/core/__init__.py,sha256=EN6Et-e7n5n_nhXy5ZKNiRtjMfEgWkoNri_gk8KEYLw,4862
|
|
2
|
-
microsoft_agents/hosting/core/activity_handler.py,sha256=
|
|
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
5
|
microsoft_agents/hosting/core/channel_adapter.py,sha256=LVHSueET6kzv-N_OCdl3F0yL4-OvZCMKMsj5tpPzZD0,10396
|
|
6
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=
|
|
7
|
+
microsoft_agents/hosting/core/channel_service_adapter.py,sha256=MmnEy4350udEffCNfr8foE8VScKmrYnSmoXh_Ghoqvg,20480
|
|
8
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
|
|
@@ -16,7 +16,7 @@ microsoft_agents/hosting/core/_oauth/_flow_storage_client.py,sha256=1MLD8m_qw0jS
|
|
|
16
16
|
microsoft_agents/hosting/core/_oauth/_oauth_flow.py,sha256=vgg_sQLYr83YA0F7aQ1K5j8vEATw7ZS151ODkpCGYAM,12211
|
|
17
17
|
microsoft_agents/hosting/core/app/__init__.py,sha256=GZQdog7BBMA8uD9iaRMNeRJf12rJZB3bAKFAD8Y8dVo,1228
|
|
18
18
|
microsoft_agents/hosting/core/app/_type_defs.py,sha256=b5VZFWnQ5ONUZMtFxw7Q-mbbxIUSJ7RXcCXjqdHwSQw,438
|
|
19
|
-
microsoft_agents/hosting/core/app/agent_application.py,sha256=
|
|
19
|
+
microsoft_agents/hosting/core/app/agent_application.py,sha256=M1ex1XCb3RNijJOSaJMTLajR9GrXqx8nim8Bp1yKLDU,31600
|
|
20
20
|
microsoft_agents/hosting/core/app/app_error.py,sha256=JgYBgv2EKe9Q2TFi5FeG_RneulBEa5SyBpWSF-duBzE,301
|
|
21
21
|
microsoft_agents/hosting/core/app/app_options.py,sha256=P3XTFFuQCnEcHixfdmr5RPG-Wli4c1VSmCMRKVBBLsw,2792
|
|
22
22
|
microsoft_agents/hosting/core/app/input_file.py,sha256=AEzVAnAPO1V7MWDI_uoZfcYY8Oog3XgvEpAeO-tATeY,1546
|
|
@@ -30,14 +30,14 @@ microsoft_agents/hosting/core/app/oauth/__init__.py,sha256=eHx-vmW2Ew8HULSfvAmV8
|
|
|
30
30
|
microsoft_agents/hosting/core/app/oauth/_sign_in_response.py,sha256=H5VBX69WiYXGALzCDVnF_-Y0brbafbJgfF4mS2wZSr0,851
|
|
31
31
|
microsoft_agents/hosting/core/app/oauth/_sign_in_state.py,sha256=lC2otIFcQthAZ8kqkYxV3wLBPOqzW9MRVUbdqQPtEdM,1159
|
|
32
32
|
microsoft_agents/hosting/core/app/oauth/auth_handler.py,sha256=KyhEfpKtoVKcapOt4szpDdbgk_KSwXF46GGOeJrmsRI,3464
|
|
33
|
-
microsoft_agents/hosting/core/app/oauth/authorization.py,sha256=
|
|
33
|
+
microsoft_agents/hosting/core/app/oauth/authorization.py,sha256=_sdCZcZ7iciwTZqXTHFOK4vWWbCgSIDv3it30fzPI8w,18246
|
|
34
34
|
microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py,sha256=ZQuXF-IZrJv_hOgt-sdRFAUyIpRXaYqYBuyEJWJRcfU,376
|
|
35
35
|
microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py,sha256=W36Y1m0zFaRmdt-cL3ZKoHxx95y0O7YJF9D0cXx_s24,4185
|
|
36
36
|
microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py,sha256=o_pn5ZO7O-YvcC5NGlUgcCmVLD-f6KwQ5CRIsPp8zQE,10186
|
|
37
37
|
microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py,sha256=7rGzYRLOzcy9vGAwnzjyImEaCy0G_bRUwufuXp3xiwk,7145
|
|
38
38
|
microsoft_agents/hosting/core/app/state/__init__.py,sha256=aL_8GB7_de8LUSEOgTJQFRx1kvgvJHHJVv7nWAoRPmU,331
|
|
39
39
|
microsoft_agents/hosting/core/app/state/conversation_state.py,sha256=LfcSwvhaU0JeAahwg9YA9uz0kKHa9c6Y3XBAWqwuMg0,1593
|
|
40
|
-
microsoft_agents/hosting/core/app/state/state.py,sha256
|
|
40
|
+
microsoft_agents/hosting/core/app/state/state.py,sha256=Q1GMGTdIGpu5Z4_6HPCfhJaD265oBlv6DMNNBCUyG3U,7372
|
|
41
41
|
microsoft_agents/hosting/core/app/state/temp_state.py,sha256=Oh7K5-uYf50Z-lBXqttSMl2N1lRakktOmjLlIAKcEsM,3501
|
|
42
42
|
microsoft_agents/hosting/core/app/state/turn_state.py,sha256=rEIRkwBsn3MPbrfKNjX8XqqbF-4THepMXU75KvDsBvM,9868
|
|
43
43
|
microsoft_agents/hosting/core/authorization/__init__.py,sha256=pOTmTJFS5CMPEcHRadBTgrbWUP5lOIxsPMgTreFq7mw,634
|
|
@@ -91,7 +91,8 @@ microsoft_agents/hosting/core/storage/transcript_info.py,sha256=5VN32j99tshChAff
|
|
|
91
91
|
microsoft_agents/hosting/core/storage/transcript_logger.py,sha256=_atDk3CJ05fIVMhlWGNa91IiM9bGLmOhasFko8Lxjhk,8237
|
|
92
92
|
microsoft_agents/hosting/core/storage/transcript_memory_store.py,sha256=v1Ud9LSs8m5c9_Fa8i49SuAjw80dX1hDciqbRduDEOE,6444
|
|
93
93
|
microsoft_agents/hosting/core/storage/transcript_store.py,sha256=ka74o0WvI5GhMZcFqSxVdamBhGzZcDZe6VNkG-sMy74,1944
|
|
94
|
-
microsoft_agents_hosting_core-0.5.0.
|
|
95
|
-
microsoft_agents_hosting_core-0.5.0.
|
|
96
|
-
microsoft_agents_hosting_core-0.5.0.
|
|
97
|
-
microsoft_agents_hosting_core-0.5.0.
|
|
94
|
+
microsoft_agents_hosting_core-0.5.0.dev7.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
|
|
95
|
+
microsoft_agents_hosting_core-0.5.0.dev7.dist-info/METADATA,sha256=GJ4iPQH75fLQb5I_P1peyZQ1A6GeVCRFQVNMieOzi-U,8594
|
|
96
|
+
microsoft_agents_hosting_core-0.5.0.dev7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
97
|
+
microsoft_agents_hosting_core-0.5.0.dev7.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
|
|
98
|
+
microsoft_agents_hosting_core-0.5.0.dev7.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,16 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: microsoft-agents-hosting-core
|
|
3
|
-
Version: 0.5.0.dev3
|
|
4
|
-
Summary: Core library for Microsoft Agents
|
|
5
|
-
Author: Microsoft Corporation
|
|
6
|
-
Project-URL: Homepage, https://github.com/microsoft/Agents
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3.9
|
|
11
|
-
Requires-Dist: microsoft-agents-activity==0.5.0.dev3
|
|
12
|
-
Requires-Dist: pyjwt>=2.10.1
|
|
13
|
-
Requires-Dist: isodate>=0.6.1
|
|
14
|
-
Requires-Dist: azure-core>=1.30.0
|
|
15
|
-
Requires-Dist: python-dotenv>=1.1.1
|
|
16
|
-
Dynamic: requires-dist
|
|
File without changes
|