microsoft-agents-hosting-msteams 1.9.0.dev3__tar.gz → 1.9.0.dev10__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.
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/PKG-INFO +2 -2
- microsoft_agents_hosting_msteams-1.9.0.dev10/VERSION.txt +1 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/config/config.py +2 -6
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/message/message.py +2 -6
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/message_extension/message_extension.py +7 -30
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/teams_agent_extension.py +89 -16
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/teams_turn_context.py +4 -16
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents_hosting_msteams.egg-info/PKG-INFO +2 -2
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents_hosting_msteams.egg-info/requires.txt +1 -1
- microsoft_agents_hosting_msteams-1.9.0.dev3/VERSION.txt +0 -1
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/LICENSE +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/MANIFEST.in +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/_graph.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/_teams_api_client.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/_utils.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/channel/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/channel/channel.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/channel/route_handlers.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/config/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/config/route_handlers.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/errors/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/errors/error_resources.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/file_consent/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/file_consent/file_consent.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/file_consent/route_handlers.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/meeting/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/meeting/meeting.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/meeting/route_handlers.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/message/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/message/route_handlers.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/message_extension/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/message_extension/route_handlers.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/models/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/models/quoted_reply.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/models/targeted_message_info.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/proactive_service_endpoints.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/py.typed +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/route_handlers.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/task_module/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/task_module/route_handlers.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/task_module/task_module.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/team/__init__.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/team/route_handlers.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/team/team.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/teams_activity.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents/hosting/msteams/type_defs.py +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents_hosting_msteams.egg-info/SOURCES.txt +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents_hosting_msteams.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/microsoft_agents_hosting_msteams.egg-info/top_level.txt +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/pyproject.toml +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/readme.md +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/setup.cfg +0 -0
- {microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-msteams
|
|
3
|
-
Version: 1.9.0.
|
|
3
|
+
Version: 1.9.0.dev10
|
|
4
4
|
Summary: Integration library for Microsoft Agents with Teams
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,7 +14,7 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: microsoft-agents-hosting-core==1.9.0.
|
|
17
|
+
Requires-Dist: microsoft-agents-hosting-core==1.9.0.dev10
|
|
18
18
|
Requires-Dist: aiohttp>=3.12
|
|
19
19
|
Requires-Dist: microsoft-teams-api==2.1.0
|
|
20
20
|
Requires-Dist: msgraph-sdk>=1.58.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.9.0.dev10
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
from typing import Generic, Optional, overload
|
|
7
7
|
|
|
8
|
-
from microsoft_agents.activity import ActivityTypes
|
|
9
8
|
from microsoft_agents.hosting.core import (
|
|
10
9
|
AgentApplication,
|
|
11
10
|
RouteRank,
|
|
@@ -15,6 +14,7 @@ from microsoft_agents.hosting.core.app._type_defs import (
|
|
|
15
14
|
StateT,
|
|
16
15
|
_RouteDecorator,
|
|
17
16
|
)
|
|
17
|
+
from microsoft_agents.hosting.core.app._selector import _invoke_event_selector
|
|
18
18
|
|
|
19
19
|
from microsoft_agents.hosting.msteams.teams_turn_context import TeamsTurnContext
|
|
20
20
|
from microsoft_agents.hosting.msteams._utils import _send_invoke_response
|
|
@@ -50,11 +50,7 @@ class Config(Generic[StateT]):
|
|
|
50
50
|
:return: A decorator that registers the handler.
|
|
51
51
|
"""
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
context.activity.type == ActivityTypes.invoke
|
|
56
|
-
and context.activity.name == name
|
|
57
|
-
)
|
|
53
|
+
__selector = _invoke_event_selector(name)
|
|
58
54
|
|
|
59
55
|
def __call(func: ConfigHandler[StateT]) -> ConfigHandler[StateT]:
|
|
60
56
|
async def __handler(context: TurnContext, state: StateT) -> None:
|
|
@@ -17,6 +17,7 @@ from microsoft_agents.hosting.core.app._type_defs import (
|
|
|
17
17
|
StateT,
|
|
18
18
|
_RouteDecorator,
|
|
19
19
|
)
|
|
20
|
+
from microsoft_agents.hosting.core.app._selector import _invoke_event_selector
|
|
20
21
|
|
|
21
22
|
from microsoft_agents.hosting.msteams.route_handlers import (
|
|
22
23
|
TeamsRouteHandler,
|
|
@@ -261,12 +262,7 @@ class Message(Generic[StateT]):
|
|
|
261
262
|
:return: The registered handler, or a decorator when used without a handler.
|
|
262
263
|
"""
|
|
263
264
|
|
|
264
|
-
|
|
265
|
-
"""Return True when the activity is an actionable message execute invoke."""
|
|
266
|
-
return (
|
|
267
|
-
context.activity.type == ActivityTypes.invoke
|
|
268
|
-
and context.activity.name == "actionableMessage/executeAction"
|
|
269
|
-
)
|
|
265
|
+
__selector = _invoke_event_selector("actionableMessage/executeAction")
|
|
270
266
|
|
|
271
267
|
def __call(func: ExecuteActionHandler[StateT]) -> ExecuteActionHandler[StateT]:
|
|
272
268
|
"""Register the supplied execute action handler."""
|
|
@@ -22,6 +22,7 @@ from microsoft_agents.hosting.core.app._type_defs import (
|
|
|
22
22
|
StateT,
|
|
23
23
|
_RouteDecorator,
|
|
24
24
|
)
|
|
25
|
+
from microsoft_agents.hosting.core.app._selector import _invoke_event_selector
|
|
25
26
|
|
|
26
27
|
from microsoft_agents.hosting.msteams.teams_turn_context import TeamsTurnContext
|
|
27
28
|
|
|
@@ -151,11 +152,7 @@ class MessageExtension(Generic[StateT]):
|
|
|
151
152
|
:return: The registered handler when provided, otherwise a decorator that registers it.
|
|
152
153
|
"""
|
|
153
154
|
|
|
154
|
-
|
|
155
|
-
return (
|
|
156
|
-
context.activity.type == ActivityTypes.invoke
|
|
157
|
-
and context.activity.name == "composeExtension/selectItem"
|
|
158
|
-
)
|
|
155
|
+
__selector = _invoke_event_selector("composeExtension/selectItem")
|
|
159
156
|
|
|
160
157
|
def __call(func: SelectItemHandler[StateT]) -> SelectItemHandler[StateT]:
|
|
161
158
|
async def __handler(context: TurnContext, state: StateT) -> None:
|
|
@@ -400,11 +397,7 @@ class MessageExtension(Generic[StateT]):
|
|
|
400
397
|
:return: The registered handler when provided, otherwise a decorator that registers it.
|
|
401
398
|
"""
|
|
402
399
|
|
|
403
|
-
|
|
404
|
-
return (
|
|
405
|
-
context.activity.type == ActivityTypes.invoke
|
|
406
|
-
and context.activity.name == "composeExtension/queryLink"
|
|
407
|
-
)
|
|
400
|
+
__selector = _invoke_event_selector("composeExtension/queryLink")
|
|
408
401
|
|
|
409
402
|
def __call(func: QueryLinkHandler[StateT]) -> QueryLinkHandler[StateT]:
|
|
410
403
|
async def __handler(context: TurnContext, state: StateT) -> None:
|
|
@@ -452,11 +445,7 @@ class MessageExtension(Generic[StateT]):
|
|
|
452
445
|
:return: The registered handler when provided, otherwise a decorator that registers it.
|
|
453
446
|
"""
|
|
454
447
|
|
|
455
|
-
|
|
456
|
-
return (
|
|
457
|
-
context.activity.type == ActivityTypes.invoke
|
|
458
|
-
and context.activity.name == "composeExtension/anonymousQueryLink"
|
|
459
|
-
)
|
|
448
|
+
__selector = _invoke_event_selector("composeExtension/anonymousQueryLink")
|
|
460
449
|
|
|
461
450
|
def __call(func: QueryLinkHandler[StateT]) -> QueryLinkHandler[StateT]:
|
|
462
451
|
async def __handler(context: TurnContext, state: StateT) -> None:
|
|
@@ -506,11 +495,7 @@ class MessageExtension(Generic[StateT]):
|
|
|
506
495
|
:return: The registered handler when provided, otherwise a decorator that registers it.
|
|
507
496
|
"""
|
|
508
497
|
|
|
509
|
-
|
|
510
|
-
return (
|
|
511
|
-
context.activity.type == ActivityTypes.invoke
|
|
512
|
-
and context.activity.name == "composeExtension/querySettingUrl"
|
|
513
|
-
)
|
|
498
|
+
__selector = _invoke_event_selector("composeExtension/querySettingUrl")
|
|
514
499
|
|
|
515
500
|
def __call(
|
|
516
501
|
func: QueryUrlSettingHandler[StateT],
|
|
@@ -560,11 +545,7 @@ class MessageExtension(Generic[StateT]):
|
|
|
560
545
|
:return: The registered handler when provided, otherwise a decorator that registers it.
|
|
561
546
|
"""
|
|
562
547
|
|
|
563
|
-
|
|
564
|
-
return (
|
|
565
|
-
context.activity.type == ActivityTypes.invoke
|
|
566
|
-
and context.activity.name == "composeExtension/setting"
|
|
567
|
-
)
|
|
548
|
+
__selector = _invoke_event_selector("composeExtension/setting")
|
|
568
549
|
|
|
569
550
|
def __call(func: SettingHandler[StateT]) -> SettingHandler[StateT]:
|
|
570
551
|
async def __handler(context: TurnContext, state: StateT) -> None:
|
|
@@ -616,11 +597,7 @@ class MessageExtension(Generic[StateT]):
|
|
|
616
597
|
:return: The registered handler when provided, otherwise a decorator that registers it.
|
|
617
598
|
"""
|
|
618
599
|
|
|
619
|
-
|
|
620
|
-
return (
|
|
621
|
-
context.activity.type == ActivityTypes.invoke
|
|
622
|
-
and context.activity.name == "composeExtension/onCardButtonClicked"
|
|
623
|
-
)
|
|
600
|
+
__selector = _invoke_event_selector("composeExtension/onCardButtonClicked")
|
|
624
601
|
|
|
625
602
|
def __call(
|
|
626
603
|
func: CardButtonClickedHandler[StateT],
|
|
@@ -14,7 +14,6 @@ from __future__ import annotations
|
|
|
14
14
|
from typing import (
|
|
15
15
|
Callable,
|
|
16
16
|
Generic,
|
|
17
|
-
Optional,
|
|
18
17
|
Pattern,
|
|
19
18
|
Protocol,
|
|
20
19
|
)
|
|
@@ -34,9 +33,10 @@ from microsoft_agents.hosting.core import (
|
|
|
34
33
|
TurnContext,
|
|
35
34
|
)
|
|
36
35
|
from microsoft_agents.hosting.core.app._type_defs import (
|
|
37
|
-
RouteHandler,
|
|
38
36
|
HandoffHandler,
|
|
37
|
+
RouteHandler,
|
|
39
38
|
StateT,
|
|
39
|
+
TextSelector,
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
from .channel import Channel
|
|
@@ -204,7 +204,7 @@ class TeamsAgentExtension(Generic[StateT]):
|
|
|
204
204
|
self,
|
|
205
205
|
activity_type: str | ActivityTypes | list[str | ActivityTypes],
|
|
206
206
|
*,
|
|
207
|
-
auth_handlers:
|
|
207
|
+
auth_handlers: list[str] | None = None,
|
|
208
208
|
**kwargs,
|
|
209
209
|
) -> _AppRouteDecorator[StateT]:
|
|
210
210
|
"""Register a handler for one or more activity types.
|
|
@@ -214,14 +214,19 @@ class TeamsAgentExtension(Generic[StateT]):
|
|
|
214
214
|
:return: A decorator that registers the handler and returns it.
|
|
215
215
|
"""
|
|
216
216
|
return self._wrap_decorator(
|
|
217
|
-
self._app.activity(
|
|
217
|
+
self._app.activity(
|
|
218
|
+
activity_type,
|
|
219
|
+
auth_handlers=auth_handlers,
|
|
220
|
+
channel_id=Channels.msteams,
|
|
221
|
+
**kwargs,
|
|
222
|
+
)
|
|
218
223
|
)
|
|
219
224
|
|
|
220
225
|
def message(
|
|
221
226
|
self,
|
|
222
227
|
select: str | Pattern[str] | list[str | Pattern[str]],
|
|
223
228
|
*,
|
|
224
|
-
auth_handlers:
|
|
229
|
+
auth_handlers: list[str] | None = None,
|
|
225
230
|
**kwargs,
|
|
226
231
|
) -> _AppRouteDecorator[StateT]:
|
|
227
232
|
"""Register a handler for message activities matching *select*.
|
|
@@ -232,14 +237,42 @@ class TeamsAgentExtension(Generic[StateT]):
|
|
|
232
237
|
:return: A decorator that registers the handler and returns it.
|
|
233
238
|
"""
|
|
234
239
|
return self._wrap_decorator(
|
|
235
|
-
self._app.message(
|
|
240
|
+
self._app.message(
|
|
241
|
+
select,
|
|
242
|
+
auth_handlers=auth_handlers,
|
|
243
|
+
channel_id=Channels.msteams,
|
|
244
|
+
**kwargs,
|
|
245
|
+
)
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
def event(
|
|
249
|
+
self,
|
|
250
|
+
select: TextSelector | None = None,
|
|
251
|
+
*,
|
|
252
|
+
auth_handlers: list[str] | None = None,
|
|
253
|
+
**kwargs,
|
|
254
|
+
) -> _AppRouteDecorator[StateT]:
|
|
255
|
+
"""Register a handler for event activities matching *select*.
|
|
256
|
+
|
|
257
|
+
:param select: A literal string, regex pattern, or list of either to match against
|
|
258
|
+
the event name.
|
|
259
|
+
:param auth_handlers: Optional list of auth handler names to run before the route.
|
|
260
|
+
:return: A decorator that registers the handler and returns it.
|
|
261
|
+
"""
|
|
262
|
+
return self._wrap_decorator(
|
|
263
|
+
self._app.event(
|
|
264
|
+
select,
|
|
265
|
+
auth_handlers=auth_handlers,
|
|
266
|
+
channel_id=Channels.msteams,
|
|
267
|
+
**kwargs,
|
|
268
|
+
)
|
|
236
269
|
)
|
|
237
270
|
|
|
238
271
|
def conversation_update(
|
|
239
272
|
self,
|
|
240
273
|
type: ConversationUpdateTypes,
|
|
241
274
|
*,
|
|
242
|
-
auth_handlers:
|
|
275
|
+
auth_handlers: list[str] | None = None,
|
|
243
276
|
**kwargs,
|
|
244
277
|
) -> _AppRouteDecorator[StateT]:
|
|
245
278
|
"""Register a handler for a specific conversation update event type.
|
|
@@ -249,14 +282,16 @@ class TeamsAgentExtension(Generic[StateT]):
|
|
|
249
282
|
:return: A decorator that registers the handler and returns it.
|
|
250
283
|
"""
|
|
251
284
|
return self._wrap_decorator(
|
|
252
|
-
self._app.conversation_update(
|
|
285
|
+
self._app.conversation_update(
|
|
286
|
+
type, auth_handlers=auth_handlers, channel_id=Channels.msteams, **kwargs
|
|
287
|
+
)
|
|
253
288
|
)
|
|
254
289
|
|
|
255
290
|
def message_reaction(
|
|
256
291
|
self,
|
|
257
292
|
type: MessageReactionTypes,
|
|
258
293
|
*,
|
|
259
|
-
auth_handlers:
|
|
294
|
+
auth_handlers: list[str] | None = None,
|
|
260
295
|
**kwargs,
|
|
261
296
|
) -> _AppRouteDecorator[StateT]:
|
|
262
297
|
"""Register a handler for a specific message reaction type.
|
|
@@ -266,14 +301,16 @@ class TeamsAgentExtension(Generic[StateT]):
|
|
|
266
301
|
:return: A decorator that registers the handler and returns it.
|
|
267
302
|
"""
|
|
268
303
|
return self._wrap_decorator(
|
|
269
|
-
self._app.message_reaction(
|
|
304
|
+
self._app.message_reaction(
|
|
305
|
+
type, auth_handlers=auth_handlers, channel_id=Channels.msteams, **kwargs
|
|
306
|
+
)
|
|
270
307
|
)
|
|
271
308
|
|
|
272
309
|
def message_update(
|
|
273
310
|
self,
|
|
274
311
|
type: MessageUpdateTypes,
|
|
275
312
|
*,
|
|
276
|
-
auth_handlers:
|
|
313
|
+
auth_handlers: list[str] | None = None,
|
|
277
314
|
**kwargs,
|
|
278
315
|
) -> _AppRouteDecorator[StateT]:
|
|
279
316
|
"""Register a handler for a specific message update event type.
|
|
@@ -283,13 +320,49 @@ class TeamsAgentExtension(Generic[StateT]):
|
|
|
283
320
|
:return: A decorator that registers the handler and returns it.
|
|
284
321
|
"""
|
|
285
322
|
return self._wrap_decorator(
|
|
286
|
-
self._app.message_update(
|
|
323
|
+
self._app.message_update(
|
|
324
|
+
type, auth_handlers=auth_handlers, channel_id=Channels.msteams, **kwargs
|
|
325
|
+
)
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
def installation_update(
|
|
329
|
+
self,
|
|
330
|
+
*,
|
|
331
|
+
auth_handlers: list[str] | None = None,
|
|
332
|
+
**kwargs,
|
|
333
|
+
) -> _AppRouteDecorator[StateT]:
|
|
334
|
+
"""Register a handler for installation update activities.
|
|
335
|
+
|
|
336
|
+
:param auth_handlers: Optional list of auth handler names to run before the route.
|
|
337
|
+
:return: A decorator that registers the handler and returns it.
|
|
338
|
+
"""
|
|
339
|
+
return self._wrap_decorator(
|
|
340
|
+
self._app.installation_update(
|
|
341
|
+
auth_handlers=auth_handlers, channel_id=Channels.msteams, **kwargs
|
|
342
|
+
)
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
def end_of_conversation(
|
|
346
|
+
self,
|
|
347
|
+
*,
|
|
348
|
+
auth_handlers: list[str] | None = None,
|
|
349
|
+
**kwargs,
|
|
350
|
+
) -> _AppRouteDecorator[StateT]:
|
|
351
|
+
"""Register a handler for end of conversation activities.
|
|
352
|
+
|
|
353
|
+
:param auth_handlers: Optional list of auth handler names to run before the route.
|
|
354
|
+
:return: A decorator that registers the handler and returns it.
|
|
355
|
+
"""
|
|
356
|
+
return self._wrap_decorator(
|
|
357
|
+
self._app.end_of_conversation(
|
|
358
|
+
auth_handlers=auth_handlers, channel_id=Channels.msteams, **kwargs
|
|
359
|
+
)
|
|
287
360
|
)
|
|
288
361
|
|
|
289
362
|
def handoff(
|
|
290
363
|
self,
|
|
291
364
|
*,
|
|
292
|
-
auth_handlers:
|
|
365
|
+
auth_handlers: list[str] | None = None,
|
|
293
366
|
**kwargs,
|
|
294
367
|
) -> Callable[[TeamsHandoffHandler[StateT]], HandoffHandler[StateT]]:
|
|
295
368
|
"""Register a Teams handoff handler.
|
|
@@ -299,9 +372,9 @@ class TeamsAgentExtension(Generic[StateT]):
|
|
|
299
372
|
"""
|
|
300
373
|
|
|
301
374
|
def __call(func: TeamsHandoffHandler[StateT]) -> HandoffHandler[StateT]:
|
|
302
|
-
return self._app.handoff(
|
|
303
|
-
|
|
304
|
-
)
|
|
375
|
+
return self._app.handoff(
|
|
376
|
+
auth_handlers=auth_handlers, channel_id=Channels.msteams, **kwargs
|
|
377
|
+
)(wrap_teams_handoff_handler(func, self._app))
|
|
305
378
|
|
|
306
379
|
return __call
|
|
307
380
|
|
|
@@ -19,6 +19,9 @@ from microsoft_agents.activity import (
|
|
|
19
19
|
InputHints,
|
|
20
20
|
ResourceResponse,
|
|
21
21
|
)
|
|
22
|
+
from microsoft_agents.hosting.core._utils._turn_context_wrapper import (
|
|
23
|
+
_TurnContextWrapper,
|
|
24
|
+
)
|
|
22
25
|
from microsoft_agents.hosting.core import (
|
|
23
26
|
AgentApplication,
|
|
24
27
|
TurnContext,
|
|
@@ -35,7 +38,7 @@ from .teams_activity import TeamsActivity
|
|
|
35
38
|
from ._utils import _apply_prompt_preview_normalizer, _is_recipient_targeted
|
|
36
39
|
|
|
37
40
|
|
|
38
|
-
class TeamsTurnContext(
|
|
41
|
+
class TeamsTurnContext(_TurnContextWrapper):
|
|
39
42
|
"""A context object for handling Teams-specific turn functionality.
|
|
40
43
|
|
|
41
44
|
Wraps a plain :class:`TurnContext` so that Teams-aware route handlers
|
|
@@ -50,9 +53,6 @@ class TeamsTurnContext(TurnContext):
|
|
|
50
53
|
"""
|
|
51
54
|
super().__init__(context)
|
|
52
55
|
self._app = app
|
|
53
|
-
self._turn_state = context.turn_state
|
|
54
|
-
|
|
55
|
-
self._original = context
|
|
56
56
|
|
|
57
57
|
self._set_teams_activity()
|
|
58
58
|
|
|
@@ -76,18 +76,6 @@ class TeamsTurnContext(TurnContext):
|
|
|
76
76
|
self._activity.__class__ = TeamsActivity
|
|
77
77
|
self._teams_activity = cast(TeamsActivity, self._activity)
|
|
78
78
|
|
|
79
|
-
@property
|
|
80
|
-
def responded(self) -> bool:
|
|
81
|
-
return self._original.responded
|
|
82
|
-
|
|
83
|
-
@responded.setter
|
|
84
|
-
def responded(self, value: bool):
|
|
85
|
-
self._original.responded = value
|
|
86
|
-
|
|
87
|
-
@property
|
|
88
|
-
def streaming_response(self):
|
|
89
|
-
return self._original.streaming_response
|
|
90
|
-
|
|
91
79
|
@property
|
|
92
80
|
def activity(self) -> TeamsActivity:
|
|
93
81
|
"""The current activity, typed as a :class:`TeamsActivity`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-msteams
|
|
3
|
-
Version: 1.9.0.
|
|
3
|
+
Version: 1.9.0.dev10
|
|
4
4
|
Summary: Integration library for Microsoft Agents with Teams
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,7 +14,7 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: microsoft-agents-hosting-core==1.9.0.
|
|
17
|
+
Requires-Dist: microsoft-agents-hosting-core==1.9.0.dev10
|
|
18
18
|
Requires-Dist: aiohttp>=3.12
|
|
19
19
|
Requires-Dist: microsoft-teams-api==2.1.0
|
|
20
20
|
Requires-Dist: msgraph-sdk>=1.58.0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.9.0.dev3
|
{microsoft_agents_hosting_msteams-1.9.0.dev3 → microsoft_agents_hosting_msteams-1.9.0.dev10}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|