microsoft-agents-activity 0.0.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.

Potentially problematic release.


This version of microsoft-agents-activity might be problematic. Click here for more details.

Files changed (195) hide show
  1. microsoft/agents/activity/__init__.py +191 -0
  2. microsoft/agents/activity/_load_configuration.py +25 -0
  3. microsoft/agents/activity/_type_aliases.py +5 -0
  4. microsoft/agents/activity/action_types.py +14 -0
  5. microsoft/agents/activity/activity.py +613 -0
  6. microsoft/agents/activity/activity_event_names.py +6 -0
  7. microsoft/agents/activity/activity_importance.py +7 -0
  8. microsoft/agents/activity/activity_types.py +22 -0
  9. microsoft/agents/activity/adaptive_card_invoke_action.py +24 -0
  10. microsoft/agents/activity/adaptive_card_invoke_response.py +20 -0
  11. microsoft/agents/activity/adaptive_card_invoke_value.py +22 -0
  12. microsoft/agents/activity/agents_model.py +18 -0
  13. microsoft/agents/activity/ai_entity.py +142 -0
  14. microsoft/agents/activity/animation_card.py +54 -0
  15. microsoft/agents/activity/attachment.py +24 -0
  16. microsoft/agents/activity/attachment_data.py +21 -0
  17. microsoft/agents/activity/attachment_info.py +19 -0
  18. microsoft/agents/activity/attachment_layout_types.py +6 -0
  19. microsoft/agents/activity/attachment_view.py +15 -0
  20. microsoft/agents/activity/audio_card.py +54 -0
  21. microsoft/agents/activity/basic_card.py +30 -0
  22. microsoft/agents/activity/caller_id_constants.py +7 -0
  23. microsoft/agents/activity/card_action.py +39 -0
  24. microsoft/agents/activity/card_image.py +19 -0
  25. microsoft/agents/activity/channel_account.py +33 -0
  26. microsoft/agents/activity/channel_adapter_protocol.py +76 -0
  27. microsoft/agents/activity/channels.py +158 -0
  28. microsoft/agents/activity/contact_relation_update_action_types.py +6 -0
  29. microsoft/agents/activity/conversation_account.py +38 -0
  30. microsoft/agents/activity/conversation_members.py +16 -0
  31. microsoft/agents/activity/conversation_parameters.py +37 -0
  32. microsoft/agents/activity/conversation_reference.py +60 -0
  33. microsoft/agents/activity/conversation_resource_response.py +19 -0
  34. microsoft/agents/activity/conversation_update_types.py +15 -0
  35. microsoft/agents/activity/conversations_result.py +17 -0
  36. microsoft/agents/activity/delivery_modes.py +9 -0
  37. microsoft/agents/activity/end_of_conversation_codes.py +10 -0
  38. microsoft/agents/activity/entity.py +38 -0
  39. microsoft/agents/activity/error.py +19 -0
  40. microsoft/agents/activity/error_response.py +12 -0
  41. microsoft/agents/activity/expected_replies.py +13 -0
  42. microsoft/agents/activity/fact.py +18 -0
  43. microsoft/agents/activity/geo_coordinates.py +27 -0
  44. microsoft/agents/activity/hero_card.py +30 -0
  45. microsoft/agents/activity/inner_http_error.py +14 -0
  46. microsoft/agents/activity/input_hints.py +10 -0
  47. microsoft/agents/activity/installation_update_action_types.py +6 -0
  48. microsoft/agents/activity/invoke_response.py +24 -0
  49. microsoft/agents/activity/media_card.py +54 -0
  50. microsoft/agents/activity/media_event_value.py +12 -0
  51. microsoft/agents/activity/media_url.py +16 -0
  52. microsoft/agents/activity/mention.py +19 -0
  53. microsoft/agents/activity/message_reaction.py +13 -0
  54. microsoft/agents/activity/message_reaction_types.py +11 -0
  55. microsoft/agents/activity/message_update_types.py +7 -0
  56. microsoft/agents/activity/oauth_card.py +24 -0
  57. microsoft/agents/activity/paged_members_result.py +16 -0
  58. microsoft/agents/activity/place.py +27 -0
  59. microsoft/agents/activity/receipt_card.py +36 -0
  60. microsoft/agents/activity/receipt_item.py +35 -0
  61. microsoft/agents/activity/resource_response.py +12 -0
  62. microsoft/agents/activity/role_types.py +7 -0
  63. microsoft/agents/activity/semantic_action.py +18 -0
  64. microsoft/agents/activity/semantic_actions_states.py +7 -0
  65. microsoft/agents/activity/sign_in_constants.py +13 -0
  66. microsoft/agents/activity/sign_in_resource.py +14 -0
  67. microsoft/agents/activity/signin_card.py +16 -0
  68. microsoft/agents/activity/suggested_actions.py +18 -0
  69. microsoft/agents/activity/teams/__init__.py +198 -0
  70. microsoft/agents/activity/teams/app_based_link_query.py +18 -0
  71. microsoft/agents/activity/teams/batch_failed_entries_response.py +15 -0
  72. microsoft/agents/activity/teams/batch_failed_entry.py +16 -0
  73. microsoft/agents/activity/teams/batch_operation_response.py +13 -0
  74. microsoft/agents/activity/teams/batch_operation_state_response.py +24 -0
  75. microsoft/agents/activity/teams/bot_config_auth.py +18 -0
  76. microsoft/agents/activity/teams/cache_info.py +18 -0
  77. microsoft/agents/activity/teams/cancel_operation_response.py +19 -0
  78. microsoft/agents/activity/teams/channel_info.py +21 -0
  79. microsoft/agents/activity/teams/config_auth_response.py +17 -0
  80. microsoft/agents/activity/teams/config_response.py +18 -0
  81. microsoft/agents/activity/teams/config_response_base.py +14 -0
  82. microsoft/agents/activity/teams/config_task_response.py +18 -0
  83. microsoft/agents/activity/teams/conversation_list.py +17 -0
  84. microsoft/agents/activity/teams/file_consent_card.py +24 -0
  85. microsoft/agents/activity/teams/file_consent_card_response.py +21 -0
  86. microsoft/agents/activity/teams/file_download_info.py +24 -0
  87. microsoft/agents/activity/teams/file_info_card.py +21 -0
  88. microsoft/agents/activity/teams/file_upload_info.py +26 -0
  89. microsoft/agents/activity/teams/meeting_details.py +23 -0
  90. microsoft/agents/activity/teams/meeting_details_base.py +21 -0
  91. microsoft/agents/activity/teams/meeting_end_event_details.py +15 -0
  92. microsoft/agents/activity/teams/meeting_event_details.py +15 -0
  93. microsoft/agents/activity/teams/meeting_info.py +24 -0
  94. microsoft/agents/activity/teams/meeting_notification.py +15 -0
  95. microsoft/agents/activity/teams/meeting_notification_base.py +14 -0
  96. microsoft/agents/activity/teams/meeting_notification_channel_data.py +16 -0
  97. microsoft/agents/activity/teams/meeting_notification_recipient_failure_info.py +20 -0
  98. microsoft/agents/activity/teams/meeting_notification_response.py +20 -0
  99. microsoft/agents/activity/teams/meeting_participant_info.py +18 -0
  100. microsoft/agents/activity/teams/meeting_participants_event_details.py +16 -0
  101. microsoft/agents/activity/teams/meeting_stage_surface.py +25 -0
  102. microsoft/agents/activity/teams/meeting_start_event_details.py +15 -0
  103. microsoft/agents/activity/teams/meeting_tab_icon_surface.py +15 -0
  104. microsoft/agents/activity/teams/message_actions_payload.py +70 -0
  105. microsoft/agents/activity/teams/message_actions_payload_app.py +29 -0
  106. microsoft/agents/activity/teams/message_actions_payload_attachment.py +30 -0
  107. microsoft/agents/activity/teams/message_actions_payload_body.py +17 -0
  108. microsoft/agents/activity/teams/message_actions_payload_conversation.py +20 -0
  109. microsoft/agents/activity/teams/message_actions_payload_from.py +25 -0
  110. microsoft/agents/activity/teams/message_actions_payload_mention.py +23 -0
  111. microsoft/agents/activity/teams/message_actions_payload_reaction.py +23 -0
  112. microsoft/agents/activity/teams/message_actions_payload_user.py +27 -0
  113. microsoft/agents/activity/teams/messaging_extension_action.py +37 -0
  114. microsoft/agents/activity/teams/messaging_extension_action_response.py +24 -0
  115. microsoft/agents/activity/teams/messaging_extension_attachment.py +32 -0
  116. microsoft/agents/activity/teams/messaging_extension_parameter.py +17 -0
  117. microsoft/agents/activity/teams/messaging_extension_query.py +27 -0
  118. microsoft/agents/activity/teams/messaging_extension_query_options.py +17 -0
  119. microsoft/agents/activity/teams/messaging_extension_response.py +21 -0
  120. microsoft/agents/activity/teams/messaging_extension_result.py +34 -0
  121. microsoft/agents/activity/teams/messaging_extension_suggested_action.py +17 -0
  122. microsoft/agents/activity/teams/notification_info.py +21 -0
  123. microsoft/agents/activity/teams/o365_connector_card.py +32 -0
  124. microsoft/agents/activity/teams/o365_connector_card_action_base.py +21 -0
  125. microsoft/agents/activity/teams/o365_connector_card_action_card.py +30 -0
  126. microsoft/agents/activity/teams/o365_connector_card_action_query.py +15 -0
  127. microsoft/agents/activity/teams/o365_connector_card_date_input.py +30 -0
  128. microsoft/agents/activity/teams/o365_connector_card_fact.py +17 -0
  129. microsoft/agents/activity/teams/o365_connector_card_http_post.py +25 -0
  130. microsoft/agents/activity/teams/o365_connector_card_image.py +18 -0
  131. microsoft/agents/activity/teams/o365_connector_card_input_base.py +28 -0
  132. microsoft/agents/activity/teams/o365_connector_card_multichoice_input.py +40 -0
  133. microsoft/agents/activity/teams/o365_connector_card_multichoice_input_choice.py +17 -0
  134. microsoft/agents/activity/teams/o365_connector_card_open_uri.py +26 -0
  135. microsoft/agents/activity/teams/o365_connector_card_open_uri_target.py +17 -0
  136. microsoft/agents/activity/teams/o365_connector_card_section.py +42 -0
  137. microsoft/agents/activity/teams/o365_connector_card_text_input.py +31 -0
  138. microsoft/agents/activity/teams/o365_connector_card_view_action.py +25 -0
  139. microsoft/agents/activity/teams/on_behalf_of.py +23 -0
  140. microsoft/agents/activity/teams/read_receipt_info.py +47 -0
  141. microsoft/agents/activity/teams/signin_state_verification_query.py +14 -0
  142. microsoft/agents/activity/teams/surface.py +18 -0
  143. microsoft/agents/activity/teams/tab_context.py +14 -0
  144. microsoft/agents/activity/teams/tab_entity_context.py +15 -0
  145. microsoft/agents/activity/teams/tab_request.py +22 -0
  146. microsoft/agents/activity/teams/tab_response.py +16 -0
  147. microsoft/agents/activity/teams/tab_response_card.py +14 -0
  148. microsoft/agents/activity/teams/tab_response_cards.py +17 -0
  149. microsoft/agents/activity/teams/tab_response_payload.py +25 -0
  150. microsoft/agents/activity/teams/tab_submit.py +23 -0
  151. microsoft/agents/activity/teams/tab_submit_data.py +18 -0
  152. microsoft/agents/activity/teams/tab_suggested_actions.py +17 -0
  153. microsoft/agents/activity/teams/targeted_meeting_notification.py +19 -0
  154. microsoft/agents/activity/teams/targeted_meeting_notification_value.py +19 -0
  155. microsoft/agents/activity/teams/task_module_card_response.py +15 -0
  156. microsoft/agents/activity/teams/task_module_continue_response.py +19 -0
  157. microsoft/agents/activity/teams/task_module_message_response.py +18 -0
  158. microsoft/agents/activity/teams/task_module_request.py +25 -0
  159. microsoft/agents/activity/teams/task_module_request_context.py +15 -0
  160. microsoft/agents/activity/teams/task_module_response.py +20 -0
  161. microsoft/agents/activity/teams/task_module_response_base.py +17 -0
  162. microsoft/agents/activity/teams/task_module_task_info.py +30 -0
  163. microsoft/agents/activity/teams/team_details.py +29 -0
  164. microsoft/agents/activity/teams/team_info.py +20 -0
  165. microsoft/agents/activity/teams/teams_batch_operation_response.py +19 -0
  166. microsoft/agents/activity/teams/teams_channel_account.py +44 -0
  167. microsoft/agents/activity/teams/teams_channel_data.py +43 -0
  168. microsoft/agents/activity/teams/teams_channel_data_settings.py +15 -0
  169. microsoft/agents/activity/teams/teams_meeting_info.py +14 -0
  170. microsoft/agents/activity/teams/teams_meeting_member.py +19 -0
  171. microsoft/agents/activity/teams/teams_meeting_participant.py +24 -0
  172. microsoft/agents/activity/teams/teams_member.py +14 -0
  173. microsoft/agents/activity/teams/teams_paged_members_result.py +19 -0
  174. microsoft/agents/activity/teams/tenant_info.py +14 -0
  175. microsoft/agents/activity/teams/user_meeting_details.py +17 -0
  176. microsoft/agents/activity/text_format_types.py +7 -0
  177. microsoft/agents/activity/text_highlight.py +16 -0
  178. microsoft/agents/activity/thing.py +15 -0
  179. microsoft/agents/activity/thumbnail_card.py +30 -0
  180. microsoft/agents/activity/thumbnail_url.py +15 -0
  181. microsoft/agents/activity/token_exchange_invoke_request.py +21 -0
  182. microsoft/agents/activity/token_exchange_invoke_response.py +21 -0
  183. microsoft/agents/activity/token_exchange_resource.py +13 -0
  184. microsoft/agents/activity/token_exchange_state.py +38 -0
  185. microsoft/agents/activity/token_post_resource.py +11 -0
  186. microsoft/agents/activity/token_request.py +16 -0
  187. microsoft/agents/activity/token_response.py +25 -0
  188. microsoft/agents/activity/token_status.py +32 -0
  189. microsoft/agents/activity/transcript.py +13 -0
  190. microsoft/agents/activity/turn_context_protocol.py +65 -0
  191. microsoft/agents/activity/video_card.py +54 -0
  192. microsoft_agents_activity-0.0.0.dist-info/METADATA +11 -0
  193. microsoft_agents_activity-0.0.0.dist-info/RECORD +195 -0
  194. microsoft_agents_activity-0.0.0.dist-info/WHEEL +5 -0
  195. microsoft_agents_activity-0.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,20 @@
1
+ from .agents_model import AgentsModel
2
+ from ._type_aliases import NonEmptyString
3
+
4
+
5
+ class AdaptiveCardInvokeResponse(AgentsModel):
6
+ """AdaptiveCardInvokeResponse.
7
+
8
+ Defines the structure that is returned as the result of an Invoke activity with Name of 'adaptiveCard/action'.
9
+
10
+ :param status_code: The Card Action Response StatusCode.
11
+ :type status_code: int
12
+ :param type: The type of this Card Action Response.
13
+ :type type: str
14
+ :param value: The JSON response object.
15
+ :type value: dict[str, object]
16
+ """
17
+
18
+ status_code: int = None
19
+ type: NonEmptyString = None
20
+ value: dict[NonEmptyString, object] = None
@@ -0,0 +1,22 @@
1
+ from .adaptive_card_invoke_action import AdaptiveCardInvokeAction
2
+ from .token_exchange_invoke_request import TokenExchangeInvokeRequest
3
+ from .agents_model import AgentsModel
4
+ from ._type_aliases import NonEmptyString
5
+
6
+
7
+ class AdaptiveCardInvokeValue(AgentsModel):
8
+ """AdaptiveCardInvokeResponse.
9
+
10
+ Defines the structure that arrives in the Activity.Value for Invoke activity with Name of 'adaptiveCard/action'.
11
+
12
+ :param action: The action of this adaptive card invoke action value.
13
+ :type action: :class:`microsoft.agents.activity.models.AdaptiveCardInvokeAction`
14
+ :param authentication: The TokenExchangeInvokeRequest for this adaptive card invoke action value.
15
+ :type authentication: :class:`microsoft.agents.activity.models.TokenExchangeInvokeRequest`
16
+ :param state: The 'state' or magic code for an OAuth flow.
17
+ :type state: str
18
+ """
19
+
20
+ action: AdaptiveCardInvokeAction = None
21
+ authentication: TokenExchangeInvokeRequest = None
22
+ state: NonEmptyString = None
@@ -0,0 +1,18 @@
1
+ from pydantic import BaseModel, ConfigDict
2
+ from pydantic.alias_generators import to_camel
3
+
4
+
5
+ class AgentsModel(BaseModel):
6
+ model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
7
+
8
+ """
9
+ @model_serializer
10
+ def _serialize(self):
11
+ omit_if_empty = {
12
+ k
13
+ for k, v in self
14
+ if isinstance(v, list) and not v
15
+ }
16
+
17
+ return {k: v for k, v in self if k not in omit_if_empty and v is not None}
18
+ """
@@ -0,0 +1,142 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ from enum import Enum
5
+ from typing import List, Optional, Union, Literal
6
+ from dataclasses import dataclass
7
+
8
+ from .agents_model import AgentsModel
9
+ from .activity import Activity
10
+ from .entity import Entity
11
+
12
+
13
+ class ClientCitationIconName(str, Enum):
14
+ """Enumeration of supported citation icon names."""
15
+
16
+ MICROSOFT_WORD = "Microsoft Word"
17
+ MICROSOFT_EXCEL = "Microsoft Excel"
18
+ MICROSOFT_POWERPOINT = "Microsoft PowerPoint"
19
+ MICROSOFT_ONENOTE = "Microsoft OneNote"
20
+ MICROSOFT_SHAREPOINT = "Microsoft SharePoint"
21
+ MICROSOFT_VISIO = "Microsoft Visio"
22
+ MICROSOFT_LOOP = "Microsoft Loop"
23
+ MICROSOFT_WHITEBOARD = "Microsoft Whiteboard"
24
+ ADOBE_ILLUSTRATOR = "Adobe Illustrator"
25
+ ADOBE_PHOTOSHOP = "Adobe Photoshop"
26
+ ADOBE_INDESIGN = "Adobe InDesign"
27
+ ADOBE_FLASH = "Adobe Flash"
28
+ SKETCH = "Sketch"
29
+ SOURCE_CODE = "Source Code"
30
+ IMAGE = "Image"
31
+ GIF = "GIF"
32
+ VIDEO = "Video"
33
+ SOUND = "Sound"
34
+ ZIP = "ZIP"
35
+ TEXT = "Text"
36
+ PDF = "PDF"
37
+
38
+
39
+ class ClientCitationImage(AgentsModel):
40
+ """Information about the citation's icon."""
41
+
42
+ type: str = "ImageObject"
43
+ name: str = ""
44
+
45
+
46
+ class SensitivityPattern(AgentsModel):
47
+ """Pattern information for sensitivity usage info."""
48
+
49
+ type: str = "DefinedTerm"
50
+ in_defined_term_set: str = ""
51
+ name: str = ""
52
+ term_code: str = ""
53
+
54
+
55
+ class SensitivityUsageInfo(AgentsModel):
56
+ """
57
+ Sensitivity usage info for content sent to the user.
58
+ This is used to provide information about the content to the user.
59
+ """
60
+
61
+ type: str = "https://schema.org/Message"
62
+ schema_type: str = "CreativeWork"
63
+ description: Optional[str] = None
64
+ name: str = ""
65
+ position: Optional[int] = None
66
+ pattern: Optional[SensitivityPattern] = None
67
+
68
+
69
+ class ClientCitationAppearance(AgentsModel):
70
+ """Appearance information for a client citation."""
71
+
72
+ type: str = "DigitalDocument"
73
+ name: str = ""
74
+ text: Optional[str] = None
75
+ url: Optional[str] = None
76
+ abstract: str = ""
77
+ encoding_format: Optional[str] = None
78
+ image: Optional[ClientCitationImage] = None
79
+ keywords: Optional[List[str]] = None
80
+ usage_info: Optional[SensitivityUsageInfo] = None
81
+
82
+
83
+ class ClientCitation(AgentsModel):
84
+ """
85
+ Represents a Teams client citation to be included in a message.
86
+ See Bot messages with AI-generated content for more details.
87
+ https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage
88
+ """
89
+
90
+ type: str = "Claim"
91
+ position: int = 0
92
+ appearance: Optional[ClientCitationAppearance] = None
93
+
94
+ def __post_init__(self):
95
+ if self.appearance is None:
96
+ self.appearance = ClientCitationAppearance()
97
+
98
+
99
+ class AIEntity(Entity):
100
+ """Entity indicating AI-generated content."""
101
+
102
+ type: str = "https://schema.org/Message"
103
+ schema_type: str = "Message"
104
+ context: str = "https://schema.org"
105
+ id: str = ""
106
+ additional_type: Optional[List[str]] = None
107
+ citation: Optional[List[ClientCitation]] = None
108
+ usage_info: Optional[SensitivityUsageInfo] = None
109
+
110
+ def __post_init__(self):
111
+ if self.additional_type is None:
112
+ self.additional_type = ["AIGeneratedContent"]
113
+
114
+
115
+ def add_ai_to_activity(
116
+ activity: Activity,
117
+ citations: Optional[List[ClientCitation]] = None,
118
+ usage_info: Optional[SensitivityUsageInfo] = None,
119
+ ) -> None:
120
+ """
121
+ Adds AI entity to an activity to indicate AI-generated content.
122
+
123
+ Args:
124
+ activity: The activity to modify
125
+ citations: Optional list of citations
126
+ usage_info: Optional sensitivity usage information
127
+ """
128
+ if citations:
129
+ ai_entity = AIEntity(
130
+ type="https://schema.org/Message",
131
+ schema_type="Message",
132
+ context="https://schema.org",
133
+ id="",
134
+ additional_type=["AIGeneratedContent"],
135
+ citation=citations,
136
+ usage_info=usage_info,
137
+ )
138
+
139
+ if activity.entities is None:
140
+ activity.entities = []
141
+
142
+ activity.entities.append(ai_entity)
@@ -0,0 +1,54 @@
1
+ from .thumbnail_url import ThumbnailUrl
2
+ from .media_url import MediaUrl
3
+ from .card_action import CardAction
4
+ from .agents_model import AgentsModel
5
+ from ._type_aliases import NonEmptyString
6
+
7
+
8
+ class AnimationCard(AgentsModel):
9
+ """An animation card (Ex: gif or short video clip).
10
+
11
+ :param title: Title of this card
12
+ :type title: str
13
+ :param subtitle: Subtitle of this card
14
+ :type subtitle: str
15
+ :param text: Text of this card
16
+ :type text: str
17
+ :param image: Thumbnail placeholder
18
+ :type image: ~microsoft.agents.protocols.models.ThumbnailUrl
19
+ :param media: Media URLs for this card. When this field contains more than
20
+ one URL, each URL is an alternative format of the same content.
21
+ :type media: list[~microsoft.agents.protocols.models.MediaUrl]
22
+ :param buttons: Actions on this card
23
+ :type buttons: list[~microsoft.agents.protocols.models.CardAction]
24
+ :param shareable: This content may be shared with others (default:true)
25
+ :type shareable: bool
26
+ :param autoloop: Should the client loop playback at end of content
27
+ (default:true)
28
+ :type autoloop: bool
29
+ :param autostart: Should the client automatically start playback of media
30
+ in this card (default:true)
31
+ :type autostart: bool
32
+ :param aspect: Aspect ratio of thumbnail/media placeholder. Allowed values
33
+ are "16:9" and "4:3"
34
+ :type aspect: str
35
+ :param duration: Describes the length of the media content without
36
+ requiring a receiver to open the content. Formatted as an ISO 8601
37
+ Duration field.
38
+ :type duration: str
39
+ :param value: Supplementary parameter for this card
40
+ :type value: object
41
+ """
42
+
43
+ title: NonEmptyString = None
44
+ subtitle: NonEmptyString = None
45
+ text: NonEmptyString = None
46
+ image: ThumbnailUrl = None
47
+ media: list[MediaUrl] = None
48
+ buttons: list[CardAction] = None
49
+ shareable: bool = None
50
+ autoloop: bool = None
51
+ autostart: bool = None
52
+ aspect: NonEmptyString = None
53
+ duration: NonEmptyString = None
54
+ value: object = None
@@ -0,0 +1,24 @@
1
+ from .agents_model import AgentsModel
2
+ from ._type_aliases import NonEmptyString
3
+
4
+
5
+ class Attachment(AgentsModel):
6
+ """An attachment within an activity.
7
+
8
+ :param content_type: mimetype/Contenttype for the file
9
+ :type content_type: str
10
+ :param content_url: Content Url
11
+ :type content_url: str
12
+ :param content: Embedded content
13
+ :type content: object
14
+ :param name: (OPTIONAL) The name of the attachment
15
+ :type name: str
16
+ :param thumbnail_url: (OPTIONAL) Thumbnail associated with attachment
17
+ :type thumbnail_url: str
18
+ """
19
+
20
+ content_type: NonEmptyString
21
+ content_url: NonEmptyString = None
22
+ content: object = None
23
+ name: NonEmptyString = None
24
+ thumbnail_url: NonEmptyString = None
@@ -0,0 +1,21 @@
1
+ from .agents_model import AgentsModel
2
+ from ._type_aliases import NonEmptyString
3
+
4
+
5
+ class AttachmentData(AgentsModel):
6
+ """Attachment data.
7
+
8
+ :param type: Content-Type of the attachment
9
+ :type type: str
10
+ :param name: Name of the attachment
11
+ :type name: str
12
+ :param original_base64: Attachment content
13
+ :type original_base64: bytes
14
+ :param thumbnail_base64: Attachment thumbnail
15
+ :type thumbnail_base64: bytes
16
+ """
17
+
18
+ type: NonEmptyString = None
19
+ name: NonEmptyString = None
20
+ original_base64: bytes = None
21
+ thumbnail_base64: bytes = None
@@ -0,0 +1,19 @@
1
+ from .attachment_view import AttachmentView
2
+ from .agents_model import AgentsModel
3
+ from ._type_aliases import NonEmptyString
4
+
5
+
6
+ class AttachmentInfo(AgentsModel):
7
+ """Metadata for an attachment.
8
+
9
+ :param name: Name of the attachment
10
+ :type name: str
11
+ :param type: ContentType of the attachment
12
+ :type type: str
13
+ :param views: attachment views
14
+ :type views: list[~microsoft.agents.protocols.models.AttachmentView]
15
+ """
16
+
17
+ name: NonEmptyString = None
18
+ type: NonEmptyString = None
19
+ views: list[AttachmentView] = None
@@ -0,0 +1,6 @@
1
+ from enum import Enum
2
+
3
+
4
+ class AttachmentLayoutTypes(str, Enum):
5
+ list = "list"
6
+ carousel = "carousel"
@@ -0,0 +1,15 @@
1
+ from .agents_model import AgentsModel
2
+ from ._type_aliases import NonEmptyString
3
+
4
+
5
+ class AttachmentView(AgentsModel):
6
+ """Attachment View name and size.
7
+
8
+ :param view_id: Id of the attachment
9
+ :type view_id: str
10
+ :param size: Size of the attachment
11
+ :type size: int
12
+ """
13
+
14
+ view_id: NonEmptyString = None
15
+ size: int = None
@@ -0,0 +1,54 @@
1
+ from .agents_model import AgentsModel
2
+ from .thumbnail_url import ThumbnailUrl
3
+ from .media_url import MediaUrl
4
+ from .card_action import CardAction
5
+ from ._type_aliases import NonEmptyString
6
+
7
+
8
+ class AudioCard(AgentsModel):
9
+ """Audio card.
10
+
11
+ :param title: Title of this card
12
+ :type title: str
13
+ :param subtitle: Subtitle of this card
14
+ :type subtitle: str
15
+ :param text: Text of this card
16
+ :type text: str
17
+ :param image: Thumbnail placeholder
18
+ :type image: ~microsoft.agents.protocols.models.ThumbnailUrl
19
+ :param media: Media URLs for this card. When this field contains more than
20
+ one URL, each URL is an alternative format of the same content.
21
+ :type media: list[~microsoft.agents.protocols.models.MediaUrl]
22
+ :param buttons: Actions on this card
23
+ :type buttons: list[~microsoft.agents.protocols.models.CardAction]
24
+ :param shareable: This content may be shared with others (default:true)
25
+ :type shareable: bool
26
+ :param autoloop: Should the client loop playback at end of content
27
+ (default:true)
28
+ :type autoloop: bool
29
+ :param autostart: Should the client automatically start playback of media
30
+ in this card (default:true)
31
+ :type autostart: bool
32
+ :param aspect: Aspect ratio of thumbnail/media placeholder. Allowed values
33
+ are "16:9" and "4:3"
34
+ :type aspect: str
35
+ :param duration: Describes the length of the media content without
36
+ requiring a receiver to open the content. Formatted as an ISO 8601
37
+ Duration field.
38
+ :type duration: str
39
+ :param value: Supplementary parameter for this card
40
+ :type value: object
41
+ """
42
+
43
+ title: NonEmptyString = None
44
+ subtitle: NonEmptyString = None
45
+ text: NonEmptyString = None
46
+ image: ThumbnailUrl = None
47
+ media: list[MediaUrl] = None
48
+ buttons: list[CardAction] = None
49
+ shareable: bool = None
50
+ autoloop: bool = None
51
+ autostart: bool = None
52
+ aspect: NonEmptyString = None
53
+ duration: NonEmptyString = None
54
+ value: object = None
@@ -0,0 +1,30 @@
1
+ from .agents_model import AgentsModel
2
+ from .card_image import CardImage
3
+ from .card_action import CardAction
4
+ from ._type_aliases import NonEmptyString
5
+
6
+
7
+ class BasicCard(AgentsModel):
8
+ """A basic card.
9
+
10
+ :param title: Title of the card
11
+ :type title: str
12
+ :param subtitle: Subtitle of the card
13
+ :type subtitle: str
14
+ :param text: Text for the card
15
+ :type text: str
16
+ :param images: Array of images for the card
17
+ :type images: list[~microsoft.agents.protocols.models.CardImage]
18
+ :param buttons: Set of actions applicable to the current card
19
+ :type buttons: list[~microsoft.agents.protocols.models.CardAction]
20
+ :param tap: This action will be activated when user taps on the card
21
+ itself
22
+ :type tap: ~microsoft.agents.protocols.models.CardAction
23
+ """
24
+
25
+ title: NonEmptyString = None
26
+ subtitle: NonEmptyString = None
27
+ text: NonEmptyString = None
28
+ images: list[CardImage] = None
29
+ buttons: list[CardAction] = None
30
+ tap: CardAction = None
@@ -0,0 +1,7 @@
1
+ from enum import Enum
2
+
3
+
4
+ class CallerIdConstants(str, Enum):
5
+ public_azure_channel = "urn:botframework:azure"
6
+ us_gov_channel = "urn:botframework:azureusgov"
7
+ agent_to_agent_prefix = "urn:botframework:aadappid:"
@@ -0,0 +1,39 @@
1
+ from typing import Optional
2
+ from .agents_model import AgentsModel
3
+ from ._type_aliases import NonEmptyString
4
+
5
+
6
+ class CardAction(AgentsModel):
7
+ """A clickable action.
8
+
9
+ :param type: The type of action implemented by this button. Possible
10
+ values include: 'openUrl', 'imBack', 'postBack', 'playAudio', 'playVideo',
11
+ 'showImage', 'downloadFile', 'signin', 'call', 'messageBack'
12
+ :type type: str or ~microsoft.agents.protocols.models.ActionTypes
13
+ :param title: Text description which appears on the button
14
+ :type title: str
15
+ :param image: Image URL which will appear on the button, next to text
16
+ label
17
+ :type image: str
18
+ :param text: Text for this action
19
+ :type text: str
20
+ :param display_text: (Optional) text to display in the chat feed if the
21
+ button is clicked
22
+ :type display_text: str
23
+ :param value: Supplementary parameter for action. Content of this property
24
+ depends on the ActionType
25
+ :type value: object
26
+ :param channel_data: Channel-specific data associated with this action
27
+ :type channel_data: object
28
+ :param image_alt_text: Alternate image text to be used in place of the `image` field
29
+ :type image_alt_text: str
30
+ """
31
+
32
+ type: NonEmptyString
33
+ title: NonEmptyString
34
+ image: str = None
35
+ text: str = None
36
+ display_text: str = None
37
+ value: object = None
38
+ channel_data: Optional[object] = None
39
+ image_alt_text: str = None
@@ -0,0 +1,19 @@
1
+ from .card_action import CardAction
2
+ from .agents_model import AgentsModel
3
+ from ._type_aliases import NonEmptyString
4
+
5
+
6
+ class CardImage(AgentsModel):
7
+ """An image on a card.
8
+
9
+ :param url: URL thumbnail image for major content property
10
+ :type url: str
11
+ :param alt: Image description intended for screen readers
12
+ :type alt: str
13
+ :param tap: Action assigned to specific Attachment
14
+ :type tap: ~microsoft.agents.protocols.models.CardAction
15
+ """
16
+
17
+ url: NonEmptyString = None
18
+ alt: NonEmptyString = None
19
+ tap: CardAction = None
@@ -0,0 +1,33 @@
1
+ from typing import Any
2
+
3
+ from pydantic import ConfigDict
4
+ from .agents_model import AgentsModel
5
+ from ._type_aliases import NonEmptyString
6
+
7
+
8
+ class ChannelAccount(AgentsModel):
9
+ """Channel account information needed to route a message.
10
+
11
+ :param id: Channel id for the user or agent on this channel (Example:
12
+ joe@smith.com, or @joesmith or 123456)
13
+ :type id: str
14
+ :param name: Display friendly name
15
+ :type name: str
16
+ :param aad_object_id: This account's object ID within Azure Active
17
+ Directory (AAD)
18
+ :type aad_object_id: str
19
+ :param role: Role of the entity behind the account
20
+ :type role: str or ~microsoft.agents.protocols.models.RoleTypes
21
+ """
22
+
23
+ model_config = ConfigDict(extra="allow")
24
+
25
+ id: NonEmptyString
26
+ name: str = None
27
+ aad_object_id: NonEmptyString = None
28
+ role: NonEmptyString = None
29
+
30
+ @property
31
+ def properties(self) -> dict[str, Any]:
32
+ """Returns the set of properties that are not None."""
33
+ return self.model_extra
@@ -0,0 +1,76 @@
1
+ from abc import abstractmethod
2
+ from typing import Protocol, List, Callable, Awaitable, Optional
3
+
4
+ from .turn_context_protocol import TurnContextProtocol
5
+ from microsoft.agents.activity import (
6
+ Activity,
7
+ ResourceResponse,
8
+ ConversationReference,
9
+ ConversationParameters,
10
+ )
11
+
12
+
13
+ class ChannelAdapterProtocol(Protocol):
14
+ on_turn_error: Optional[Callable[[TurnContextProtocol, Exception], Awaitable]]
15
+
16
+ @abstractmethod
17
+ async def send_activities(
18
+ self, context: TurnContextProtocol, activities: List[Activity]
19
+ ) -> List[ResourceResponse]:
20
+ pass
21
+
22
+ @abstractmethod
23
+ async def update_activity(
24
+ self, context: TurnContextProtocol, activity: Activity
25
+ ) -> None:
26
+ pass
27
+
28
+ @abstractmethod
29
+ async def delete_activity(
30
+ self, context: TurnContextProtocol, reference: ConversationReference
31
+ ) -> None:
32
+ pass
33
+
34
+ @abstractmethod
35
+ def use(self, middleware: object) -> "ChannelAdapterProtocol":
36
+ pass
37
+
38
+ @abstractmethod
39
+ async def continue_conversation(
40
+ self,
41
+ agent_id: str,
42
+ reference: ConversationReference,
43
+ callback: Callable[[TurnContextProtocol], Awaitable],
44
+ ) -> None:
45
+ pass
46
+
47
+ # TODO: potentially move ClaimsIdentity to activity
48
+ @abstractmethod
49
+ async def continue_conversation_with_claims(
50
+ self,
51
+ claims_identity: dict,
52
+ continuation_activity: Activity,
53
+ callback: Callable[[TurnContextProtocol], Awaitable],
54
+ audience: str = None,
55
+ ):
56
+ pass
57
+
58
+ @abstractmethod
59
+ async def create_conversation(
60
+ self,
61
+ agent_app_id: str,
62
+ channel_id: str,
63
+ service_url: str,
64
+ audience: str,
65
+ conversation_parameters: ConversationParameters,
66
+ callback: Callable[[TurnContextProtocol], Awaitable],
67
+ ) -> None:
68
+ pass
69
+
70
+ @abstractmethod
71
+ async def run_pipeline(
72
+ self,
73
+ context: TurnContextProtocol,
74
+ callback: Callable[[TurnContextProtocol], Awaitable],
75
+ ) -> None:
76
+ pass