microsoft-agents-copilotstudio-client 0.5.3__py3-none-any.whl → 0.6.0__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.
@@ -0,0 +1,15 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ """
5
+ Error resources for Microsoft Agents Copilot Studio Client package.
6
+ """
7
+
8
+ from microsoft_agents.activity.errors import ErrorMessage
9
+
10
+ from .error_resources import CopilotStudioErrorResources
11
+
12
+ # Singleton instance
13
+ copilot_studio_errors = CopilotStudioErrorResources()
14
+
15
+ __all__ = ["ErrorMessage", "CopilotStudioErrorResources", "copilot_studio_errors"]
@@ -0,0 +1,57 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ """
5
+ Copilot Studio error resources for Microsoft Agents SDK.
6
+
7
+ Error codes are in the range -65000 to -65999.
8
+ """
9
+
10
+ from microsoft_agents.activity.errors import ErrorMessage
11
+
12
+
13
+ class CopilotStudioErrorResources:
14
+ """
15
+ Error messages for Copilot Studio operations.
16
+
17
+ Error codes are organized in the range -65000 to -65999.
18
+ """
19
+
20
+ CloudBaseAddressRequired = ErrorMessage(
21
+ "cloud_base_address must be provided when PowerPlatformCloud is Other",
22
+ -65000,
23
+ )
24
+
25
+ EnvironmentIdRequired = ErrorMessage(
26
+ "EnvironmentId must be provided",
27
+ -65001,
28
+ )
29
+
30
+ AgentIdentifierRequired = ErrorMessage(
31
+ "AgentIdentifier must be provided",
32
+ -65002,
33
+ )
34
+
35
+ CustomCloudOrBaseAddressRequired = ErrorMessage(
36
+ "Either CustomPowerPlatformCloud or cloud_base_address must be provided when PowerPlatformCloud is Other",
37
+ -65003,
38
+ )
39
+
40
+ InvalidConnectionSettingsType = ErrorMessage(
41
+ "connection_settings must be of type DirectToEngineConnectionSettings",
42
+ -65004,
43
+ )
44
+
45
+ PowerPlatformEnvironmentRequired = ErrorMessage(
46
+ "PowerPlatformEnvironment must be provided",
47
+ -65005,
48
+ )
49
+
50
+ AccessTokenProviderRequired = ErrorMessage(
51
+ "AccessTokenProvider must be provided",
52
+ -65006,
53
+ )
54
+
55
+ def __init__(self):
56
+ """Initialize CopilotStudioErrorResources."""
57
+ pass
@@ -1,3 +1,4 @@
1
+ from microsoft_agents.copilotstudio.client.errors import copilot_studio_errors
1
2
  from urllib.parse import urlparse, urlunparse
2
3
  from typing import Optional
3
4
  from .connection_settings import ConnectionSettings
@@ -22,13 +23,11 @@ class PowerPlatformEnvironment:
22
23
  cloud_base_address: Optional[str] = None,
23
24
  ) -> str:
24
25
  if cloud == PowerPlatformCloud.OTHER and not cloud_base_address:
25
- raise ValueError(
26
- "cloud_base_address must be provided when PowerPlatformCloud is Other"
27
- )
26
+ raise ValueError(str(copilot_studio_errors.CloudBaseAddressRequired))
28
27
  if not settings.environment_id:
29
- raise ValueError("EnvironmentId must be provided")
28
+ raise ValueError(str(copilot_studio_errors.EnvironmentIdRequired))
30
29
  if not settings.agent_identifier:
31
- raise ValueError("AgentIdentifier must be provided")
30
+ raise ValueError(str(copilot_studio_errors.AgentIdentifierRequired))
32
31
  if settings.cloud and settings.cloud != PowerPlatformCloud.UNKNOWN:
33
32
  cloud = settings.cloud
34
33
  if cloud == PowerPlatformCloud.OTHER:
@@ -40,7 +39,7 @@ class PowerPlatformEnvironment:
40
39
  cloud_base_address = settings.custom_power_platform_cloud
41
40
  else:
42
41
  raise ValueError(
43
- "Either CustomPowerPlatformCloud or cloud_base_address must be provided when PowerPlatformCloud is Other"
42
+ str(copilot_studio_errors.CustomCloudOrBaseAddressRequired)
44
43
  )
45
44
  if settings.copilot_agent_type:
46
45
  agent_type = settings.copilot_agent_type
@@ -60,9 +59,7 @@ class PowerPlatformEnvironment:
60
59
  cloud_base_address: Optional[str] = None,
61
60
  ) -> str:
62
61
  if cloud == PowerPlatformCloud.OTHER and not cloud_base_address:
63
- raise ValueError(
64
- "cloud_base_address must be provided when PowerPlatformCloud is Other"
65
- )
62
+ raise ValueError(str(copilot_studio_errors.CloudBaseAddressRequired))
66
63
  if not settings and cloud == PowerPlatformCloud.UNKNOWN:
67
64
  raise ValueError("Either settings or cloud must be provided")
68
65
  if settings and settings.cloud and settings.cloud != PowerPlatformCloud.UNKNOWN:
@@ -79,7 +76,7 @@ class PowerPlatformEnvironment:
79
76
  cloud_base_address = settings.custom_power_platform_cloud
80
77
  else:
81
78
  raise ValueError(
82
- "Either CustomPowerPlatformCloud or cloud_base_address must be provided when PowerPlatformCloud is Other"
79
+ str(copilot_studio_errors.CustomCloudOrBaseAddressRequired)
83
80
  )
84
81
 
85
82
  cloud_base_address = cloud_base_address or "api.unknown.powerplatform.com"
@@ -116,9 +113,7 @@ class PowerPlatformEnvironment:
116
113
  cloud_base_address: Optional[str] = None,
117
114
  ) -> str:
118
115
  if cloud == PowerPlatformCloud.OTHER and not cloud_base_address:
119
- raise ValueError(
120
- "cloud_base_address must be provided when PowerPlatformCloud is Other"
121
- )
116
+ raise ValueError(str(copilot_studio_errors.CloudBaseAddressRequired))
122
117
  cloud_base_address = cloud_base_address or "api.unknown.powerplatform.com"
123
118
  normalized_resource_id = environment_id.lower().replace("-", "")
124
119
  id_suffix_length = PowerPlatformEnvironment.get_id_suffix_length(cloud)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-copilotstudio-client
3
- Version: 0.5.3
3
+ Version: 0.6.0
4
4
  Summary: A client 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-hosting-core==0.5.3
18
+ Requires-Dist: microsoft-agents-hosting-core==0.6.0
19
19
  Dynamic: license-file
20
20
  Dynamic: requires-dist
21
21
 
@@ -5,9 +5,11 @@ microsoft_agents/copilotstudio/client/copilot_client.py,sha256=YuOi-aOt_gM-l7CYd
5
5
  microsoft_agents/copilotstudio/client/direct_to_engine_connection_settings_protocol.py,sha256=JBBGSI5TfzO5QjTQpNORbX0blBY88jz7v9egtFd_7Yw,785
6
6
  microsoft_agents/copilotstudio/client/execute_turn_request.py,sha256=Gi8KPODVAaISjMtBbdbHvWSq56VAt_I7D9-U1YyEL00,125
7
7
  microsoft_agents/copilotstudio/client/power_platform_cloud.py,sha256=YrwAmxpeSuWpuQ1VnDc2_4m_r6T6sjbHMugBrIEF4iQ,465
8
- microsoft_agents/copilotstudio/client/power_platform_environment.py,sha256=PVKzyx2inaIEBCA5Fh8JsrZ0vYeG6qRza0hEbfrHDpY,6956
9
- microsoft_agents_copilotstudio_client-0.5.3.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
10
- microsoft_agents_copilotstudio_client-0.5.3.dist-info/METADATA,sha256=4q3TTnLDyNcR5ynWfN3oSMOLcS1F-4yALsp__bP4NE0,8870
11
- microsoft_agents_copilotstudio_client-0.5.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
- microsoft_agents_copilotstudio_client-0.5.3.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
13
- microsoft_agents_copilotstudio_client-0.5.3.dist-info/RECORD,,
8
+ microsoft_agents/copilotstudio/client/power_platform_environment.py,sha256=es9KQ52usUyCPq0DSn-IKRxIv1fhnhBPAC6mmpYiENs,6828
9
+ microsoft_agents/copilotstudio/client/errors/__init__.py,sha256=o-OHGAnaYY8diahW9rrRn18WNeLL2hnUVtlV20HWeh8,448
10
+ microsoft_agents/copilotstudio/client/errors/error_resources.py,sha256=mhsmdShrHtUeMOuCi84a_vJmqyidbygArPdwM-mSHHw,1482
11
+ microsoft_agents_copilotstudio_client-0.6.0.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
12
+ microsoft_agents_copilotstudio_client-0.6.0.dist-info/METADATA,sha256=aFDuZ70k9jdolL2DyLUvSxNg9yhkY43RHAvfz9Y8ots,8870
13
+ microsoft_agents_copilotstudio_client-0.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ microsoft_agents_copilotstudio_client-0.6.0.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
15
+ microsoft_agents_copilotstudio_client-0.6.0.dist-info/RECORD,,