microsoft-agents-hosting-core 0.6.0.dev15__py3-none-any.whl → 0.6.0.dev17__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.
@@ -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
- context, claims_identity, service_url, audience
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.activity = create_activity
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)
@@ -16,7 +16,7 @@ class ChannelServiceClientFactoryBase(Protocol):
16
16
  @abstractmethod
17
17
  async def create_connector_client(
18
18
  self,
19
- context: TurnContext,
19
+ context: TurnContext | None,
20
20
  claims_identity: ClaimsIdentity,
21
21
  service_url: str,
22
22
  audience: str,
@@ -83,15 +83,15 @@ class RestChannelServiceClientFactory(ChannelServiceClientFactoryBase):
83
83
 
84
84
  async def create_connector_client(
85
85
  self,
86
- context: TurnContext,
86
+ context: TurnContext | None,
87
87
  claims_identity: ClaimsIdentity,
88
88
  service_url: str,
89
89
  audience: str,
90
90
  scopes: Optional[list[str]] = None,
91
91
  use_anonymous: bool = False,
92
92
  ) -> ConnectorClientBase:
93
- if not context or not claims_identity:
94
- raise TypeError("context and claims_identity are required")
93
+ if not claims_identity:
94
+ raise TypeError("claims_identity is required")
95
95
  if not service_url:
96
96
  raise TypeError(
97
97
  "RestChannelServiceClientFactory.create_connector_client: service_url can't be None or Empty"
@@ -101,7 +101,7 @@ class RestChannelServiceClientFactory(ChannelServiceClientFactoryBase):
101
101
  "RestChannelServiceClientFactory.create_connector_client: audience can't be None or Empty"
102
102
  )
103
103
 
104
- if context.activity.is_agentic_request():
104
+ if context and context.activity.is_agentic_request():
105
105
  token = await self._get_agentic_token(context, service_url)
106
106
  else:
107
107
  token_provider: AccessTokenProviderBase = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 0.6.0.dev15
3
+ Version: 0.6.0.dev17
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.6.0.dev15
18
+ Requires-Dist: microsoft-agents-activity==0.6.0.dev17
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
@@ -4,11 +4,11 @@ microsoft_agents/hosting/core/agent.py,sha256=K8v84y8ULP7rbcMKg8LxaM3haAq7f1oHFC
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=jDzZkiRFO-sOD66MQV-Qsk4nmAxhMb_mSjGV6758rTY,20937
8
- microsoft_agents/hosting/core/channel_service_client_factory_base.py,sha256=ArMAUt84Kzq17Oyqz6o8HZrc01UqAAmNCSBTShv3rgk,1704
7
+ microsoft_agents/hosting/core/channel_service_adapter.py,sha256=OTF1EFycfBv4sdX2Zt_jPzk80aRHjLhSv5DyU6CEc7Q,20919
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=afLeWgLz9N417Egc_6LBfnYNiuuwTEcSBefeOvTQ_H4,6217
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
@@ -93,8 +93,8 @@ microsoft_agents/hosting/core/storage/transcript_info.py,sha256=5VN32j99tshChAff
93
93
  microsoft_agents/hosting/core/storage/transcript_logger.py,sha256=_atDk3CJ05fIVMhlWGNa91IiM9bGLmOhasFko8Lxjhk,8237
94
94
  microsoft_agents/hosting/core/storage/transcript_memory_store.py,sha256=v1Ud9LSs8m5c9_Fa8i49SuAjw80dX1hDciqbRduDEOE,6444
95
95
  microsoft_agents/hosting/core/storage/transcript_store.py,sha256=ka74o0WvI5GhMZcFqSxVdamBhGzZcDZe6VNkG-sMy74,1944
96
- microsoft_agents_hosting_core-0.6.0.dev15.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
97
- microsoft_agents_hosting_core-0.6.0.dev15.dist-info/METADATA,sha256=MJNB3S9PYljd-tdAYTtLL7vp5ZXatkCIO_90fneXpIo,9244
98
- microsoft_agents_hosting_core-0.6.0.dev15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
- microsoft_agents_hosting_core-0.6.0.dev15.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
100
- microsoft_agents_hosting_core-0.6.0.dev15.dist-info/RECORD,,
96
+ microsoft_agents_hosting_core-0.6.0.dev17.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
97
+ microsoft_agents_hosting_core-0.6.0.dev17.dist-info/METADATA,sha256=-icqUPeN60K-HvbDoTVT3ptHvkRHK4KqqKA704WjePY,9244
98
+ microsoft_agents_hosting_core-0.6.0.dev17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
+ microsoft_agents_hosting_core-0.6.0.dev17.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
100
+ microsoft_agents_hosting_core-0.6.0.dev17.dist-info/RECORD,,