microsoft-agents-hosting-core 0.5.3__tar.gz → 0.6.0__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.5.3 → microsoft_agents_hosting_core-0.6.0}/PKG-INFO +2 -2
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/__init__.py +6 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/agent_application.py +3 -3
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/state/state.py +1 -1
- microsoft_agents_hosting_core-0.6.0/microsoft_agents/hosting/core/app/typing_indicator.py +81 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/channel_service_adapter.py +17 -18
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +1 -1
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/client/connector_client.py +84 -50
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/client/user_token_client.py +26 -24
- microsoft_agents_hosting_core-0.6.0/microsoft_agents/hosting/core/errors/__init__.py +18 -0
- microsoft_agents_hosting_core-0.6.0/microsoft_agents/hosting/core/errors/error_resources.py +173 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +4 -4
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents_hosting_core.egg-info/PKG-INFO +2 -2
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +2 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents_hosting_core.egg-info/requires.txt +1 -1
- microsoft_agents_hosting_core-0.5.3/microsoft_agents/hosting/core/app/typing_indicator.py +0 -78
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/LICENSE +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/activity_handler.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/agent.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/_type_defs.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/app_error.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/app_options.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/input_file.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/oauth/authorization.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/query.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/authorization/jwt_token_validator.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/card_factory.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/message_factory.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/middleware_set.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/state/user_state.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/storage.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/transcript_file_store.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/transcript_info.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/transcript_logger.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/transcript_memory_store.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/storage/transcript_store.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents/hosting/core/turn_context.py +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/pyproject.toml +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/readme.md +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/setup.cfg +0 -0
- {microsoft_agents_hosting_core-0.5.3 → microsoft_agents_hosting_core-0.6.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-core
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Core library for Microsoft Agents
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: microsoft-agents-activity==0.
|
|
18
|
+
Requires-Dist: microsoft-agents-activity==0.6.0
|
|
19
19
|
Requires-Dist: pyjwt>=2.10.1
|
|
20
20
|
Requires-Dist: isodate>=0.6.1
|
|
21
21
|
Requires-Dist: azure-core>=1.30.0
|
|
@@ -82,6 +82,9 @@ from .storage.store_item import StoreItem
|
|
|
82
82
|
from .storage import Storage
|
|
83
83
|
from .storage.memory_storage import MemoryStorage
|
|
84
84
|
|
|
85
|
+
# Error Resources
|
|
86
|
+
from .errors import error_resources, ErrorMessage, ErrorResources
|
|
87
|
+
|
|
85
88
|
|
|
86
89
|
# Define the package's public interface
|
|
87
90
|
__all__ = [
|
|
@@ -148,4 +151,7 @@ __all__ = [
|
|
|
148
151
|
"MemoryStorage",
|
|
149
152
|
"AgenticUserAuthorization",
|
|
150
153
|
"Authorization",
|
|
154
|
+
"error_resources",
|
|
155
|
+
"ErrorMessage",
|
|
156
|
+
"ErrorResources",
|
|
151
157
|
]
|
|
@@ -683,8 +683,8 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
683
683
|
try:
|
|
684
684
|
if context.activity.type != ActivityTypes.typing:
|
|
685
685
|
if self._options.start_typing_timer:
|
|
686
|
-
typing = TypingIndicator()
|
|
687
|
-
|
|
686
|
+
typing = TypingIndicator(context)
|
|
687
|
+
typing.start()
|
|
688
688
|
|
|
689
689
|
self._remove_mentions(context)
|
|
690
690
|
|
|
@@ -733,7 +733,7 @@ class AgentApplication(Agent, Generic[StateT]):
|
|
|
733
733
|
await self._on_error(context, err)
|
|
734
734
|
finally:
|
|
735
735
|
if typing:
|
|
736
|
-
|
|
736
|
+
typing.stop()
|
|
737
737
|
|
|
738
738
|
def _remove_mentions(self, context: TurnContext):
|
|
739
739
|
if (
|
|
@@ -109,7 +109,7 @@ class State(dict[str, StoreItem], ABC):
|
|
|
109
109
|
data = self.copy()
|
|
110
110
|
del data["__key__"]
|
|
111
111
|
|
|
112
|
-
logger.info(
|
|
112
|
+
logger.info("Saving state %s", self.__key__)
|
|
113
113
|
await storage.delete(self.__deleted__)
|
|
114
114
|
await storage.write(
|
|
115
115
|
{
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the MIT License.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import asyncio
|
|
9
|
+
import logging
|
|
10
|
+
from typing import Optional
|
|
11
|
+
|
|
12
|
+
from microsoft_agents.hosting.core import TurnContext
|
|
13
|
+
from microsoft_agents.activity import Activity, ActivityTypes
|
|
14
|
+
|
|
15
|
+
logger = logging.getLogger(__name__)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class TypingIndicator:
|
|
19
|
+
"""
|
|
20
|
+
Encapsulates the logic for sending "typing" activity to the user.
|
|
21
|
+
|
|
22
|
+
Scoped to a single turn of conversation with the user.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
def __init__(self, context: TurnContext, interval_seconds: float = 10.0) -> None:
|
|
26
|
+
"""Initializes a new instance of the TypingIndicator class.
|
|
27
|
+
|
|
28
|
+
:param context: The turn context.
|
|
29
|
+
:param interval_seconds: The interval in seconds between typing indicators.
|
|
30
|
+
"""
|
|
31
|
+
if interval_seconds <= 0:
|
|
32
|
+
raise ValueError("interval_seconds must be greater than 0")
|
|
33
|
+
self._context: TurnContext = context
|
|
34
|
+
self._interval: float = interval_seconds
|
|
35
|
+
self._task: Optional[asyncio.Task[None]] = None
|
|
36
|
+
|
|
37
|
+
async def _run(self) -> None:
|
|
38
|
+
"""Sends typing indicators at regular intervals."""
|
|
39
|
+
|
|
40
|
+
running_task = self._task
|
|
41
|
+
try:
|
|
42
|
+
while running_task is self._task:
|
|
43
|
+
await self._context.send_activity(Activity(type=ActivityTypes.typing))
|
|
44
|
+
await asyncio.sleep(self._interval)
|
|
45
|
+
except asyncio.CancelledError:
|
|
46
|
+
# Task was cancelled, exit gracefully
|
|
47
|
+
pass
|
|
48
|
+
|
|
49
|
+
def start(self) -> None:
|
|
50
|
+
"""Starts sending typing indicators."""
|
|
51
|
+
|
|
52
|
+
if self._task is not None:
|
|
53
|
+
logger.warning(
|
|
54
|
+
"Typing indicator is already running for conversation %s",
|
|
55
|
+
self._context.activity.conversation.id,
|
|
56
|
+
)
|
|
57
|
+
return
|
|
58
|
+
|
|
59
|
+
logger.debug(
|
|
60
|
+
"Starting typing indicator with interval: %s seconds in conversation %s",
|
|
61
|
+
self._interval,
|
|
62
|
+
self._context.activity.conversation.id,
|
|
63
|
+
)
|
|
64
|
+
self._task = asyncio.create_task(self._run())
|
|
65
|
+
|
|
66
|
+
def stop(self) -> None:
|
|
67
|
+
"""Stops sending typing indicators."""
|
|
68
|
+
|
|
69
|
+
if self._task is None:
|
|
70
|
+
logger.warning(
|
|
71
|
+
"Typing indicator is not running for conversation %s",
|
|
72
|
+
self._context.activity.conversation.id,
|
|
73
|
+
)
|
|
74
|
+
return
|
|
75
|
+
|
|
76
|
+
logger.debug(
|
|
77
|
+
"Stopping typing indicator for conversation %s",
|
|
78
|
+
self._context.activity.conversation.id,
|
|
79
|
+
)
|
|
80
|
+
self._task.cancel()
|
|
81
|
+
self._task = None
|
|
@@ -262,28 +262,12 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
262
262
|
claims_identity = self.create_claims_identity(agent_app_id)
|
|
263
263
|
claims_identity.claims[AuthenticationConstants.SERVICE_URL_CLAIM] = service_url
|
|
264
264
|
|
|
265
|
-
# Create a turn context and run the pipeline.
|
|
266
|
-
context = self._create_turn_context(
|
|
267
|
-
claims_identity,
|
|
268
|
-
None,
|
|
269
|
-
callback,
|
|
270
|
-
)
|
|
271
|
-
|
|
272
|
-
# Create a UserTokenClient instance for the application to use. (For example, in the OAuthPrompt.)
|
|
273
|
-
user_token_client: UserTokenClient = (
|
|
274
|
-
await self._channel_service_client_factory.create_user_token_client(
|
|
275
|
-
context, claims_identity
|
|
276
|
-
)
|
|
277
|
-
)
|
|
278
|
-
context.turn_state[self.USER_TOKEN_CLIENT_KEY] = user_token_client
|
|
279
|
-
|
|
280
265
|
# Create the connector client to use for outbound requests.
|
|
281
266
|
connector_client: ConnectorClient = (
|
|
282
267
|
await self._channel_service_client_factory.create_connector_client(
|
|
283
|
-
|
|
268
|
+
None, claims_identity, service_url, audience
|
|
284
269
|
)
|
|
285
270
|
)
|
|
286
|
-
context.turn_state[self._AGENT_CONNECTOR_CLIENT_KEY] = connector_client
|
|
287
271
|
|
|
288
272
|
# Make the actual create conversation call using the connector.
|
|
289
273
|
create_conversation_result = (
|
|
@@ -297,7 +281,22 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
|
|
|
297
281
|
create_conversation_result, channel_id, service_url, conversation_parameters
|
|
298
282
|
)
|
|
299
283
|
|
|
300
|
-
context
|
|
284
|
+
# Create a turn context and run the pipeline.
|
|
285
|
+
context = self._create_turn_context(
|
|
286
|
+
claims_identity,
|
|
287
|
+
None,
|
|
288
|
+
callback,
|
|
289
|
+
create_activity,
|
|
290
|
+
)
|
|
291
|
+
context.turn_state[self._AGENT_CONNECTOR_CLIENT_KEY] = connector_client
|
|
292
|
+
|
|
293
|
+
# Create a UserTokenClient instance for the application to use. (For example, in the OAuthPrompt.)
|
|
294
|
+
user_token_client: UserTokenClient = (
|
|
295
|
+
await self._channel_service_client_factory.create_user_token_client(
|
|
296
|
+
context, claims_identity
|
|
297
|
+
)
|
|
298
|
+
)
|
|
299
|
+
context.turn_state[self.USER_TOKEN_CLIENT_KEY] = user_token_client
|
|
301
300
|
|
|
302
301
|
# Run the pipeline
|
|
303
302
|
await self.run_pipeline(context, callback)
|
|
@@ -74,11 +74,13 @@ class AttachmentsOperations(AttachmentsBase):
|
|
|
74
74
|
|
|
75
75
|
url = f"v3/attachments/{attachment_id}"
|
|
76
76
|
|
|
77
|
-
logger.info(
|
|
77
|
+
logger.info("Getting attachment info for ID: %s", attachment_id)
|
|
78
78
|
async with self.client.get(url) as response:
|
|
79
|
-
if response.status >=
|
|
79
|
+
if response.status >= 300:
|
|
80
80
|
logger.error(
|
|
81
|
-
|
|
81
|
+
"Error getting attachment info: %s",
|
|
82
|
+
response.status,
|
|
83
|
+
stack_info=True,
|
|
82
84
|
)
|
|
83
85
|
response.raise_for_status()
|
|
84
86
|
|
|
@@ -108,11 +110,13 @@ class AttachmentsOperations(AttachmentsBase):
|
|
|
108
110
|
|
|
109
111
|
url = f"v3/attachments/{attachment_id}/views/{view_id}"
|
|
110
112
|
|
|
111
|
-
logger.info(
|
|
113
|
+
logger.info(
|
|
114
|
+
"Getting attachment for ID: %s, View ID: %s", attachment_id, view_id
|
|
115
|
+
)
|
|
112
116
|
async with self.client.get(url) as response:
|
|
113
|
-
if response.status >=
|
|
117
|
+
if response.status >= 300:
|
|
114
118
|
logger.error(
|
|
115
|
-
|
|
119
|
+
"Error getting attachment: %s", response.status, stack_info=True
|
|
116
120
|
)
|
|
117
121
|
response.raise_for_status()
|
|
118
122
|
|
|
@@ -143,12 +147,12 @@ class ConversationsOperations(ConversationsBase):
|
|
|
143
147
|
)
|
|
144
148
|
|
|
145
149
|
logger.info(
|
|
146
|
-
|
|
150
|
+
"Getting conversations with continuation token: %s", continuation_token
|
|
147
151
|
)
|
|
148
152
|
async with self.client.get("v3/conversations", params=params) as response:
|
|
149
|
-
if response.status >=
|
|
153
|
+
if response.status >= 300:
|
|
150
154
|
logger.error(
|
|
151
|
-
|
|
155
|
+
"Error getting conversations: %s", response.status, stack_info=True
|
|
152
156
|
)
|
|
153
157
|
response.raise_for_status()
|
|
154
158
|
|
|
@@ -170,9 +174,9 @@ class ConversationsOperations(ConversationsBase):
|
|
|
170
174
|
"v3/conversations",
|
|
171
175
|
json=body.model_dump(by_alias=True, exclude_unset=True, mode="json"),
|
|
172
176
|
) as response:
|
|
173
|
-
if response.status >=
|
|
177
|
+
if response.status >= 300:
|
|
174
178
|
logger.error(
|
|
175
|
-
|
|
179
|
+
"Error creating conversation: %s", response.status, stack_info=True
|
|
176
180
|
)
|
|
177
181
|
response.raise_for_status()
|
|
178
182
|
|
|
@@ -201,7 +205,10 @@ class ConversationsOperations(ConversationsBase):
|
|
|
201
205
|
url = f"v3/conversations/{conversation_id}/activities/{activity_id}"
|
|
202
206
|
|
|
203
207
|
logger.info(
|
|
204
|
-
|
|
208
|
+
"Replying to activity: %s in conversation: %s. Activity type is %s",
|
|
209
|
+
activity_id,
|
|
210
|
+
conversation_id,
|
|
211
|
+
body.type,
|
|
205
212
|
)
|
|
206
213
|
|
|
207
214
|
async with self.client.post(
|
|
@@ -212,15 +219,16 @@ class ConversationsOperations(ConversationsBase):
|
|
|
212
219
|
) as response:
|
|
213
220
|
result = await response.json() if response.content_length else {}
|
|
214
221
|
|
|
215
|
-
if response.status >=
|
|
222
|
+
if response.status >= 300:
|
|
216
223
|
logger.error(
|
|
217
|
-
|
|
224
|
+
"Error replying to activity: %s",
|
|
225
|
+
result or response.status,
|
|
218
226
|
stack_info=True,
|
|
219
227
|
)
|
|
220
228
|
response.raise_for_status()
|
|
221
229
|
|
|
222
230
|
logger.info(
|
|
223
|
-
|
|
231
|
+
"Reply to conversation/activity: %s, %s", result.get("id"), activity_id
|
|
224
232
|
)
|
|
225
233
|
|
|
226
234
|
return ResourceResponse.model_validate(result)
|
|
@@ -246,15 +254,19 @@ class ConversationsOperations(ConversationsBase):
|
|
|
246
254
|
url = f"v3/conversations/{conversation_id}/activities"
|
|
247
255
|
|
|
248
256
|
logger.info(
|
|
249
|
-
|
|
257
|
+
"Sending to conversation: %s. Activity type is %s",
|
|
258
|
+
conversation_id,
|
|
259
|
+
body.type,
|
|
250
260
|
)
|
|
251
261
|
async with self.client.post(
|
|
252
262
|
url,
|
|
253
263
|
json=body.model_dump(by_alias=True, exclude_unset=True, mode="json"),
|
|
254
264
|
) as response:
|
|
255
|
-
if response.status >=
|
|
265
|
+
if response.status >= 300:
|
|
256
266
|
logger.error(
|
|
257
|
-
|
|
267
|
+
"Error sending to conversation: %s",
|
|
268
|
+
response.status,
|
|
269
|
+
stack_info=True,
|
|
258
270
|
)
|
|
259
271
|
response.raise_for_status()
|
|
260
272
|
|
|
@@ -283,15 +295,18 @@ class ConversationsOperations(ConversationsBase):
|
|
|
283
295
|
url = f"v3/conversations/{conversation_id}/activities/{activity_id}"
|
|
284
296
|
|
|
285
297
|
logger.info(
|
|
286
|
-
|
|
298
|
+
"Updating activity: %s in conversation: %s. Activity type is %s",
|
|
299
|
+
activity_id,
|
|
300
|
+
conversation_id,
|
|
301
|
+
body.type,
|
|
287
302
|
)
|
|
288
303
|
async with self.client.put(
|
|
289
304
|
url,
|
|
290
305
|
json=body.model_dump(by_alias=True, exclude_unset=True),
|
|
291
306
|
) as response:
|
|
292
|
-
if response.status >=
|
|
307
|
+
if response.status >= 300:
|
|
293
308
|
logger.error(
|
|
294
|
-
|
|
309
|
+
"Error updating activity: %s", response.status, stack_info=True
|
|
295
310
|
)
|
|
296
311
|
response.raise_for_status()
|
|
297
312
|
|
|
@@ -316,12 +331,14 @@ class ConversationsOperations(ConversationsBase):
|
|
|
316
331
|
url = f"v3/conversations/{conversation_id}/activities/{activity_id}"
|
|
317
332
|
|
|
318
333
|
logger.info(
|
|
319
|
-
|
|
334
|
+
"Deleting activity: %s from conversation: %s",
|
|
335
|
+
activity_id,
|
|
336
|
+
conversation_id,
|
|
320
337
|
)
|
|
321
338
|
async with self.client.delete(url) as response:
|
|
322
|
-
if response.status >=
|
|
339
|
+
if response.status >= 300:
|
|
323
340
|
logger.error(
|
|
324
|
-
|
|
341
|
+
"Error deleting activity: %s", response.status, stack_info=True
|
|
325
342
|
)
|
|
326
343
|
response.raise_for_status()
|
|
327
344
|
|
|
@@ -354,12 +371,14 @@ class ConversationsOperations(ConversationsBase):
|
|
|
354
371
|
}
|
|
355
372
|
|
|
356
373
|
logger.info(
|
|
357
|
-
|
|
374
|
+
"Uploading attachment to conversation: %s, Attachment name: %s",
|
|
375
|
+
conversation_id,
|
|
376
|
+
body.name,
|
|
358
377
|
)
|
|
359
378
|
async with self.client.post(url, json=attachment_dict) as response:
|
|
360
|
-
if response.status >=
|
|
379
|
+
if response.status >= 300:
|
|
361
380
|
logger.error(
|
|
362
|
-
|
|
381
|
+
"Error uploading attachment: %s", response.status, stack_info=True
|
|
363
382
|
)
|
|
364
383
|
response.raise_for_status()
|
|
365
384
|
|
|
@@ -385,11 +404,14 @@ class ConversationsOperations(ConversationsBase):
|
|
|
385
404
|
conversation_id = self._normalize_conversation_id(conversation_id)
|
|
386
405
|
url = f"v3/conversations/{conversation_id}/members"
|
|
387
406
|
|
|
388
|
-
logger.info(
|
|
407
|
+
logger.info(
|
|
408
|
+
"Getting conversation members for conversation: %s", conversation_id
|
|
409
|
+
)
|
|
389
410
|
async with self.client.get(url) as response:
|
|
390
|
-
if response.status >=
|
|
411
|
+
if response.status >= 300:
|
|
391
412
|
logger.error(
|
|
392
|
-
|
|
413
|
+
"Error getting conversation members: %s",
|
|
414
|
+
response.status,
|
|
393
415
|
stack_info=True,
|
|
394
416
|
)
|
|
395
417
|
response.raise_for_status()
|
|
@@ -418,12 +440,15 @@ class ConversationsOperations(ConversationsBase):
|
|
|
418
440
|
url = f"v3/conversations/{conversation_id}/members/{member_id}"
|
|
419
441
|
|
|
420
442
|
logger.info(
|
|
421
|
-
|
|
443
|
+
"Getting conversation member: %s from conversation: %s",
|
|
444
|
+
member_id,
|
|
445
|
+
conversation_id,
|
|
422
446
|
)
|
|
423
447
|
async with self.client.get(url) as response:
|
|
424
|
-
if response.status >=
|
|
448
|
+
if response.status >= 300:
|
|
425
449
|
logger.error(
|
|
426
|
-
|
|
450
|
+
"Error getting conversation member: %s",
|
|
451
|
+
response.status,
|
|
427
452
|
stack_info=True,
|
|
428
453
|
)
|
|
429
454
|
response.raise_for_status()
|
|
@@ -451,12 +476,15 @@ class ConversationsOperations(ConversationsBase):
|
|
|
451
476
|
url = f"v3/conversations/{conversation_id}/members/{member_id}"
|
|
452
477
|
|
|
453
478
|
logger.info(
|
|
454
|
-
|
|
479
|
+
"Deleting conversation member: %s from conversation: %s",
|
|
480
|
+
member_id,
|
|
481
|
+
conversation_id,
|
|
455
482
|
)
|
|
456
483
|
async with self.client.delete(url) as response:
|
|
457
|
-
if response.status >=
|
|
484
|
+
if response.status >= 300:
|
|
458
485
|
logger.error(
|
|
459
|
-
|
|
486
|
+
"Error deleting conversation member: %s",
|
|
487
|
+
response.status,
|
|
460
488
|
stack_info=True,
|
|
461
489
|
)
|
|
462
490
|
response.raise_for_status()
|
|
@@ -482,12 +510,15 @@ class ConversationsOperations(ConversationsBase):
|
|
|
482
510
|
url = f"v3/conversations/{conversation_id}/activities/{activity_id}/members"
|
|
483
511
|
|
|
484
512
|
logger.info(
|
|
485
|
-
|
|
513
|
+
"Getting activity members for conversation: %s, Activity ID: %s",
|
|
514
|
+
conversation_id,
|
|
515
|
+
activity_id,
|
|
486
516
|
)
|
|
487
517
|
async with self.client.get(url) as response:
|
|
488
|
-
if response.status >=
|
|
518
|
+
if response.status >= 300:
|
|
489
519
|
logger.error(
|
|
490
|
-
|
|
520
|
+
"Error getting activity members: %s",
|
|
521
|
+
response.status,
|
|
491
522
|
stack_info=True,
|
|
492
523
|
)
|
|
493
524
|
response.raise_for_status()
|
|
@@ -526,12 +557,16 @@ class ConversationsOperations(ConversationsBase):
|
|
|
526
557
|
url = f"v3/conversations/{conversation_id}/pagedmembers"
|
|
527
558
|
|
|
528
559
|
logger.info(
|
|
529
|
-
|
|
560
|
+
"Getting paged members for conversation: %s, Page Size: %s, Continuation Token: %s",
|
|
561
|
+
conversation_id,
|
|
562
|
+
page_size,
|
|
563
|
+
continuation_token,
|
|
530
564
|
)
|
|
531
565
|
async with self.client.get(url, params=params) as response:
|
|
532
|
-
if response.status >=
|
|
566
|
+
if response.status >= 300:
|
|
533
567
|
logger.error(
|
|
534
|
-
|
|
568
|
+
"Error getting conversation paged members: %s",
|
|
569
|
+
response.status,
|
|
535
570
|
stack_info=True,
|
|
536
571
|
)
|
|
537
572
|
response.raise_for_status()
|
|
@@ -559,15 +594,12 @@ class ConversationsOperations(ConversationsBase):
|
|
|
559
594
|
conversation_id = self._normalize_conversation_id(conversation_id)
|
|
560
595
|
url = f"v3/conversations/{conversation_id}/activities/history"
|
|
561
596
|
|
|
562
|
-
logger.info(
|
|
597
|
+
logger.info("Sending conversation history to conversation: %s", conversation_id)
|
|
563
598
|
async with self.client.post(url, json=body) as response:
|
|
564
|
-
if
|
|
565
|
-
response.status >= 400
|
|
566
|
-
and response.status != 201
|
|
567
|
-
and response.status != 202
|
|
568
|
-
):
|
|
599
|
+
if response.status >= 300:
|
|
569
600
|
logger.error(
|
|
570
|
-
|
|
601
|
+
"Error sending conversation history: %s",
|
|
602
|
+
response.status,
|
|
571
603
|
stack_info=True,
|
|
572
604
|
)
|
|
573
605
|
response.raise_for_status()
|
|
@@ -602,7 +634,9 @@ class ConnectorClient(ConnectorClientBase):
|
|
|
602
634
|
headers=headers,
|
|
603
635
|
)
|
|
604
636
|
logger.debug(
|
|
605
|
-
|
|
637
|
+
"ConnectorClient initialized with endpoint: %s and headers: %s",
|
|
638
|
+
endpoint,
|
|
639
|
+
headers,
|
|
606
640
|
)
|
|
607
641
|
|
|
608
642
|
if len(token) > 1:
|
|
@@ -53,13 +53,14 @@ class AgentSignIn(AgentSignInBase):
|
|
|
53
53
|
params["finalRedirect"] = final_redirect
|
|
54
54
|
|
|
55
55
|
logger.info(
|
|
56
|
-
|
|
56
|
+
"AgentSignIn.get_sign_in_url(): Getting sign-in URL with params: %s",
|
|
57
|
+
params,
|
|
57
58
|
)
|
|
58
59
|
async with self.client.get(
|
|
59
60
|
"api/agentsignin/getSignInUrl", params=params
|
|
60
61
|
) as response:
|
|
61
|
-
if response.status >=
|
|
62
|
-
logger.error(
|
|
62
|
+
if response.status >= 300:
|
|
63
|
+
logger.error("Error getting sign-in URL: %s", response.status)
|
|
63
64
|
response.raise_for_status()
|
|
64
65
|
|
|
65
66
|
return await response.text()
|
|
@@ -89,13 +90,14 @@ class AgentSignIn(AgentSignInBase):
|
|
|
89
90
|
params["finalRedirect"] = final_redirect
|
|
90
91
|
|
|
91
92
|
logger.info(
|
|
92
|
-
|
|
93
|
+
"AgentSignIn.get_sign_in_resource(): Getting sign-in resource with params: %s",
|
|
94
|
+
params,
|
|
93
95
|
)
|
|
94
96
|
async with self.client.get(
|
|
95
97
|
"api/botsignin/getSignInResource", params=params
|
|
96
98
|
) as response:
|
|
97
|
-
if response.status >=
|
|
98
|
-
logger.error(
|
|
99
|
+
if response.status >= 300:
|
|
100
|
+
logger.error("Error getting sign-in resource: %s", response.status)
|
|
99
101
|
response.raise_for_status()
|
|
100
102
|
|
|
101
103
|
data = await response.json()
|
|
@@ -122,12 +124,10 @@ class UserToken(UserTokenBase):
|
|
|
122
124
|
if code:
|
|
123
125
|
params["code"] = code
|
|
124
126
|
|
|
125
|
-
logger.info(
|
|
127
|
+
logger.info("User_token.get_token(): Getting token with params: %s", params)
|
|
126
128
|
async with self.client.get("api/usertoken/GetToken", params=params) as response:
|
|
127
|
-
if response.status
|
|
128
|
-
|
|
129
|
-
if response.status >= 400:
|
|
130
|
-
logger.error(f"Error getting token: {response.status}")
|
|
129
|
+
if response.status >= 300:
|
|
130
|
+
logger.error("Error getting token: %s", response.status)
|
|
131
131
|
response.raise_for_status()
|
|
132
132
|
|
|
133
133
|
data = await response.json()
|
|
@@ -179,12 +179,12 @@ class UserToken(UserTokenBase):
|
|
|
179
179
|
if channel_id:
|
|
180
180
|
params["channelId"] = channel_id
|
|
181
181
|
|
|
182
|
-
logger.info(
|
|
182
|
+
logger.info("Getting AAD tokens with params: %s and body: %s", params, body)
|
|
183
183
|
async with self.client.post(
|
|
184
184
|
"api/usertoken/GetAadTokens", params=params, json=body
|
|
185
185
|
) as response:
|
|
186
|
-
if response.status >=
|
|
187
|
-
logger.error(
|
|
186
|
+
if response.status >= 300:
|
|
187
|
+
logger.error("Error getting AAD tokens: %s", response.status)
|
|
188
188
|
response.raise_for_status()
|
|
189
189
|
|
|
190
190
|
data = await response.json()
|
|
@@ -203,12 +203,12 @@ class UserToken(UserTokenBase):
|
|
|
203
203
|
if channel_id:
|
|
204
204
|
params["channelId"] = channel_id
|
|
205
205
|
|
|
206
|
-
logger.info(
|
|
206
|
+
logger.info("Signing out user %s with params: %s", user_id, params)
|
|
207
207
|
async with self.client.delete(
|
|
208
208
|
"api/usertoken/SignOut", params=params
|
|
209
209
|
) as response:
|
|
210
|
-
if response.status >=
|
|
211
|
-
logger.error(
|
|
210
|
+
if response.status >= 300:
|
|
211
|
+
logger.error("Error signing out: %s", response.status)
|
|
212
212
|
response.raise_for_status()
|
|
213
213
|
|
|
214
214
|
async def get_token_status(
|
|
@@ -224,12 +224,12 @@ class UserToken(UserTokenBase):
|
|
|
224
224
|
if include:
|
|
225
225
|
params["include"] = include
|
|
226
226
|
|
|
227
|
-
logger.info(
|
|
227
|
+
logger.info("Getting token status for user %s with params: %s", user_id, params)
|
|
228
228
|
async with self.client.get(
|
|
229
229
|
"api/usertoken/GetTokenStatus", params=params
|
|
230
230
|
) as response:
|
|
231
|
-
if response.status >=
|
|
232
|
-
logger.error(
|
|
231
|
+
if response.status >= 300:
|
|
232
|
+
logger.error("Error getting token status: %s", response.status)
|
|
233
233
|
response.raise_for_status()
|
|
234
234
|
|
|
235
235
|
data = await response.json()
|
|
@@ -248,12 +248,12 @@ class UserToken(UserTokenBase):
|
|
|
248
248
|
"channelId": channel_id,
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
logger.info(
|
|
251
|
+
logger.info("Exchanging token with params: %s and body: %s", params, body)
|
|
252
252
|
async with self.client.post(
|
|
253
253
|
"api/usertoken/exchange", params=params, json=body
|
|
254
254
|
) as response:
|
|
255
|
-
if response.status >=
|
|
256
|
-
logger.error(
|
|
255
|
+
if response.status >= 300:
|
|
256
|
+
logger.error("Error exchanging token: %s", response.status)
|
|
257
257
|
response.raise_for_status()
|
|
258
258
|
|
|
259
259
|
data = await response.json()
|
|
@@ -289,7 +289,9 @@ class UserTokenClient(UserTokenClientBase):
|
|
|
289
289
|
headers=headers,
|
|
290
290
|
)
|
|
291
291
|
logger.debug(
|
|
292
|
-
|
|
292
|
+
"Creating UserTokenClient with endpoint: %s and headers: %s",
|
|
293
|
+
endpoint,
|
|
294
|
+
headers,
|
|
293
295
|
)
|
|
294
296
|
|
|
295
297
|
if len(token) > 1:
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Error resources for Microsoft Agents SDK.
|
|
6
|
+
|
|
7
|
+
This module provides centralized error messages with error codes and help URLs
|
|
8
|
+
following the pattern established in the C# SDK.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from microsoft_agents.activity.errors import ErrorMessage
|
|
12
|
+
|
|
13
|
+
from .error_resources import ErrorResources
|
|
14
|
+
|
|
15
|
+
# Singleton instance
|
|
16
|
+
error_resources = ErrorResources()
|
|
17
|
+
|
|
18
|
+
__all__ = ["ErrorMessage", "ErrorResources", "error_resources"]
|