microsoft-agents-hosting-core 0.7.0__py3-none-any.whl → 0.7.0.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. microsoft_agents/hosting/core/__init__.py +1 -24
  2. microsoft_agents/hosting/core/app/agent_application.py +24 -12
  3. microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +15 -7
  4. microsoft_agents/hosting/core/authorization/claims_identity.py +0 -14
  5. microsoft_agents/hosting/core/channel_service_adapter.py +14 -28
  6. microsoft_agents/hosting/core/connector/client/connector_client.py +1 -0
  7. microsoft_agents/hosting/core/connector/client/user_token_client.py +1 -0
  8. microsoft_agents/hosting/core/rest_channel_service_client_factory.py +2 -2
  9. microsoft_agents/hosting/core/storage/memory_storage.py +1 -0
  10. microsoft_agents/hosting/core/storage/storage.py +1 -0
  11. microsoft_agents/hosting/core/storage/transcript_logger.py +1 -0
  12. {microsoft_agents_hosting_core-0.7.0.dist-info → microsoft_agents_hosting_core-0.7.0.dev0.dist-info}/METADATA +3 -21
  13. {microsoft_agents_hosting_core-0.7.0.dist-info → microsoft_agents_hosting_core-0.7.0.dev0.dist-info}/RECORD +16 -25
  14. microsoft_agents/hosting/core/app/streaming/__init__.py +0 -14
  15. microsoft_agents/hosting/core/app/streaming/citation.py +0 -22
  16. microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -85
  17. microsoft_agents/hosting/core/app/streaming/streaming_response.py +0 -411
  18. microsoft_agents/hosting/core/http/__init__.py +0 -17
  19. microsoft_agents/hosting/core/http/_channel_service_routes.py +0 -202
  20. microsoft_agents/hosting/core/http/_http_adapter_base.py +0 -136
  21. microsoft_agents/hosting/core/http/_http_request_protocol.py +0 -36
  22. microsoft_agents/hosting/core/http/_http_response.py +0 -56
  23. {microsoft_agents_hosting_core-0.7.0.dist-info → microsoft_agents_hosting_core-0.7.0.dev0.dist-info}/WHEEL +0 -0
  24. {microsoft_agents_hosting_core-0.7.0.dist-info → microsoft_agents_hosting_core-0.7.0.dev0.dist-info}/licenses/LICENSE +0 -0
  25. {microsoft_agents_hosting_core-0.7.0.dist-info → microsoft_agents_hosting_core-0.7.0.dev0.dist-info}/top_level.txt +0 -0
@@ -10,15 +10,6 @@ from .middleware_set import Middleware
10
10
  from .rest_channel_service_client_factory import RestChannelServiceClientFactory
11
11
  from .turn_context import TurnContext
12
12
 
13
- # HTTP abstractions
14
- from .http import (
15
- HttpRequestProtocol,
16
- HttpResponse,
17
- HttpResponseFactory,
18
- HttpAdapterBase,
19
- ChannelServiceRoutes,
20
- )
21
-
22
13
  # Application Style
23
14
  from .app._type_defs import RouteHandler, RouteSelector, StateT
24
15
  from .app.agent_application import AgentApplication
@@ -29,13 +20,6 @@ from .app.query import Query
29
20
  from .app._routes import _Route, _RouteList, RouteRank
30
21
  from .app.typing_indicator import TypingIndicator
31
22
 
32
- # App Streaming
33
- from .app.streaming import (
34
- Citation,
35
- CitationUtil,
36
- StreamingResponse,
37
- )
38
-
39
23
  # App Auth
40
24
  from .app.oauth import (
41
25
  Authorization,
@@ -101,6 +85,7 @@ from .storage.memory_storage import MemoryStorage
101
85
  # Error Resources
102
86
  from .errors import error_resources, ErrorMessage, ErrorResources
103
87
 
88
+
104
89
  # Define the package's public interface
105
90
  __all__ = [
106
91
  "ActivityHandler",
@@ -114,11 +99,6 @@ __all__ = [
114
99
  "Middleware",
115
100
  "RestChannelServiceClientFactory",
116
101
  "TurnContext",
117
- "HttpRequestProtocol",
118
- "HttpResponse",
119
- "HttpResponseFactory",
120
- "HttpAdapterBase",
121
- "ChannelServiceRoutes",
122
102
  "AgentApplication",
123
103
  "ApplicationError",
124
104
  "ApplicationOptions",
@@ -128,9 +108,6 @@ __all__ = [
128
108
  "Route",
129
109
  "RouteHandler",
130
110
  "TypingIndicator",
131
- "Citation",
132
- "CitationUtil",
133
- "StreamingResponse",
134
111
  "ConversationState",
135
112
  "state",
136
113
  "State",
@@ -120,9 +120,11 @@ class AgentApplication(Agent, Generic[StateT]):
120
120
  "ApplicationOptions.storage is required and was not configured.",
121
121
  stack_info=True,
122
122
  )
123
- raise ApplicationError("""
123
+ raise ApplicationError(
124
+ """
124
125
  The `ApplicationOptions.storage` property is required and was not configured.
125
- """)
126
+ """
127
+ )
126
128
 
127
129
  if options.long_running_messages and (
128
130
  not options.adapter or not options.bot_app_id
@@ -131,10 +133,12 @@ class AgentApplication(Agent, Generic[StateT]):
131
133
  "ApplicationOptions.long_running_messages requires an adapter and bot_app_id.",
132
134
  stack_info=True,
133
135
  )
134
- raise ApplicationError("""
136
+ raise ApplicationError(
137
+ """
135
138
  The `ApplicationOptions.long_running_messages` property is unavailable because
136
139
  no adapter or `bot_app_id` was configured.
137
- """)
140
+ """
141
+ )
138
142
 
139
143
  if options.adapter:
140
144
  self._adapter = options.adapter
@@ -176,10 +180,12 @@ class AgentApplication(Agent, Generic[StateT]):
176
180
  "AgentApplication.adapter(): self._adapter is not configured.",
177
181
  stack_info=True,
178
182
  )
179
- raise ApplicationError("""
183
+ raise ApplicationError(
184
+ """
180
185
  The AgentApplication.adapter property is unavailable because it was
181
186
  not configured when creating the AgentApplication.
182
- """)
187
+ """
188
+ )
183
189
 
184
190
  return self._adapter
185
191
 
@@ -197,10 +203,12 @@ class AgentApplication(Agent, Generic[StateT]):
197
203
  "AgentApplication.auth(): self._auth is not configured.",
198
204
  stack_info=True,
199
205
  )
200
- raise ApplicationError("""
206
+ raise ApplicationError(
207
+ """
201
208
  The `AgentApplication.auth` property is unavailable because
202
209
  no Auth options were configured.
203
- """)
210
+ """
211
+ )
204
212
 
205
213
  return self._auth
206
214
 
@@ -584,10 +592,12 @@ class AgentApplication(Agent, Generic[StateT]):
584
592
  f"Failed to register sign-in success handler for route handler {func.__name__}",
585
593
  stack_info=True,
586
594
  )
587
- raise ApplicationError("""
595
+ raise ApplicationError(
596
+ """
588
597
  The `AgentApplication.on_sign_in_success` method is unavailable because
589
598
  no Auth options were configured.
590
- """)
599
+ """
600
+ )
591
601
  return func
592
602
 
593
603
  def on_sign_in_failure(
@@ -618,10 +628,12 @@ class AgentApplication(Agent, Generic[StateT]):
618
628
  f"Failed to register sign-in failure handler for route handler {func.__name__}",
619
629
  stack_info=True,
620
630
  )
621
- raise ApplicationError("""
631
+ raise ApplicationError(
632
+ """
622
633
  The `AgentApplication.on_sign_in_failure` method is unavailable because
623
634
  no Auth options were configured.
624
- """)
635
+ """
636
+ )
625
637
  return func
626
638
 
627
639
  def error(
@@ -7,27 +7,35 @@ from __future__ import annotations
7
7
 
8
8
  from typing import Optional
9
9
 
10
- from pydantic import BaseModel
11
-
12
10
  from microsoft_agents.activity import Activity
13
11
 
14
12
  from ...storage._type_aliases import JSON
15
13
  from ...storage import StoreItem
16
14
 
17
15
 
18
- class _SignInState(BaseModel, StoreItem):
16
+ class _SignInState(StoreItem):
19
17
  """Store item for sign-in state, including tokens and continuation activity.
20
18
 
21
19
  Used to cache tokens and keep track of activities during single and
22
20
  multi-turn sign-in flows.
23
21
  """
24
22
 
25
- active_handler_id: str
26
- continuation_activity: Optional[Activity] = None
23
+ def __init__(
24
+ self,
25
+ active_handler_id: str,
26
+ continuation_activity: Optional[Activity] = None,
27
+ ) -> None:
28
+ self.active_handler_id = active_handler_id
29
+ self.continuation_activity = continuation_activity
27
30
 
28
31
  def store_item_to_json(self) -> JSON:
29
- return self.model_dump(mode="json", exclude_unset=True, by_alias=True)
32
+ return {
33
+ "active_handler_id": self.active_handler_id,
34
+ "continuation_activity": self.continuation_activity,
35
+ }
30
36
 
31
37
  @staticmethod
32
38
  def from_json_to_store_item(json_data: JSON) -> _SignInState:
33
- return _SignInState.model_validate(json_data)
39
+ return _SignInState(
40
+ json_data["active_handler_id"], json_data.get("continuation_activity")
41
+ )
@@ -83,17 +83,3 @@ class ClaimsIdentity:
83
83
  if self.is_agent_claim()
84
84
  else AuthenticationConstants.AGENTS_SDK_SCOPE
85
85
  )
86
-
87
- def get_token_scope(self) -> list[str]:
88
- """
89
- Gets the token scope from current claims.
90
-
91
- :return: The token scope.
92
- """
93
- return [
94
- (
95
- f"{self.get_outgoing_app_id()}/.default"
96
- if self.is_agent_claim()
97
- else AuthenticationConstants.AGENTS_SDK_SCOPE + "/.default"
98
- )
99
- ]
@@ -341,19 +341,6 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
341
341
  await connector_client.close()
342
342
  await user_token_client.close()
343
343
 
344
- def _resolve_if_connector_client_is_needed(self, activity: Activity) -> bool:
345
- """Determine if a connector client is needed based on the activity's delivery mode and service URL.
346
-
347
- :param activity: The activity to evaluate.
348
- :type activity: :class:`microsoft_agents.activity.Activity`
349
- """
350
- if activity.delivery_mode in [
351
- DeliveryModes.expect_replies,
352
- DeliveryModes.stream,
353
- ]:
354
- return False
355
- return True
356
-
357
344
  async def process_activity(
358
345
  self,
359
346
  claims_identity: ClaimsIdentity,
@@ -381,14 +368,16 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
381
368
  If the task completes successfully, then an :class:`microsoft_agents.activity.InvokeResponse` is returned;
382
369
  otherwise, `None` is returned.
383
370
  """
384
- scopes: list[str] = claims_identity.get_token_scope()
371
+ scopes: list[str] = None
385
372
  outgoing_audience: str = None
386
373
 
387
374
  if claims_identity.is_agent_claim():
388
375
  outgoing_audience = claims_identity.get_token_audience()
376
+ scopes = [f"{claims_identity.get_outgoing_app_id()}/.default"]
389
377
  activity.caller_id = f"{CallerIdConstants.agent_to_agent_prefix}{claims_identity.get_outgoing_app_id()}"
390
378
  else:
391
379
  outgoing_audience = AuthenticationConstants.AGENTS_SDK_SCOPE
380
+ scopes = [f"{AuthenticationConstants.AGENTS_SDK_SCOPE}/.default"]
392
381
 
393
382
  use_anonymous_auth_callback = False
394
383
  if (
@@ -414,24 +403,21 @@ class ChannelServiceAdapter(ChannelAdapter, ABC):
414
403
  context.turn_state[self.USER_TOKEN_CLIENT_KEY] = user_token_client
415
404
 
416
405
  # Create the connector client to use for outbound requests.
417
- connector_client: Optional[ConnectorClient] = None
418
- if self._resolve_if_connector_client_is_needed(activity):
419
- connector_client = (
420
- await self._channel_service_client_factory.create_connector_client(
421
- context,
422
- claims_identity,
423
- activity.service_url,
424
- outgoing_audience,
425
- scopes,
426
- use_anonymous_auth_callback,
427
- )
406
+ connector_client: ConnectorClient = (
407
+ await self._channel_service_client_factory.create_connector_client(
408
+ context,
409
+ claims_identity,
410
+ activity.service_url,
411
+ outgoing_audience,
412
+ scopes,
413
+ use_anonymous_auth_callback,
428
414
  )
429
- context.turn_state[self._AGENT_CONNECTOR_CLIENT_KEY] = connector_client
415
+ )
416
+ context.turn_state[self._AGENT_CONNECTOR_CLIENT_KEY] = connector_client
430
417
 
431
418
  await self.run_pipeline(context, callback)
432
419
 
433
- if connector_client:
434
- await connector_client.close()
420
+ await connector_client.close()
435
421
  await user_token_client.close()
436
422
 
437
423
  # If there are any results they will have been left on the TurnContext.
@@ -22,6 +22,7 @@ from ..attachments_base import AttachmentsBase
22
22
  from ..conversations_base import ConversationsBase
23
23
  from ..get_product_info import get_product_info
24
24
 
25
+
25
26
  logger = logging.getLogger(__name__)
26
27
 
27
28
 
@@ -18,6 +18,7 @@ from ..get_product_info import get_product_info
18
18
  from ..user_token_base import UserTokenBase
19
19
  from ..agent_sign_in_base import AgentSignInBase
20
20
 
21
+
21
22
  logger = logging.getLogger(__name__)
22
23
 
23
24
 
@@ -113,7 +113,7 @@ class RestChannelServiceClientFactory(ChannelServiceClientFactoryBase):
113
113
  )
114
114
 
115
115
  token = await token_provider.get_access_token(
116
- audience, scopes or claims_identity.get_token_scope()
116
+ audience, scopes or [f"{audience}/.default"]
117
117
  )
118
118
 
119
119
  return TeamsConnectorClient(
@@ -142,7 +142,7 @@ class RestChannelServiceClientFactory(ChannelServiceClientFactoryBase):
142
142
  if context.activity.is_agentic_request():
143
143
  token = await self._get_agentic_token(context, self._token_service_endpoint)
144
144
  else:
145
- scopes = claims_identity.get_token_scope()
145
+ scopes = [f"{self._token_service_audience}/.default"]
146
146
 
147
147
  token_provider = self._connection_manager.get_token_provider(
148
148
  claims_identity, self._token_service_endpoint
@@ -8,6 +8,7 @@ from ._type_aliases import JSON
8
8
  from .storage import Storage
9
9
  from .store_item import StoreItem
10
10
 
11
+
11
12
  StoreItemT = TypeVar("StoreItemT", bound=StoreItem)
12
13
 
13
14
 
@@ -8,6 +8,7 @@ from asyncio import gather
8
8
  from ._type_aliases import JSON
9
9
  from .store_item import StoreItem
10
10
 
11
+
11
12
  StoreItemT = TypeVar("StoreItemT", bound=StoreItem)
12
13
 
13
14
 
@@ -19,6 +19,7 @@ from microsoft_agents.activity.conversation_reference import ActivityEventNames
19
19
  from microsoft_agents.hosting.core.middleware_set import Middleware, TurnContext
20
20
  from typing import Generic, TypeVar
21
21
 
22
+
22
23
  T = TypeVar("T")
23
24
 
24
25
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 0.7.0
3
+ Version: 0.7.0.dev0
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.7.0
18
+ Requires-Dist: microsoft-agents-activity==0.7.0.dev0
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
@@ -41,29 +41,11 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
41
41
  <th style="width:20%">Date</th>
42
42
  <th style="width:60%">Release Notes</th>
43
43
  </tr>
44
- <tr>
45
- <td>0.6.1</td>
46
- <td>2025-12-01</td>
47
- <td>
48
- <a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v061">
49
- 0.6.1 Release Notes
50
- </a>
51
- </td>
52
- </tr>
53
- <tr>
54
- <td>0.6.0</td>
55
- <td>2025-11-18</td>
56
- <td>
57
- <a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v060">
58
- 0.6.0 Release Notes
59
- </a>
60
- </td>
61
- </tr>
62
44
  <tr>
63
45
  <td>0.5.0</td>
64
46
  <td>2025-10-22</td>
65
47
  <td>
66
- <a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v050">
48
+ <a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md">
67
49
  0.5.0 Release Notes
68
50
  </a>
69
51
  </td>
@@ -1,14 +1,14 @@
1
- microsoft_agents/hosting/core/__init__.py,sha256=bpUnDxIdWHzcta50KQ0GVul9b7Y5-o4VxFJ20CQm4hQ,5458
1
+ microsoft_agents/hosting/core/__init__.py,sha256=jZ0551xg2RnMtHpAMD1AtXyDh0oPUSDYPe_S9QNdbtA,5012
2
2
  microsoft_agents/hosting/core/activity_handler.py,sha256=1hsSmVCnQLS44RK05v8j6mlmV38_JGmJTPR9LkogQuc,27779
3
3
  microsoft_agents/hosting/core/agent.py,sha256=K8v84y8ULP7rbcMKg8LxaM3haAq7f1oHFCLy3AAphQE,574
4
4
  microsoft_agents/hosting/core/card_factory.py,sha256=UDmPEpOk2SpEr9ShN9Q0CiaI_GTD3qjHgkDMOWinW9I,6926
5
5
  microsoft_agents/hosting/core/channel_adapter.py,sha256=MqES9gHGS0nrKBR7u8zLQCsuIksl-hScZy_jg4LTTHo,10669
6
6
  microsoft_agents/hosting/core/channel_api_handler_protocol.py,sha256=RO59hiOYx7flQVWhX6VGvfpFPoKVkdT_la-7WhUl8UM,4506
7
- microsoft_agents/hosting/core/channel_service_adapter.py,sha256=9wUrCGLO4WiHt_NLrSwUShHQAHxNsIefndOXZxKZu8M,21474
7
+ microsoft_agents/hosting/core/channel_service_adapter.py,sha256=OTF1EFycfBv4sdX2Zt_jPzk80aRHjLhSv5DyU6CEc7Q,20919
8
8
  microsoft_agents/hosting/core/channel_service_client_factory_base.py,sha256=9LcpxiWMXmWAdGQt6lRzvY9ybF_5mGc5Focd1Z7f9MY,1711
9
9
  microsoft_agents/hosting/core/message_factory.py,sha256=F9QJBF4yBupHXxOW984ZzZomVEG57t9IUnTHwub-lX0,7822
10
10
  microsoft_agents/hosting/core/middleware_set.py,sha256=TBsBs4KwAfKyHlQTlG4bl1y5UjkBzeMDs5w7LNB-Bi4,2585
11
- microsoft_agents/hosting/core/rest_channel_service_client_factory.py,sha256=1uNi1Voy0Llj-Z7EtKwBCmkY7KsULnGO4Ttxyqj253Y,6206
11
+ microsoft_agents/hosting/core/rest_channel_service_client_factory.py,sha256=NY9Pj9-jR2Oq-Crqm7as41FsVX3PLWsM-JEw3RTjyhE,6208
12
12
  microsoft_agents/hosting/core/turn_context.py,sha256=muA8S4R6Xxja5it7DiFqr5J5zmttwDN-Mj5_SDdxZ4A,14874
13
13
  microsoft_agents/hosting/core/_oauth/__init__.py,sha256=sU1HsIXbETRYwnudtFc6GrNbM6C3oYjmruqXc6kIAFw,405
14
14
  microsoft_agents/hosting/core/_oauth/_flow_state.py,sha256=BQbXn0a3Fw4aozS-WSjL0Y7vEdb4eua1ZitSr0qZ6bE,2207
@@ -16,7 +16,7 @@ microsoft_agents/hosting/core/_oauth/_flow_storage_client.py,sha256=1MLD8m_qw0jS
16
16
  microsoft_agents/hosting/core/_oauth/_oauth_flow.py,sha256=vgg_sQLYr83YA0F7aQ1K5j8vEATw7ZS151ODkpCGYAM,12211
17
17
  microsoft_agents/hosting/core/app/__init__.py,sha256=GZQdog7BBMA8uD9iaRMNeRJf12rJZB3bAKFAD8Y8dVo,1228
18
18
  microsoft_agents/hosting/core/app/_type_defs.py,sha256=b5VZFWnQ5ONUZMtFxw7Q-mbbxIUSJ7RXcCXjqdHwSQw,438
19
- microsoft_agents/hosting/core/app/agent_application.py,sha256=24WjroVgiHavWdJTsfyOgQTjRR8H-jF98JVLfkwWcXo,33804
19
+ microsoft_agents/hosting/core/app/agent_application.py,sha256=iqcsLM4k_BWY0KKI1Ia-W11geuIHF8TP3mRc3D1eVF0,33984
20
20
  microsoft_agents/hosting/core/app/app_error.py,sha256=JgYBgv2EKe9Q2TFi5FeG_RneulBEa5SyBpWSF-duBzE,301
21
21
  microsoft_agents/hosting/core/app/app_options.py,sha256=P3XTFFuQCnEcHixfdmr5RPG-Wli4c1VSmCMRKVBBLsw,2792
22
22
  microsoft_agents/hosting/core/app/input_file.py,sha256=AEzVAnAPO1V7MWDI_uoZfcYY8Oog3XgvEpAeO-tATeY,1546
@@ -28,7 +28,7 @@ microsoft_agents/hosting/core/app/_routes/_route_list.py,sha256=fe1-wmFaJJqYkWFc
28
28
  microsoft_agents/hosting/core/app/_routes/route_rank.py,sha256=-UwmLMCtgLT2cWnWvLfE2puV0RuQfI2m3WyEvkBkSBg,324
29
29
  microsoft_agents/hosting/core/app/oauth/__init__.py,sha256=eHx-vmW2Ew8HULSfvAmV8F9TBXXLcTPsBe3XP4JEDdY,556
30
30
  microsoft_agents/hosting/core/app/oauth/_sign_in_response.py,sha256=H5VBX69WiYXGALzCDVnF_-Y0brbafbJgfF4mS2wZSr0,851
31
- microsoft_agents/hosting/core/app/oauth/_sign_in_state.py,sha256=gtrLa_BgQq-yrTu8ItVwQ8fntfSKjlng2lCj6A8mCrc,897
31
+ microsoft_agents/hosting/core/app/oauth/_sign_in_state.py,sha256=lC2otIFcQthAZ8kqkYxV3wLBPOqzW9MRVUbdqQPtEdM,1159
32
32
  microsoft_agents/hosting/core/app/oauth/auth_handler.py,sha256=KyhEfpKtoVKcapOt4szpDdbgk_KSwXF46GGOeJrmsRI,3464
33
33
  microsoft_agents/hosting/core/app/oauth/authorization.py,sha256=_sdCZcZ7iciwTZqXTHFOK4vWWbCgSIDv3it30fzPI8w,18246
34
34
  microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py,sha256=ZQuXF-IZrJv_hOgt-sdRFAUyIpRXaYqYBuyEJWJRcfU,376
@@ -40,17 +40,13 @@ microsoft_agents/hosting/core/app/state/conversation_state.py,sha256=LfcSwvhaU0J
40
40
  microsoft_agents/hosting/core/app/state/state.py,sha256=mbNrHuAc7d9vJep3PtExbLFtfKxZoAUX3Jr45GT3SuA,7373
41
41
  microsoft_agents/hosting/core/app/state/temp_state.py,sha256=Oh7K5-uYf50Z-lBXqttSMl2N1lRakktOmjLlIAKcEsM,3501
42
42
  microsoft_agents/hosting/core/app/state/turn_state.py,sha256=rEIRkwBsn3MPbrfKNjX8XqqbF-4THepMXU75KvDsBvM,9868
43
- microsoft_agents/hosting/core/app/streaming/__init__.py,sha256=LtchDJTb25owxcbDd1sWr0BtGHK-PQboxCX4oNiN89c,329
44
- microsoft_agents/hosting/core/app/streaming/citation.py,sha256=ZGaMUOWxxoMplwRrkFsjnK7Z12V6rT5odE7qZCu-mP8,498
45
- microsoft_agents/hosting/core/app/streaming/citation_util.py,sha256=c95c3Y3genmFc0vSXppPaD1-ShFohAV1UABZnyJS_BQ,2478
46
- microsoft_agents/hosting/core/app/streaming/streaming_response.py,sha256=uwNYaVJ8cghdjHS_Y8ZeOiYnpyeQGHt0rQQlay6a-C8,13799
47
43
  microsoft_agents/hosting/core/authorization/__init__.py,sha256=pOTmTJFS5CMPEcHRadBTgrbWUP5lOIxsPMgTreFq7mw,634
48
44
  microsoft_agents/hosting/core/authorization/access_token_provider_base.py,sha256=Z0nGkfOUSIBvJSFjGGNQEd1-upqZVjT6eSXsqsFa2Cc,1646
49
45
  microsoft_agents/hosting/core/authorization/agent_auth_configuration.py,sha256=meLUO0Mwb9SBr01dLvYS9q3xuZyndCsb_gIx0r7__Sk,2944
50
46
  microsoft_agents/hosting/core/authorization/anonymous_token_provider.py,sha256=44XKaSLJFZj4hCSAdWAtW1R31M5QCZVaFKJaxcwx5h4,1076
51
47
  microsoft_agents/hosting/core/authorization/auth_types.py,sha256=Fg_ywEItm3xL_DBUNzi0QsfDPVY5S3HlAiNw6I2SW64,374
52
48
  microsoft_agents/hosting/core/authorization/authentication_constants.py,sha256=ABEwosDCMYhubDiGrD8QULboTkACqDvNp_x_XBPt6dQ,4618
53
- microsoft_agents/hosting/core/authorization/claims_identity.py,sha256=Nc2o12K1yUXch34_r83QTWdhydudCKGpvYs0NsRIh8Q,3003
49
+ microsoft_agents/hosting/core/authorization/claims_identity.py,sha256=z2Ql7CMPgioYOw970ynxfKWHyk5lqPwMgSrNh4bUfNo,2620
54
50
  microsoft_agents/hosting/core/authorization/connections.py,sha256=f_NQpuJzhCBNZLk56SK4kvb_V_g2x2XMnFwWbYyDX_s,1247
55
51
  microsoft_agents/hosting/core/authorization/jwt_token_validator.py,sha256=b440T7y1tM7gPUQZ27EA3SgNiaEupxz56E6773gL5Zo,2025
56
52
  microsoft_agents/hosting/core/client/__init__.py,sha256=HMWtSUXu1akaX6qtDx412Lr8vLi5SEslc-DYrvZAPWs,1299
@@ -76,17 +72,12 @@ microsoft_agents/hosting/core/connector/get_product_info.py,sha256=SDxPqBCzzQLEU
76
72
  microsoft_agents/hosting/core/connector/user_token_base.py,sha256=h_l5D1SghN2RrUkFcKWQhCHlO9r7akMbzsm2x8MvomI,3639
77
73
  microsoft_agents/hosting/core/connector/user_token_client_base.py,sha256=dfUTUsBNOzWze9_JldAeLe73sydSDzlKyMKMvj48g2E,471
78
74
  microsoft_agents/hosting/core/connector/client/__init__.py,sha256=6JdKhmm7btmo0omxMBd8PJbtGFk0cnMwVUoStyW7Ft0,143
79
- microsoft_agents/hosting/core/connector/client/connector_client.py,sha256=S0JzWkOCgsVKLUi0KGplXT0SCbQ0HEahhTe3ex2iO_E,23865
80
- microsoft_agents/hosting/core/connector/client/user_token_client.py,sha256=rtQ5GivBhCOpDeUkAdI0_R5c0RE-FbLxzTttopxOH2o,10535
75
+ microsoft_agents/hosting/core/connector/client/connector_client.py,sha256=9oF_x_LffOIKjTLMdPf3Biq3vvWn8r8e0NBJkHBn684,23866
76
+ microsoft_agents/hosting/core/connector/client/user_token_client.py,sha256=qxYxvdUcvYinCzaR4YiIucEEAb8TjYYtPsmXKZRbxv4,10536
81
77
  microsoft_agents/hosting/core/connector/teams/__init__.py,sha256=3ZMPGYyZ15EwvfQzfJJQy1J58oIt4InSxibl3BN6R54,100
82
78
  microsoft_agents/hosting/core/connector/teams/teams_connector_client.py,sha256=XGQDTYHrA_I9n9JlxGST5eesjsFhz2dnSaMSuyoFnKU,12676
83
79
  microsoft_agents/hosting/core/errors/__init__.py,sha256=kcfwDGDaopWfLyvYsNXM6j4cYt2oGKysjCRDezcVY0A,500
84
80
  microsoft_agents/hosting/core/errors/error_resources.py,sha256=_nyvPQaX3gpi9kziajVdzGWCzMa6JcTntK__zQJlGMo,3922
85
- microsoft_agents/hosting/core/http/__init__.py,sha256=Jh6lIivBN9YsNaLPzYvzvbhLAwJbeQTSRHtFupfSy-I,532
86
- microsoft_agents/hosting/core/http/_channel_service_routes.py,sha256=80IWoUDKywUurXnh7vmG0QMxu3sk7W38zgHsw0eJ2DA,8436
87
- microsoft_agents/hosting/core/http/_http_adapter_base.py,sha256=qRqAwMl1Wsq_A1J6asMMcS9jUGjlLD3HF-0Sioba5IM,4561
88
- microsoft_agents/hosting/core/http/_http_request_protocol.py,sha256=YTfcp_K1IswAIWVQ5QFBTyX-ssuUo6BChdlPHEh-t4Q,1002
89
- microsoft_agents/hosting/core/http/_http_response.py,sha256=e_bY0bJJXx--Zb_Yd-f9iDPFbK4bWkFi92a0nq1A6us,1862
90
81
  microsoft_agents/hosting/core/state/__init__.py,sha256=yckKi1wg_86ng-DL9Q3R49QiWKvNjPkVNk6HClWgVrY,208
91
82
  microsoft_agents/hosting/core/state/agent_state.py,sha256=uboptWaC3VrSGTnXIzaO38XUqOT-ITW6EhJxuGMtKWs,13724
92
83
  microsoft_agents/hosting/core/state/state_property_accessor.py,sha256=kpiNnzkZ6el-oRITRbRkk1Faa_CPFxpJQdvSGxIJP70,1392
@@ -94,16 +85,16 @@ microsoft_agents/hosting/core/state/user_state.py,sha256=zEigX-sroNAyoQAxQjG1Ogm
94
85
  microsoft_agents/hosting/core/storage/__init__.py,sha256=Df_clI0uMRgcr4Td-xkP83bU_mGae7_gRMhtVDPZDmE,729
95
86
  microsoft_agents/hosting/core/storage/_type_aliases.py,sha256=VCKtjiCBrhEsGSm3zVVSSccdoiY02GYhABvrLjhAcz8,72
96
87
  microsoft_agents/hosting/core/storage/error_handling.py,sha256=kTMQ68GxL4GgVKpo3SexzyRARLw6UbsVhHU723XxIck,1360
97
- microsoft_agents/hosting/core/storage/memory_storage.py,sha256=VUKFWc6aAfUzwfH_hiPvFsbESGY78qCCTkBnpoNZUe4,2447
98
- microsoft_agents/hosting/core/storage/storage.py,sha256=zHnQNaLYgzjLP_XWfL3e-Dlw7eQbNgXUYbnT_26rYvM,3321
88
+ microsoft_agents/hosting/core/storage/memory_storage.py,sha256=5AZ2QQ3TagVCHCKp0GEVAIuDswDGHgbgnUZgS9YbPAI,2448
89
+ microsoft_agents/hosting/core/storage/storage.py,sha256=bt93jItMQKC9NJlcmxPtcE67MvnibolcFwvV1LFwliI,3322
99
90
  microsoft_agents/hosting/core/storage/store_item.py,sha256=rjtzB5yufsKuY1O5PjCqWHjjmO6UiORwkzpwbsaxp_4,371
100
91
  microsoft_agents/hosting/core/storage/transcript_file_store.py,sha256=eJdcU6BgMbvFYunWul2CZURH762HmUr11iUN7NgvZek,10045
101
92
  microsoft_agents/hosting/core/storage/transcript_info.py,sha256=5VN32j99tshChAffvuZ6D3GH3ABCZsQGHC_bYDAwFOk,328
102
- microsoft_agents/hosting/core/storage/transcript_logger.py,sha256=rgFeghzyRd9M3IUtI9n5y_rdAOL9s6qgGVD4OTOjkEg,8236
93
+ microsoft_agents/hosting/core/storage/transcript_logger.py,sha256=_atDk3CJ05fIVMhlWGNa91IiM9bGLmOhasFko8Lxjhk,8237
103
94
  microsoft_agents/hosting/core/storage/transcript_memory_store.py,sha256=v1Ud9LSs8m5c9_Fa8i49SuAjw80dX1hDciqbRduDEOE,6444
104
95
  microsoft_agents/hosting/core/storage/transcript_store.py,sha256=ka74o0WvI5GhMZcFqSxVdamBhGzZcDZe6VNkG-sMy74,1944
105
- microsoft_agents_hosting_core-0.7.0.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
106
- microsoft_agents_hosting_core-0.7.0.dist-info/METADATA,sha256=UpC6quDud6QCw5ctSuP1-WGmAbPNflUmAuSPobqrIz0,9809
107
- microsoft_agents_hosting_core-0.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
108
- microsoft_agents_hosting_core-0.7.0.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
109
- microsoft_agents_hosting_core-0.7.0.dist-info/RECORD,,
96
+ microsoft_agents_hosting_core-0.7.0.dev0.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
97
+ microsoft_agents_hosting_core-0.7.0.dev0.dist-info/METADATA,sha256=kum-N0M9RQKtwhrewQsTH8JkWJXgo1Fqnr5yjD--cmc,9242
98
+ microsoft_agents_hosting_core-0.7.0.dev0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
+ microsoft_agents_hosting_core-0.7.0.dev0.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
100
+ microsoft_agents_hosting_core-0.7.0.dev0.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- # Copyright (c) Microsoft Corporation. All rights reserved.
2
- # Licensed under the MIT License.
3
-
4
- """Streaming response utilities."""
5
-
6
- from .citation import Citation
7
- from .citation_util import CitationUtil
8
- from .streaming_response import StreamingResponse
9
-
10
- __all__ = [
11
- "Citation",
12
- "CitationUtil",
13
- "StreamingResponse",
14
- ]
@@ -1,22 +0,0 @@
1
- # Copyright (c) Microsoft Corporation. All rights reserved.
2
- # Licensed under the MIT License.
3
-
4
- from typing import Optional
5
- from dataclasses import dataclass
6
-
7
-
8
- @dataclass
9
- class Citation:
10
- """Citations returned by the model."""
11
-
12
- content: str
13
- """The content of the citation."""
14
-
15
- title: Optional[str] = None
16
- """The title of the citation."""
17
-
18
- url: Optional[str] = None
19
- """The URL of the citation."""
20
-
21
- filepath: Optional[str] = None
22
- """The filepath of the document."""
@@ -1,85 +0,0 @@
1
- # Copyright (c) Microsoft Corporation. All rights reserved.
2
- # Licensed under the MIT License.
3
-
4
- import re
5
- from typing import List, Optional
6
-
7
- from microsoft_agents.activity import ClientCitation
8
-
9
-
10
- class CitationUtil:
11
- """Utility functions for manipulating text and citations."""
12
-
13
- @staticmethod
14
- def snippet(text: str, max_length: int) -> str:
15
- """
16
- Clips the text to a maximum length in case it exceeds the limit.
17
-
18
- Args:
19
- text: The text to clip.
20
- max_length: The maximum length of the text to return, cutting off the last whole word.
21
-
22
- Returns:
23
- The modified text
24
- """
25
- if len(text) <= max_length:
26
- return text
27
-
28
- snippet = text[:max_length]
29
- snippet = snippet[: min(len(snippet), snippet.rfind(" "))]
30
- snippet += "..."
31
- return snippet
32
-
33
- @staticmethod
34
- def format_citations_response(text: str) -> str:
35
- """
36
- Convert citation tags `[doc(s)n]` to `[n]` where n is a number.
37
-
38
- Args:
39
- text: The text to format.
40
-
41
- Returns:
42
- The formatted text.
43
- """
44
- return re.sub(r"\[docs?(\d+)\]", r"[\1]", text, flags=re.IGNORECASE)
45
-
46
- @staticmethod
47
- def get_used_citations(
48
- text: str, citations: List[ClientCitation]
49
- ) -> Optional[List[ClientCitation]]:
50
- """
51
- Get the citations used in the text. This will remove any citations that are
52
- included in the citations array from the response but not referenced in the text.
53
-
54
- Args:
55
- text: The text to search for citation references, i.e. [1], [2], etc.
56
- citations: The list of citations to search for.
57
-
58
- Returns:
59
- The list of citations used in the text.
60
- """
61
- regex = re.compile(r"\[(\d+)\]", re.IGNORECASE)
62
- matches = regex.findall(text)
63
-
64
- if not matches:
65
- return None
66
-
67
- # Remove duplicates
68
- filtered_matches = set(matches)
69
-
70
- # Add citations
71
- used_citations = []
72
- for match in filtered_matches:
73
- citation_ref = f"[{match}]"
74
- found = next(
75
- (
76
- citation
77
- for citation in citations
78
- if f"[{citation.position}]" == citation_ref
79
- ),
80
- None,
81
- )
82
- if found:
83
- used_citations.append(found)
84
-
85
- return used_citations if used_citations else None