microsoft-agents-hosting-core 0.4.0.dev16__tar.gz → 0.4.0.dev18__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_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/PKG-INFO +2 -2
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/__init__.py +2 -1
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/_oauth/__init__.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/activity_handler.py +1 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/__init__.py +2 -1
- microsoft_agents_hosting_core-0.4.0.dev18/microsoft_agents/hosting/core/app/_routes/__init__.py +13 -0
- microsoft_agents_hosting_core-0.4.0.dev18/microsoft_agents/hosting/core/app/_routes/_route.py +89 -0
- microsoft_agents_hosting_core-0.4.0.dev18/microsoft_agents/hosting/core/app/_routes/_route_list.py +32 -0
- microsoft_agents_hosting_core-0.4.0.dev18/microsoft_agents/hosting/core/app/_routes/route_rank.py +14 -0
- microsoft_agents_hosting_core-0.4.0.dev18/microsoft_agents/hosting/core/app/_type_defs.py +15 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/agent_application.py +85 -45
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/oauth/__init__.py +4 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +5 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +5 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +4 -2
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +5 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +4 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +5 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +4 -2
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/oauth/authorization.py +5 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/authorization/auth_types.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/authorization/connections.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/authorization/jwt_token_validator.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/channel_service_adapter.py +1 -4
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/channel_host_protocol.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/channel_info_protocol.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/channel_protocol.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/channels_configuration.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/configuration_channel_host.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/conversation_constants.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/conversation_id_factory.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/http_agent_channel.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -3
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/error_handling.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/memory_storage.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/storage.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/store_item.py +3 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents_hosting_core.egg-info/PKG-INFO +2 -2
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +5 -1
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents_hosting_core.egg-info/requires.txt +1 -1
- microsoft_agents_hosting_core-0.4.0.dev16/microsoft_agents/hosting/core/app/route.py +0 -32
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/agent.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/app_error.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/app_options.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/input_file.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/query.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/state/state.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/app/typing_indicator.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/card_factory.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/message_factory.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/middleware_set.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/state/user_state.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/transcript_file_store.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/transcript_info.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/transcript_logger.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/transcript_memory_store.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/storage/transcript_store.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents/hosting/core/turn_context.py +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/pyproject.toml +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/setup.cfg +0 -0
- {microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/setup.py +0 -0
{microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-core
|
|
3
|
-
Version: 0.4.0.
|
|
3
|
+
Version: 0.4.0.dev18
|
|
4
4
|
Summary: Core library for Microsoft Agents
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
Project-URL: Homepage, https://github.com/microsoft/Agents
|
|
@@ -8,7 +8,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
10
|
Requires-Python: >=3.9
|
|
11
|
-
Requires-Dist: microsoft-agents-activity==0.4.0.
|
|
11
|
+
Requires-Dist: microsoft-agents-activity==0.4.0.dev18
|
|
12
12
|
Requires-Dist: pyjwt>=2.10.1
|
|
13
13
|
Requires-Dist: isodate>=0.6.1
|
|
14
14
|
Requires-Dist: azure-core>=1.30.0
|
|
@@ -11,12 +11,13 @@ from .rest_channel_service_client_factory import RestChannelServiceClientFactory
|
|
|
11
11
|
from .turn_context import TurnContext
|
|
12
12
|
|
|
13
13
|
# Application Style
|
|
14
|
+
from .app._type_defs import RouteHandler, RouteSelector, StateT
|
|
14
15
|
from .app.agent_application import AgentApplication
|
|
15
16
|
from .app.app_error import ApplicationError
|
|
16
17
|
from .app.app_options import ApplicationOptions
|
|
17
18
|
from .app.input_file import InputFile, InputFileDownloader
|
|
18
19
|
from .app.query import Query
|
|
19
|
-
from .app.
|
|
20
|
+
from .app._routes import _Route, _RouteList, RouteRank
|
|
20
21
|
from .app.typing_indicator import TypingIndicator
|
|
21
22
|
|
|
22
23
|
# App Auth
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
1
4
|
from ._flow_state import _FlowState, _FlowStateTag, _FlowErrorTag
|
|
2
5
|
from ._flow_storage_client import _FlowStorageClient
|
|
3
6
|
from ._oauth_flow import _OAuthFlow, _FlowResponse
|
|
@@ -10,8 +10,9 @@ from .app_error import ApplicationError
|
|
|
10
10
|
from .app_options import ApplicationOptions
|
|
11
11
|
from .input_file import InputFile, InputFileDownloader
|
|
12
12
|
from .query import Query
|
|
13
|
-
from .
|
|
13
|
+
from ._routes import _RouteList, _Route, RouteRank
|
|
14
14
|
from .typing_indicator import TypingIndicator
|
|
15
|
+
from ._type_defs import RouteHandler, RouteSelector, StateT
|
|
15
16
|
|
|
16
17
|
# Auth
|
|
17
18
|
from .oauth import (
|
microsoft_agents_hosting_core-0.4.0.dev18/microsoft_agents/hosting/core/app/_routes/__init__.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from ._route_list import _RouteList
|
|
5
|
+
from ._route import _Route, _agentic_selector
|
|
6
|
+
from .route_rank import RouteRank
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"_RouteList",
|
|
10
|
+
"_Route",
|
|
11
|
+
"RouteRank",
|
|
12
|
+
"_agentic_selector",
|
|
13
|
+
]
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import Generic, Optional, TypeVar
|
|
7
|
+
|
|
8
|
+
from ...turn_context import TurnContext
|
|
9
|
+
from .._type_defs import RouteHandler, RouteSelector
|
|
10
|
+
from ..state.turn_state import TurnState
|
|
11
|
+
from .route_rank import RouteRank
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _agentic_selector(selector: RouteSelector) -> RouteSelector:
|
|
15
|
+
def wrapped_selector(context: TurnContext) -> bool:
|
|
16
|
+
return context.activity.is_agentic_request() and selector(context)
|
|
17
|
+
|
|
18
|
+
return wrapped_selector
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
StateT = TypeVar("StateT", bound=TurnState)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class _Route(Generic[StateT]):
|
|
25
|
+
selector: RouteSelector
|
|
26
|
+
handler: RouteHandler[StateT]
|
|
27
|
+
_is_invoke: bool
|
|
28
|
+
_rank: int
|
|
29
|
+
auth_handlers: list[str]
|
|
30
|
+
_is_agentic: bool
|
|
31
|
+
|
|
32
|
+
def __init__(
|
|
33
|
+
self,
|
|
34
|
+
selector: RouteSelector,
|
|
35
|
+
handler: RouteHandler[StateT],
|
|
36
|
+
is_invoke: bool = False,
|
|
37
|
+
rank: int = RouteRank.DEFAULT,
|
|
38
|
+
auth_handlers: Optional[list[str]] = None,
|
|
39
|
+
is_agentic: bool = False,
|
|
40
|
+
**kwargs,
|
|
41
|
+
) -> None:
|
|
42
|
+
|
|
43
|
+
if rank < 0 or rank > RouteRank.LAST:
|
|
44
|
+
raise ValueError(
|
|
45
|
+
"Route rank must be between 0 and RouteRank.LAST (inclusive)"
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
self.selector = selector
|
|
49
|
+
self.handler = handler
|
|
50
|
+
self._is_invoke = is_invoke
|
|
51
|
+
self._rank = int(rank) # conversion from RouteRank IntEnum if necessary
|
|
52
|
+
self._is_agentic = is_agentic
|
|
53
|
+
self.auth_handlers = auth_handlers or []
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def is_invoke(self) -> bool:
|
|
57
|
+
return self._is_invoke
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def rank(self) -> int:
|
|
61
|
+
return self._rank
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def is_agentic(self) -> bool:
|
|
65
|
+
return self._is_agentic
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def priority(self) -> list[int]:
|
|
69
|
+
"""Lower "values" indicate higher priority.
|
|
70
|
+
|
|
71
|
+
Priority is determined by:
|
|
72
|
+
1. Whether the route is for an invoke activity (0) or not (1).
|
|
73
|
+
2. Whether the route is agentic (0) or not (1).
|
|
74
|
+
3. The rank of the route (lower numbers indicate higher priority).
|
|
75
|
+
|
|
76
|
+
In that order. If both are invokes, the agentic one has higher priority.
|
|
77
|
+
If both are agentic and invokes, then the rank determines priority.
|
|
78
|
+
|
|
79
|
+
priority is represented as a list of three integers for easy lexicographic comparison.
|
|
80
|
+
"""
|
|
81
|
+
return [
|
|
82
|
+
0 if self._is_invoke else 1,
|
|
83
|
+
0 if self._is_agentic else 1,
|
|
84
|
+
self._rank,
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
def __lt__(self, other: _Route) -> bool:
|
|
88
|
+
# built-in list ordering is a lexicographic comparison in Python
|
|
89
|
+
return self.priority < other.priority
|
microsoft_agents_hosting_core-0.4.0.dev18/microsoft_agents/hosting/core/app/_routes/_route_list.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import heapq
|
|
7
|
+
from typing import Generic, TypeVar
|
|
8
|
+
|
|
9
|
+
from ..state.turn_state import TurnState
|
|
10
|
+
from ._route import _Route
|
|
11
|
+
|
|
12
|
+
StateT = TypeVar("StateT", bound=TurnState)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class _RouteList(Generic[StateT]):
|
|
16
|
+
_routes: list[_Route[StateT]]
|
|
17
|
+
|
|
18
|
+
def __init__(
|
|
19
|
+
self,
|
|
20
|
+
) -> None:
|
|
21
|
+
# a min-heap where lower "values" indicate higher priority
|
|
22
|
+
self._routes = []
|
|
23
|
+
|
|
24
|
+
def add_route(self, route: _Route[StateT]) -> None:
|
|
25
|
+
"""Adds a route to the list."""
|
|
26
|
+
heapq.heappush(self._routes, route)
|
|
27
|
+
|
|
28
|
+
def __iter__(self):
|
|
29
|
+
# sorted will return a new list, leaving the heap intact
|
|
30
|
+
# returning an iterator over the previous list would expose
|
|
31
|
+
# internal details
|
|
32
|
+
return iter(sorted(self._routes))
|
microsoft_agents_hosting_core-0.4.0.dev18/microsoft_agents/hosting/core/app/_routes/route_rank.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from enum import IntEnum
|
|
5
|
+
|
|
6
|
+
_MAX_RANK = 2**16 - 1 # 65,535
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RouteRank(IntEnum):
|
|
10
|
+
"""Defines the rank of a route. Lower values indicate higher priority."""
|
|
11
|
+
|
|
12
|
+
FIRST = 0
|
|
13
|
+
DEFAULT = _MAX_RANK // 2
|
|
14
|
+
LAST = _MAX_RANK
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Callable, TypeVar, Awaitable, Protocol
|
|
5
|
+
|
|
6
|
+
from ..turn_context import TurnContext
|
|
7
|
+
from .state import TurnState
|
|
8
|
+
|
|
9
|
+
RouteSelector = Callable[[TurnContext], bool]
|
|
10
|
+
|
|
11
|
+
StateT = TypeVar("StateT", bound=TurnState)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class RouteHandler(Protocol[StateT]):
|
|
15
|
+
def __call__(self, context: TurnContext, state: StateT) -> Awaitable[None]: ...
|
|
@@ -13,9 +13,7 @@ from typing import (
|
|
|
13
13
|
Any,
|
|
14
14
|
Awaitable,
|
|
15
15
|
Callable,
|
|
16
|
-
Dict,
|
|
17
16
|
Generic,
|
|
18
|
-
List,
|
|
19
17
|
Optional,
|
|
20
18
|
Pattern,
|
|
21
19
|
TypeVar,
|
|
@@ -38,16 +36,17 @@ from ..authorization import Connections
|
|
|
38
36
|
from .app_error import ApplicationError
|
|
39
37
|
from .app_options import ApplicationOptions
|
|
40
38
|
|
|
41
|
-
from .route import Route, RouteHandler
|
|
42
39
|
from .state import TurnState
|
|
43
40
|
from ..channel_service_adapter import ChannelServiceAdapter
|
|
44
41
|
from .oauth import Authorization
|
|
45
42
|
from .typing_indicator import TypingIndicator
|
|
46
43
|
|
|
44
|
+
from ._type_defs import RouteHandler, RouteSelector
|
|
45
|
+
from ._routes import _RouteList, _Route, RouteRank, _agentic_selector
|
|
46
|
+
|
|
47
47
|
logger = logging.getLogger(__name__)
|
|
48
48
|
|
|
49
49
|
StateT = TypeVar("StateT", bound=TurnState)
|
|
50
|
-
IN_SIGN_IN_KEY = "__InSignInFlow__"
|
|
51
50
|
|
|
52
51
|
|
|
53
52
|
class AgentApplication(Agent, Generic[StateT]):
|
|
@@ -68,25 +67,25 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
68
67
|
_options: ApplicationOptions
|
|
69
68
|
_adapter: Optional[ChannelServiceAdapter] = None
|
|
70
69
|
_auth: Optional[Authorization] = None
|
|
71
|
-
_internal_before_turn:
|
|
72
|
-
_internal_after_turn:
|
|
73
|
-
|
|
70
|
+
_internal_before_turn: list[Callable[[TurnContext, StateT], Awaitable[bool]]] = []
|
|
71
|
+
_internal_after_turn: list[Callable[[TurnContext, StateT], Awaitable[bool]]] = []
|
|
72
|
+
_route_list: _RouteList[StateT] = _RouteList[StateT]()
|
|
74
73
|
_error: Optional[Callable[[TurnContext, Exception], Awaitable[None]]] = None
|
|
75
74
|
_turn_state_factory: Optional[Callable[[TurnContext], StateT]] = None
|
|
76
75
|
|
|
77
76
|
def __init__(
|
|
78
77
|
self,
|
|
79
|
-
options: ApplicationOptions = None,
|
|
78
|
+
options: Optional[ApplicationOptions] = None,
|
|
80
79
|
*,
|
|
81
|
-
connection_manager: Connections = None,
|
|
82
|
-
authorization: Authorization = None,
|
|
80
|
+
connection_manager: Optional[Connections] = None,
|
|
81
|
+
authorization: Optional[Authorization] = None,
|
|
83
82
|
**kwargs,
|
|
84
83
|
) -> None:
|
|
85
84
|
"""
|
|
86
85
|
Creates a new AgentApplication instance.
|
|
87
86
|
"""
|
|
88
87
|
self.typing = TypingIndicator()
|
|
89
|
-
self.
|
|
88
|
+
self._route_list = _RouteList[StateT]()
|
|
90
89
|
|
|
91
90
|
configuration = kwargs
|
|
92
91
|
|
|
@@ -204,11 +203,54 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
204
203
|
"""
|
|
205
204
|
return self._options
|
|
206
205
|
|
|
206
|
+
def add_route(
|
|
207
|
+
self,
|
|
208
|
+
selector: RouteSelector,
|
|
209
|
+
handler: RouteHandler[StateT],
|
|
210
|
+
is_invoke: bool = False,
|
|
211
|
+
is_agentic: bool = False,
|
|
212
|
+
rank: RouteRank = RouteRank.DEFAULT,
|
|
213
|
+
auth_handlers: Optional[list[str]] = None,
|
|
214
|
+
) -> None:
|
|
215
|
+
"""Adds a new route to the application.
|
|
216
|
+
|
|
217
|
+
Routes are ordered by: is_agentic, is_invoke, rank (lower is higher priority), in that order.
|
|
218
|
+
|
|
219
|
+
:param selector: A function that takes a TurnContext and returns a boolean indicating whether the route should be selected.
|
|
220
|
+
:type selector: RouteSelector
|
|
221
|
+
:param handler: A function that takes a TurnContext and a TurnState and returns an Awaitable.
|
|
222
|
+
:type handler: RouteHandler[StateT]
|
|
223
|
+
:param is_invoke: Whether the route is for an invoke activity, defaults to False
|
|
224
|
+
:type is_invoke: bool, optional
|
|
225
|
+
:param is_agentic: Whether the route is for an agentic request, defaults to False. For agentic requests
|
|
226
|
+
the selector will include a new check for `context.activity.is_agentic_request()`.
|
|
227
|
+
:type is_agentic: bool, optional
|
|
228
|
+
:param rank: The rank of the route, defaults to RouteRank.DEFAULT
|
|
229
|
+
:type rank: RouteRank, optional
|
|
230
|
+
:param auth_handlers: A list of authentication handler IDs to use for this route, defaults to None
|
|
231
|
+
:type auth_handlers: Optional[list[str]], optional
|
|
232
|
+
:raises ApplicationError: If the selector or handler are not valid.
|
|
233
|
+
"""
|
|
234
|
+
if not selector or not handler:
|
|
235
|
+
logger.error(
|
|
236
|
+
"AgentApplication.add_route(): selector and handler are required."
|
|
237
|
+
)
|
|
238
|
+
raise ApplicationError("selector and handler are required.")
|
|
239
|
+
|
|
240
|
+
if is_agentic:
|
|
241
|
+
selector = _agentic_selector(selector)
|
|
242
|
+
|
|
243
|
+
route = _Route[StateT](
|
|
244
|
+
selector, handler, is_invoke, rank, auth_handlers, is_agentic
|
|
245
|
+
)
|
|
246
|
+
self._route_list.add_route(route)
|
|
247
|
+
|
|
207
248
|
def activity(
|
|
208
249
|
self,
|
|
209
|
-
activity_type: Union[str, ActivityTypes,
|
|
250
|
+
activity_type: Union[str, ActivityTypes, list[Union[str, ActivityTypes]]],
|
|
210
251
|
*,
|
|
211
|
-
auth_handlers: Optional[
|
|
252
|
+
auth_handlers: Optional[list[str]] = None,
|
|
253
|
+
**kwargs,
|
|
212
254
|
) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]:
|
|
213
255
|
"""
|
|
214
256
|
Registers a new activity event listener. This method can be used as either
|
|
@@ -233,18 +275,17 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
233
275
|
logger.debug(
|
|
234
276
|
f"Registering activity handler for route handler {func.__name__} with type: {activity_type} with auth handlers: {auth_handlers}"
|
|
235
277
|
)
|
|
236
|
-
self.
|
|
237
|
-
Route[StateT](__selector, func, auth_handlers=auth_handlers)
|
|
238
|
-
)
|
|
278
|
+
self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
|
|
239
279
|
return func
|
|
240
280
|
|
|
241
281
|
return __call
|
|
242
282
|
|
|
243
283
|
def message(
|
|
244
284
|
self,
|
|
245
|
-
select: Union[str, Pattern[str],
|
|
285
|
+
select: Union[str, Pattern[str], list[Union[str, Pattern[str]]]],
|
|
246
286
|
*,
|
|
247
|
-
auth_handlers: Optional[
|
|
287
|
+
auth_handlers: Optional[list[str]] = None,
|
|
288
|
+
**kwargs,
|
|
248
289
|
) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]:
|
|
249
290
|
"""
|
|
250
291
|
Registers a new message activity event listener. This method can be used as either
|
|
@@ -276,9 +317,7 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
276
317
|
logger.debug(
|
|
277
318
|
f"Registering message handler for route handler {func.__name__} with select: {select} with auth handlers: {auth_handlers}"
|
|
278
319
|
)
|
|
279
|
-
self.
|
|
280
|
-
Route[StateT](__selector, func, auth_handlers=auth_handlers)
|
|
281
|
-
)
|
|
320
|
+
self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
|
|
282
321
|
return func
|
|
283
322
|
|
|
284
323
|
return __call
|
|
@@ -287,7 +326,8 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
287
326
|
self,
|
|
288
327
|
type: ConversationUpdateTypes,
|
|
289
328
|
*,
|
|
290
|
-
auth_handlers: Optional[
|
|
329
|
+
auth_handlers: Optional[list[str]] = None,
|
|
330
|
+
**kwargs,
|
|
291
331
|
) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]:
|
|
292
332
|
"""
|
|
293
333
|
Registers a new message activity event listener. This method can be used as either
|
|
@@ -311,12 +351,12 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
311
351
|
return False
|
|
312
352
|
|
|
313
353
|
if type == "membersAdded":
|
|
314
|
-
if isinstance(context.activity.members_added,
|
|
354
|
+
if isinstance(context.activity.members_added, list):
|
|
315
355
|
return len(context.activity.members_added) > 0
|
|
316
356
|
return False
|
|
317
357
|
|
|
318
358
|
if type == "membersRemoved":
|
|
319
|
-
if isinstance(context.activity.members_removed,
|
|
359
|
+
if isinstance(context.activity.members_removed, list):
|
|
320
360
|
return len(context.activity.members_removed) > 0
|
|
321
361
|
return False
|
|
322
362
|
|
|
@@ -330,15 +370,17 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
330
370
|
logger.debug(
|
|
331
371
|
f"Registering conversation update handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}"
|
|
332
372
|
)
|
|
333
|
-
self.
|
|
334
|
-
Route[StateT](__selector, func, auth_handlers=auth_handlers)
|
|
335
|
-
)
|
|
373
|
+
self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
|
|
336
374
|
return func
|
|
337
375
|
|
|
338
376
|
return __call
|
|
339
377
|
|
|
340
378
|
def message_reaction(
|
|
341
|
-
self,
|
|
379
|
+
self,
|
|
380
|
+
type: MessageReactionTypes,
|
|
381
|
+
*,
|
|
382
|
+
auth_handlers: Optional[list[str]] = None,
|
|
383
|
+
**kwargs,
|
|
342
384
|
) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]:
|
|
343
385
|
"""
|
|
344
386
|
Registers a new message activity event listener. This method can be used as either
|
|
@@ -361,12 +403,12 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
361
403
|
return False
|
|
362
404
|
|
|
363
405
|
if type == "reactionsAdded":
|
|
364
|
-
if isinstance(context.activity.reactions_added,
|
|
406
|
+
if isinstance(context.activity.reactions_added, list):
|
|
365
407
|
return len(context.activity.reactions_added) > 0
|
|
366
408
|
return False
|
|
367
409
|
|
|
368
410
|
if type == "reactionsRemoved":
|
|
369
|
-
if isinstance(context.activity.reactions_removed,
|
|
411
|
+
if isinstance(context.activity.reactions_removed, list):
|
|
370
412
|
return len(context.activity.reactions_removed) > 0
|
|
371
413
|
return False
|
|
372
414
|
|
|
@@ -376,15 +418,17 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
376
418
|
logger.debug(
|
|
377
419
|
f"Registering message reaction handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}"
|
|
378
420
|
)
|
|
379
|
-
self.
|
|
380
|
-
Route[StateT](__selector, func, auth_handlers=auth_handlers)
|
|
381
|
-
)
|
|
421
|
+
self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
|
|
382
422
|
return func
|
|
383
423
|
|
|
384
424
|
return __call
|
|
385
425
|
|
|
386
426
|
def message_update(
|
|
387
|
-
self,
|
|
427
|
+
self,
|
|
428
|
+
type: MessageUpdateTypes,
|
|
429
|
+
*,
|
|
430
|
+
auth_handlers: Optional[list[str]] = None,
|
|
431
|
+
**kwargs,
|
|
388
432
|
) -> Callable[[RouteHandler[StateT]], RouteHandler[StateT]]:
|
|
389
433
|
"""
|
|
390
434
|
Registers a new message activity event listener. This method can be used as either
|
|
@@ -435,14 +479,14 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
435
479
|
logger.debug(
|
|
436
480
|
f"Registering message update handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}"
|
|
437
481
|
)
|
|
438
|
-
self.
|
|
439
|
-
Route[StateT](__selector, func, auth_handlers=auth_handlers)
|
|
440
|
-
)
|
|
482
|
+
self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
|
|
441
483
|
return func
|
|
442
484
|
|
|
443
485
|
return __call
|
|
444
486
|
|
|
445
|
-
def handoff(
|
|
487
|
+
def handoff(
|
|
488
|
+
self, *, auth_handlers: Optional[list[str]] = None, **kwargs
|
|
489
|
+
) -> Callable[
|
|
446
490
|
[Callable[[TurnContext, StateT, str], Awaitable[None]]],
|
|
447
491
|
Callable[[TurnContext, StateT, str], Awaitable[None]],
|
|
448
492
|
]:
|
|
@@ -483,10 +527,7 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
483
527
|
f"Registering handoff handler for route handler {func.__name__} with auth handlers: {auth_handlers}"
|
|
484
528
|
)
|
|
485
529
|
|
|
486
|
-
self.
|
|
487
|
-
Route[StateT](__selector, __handler, True, auth_handlers)
|
|
488
|
-
)
|
|
489
|
-
self._routes = sorted(self._routes, key=lambda route: not route.is_invoke)
|
|
530
|
+
self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
|
|
490
531
|
return func
|
|
491
532
|
|
|
492
533
|
return __call
|
|
@@ -598,7 +639,6 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
598
639
|
await self._start_long_running_call(context, self._on_turn)
|
|
599
640
|
|
|
600
641
|
async def _on_turn(self, context: TurnContext):
|
|
601
|
-
# robrandao: TODO
|
|
602
642
|
try:
|
|
603
643
|
if context.activity.type != ActivityTypes.typing:
|
|
604
644
|
await self._start_typing(context)
|
|
@@ -663,7 +703,7 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
663
703
|
context.activity.text = context.remove_recipient_mention(context.activity)
|
|
664
704
|
|
|
665
705
|
@staticmethod
|
|
666
|
-
def parse_env_vars_configuration(vars:
|
|
706
|
+
def parse_env_vars_configuration(vars: dict[str, Any]) -> dict:
|
|
667
707
|
"""
|
|
668
708
|
Parses environment variables and returns a dictionary with the relevant configuration.
|
|
669
709
|
"""
|
|
@@ -738,7 +778,7 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
738
778
|
return True
|
|
739
779
|
|
|
740
780
|
async def _on_activity(self, context: TurnContext, state: StateT):
|
|
741
|
-
for route in self.
|
|
781
|
+
for route in self._route_list:
|
|
742
782
|
if route.selector(context):
|
|
743
783
|
if not route.auth_handlers:
|
|
744
784
|
await route.handler(context, state)
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the MIT License.
|
|
4
|
+
"""
|
|
5
|
+
|
|
1
6
|
from .agentic_user_authorization import AgenticUserAuthorization
|
|
2
7
|
from ._user_authorization import _UserAuthorization
|
|
3
8
|
from ._authorization_handler import _AuthorizationHandler
|
|
@@ -66,10 +66,7 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
66
66
|
|
|
67
67
|
response = ResourceResponse()
|
|
68
68
|
|
|
69
|
-
if activity.type ==
|
|
70
|
-
delay_time = int((activity.value or 1000) / 1000)
|
|
71
|
-
await sleep(delay_time)
|
|
72
|
-
elif activity.type == ActivityTypes.invoke_response:
|
|
69
|
+
if activity.type == ActivityTypes.invoke_response:
|
|
73
70
|
context.turn_state[self.INVOKE_RESPONSE_KEY] = activity
|
|
74
71
|
elif (
|
|
75
72
|
activity.type == ActivityTypes.trace
|
|
@@ -197,9 +197,6 @@ class ConversationsOperations(ConversationsBase):
|
|
|
197
197
|
)
|
|
198
198
|
raise ValueError("conversationId and activityId are required")
|
|
199
199
|
|
|
200
|
-
print("\n*3")
|
|
201
|
-
print(conversation_id)
|
|
202
|
-
print("\n*3")
|
|
203
200
|
conversation_id = self._normalize_conversation_id(conversation_id)
|
|
204
201
|
url = f"v3/conversations/{conversation_id}/activities/{activity_id}"
|
|
205
202
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-core
|
|
3
|
-
Version: 0.4.0.
|
|
3
|
+
Version: 0.4.0.dev18
|
|
4
4
|
Summary: Core library for Microsoft Agents
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
Project-URL: Homepage, https://github.com/microsoft/Agents
|
|
@@ -8,7 +8,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
9
|
Classifier: Operating System :: OS Independent
|
|
10
10
|
Requires-Python: >=3.9
|
|
11
|
-
Requires-Dist: microsoft-agents-activity==0.4.0.
|
|
11
|
+
Requires-Dist: microsoft-agents-activity==0.4.0.dev18
|
|
12
12
|
Requires-Dist: pyjwt>=2.10.1
|
|
13
13
|
Requires-Dist: isodate>=0.6.1
|
|
14
14
|
Requires-Dist: azure-core>=1.30.0
|
|
@@ -17,13 +17,17 @@ microsoft_agents/hosting/core/_oauth/_flow_state.py
|
|
|
17
17
|
microsoft_agents/hosting/core/_oauth/_flow_storage_client.py
|
|
18
18
|
microsoft_agents/hosting/core/_oauth/_oauth_flow.py
|
|
19
19
|
microsoft_agents/hosting/core/app/__init__.py
|
|
20
|
+
microsoft_agents/hosting/core/app/_type_defs.py
|
|
20
21
|
microsoft_agents/hosting/core/app/agent_application.py
|
|
21
22
|
microsoft_agents/hosting/core/app/app_error.py
|
|
22
23
|
microsoft_agents/hosting/core/app/app_options.py
|
|
23
24
|
microsoft_agents/hosting/core/app/input_file.py
|
|
24
25
|
microsoft_agents/hosting/core/app/query.py
|
|
25
|
-
microsoft_agents/hosting/core/app/route.py
|
|
26
26
|
microsoft_agents/hosting/core/app/typing_indicator.py
|
|
27
|
+
microsoft_agents/hosting/core/app/_routes/__init__.py
|
|
28
|
+
microsoft_agents/hosting/core/app/_routes/_route.py
|
|
29
|
+
microsoft_agents/hosting/core/app/_routes/_route_list.py
|
|
30
|
+
microsoft_agents/hosting/core/app/_routes/route_rank.py
|
|
27
31
|
microsoft_agents/hosting/core/app/oauth/__init__.py
|
|
28
32
|
microsoft_agents/hosting/core/app/oauth/_sign_in_response.py
|
|
29
33
|
microsoft_agents/hosting/core/app/oauth/_sign_in_state.py
|
|
@@ -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 []
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/setup.cfg
RENAMED
|
File without changes
|
{microsoft_agents_hosting_core-0.4.0.dev16 → microsoft_agents_hosting_core-0.4.0.dev18}/setup.py
RENAMED
|
File without changes
|