microsoft-agents-activity 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.
- microsoft_agents/activity/__init__.py +200 -0
- microsoft_agents/activity/_channel_id_field_mixin.py +95 -0
- microsoft_agents/activity/_load_configuration.py +33 -0
- microsoft_agents/activity/_model_utils.py +64 -0
- microsoft_agents/activity/_type_aliases.py +7 -0
- microsoft_agents/activity/_utils/__init__.py +6 -0
- microsoft_agents/activity/_utils/_deferred_string.py +34 -0
- microsoft_agents/activity/action_types.py +17 -0
- microsoft_agents/activity/activity.py +787 -0
- microsoft_agents/activity/activity_event_names.py +9 -0
- microsoft_agents/activity/activity_importance.py +10 -0
- microsoft_agents/activity/activity_types.py +25 -0
- microsoft_agents/activity/adaptive_card_invoke_action.py +27 -0
- microsoft_agents/activity/adaptive_card_invoke_response.py +23 -0
- microsoft_agents/activity/adaptive_card_invoke_value.py +25 -0
- microsoft_agents/activity/agents_model.py +49 -0
- microsoft_agents/activity/animation_card.py +57 -0
- microsoft_agents/activity/attachment.py +27 -0
- microsoft_agents/activity/attachment_data.py +24 -0
- microsoft_agents/activity/attachment_info.py +22 -0
- microsoft_agents/activity/attachment_layout_types.py +9 -0
- microsoft_agents/activity/attachment_view.py +18 -0
- microsoft_agents/activity/audio_card.py +57 -0
- microsoft_agents/activity/basic_card.py +33 -0
- microsoft_agents/activity/caller_id_constants.py +10 -0
- microsoft_agents/activity/card_action.py +42 -0
- microsoft_agents/activity/card_image.py +22 -0
- microsoft_agents/activity/channel_account.py +39 -0
- microsoft_agents/activity/channel_adapter_protocol.py +79 -0
- microsoft_agents/activity/channel_id.py +95 -0
- microsoft_agents/activity/channels.py +161 -0
- microsoft_agents/activity/contact_relation_update_action_types.py +9 -0
- microsoft_agents/activity/conversation_account.py +41 -0
- microsoft_agents/activity/conversation_members.py +19 -0
- microsoft_agents/activity/conversation_parameters.py +40 -0
- microsoft_agents/activity/conversation_reference.py +69 -0
- microsoft_agents/activity/conversation_resource_response.py +22 -0
- microsoft_agents/activity/conversation_update_types.py +18 -0
- microsoft_agents/activity/conversations_result.py +20 -0
- microsoft_agents/activity/delivery_modes.py +12 -0
- microsoft_agents/activity/end_of_conversation_codes.py +13 -0
- microsoft_agents/activity/entity/__init__.py +36 -0
- microsoft_agents/activity/entity/ai_entity.py +111 -0
- microsoft_agents/activity/entity/entity.py +41 -0
- microsoft_agents/activity/entity/entity_types.py +14 -0
- microsoft_agents/activity/entity/geo_coordinates.py +33 -0
- microsoft_agents/activity/entity/mention.py +24 -0
- microsoft_agents/activity/entity/place.py +33 -0
- microsoft_agents/activity/entity/product_info.py +20 -0
- microsoft_agents/activity/entity/thing.py +21 -0
- microsoft_agents/activity/error.py +22 -0
- microsoft_agents/activity/error_response.py +15 -0
- microsoft_agents/activity/errors/__init__.py +14 -0
- microsoft_agents/activity/errors/error_message.py +64 -0
- microsoft_agents/activity/errors/error_resources.py +52 -0
- microsoft_agents/activity/expected_replies.py +16 -0
- microsoft_agents/activity/fact.py +21 -0
- microsoft_agents/activity/hero_card.py +33 -0
- microsoft_agents/activity/inner_http_error.py +17 -0
- microsoft_agents/activity/input_hints.py +10 -0
- microsoft_agents/activity/installation_update_action_types.py +9 -0
- microsoft_agents/activity/invoke_response.py +27 -0
- microsoft_agents/activity/media_card.py +57 -0
- microsoft_agents/activity/media_event_value.py +15 -0
- microsoft_agents/activity/media_url.py +19 -0
- microsoft_agents/activity/message_reaction.py +16 -0
- microsoft_agents/activity/message_reaction_types.py +14 -0
- microsoft_agents/activity/message_update_types.py +10 -0
- microsoft_agents/activity/oauth_card.py +27 -0
- microsoft_agents/activity/paged_members_result.py +19 -0
- microsoft_agents/activity/receipt_card.py +39 -0
- microsoft_agents/activity/receipt_item.py +38 -0
- microsoft_agents/activity/resource_response.py +15 -0
- microsoft_agents/activity/role_types.py +12 -0
- microsoft_agents/activity/semantic_action.py +21 -0
- microsoft_agents/activity/semantic_actions_states.py +10 -0
- microsoft_agents/activity/sign_in_constants.py +13 -0
- microsoft_agents/activity/sign_in_resource.py +17 -0
- microsoft_agents/activity/signin_card.py +19 -0
- microsoft_agents/activity/suggested_actions.py +21 -0
- microsoft_agents/activity/teams/__init__.py +198 -0
- microsoft_agents/activity/teams/app_based_link_query.py +18 -0
- microsoft_agents/activity/teams/batch_failed_entries_response.py +15 -0
- microsoft_agents/activity/teams/batch_failed_entry.py +16 -0
- microsoft_agents/activity/teams/batch_operation_response.py +13 -0
- microsoft_agents/activity/teams/batch_operation_state_response.py +24 -0
- microsoft_agents/activity/teams/bot_config_auth.py +18 -0
- microsoft_agents/activity/teams/cache_info.py +18 -0
- microsoft_agents/activity/teams/cancel_operation_response.py +19 -0
- microsoft_agents/activity/teams/channel_info.py +21 -0
- microsoft_agents/activity/teams/config_auth_response.py +17 -0
- microsoft_agents/activity/teams/config_response.py +18 -0
- microsoft_agents/activity/teams/config_response_base.py +14 -0
- microsoft_agents/activity/teams/config_task_response.py +18 -0
- microsoft_agents/activity/teams/conversation_list.py +17 -0
- microsoft_agents/activity/teams/file_consent_card.py +24 -0
- microsoft_agents/activity/teams/file_consent_card_response.py +21 -0
- microsoft_agents/activity/teams/file_download_info.py +24 -0
- microsoft_agents/activity/teams/file_info_card.py +21 -0
- microsoft_agents/activity/teams/file_upload_info.py +26 -0
- microsoft_agents/activity/teams/meeting_details.py +23 -0
- microsoft_agents/activity/teams/meeting_details_base.py +21 -0
- microsoft_agents/activity/teams/meeting_end_event_details.py +15 -0
- microsoft_agents/activity/teams/meeting_event_details.py +15 -0
- microsoft_agents/activity/teams/meeting_info.py +24 -0
- microsoft_agents/activity/teams/meeting_notification.py +15 -0
- microsoft_agents/activity/teams/meeting_notification_base.py +14 -0
- microsoft_agents/activity/teams/meeting_notification_channel_data.py +16 -0
- microsoft_agents/activity/teams/meeting_notification_recipient_failure_info.py +20 -0
- microsoft_agents/activity/teams/meeting_notification_response.py +20 -0
- microsoft_agents/activity/teams/meeting_participant_info.py +18 -0
- microsoft_agents/activity/teams/meeting_participants_event_details.py +16 -0
- microsoft_agents/activity/teams/meeting_stage_surface.py +25 -0
- microsoft_agents/activity/teams/meeting_start_event_details.py +15 -0
- microsoft_agents/activity/teams/meeting_tab_icon_surface.py +15 -0
- microsoft_agents/activity/teams/message_actions_payload.py +70 -0
- microsoft_agents/activity/teams/message_actions_payload_app.py +29 -0
- microsoft_agents/activity/teams/message_actions_payload_attachment.py +30 -0
- microsoft_agents/activity/teams/message_actions_payload_body.py +17 -0
- microsoft_agents/activity/teams/message_actions_payload_conversation.py +20 -0
- microsoft_agents/activity/teams/message_actions_payload_from.py +25 -0
- microsoft_agents/activity/teams/message_actions_payload_mention.py +23 -0
- microsoft_agents/activity/teams/message_actions_payload_reaction.py +23 -0
- microsoft_agents/activity/teams/message_actions_payload_user.py +27 -0
- microsoft_agents/activity/teams/messaging_extension_action.py +37 -0
- microsoft_agents/activity/teams/messaging_extension_action_response.py +24 -0
- microsoft_agents/activity/teams/messaging_extension_attachment.py +32 -0
- microsoft_agents/activity/teams/messaging_extension_parameter.py +17 -0
- microsoft_agents/activity/teams/messaging_extension_query.py +27 -0
- microsoft_agents/activity/teams/messaging_extension_query_options.py +17 -0
- microsoft_agents/activity/teams/messaging_extension_response.py +21 -0
- microsoft_agents/activity/teams/messaging_extension_result.py +34 -0
- microsoft_agents/activity/teams/messaging_extension_suggested_action.py +17 -0
- microsoft_agents/activity/teams/notification_info.py +21 -0
- microsoft_agents/activity/teams/o365_connector_card.py +32 -0
- microsoft_agents/activity/teams/o365_connector_card_action_base.py +21 -0
- microsoft_agents/activity/teams/o365_connector_card_action_card.py +30 -0
- microsoft_agents/activity/teams/o365_connector_card_action_query.py +15 -0
- microsoft_agents/activity/teams/o365_connector_card_date_input.py +30 -0
- microsoft_agents/activity/teams/o365_connector_card_fact.py +17 -0
- microsoft_agents/activity/teams/o365_connector_card_http_post.py +25 -0
- microsoft_agents/activity/teams/o365_connector_card_image.py +18 -0
- microsoft_agents/activity/teams/o365_connector_card_input_base.py +28 -0
- microsoft_agents/activity/teams/o365_connector_card_multichoice_input.py +40 -0
- microsoft_agents/activity/teams/o365_connector_card_multichoice_input_choice.py +17 -0
- microsoft_agents/activity/teams/o365_connector_card_open_uri.py +26 -0
- microsoft_agents/activity/teams/o365_connector_card_open_uri_target.py +17 -0
- microsoft_agents/activity/teams/o365_connector_card_section.py +42 -0
- microsoft_agents/activity/teams/o365_connector_card_text_input.py +31 -0
- microsoft_agents/activity/teams/o365_connector_card_view_action.py +25 -0
- microsoft_agents/activity/teams/on_behalf_of.py +23 -0
- microsoft_agents/activity/teams/read_receipt_info.py +47 -0
- microsoft_agents/activity/teams/signin_state_verification_query.py +14 -0
- microsoft_agents/activity/teams/surface.py +18 -0
- microsoft_agents/activity/teams/tab_context.py +14 -0
- microsoft_agents/activity/teams/tab_entity_context.py +15 -0
- microsoft_agents/activity/teams/tab_request.py +22 -0
- microsoft_agents/activity/teams/tab_response.py +16 -0
- microsoft_agents/activity/teams/tab_response_card.py +14 -0
- microsoft_agents/activity/teams/tab_response_cards.py +17 -0
- microsoft_agents/activity/teams/tab_response_payload.py +25 -0
- microsoft_agents/activity/teams/tab_submit.py +23 -0
- microsoft_agents/activity/teams/tab_submit_data.py +18 -0
- microsoft_agents/activity/teams/tab_suggested_actions.py +17 -0
- microsoft_agents/activity/teams/targeted_meeting_notification.py +19 -0
- microsoft_agents/activity/teams/targeted_meeting_notification_value.py +19 -0
- microsoft_agents/activity/teams/task_module_card_response.py +15 -0
- microsoft_agents/activity/teams/task_module_continue_response.py +19 -0
- microsoft_agents/activity/teams/task_module_message_response.py +18 -0
- microsoft_agents/activity/teams/task_module_request.py +25 -0
- microsoft_agents/activity/teams/task_module_request_context.py +15 -0
- microsoft_agents/activity/teams/task_module_response.py +20 -0
- microsoft_agents/activity/teams/task_module_response_base.py +17 -0
- microsoft_agents/activity/teams/task_module_task_info.py +30 -0
- microsoft_agents/activity/teams/team_details.py +29 -0
- microsoft_agents/activity/teams/team_info.py +20 -0
- microsoft_agents/activity/teams/teams_batch_operation_response.py +19 -0
- microsoft_agents/activity/teams/teams_channel_account.py +44 -0
- microsoft_agents/activity/teams/teams_channel_data.py +43 -0
- microsoft_agents/activity/teams/teams_channel_data_settings.py +15 -0
- microsoft_agents/activity/teams/teams_meeting_info.py +14 -0
- microsoft_agents/activity/teams/teams_meeting_member.py +19 -0
- microsoft_agents/activity/teams/teams_meeting_participant.py +24 -0
- microsoft_agents/activity/teams/teams_member.py +14 -0
- microsoft_agents/activity/teams/teams_paged_members_result.py +19 -0
- microsoft_agents/activity/teams/tenant_info.py +14 -0
- microsoft_agents/activity/teams/user_meeting_details.py +17 -0
- microsoft_agents/activity/text_format_types.py +10 -0
- microsoft_agents/activity/text_highlight.py +19 -0
- microsoft_agents/activity/thumbnail_card.py +33 -0
- microsoft_agents/activity/thumbnail_url.py +18 -0
- microsoft_agents/activity/token_exchange_invoke_request.py +24 -0
- microsoft_agents/activity/token_exchange_invoke_response.py +24 -0
- microsoft_agents/activity/token_exchange_resource.py +16 -0
- microsoft_agents/activity/token_exchange_state.py +41 -0
- microsoft_agents/activity/token_or_sign_in_resource_response.py +21 -0
- microsoft_agents/activity/token_post_resource.py +14 -0
- microsoft_agents/activity/token_request.py +19 -0
- microsoft_agents/activity/token_response.py +46 -0
- microsoft_agents/activity/token_status.py +32 -0
- microsoft_agents/activity/transcript.py +16 -0
- microsoft_agents/activity/turn_context_protocol.py +68 -0
- microsoft_agents/activity/video_card.py +57 -0
- microsoft_agents_activity-0.7.0.dev0.dist-info/METADATA +173 -0
- microsoft_agents_activity-0.7.0.dev0.dist-info/RECORD +208 -0
- microsoft_agents_activity-0.7.0.dev0.dist-info/WHEEL +5 -0
- microsoft_agents_activity-0.7.0.dev0.dist-info/licenses/LICENSE +21 -0
- microsoft_agents_activity-0.7.0.dev0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ActivityTypes(str, Enum):
|
|
8
|
+
message = "message"
|
|
9
|
+
contact_relation_update = "contactRelationUpdate"
|
|
10
|
+
conversation_update = "conversationUpdate"
|
|
11
|
+
typing = "typing"
|
|
12
|
+
end_of_conversation = "endOfConversation"
|
|
13
|
+
event = "event"
|
|
14
|
+
invoke = "invoke"
|
|
15
|
+
invoke_response = "invokeResponse"
|
|
16
|
+
delete_user_data = "deleteUserData"
|
|
17
|
+
message_update = "messageUpdate"
|
|
18
|
+
message_delete = "messageDelete"
|
|
19
|
+
installation_update = "installationUpdate"
|
|
20
|
+
message_reaction = "messageReaction"
|
|
21
|
+
suggestion = "suggestion"
|
|
22
|
+
trace = "trace"
|
|
23
|
+
handoff = "handoff"
|
|
24
|
+
command = "command"
|
|
25
|
+
command_result = "commandResult"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .agents_model import AgentsModel
|
|
5
|
+
from ._type_aliases import NonEmptyString
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AdaptiveCardInvokeAction(AgentsModel):
|
|
9
|
+
"""AdaptiveCardInvokeAction.
|
|
10
|
+
|
|
11
|
+
Defines the structure that arrives in the Activity.Value.Action for Invoke activity with
|
|
12
|
+
name of 'adaptiveCard/action'.
|
|
13
|
+
|
|
14
|
+
:param type: The Type of this Adaptive Card Invoke Action.
|
|
15
|
+
:type type: str
|
|
16
|
+
:param id: The Id of this Adaptive Card Invoke Action.
|
|
17
|
+
:type id: str
|
|
18
|
+
:param verb: The Verb of this Adaptive Card Invoke Action.
|
|
19
|
+
:type verb: str
|
|
20
|
+
:param data: The data of this Adaptive Card Invoke Action.
|
|
21
|
+
:type data: dict[str, object]
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
type: NonEmptyString = None
|
|
25
|
+
id: NonEmptyString = None
|
|
26
|
+
verb: NonEmptyString = None
|
|
27
|
+
data: dict[NonEmptyString, object] = None
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .agents_model import AgentsModel
|
|
5
|
+
from ._type_aliases import NonEmptyString
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AdaptiveCardInvokeResponse(AgentsModel):
|
|
9
|
+
"""AdaptiveCardInvokeResponse.
|
|
10
|
+
|
|
11
|
+
Defines the structure that is returned as the result of an Invoke activity with Name of 'adaptiveCard/action'.
|
|
12
|
+
|
|
13
|
+
:param status_code: The Card Action Response StatusCode.
|
|
14
|
+
:type status_code: int
|
|
15
|
+
:param type: The type of this Card Action Response.
|
|
16
|
+
:type type: str
|
|
17
|
+
:param value: The JSON response object.
|
|
18
|
+
:type value: dict[str, object]
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
status_code: int = None
|
|
22
|
+
type: NonEmptyString = None
|
|
23
|
+
value: dict[NonEmptyString, object] = None
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .adaptive_card_invoke_action import AdaptiveCardInvokeAction
|
|
5
|
+
from .token_exchange_invoke_request import TokenExchangeInvokeRequest
|
|
6
|
+
from .agents_model import AgentsModel
|
|
7
|
+
from ._type_aliases import NonEmptyString
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AdaptiveCardInvokeValue(AgentsModel):
|
|
11
|
+
"""AdaptiveCardInvokeResponse.
|
|
12
|
+
|
|
13
|
+
Defines the structure that arrives in the Activity.Value for Invoke activity with Name of 'adaptiveCard/action'.
|
|
14
|
+
|
|
15
|
+
:param action: The action of this adaptive card invoke action value.
|
|
16
|
+
:type action: :class:`microsoft_agents.activity.adaptive_card_invoke_action.AdaptiveCardInvokeAction`
|
|
17
|
+
:param authentication: The TokenExchangeInvokeRequest for this adaptive card invoke action value.
|
|
18
|
+
:type authentication: :class:`microsoft_agents.activity.token_exchange_invoke_request.TokenExchangeInvokeRequest`
|
|
19
|
+
:param state: The 'state' or magic code for an OAuth flow.
|
|
20
|
+
:type state: str
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
action: AdaptiveCardInvokeAction = None
|
|
24
|
+
authentication: TokenExchangeInvokeRequest = None
|
|
25
|
+
state: NonEmptyString = None
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict
|
|
7
|
+
from pydantic.alias_generators import to_camel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AgentsModel(BaseModel):
|
|
11
|
+
model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True)
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
@model_serializer
|
|
15
|
+
def _serialize(self):
|
|
16
|
+
omit_if_empty = {
|
|
17
|
+
k
|
|
18
|
+
for k, v in self
|
|
19
|
+
if isinstance(v, list) and not v
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return {k: v for k, v in self if k not in omit_if_empty and v is not None}
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def pick_properties(cls, original: AgentsModel, fields_to_copy=None, **kwargs):
|
|
27
|
+
"""Picks properties from the original model and returns a new instance (of a possibly different AgentsModel) with those properties.
|
|
28
|
+
|
|
29
|
+
This method preserves unset values.
|
|
30
|
+
|
|
31
|
+
args:
|
|
32
|
+
original: The original model instance to copy properties from. If None, returns None.
|
|
33
|
+
fields_to_copy: The specific fields to copy. If None, all fields are copied.
|
|
34
|
+
**kwargs: Additional fields to include in the new instance.
|
|
35
|
+
"""
|
|
36
|
+
if not original:
|
|
37
|
+
return None
|
|
38
|
+
|
|
39
|
+
if fields_to_copy is None:
|
|
40
|
+
fields_to_copy = original.model_fields_set
|
|
41
|
+
else:
|
|
42
|
+
fields_to_copy = original.model_fields_set & set(fields_to_copy)
|
|
43
|
+
|
|
44
|
+
dest = {}
|
|
45
|
+
for field in fields_to_copy:
|
|
46
|
+
dest[field] = getattr(original, field)
|
|
47
|
+
|
|
48
|
+
dest.update(kwargs)
|
|
49
|
+
return cls.model_validate(dest)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .thumbnail_url import ThumbnailUrl
|
|
5
|
+
from .media_url import MediaUrl
|
|
6
|
+
from .card_action import CardAction
|
|
7
|
+
from .agents_model import AgentsModel
|
|
8
|
+
from ._type_aliases import NonEmptyString
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AnimationCard(AgentsModel):
|
|
12
|
+
"""An animation card (Ex: gif or short video clip).
|
|
13
|
+
|
|
14
|
+
:param title: Title of this card
|
|
15
|
+
:type title: str
|
|
16
|
+
:param subtitle: Subtitle of this card
|
|
17
|
+
:type subtitle: str
|
|
18
|
+
:param text: Text of this card
|
|
19
|
+
:type text: str
|
|
20
|
+
:param image: Thumbnail placeholder
|
|
21
|
+
:type image: ~microsoft_agents.activity.ThumbnailUrl
|
|
22
|
+
:param media: Media URLs for this card. When this field contains more than
|
|
23
|
+
one URL, each URL is an alternative format of the same content.
|
|
24
|
+
:type media: list[~microsoft_agents.activity.MediaUrl]
|
|
25
|
+
:param buttons: Actions on this card
|
|
26
|
+
:type buttons: list[~microsoft_agents.activity.CardAction]
|
|
27
|
+
:param shareable: This content may be shared with others (default:true)
|
|
28
|
+
:type shareable: bool
|
|
29
|
+
:param autoloop: Should the client loop playback at end of content
|
|
30
|
+
(default:true)
|
|
31
|
+
:type autoloop: bool
|
|
32
|
+
:param autostart: Should the client automatically start playback of media
|
|
33
|
+
in this card (default:true)
|
|
34
|
+
:type autostart: bool
|
|
35
|
+
:param aspect: Aspect ratio of thumbnail/media placeholder. Allowed values
|
|
36
|
+
are "16:9" and "4:3"
|
|
37
|
+
:type aspect: str
|
|
38
|
+
:param duration: Describes the length of the media content without
|
|
39
|
+
requiring a receiver to open the content. Formatted as an ISO 8601
|
|
40
|
+
Duration field.
|
|
41
|
+
:type duration: str
|
|
42
|
+
:param value: Supplementary parameter for this card
|
|
43
|
+
:type value: object
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
title: NonEmptyString = None
|
|
47
|
+
subtitle: NonEmptyString = None
|
|
48
|
+
text: str = None
|
|
49
|
+
image: ThumbnailUrl = None
|
|
50
|
+
media: list[MediaUrl] = None
|
|
51
|
+
buttons: list[CardAction] = None
|
|
52
|
+
shareable: bool = None
|
|
53
|
+
autoloop: bool = None
|
|
54
|
+
autostart: bool = None
|
|
55
|
+
aspect: NonEmptyString = None
|
|
56
|
+
duration: NonEmptyString = None
|
|
57
|
+
value: object = None
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .agents_model import AgentsModel
|
|
5
|
+
from ._type_aliases import NonEmptyString
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Attachment(AgentsModel):
|
|
9
|
+
"""An attachment within an activity.
|
|
10
|
+
|
|
11
|
+
:param content_type: mimetype/Contenttype for the file
|
|
12
|
+
:type content_type: str
|
|
13
|
+
:param content_url: Content Url
|
|
14
|
+
:type content_url: str
|
|
15
|
+
:param content: Embedded content
|
|
16
|
+
:type content: object
|
|
17
|
+
:param name: (OPTIONAL) The name of the attachment
|
|
18
|
+
:type name: str
|
|
19
|
+
:param thumbnail_url: (OPTIONAL) Thumbnail associated with attachment
|
|
20
|
+
:type thumbnail_url: str
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
content_type: NonEmptyString
|
|
24
|
+
content_url: NonEmptyString = None
|
|
25
|
+
content: object = None
|
|
26
|
+
name: NonEmptyString = None
|
|
27
|
+
thumbnail_url: NonEmptyString = None
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .agents_model import AgentsModel
|
|
5
|
+
from ._type_aliases import NonEmptyString
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AttachmentData(AgentsModel):
|
|
9
|
+
"""Attachment data.
|
|
10
|
+
|
|
11
|
+
:param type: Content-Type of the attachment
|
|
12
|
+
:type type: str
|
|
13
|
+
:param name: Name of the attachment
|
|
14
|
+
:type name: str
|
|
15
|
+
:param original_base64: Attachment content
|
|
16
|
+
:type original_base64: bytes
|
|
17
|
+
:param thumbnail_base64: Attachment thumbnail
|
|
18
|
+
:type thumbnail_base64: bytes
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
type: NonEmptyString = None
|
|
22
|
+
name: NonEmptyString = None
|
|
23
|
+
original_base64: bytes = None
|
|
24
|
+
thumbnail_base64: bytes = None
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .attachment_view import AttachmentView
|
|
5
|
+
from .agents_model import AgentsModel
|
|
6
|
+
from ._type_aliases import NonEmptyString
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AttachmentInfo(AgentsModel):
|
|
10
|
+
"""Metadata for an attachment.
|
|
11
|
+
|
|
12
|
+
:param name: Name of the attachment
|
|
13
|
+
:type name: str
|
|
14
|
+
:param type: ContentType of the attachment
|
|
15
|
+
:type type: str
|
|
16
|
+
:param views: attachment views
|
|
17
|
+
:type views: list[~microsoft_agents.activity.AttachmentView]
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
name: NonEmptyString = None
|
|
21
|
+
type: NonEmptyString = None
|
|
22
|
+
views: list[AttachmentView] = None
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .agents_model import AgentsModel
|
|
5
|
+
from ._type_aliases import NonEmptyString
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AttachmentView(AgentsModel):
|
|
9
|
+
"""Attachment View name and size.
|
|
10
|
+
|
|
11
|
+
:param view_id: Id of the attachment
|
|
12
|
+
:type view_id: str
|
|
13
|
+
:param size: Size of the attachment
|
|
14
|
+
:type size: int
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
view_id: NonEmptyString = None
|
|
18
|
+
size: int = None
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .agents_model import AgentsModel
|
|
5
|
+
from .thumbnail_url import ThumbnailUrl
|
|
6
|
+
from .media_url import MediaUrl
|
|
7
|
+
from .card_action import CardAction
|
|
8
|
+
from ._type_aliases import NonEmptyString
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AudioCard(AgentsModel):
|
|
12
|
+
"""Audio card.
|
|
13
|
+
|
|
14
|
+
:param title: Title of this card
|
|
15
|
+
:type title: str
|
|
16
|
+
:param subtitle: Subtitle of this card
|
|
17
|
+
:type subtitle: str
|
|
18
|
+
:param text: Text of this card
|
|
19
|
+
:type text: str
|
|
20
|
+
:param image: Thumbnail placeholder
|
|
21
|
+
:type image: ~microsoft_agents.activity.ThumbnailUrl
|
|
22
|
+
:param media: Media URLs for this card. When this field contains more than
|
|
23
|
+
one URL, each URL is an alternative format of the same content.
|
|
24
|
+
:type media: list[~microsoft_agents.activity.MediaUrl]
|
|
25
|
+
:param buttons: Actions on this card
|
|
26
|
+
:type buttons: list[~microsoft_agents.activity.CardAction]
|
|
27
|
+
:param shareable: This content may be shared with others (default:true)
|
|
28
|
+
:type shareable: bool
|
|
29
|
+
:param autoloop: Should the client loop playback at end of content
|
|
30
|
+
(default:true)
|
|
31
|
+
:type autoloop: bool
|
|
32
|
+
:param autostart: Should the client automatically start playback of media
|
|
33
|
+
in this card (default:true)
|
|
34
|
+
:type autostart: bool
|
|
35
|
+
:param aspect: Aspect ratio of thumbnail/media placeholder. Allowed values
|
|
36
|
+
are "16:9" and "4:3"
|
|
37
|
+
:type aspect: str
|
|
38
|
+
:param duration: Describes the length of the media content without
|
|
39
|
+
requiring a receiver to open the content. Formatted as an ISO 8601
|
|
40
|
+
Duration field.
|
|
41
|
+
:type duration: str
|
|
42
|
+
:param value: Supplementary parameter for this card
|
|
43
|
+
:type value: object
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
title: NonEmptyString = None
|
|
47
|
+
subtitle: NonEmptyString = None
|
|
48
|
+
text: str = None
|
|
49
|
+
image: ThumbnailUrl = None
|
|
50
|
+
media: list[MediaUrl] = None
|
|
51
|
+
buttons: list[CardAction] = None
|
|
52
|
+
shareable: bool = None
|
|
53
|
+
autoloop: bool = None
|
|
54
|
+
autostart: bool = None
|
|
55
|
+
aspect: NonEmptyString = None
|
|
56
|
+
duration: NonEmptyString = None
|
|
57
|
+
value: object = None
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .agents_model import AgentsModel
|
|
5
|
+
from .card_image import CardImage
|
|
6
|
+
from .card_action import CardAction
|
|
7
|
+
from ._type_aliases import NonEmptyString
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BasicCard(AgentsModel):
|
|
11
|
+
"""A basic card.
|
|
12
|
+
|
|
13
|
+
:param title: Title of the card
|
|
14
|
+
:type title: str
|
|
15
|
+
:param subtitle: Subtitle of the card
|
|
16
|
+
:type subtitle: str
|
|
17
|
+
:param text: Text for the card
|
|
18
|
+
:type text: str
|
|
19
|
+
:param images: Array of images for the card
|
|
20
|
+
:type images: list[~microsoft_agents.activity.CardImage]
|
|
21
|
+
:param buttons: Set of actions applicable to the current card
|
|
22
|
+
:type buttons: list[~microsoft_agents.activity.CardAction]
|
|
23
|
+
:param tap: This action will be activated when user taps on the card
|
|
24
|
+
itself
|
|
25
|
+
:type tap: ~microsoft_agents.activity.CardAction
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
title: NonEmptyString = None
|
|
29
|
+
subtitle: NonEmptyString = None
|
|
30
|
+
text: str = None
|
|
31
|
+
images: list[CardImage] = None
|
|
32
|
+
buttons: list[CardAction] = None
|
|
33
|
+
tap: CardAction = None
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class CallerIdConstants(str, Enum):
|
|
8
|
+
public_azure_channel = "urn:botframework:azure"
|
|
9
|
+
us_gov_channel = "urn:botframework:azureusgov"
|
|
10
|
+
agent_to_agent_prefix = "urn:botframework:aadappid:"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Optional
|
|
5
|
+
from .agents_model import AgentsModel
|
|
6
|
+
from ._type_aliases import NonEmptyString
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class CardAction(AgentsModel):
|
|
10
|
+
"""A clickable action.
|
|
11
|
+
|
|
12
|
+
:param type: The type of action implemented by this button. Possible
|
|
13
|
+
values include: 'openUrl', 'imBack', 'postBack', 'playAudio', 'playVideo',
|
|
14
|
+
'showImage', 'downloadFile', 'signin', 'call', 'messageBack'
|
|
15
|
+
:type type: str or ~microsoft_agents.activity.ActionTypes
|
|
16
|
+
:param title: Text description which appears on the button
|
|
17
|
+
:type title: str
|
|
18
|
+
:param image: Image URL which will appear on the button, next to text
|
|
19
|
+
label
|
|
20
|
+
:type image: str
|
|
21
|
+
:param text: Text for this action
|
|
22
|
+
:type text: str
|
|
23
|
+
:param display_text: (Optional) text to display in the chat feed if the
|
|
24
|
+
button is clicked
|
|
25
|
+
:type display_text: str
|
|
26
|
+
:param value: Supplementary parameter for action. Content of this property
|
|
27
|
+
depends on the ActionType
|
|
28
|
+
:type value: object
|
|
29
|
+
:param channel_data: Channel-specific data associated with this action
|
|
30
|
+
:type channel_data: object
|
|
31
|
+
:param image_alt_text: Alternate image text to be used in place of the `image` field
|
|
32
|
+
:type image_alt_text: str
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
type: NonEmptyString
|
|
36
|
+
title: NonEmptyString
|
|
37
|
+
image: str = None
|
|
38
|
+
text: str = None
|
|
39
|
+
display_text: str = None
|
|
40
|
+
value: object = None
|
|
41
|
+
channel_data: Optional[object] = None
|
|
42
|
+
image_alt_text: str = None
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .card_action import CardAction
|
|
5
|
+
from .agents_model import AgentsModel
|
|
6
|
+
from ._type_aliases import NonEmptyString
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class CardImage(AgentsModel):
|
|
10
|
+
"""An image on a card.
|
|
11
|
+
|
|
12
|
+
:param url: URL thumbnail image for major content property
|
|
13
|
+
:type url: str
|
|
14
|
+
:param alt: Image description intended for screen readers
|
|
15
|
+
:type alt: str
|
|
16
|
+
:param tap: Action assigned to specific Attachment
|
|
17
|
+
:type tap: ~microsoft_agents.activity.CardAction
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
url: NonEmptyString = None
|
|
21
|
+
alt: NonEmptyString = None
|
|
22
|
+
tap: CardAction = None
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Any, Optional
|
|
5
|
+
|
|
6
|
+
from pydantic import ConfigDict
|
|
7
|
+
from .agents_model import AgentsModel
|
|
8
|
+
from ._type_aliases import NonEmptyString
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ChannelAccount(AgentsModel):
|
|
12
|
+
"""Channel account information needed to route a message.
|
|
13
|
+
|
|
14
|
+
:param id: Channel id for the user or agent on this channel (Example:
|
|
15
|
+
``joe@smith.com``, or ``@joesmith`` or ``123456``)
|
|
16
|
+
:type id: str
|
|
17
|
+
:param name: Display friendly name
|
|
18
|
+
:type name: str
|
|
19
|
+
:param aad_object_id: This account's object ID within Azure Active
|
|
20
|
+
Directory (AAD)
|
|
21
|
+
:type aad_object_id: str
|
|
22
|
+
:param role: Role of the entity behind the account
|
|
23
|
+
:type role: str or ~microsoft_agents.activity.RoleTypes
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
model_config = ConfigDict(extra="allow")
|
|
27
|
+
|
|
28
|
+
id: NonEmptyString = None
|
|
29
|
+
name: str = None
|
|
30
|
+
aad_object_id: Optional[NonEmptyString] = None
|
|
31
|
+
role: Optional[NonEmptyString] = None
|
|
32
|
+
agentic_user_id: Optional[NonEmptyString] = None
|
|
33
|
+
agentic_app_id: Optional[NonEmptyString] = None
|
|
34
|
+
tenant_id: Optional[NonEmptyString] = None
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def properties(self) -> dict[str, Any]:
|
|
38
|
+
"""Returns the set of properties that are not None."""
|
|
39
|
+
return self.model_extra
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from abc import abstractmethod
|
|
5
|
+
from typing import Protocol, List, Callable, Awaitable, Optional
|
|
6
|
+
|
|
7
|
+
from .turn_context_protocol import TurnContextProtocol
|
|
8
|
+
from microsoft_agents.activity import (
|
|
9
|
+
Activity,
|
|
10
|
+
ResourceResponse,
|
|
11
|
+
ConversationReference,
|
|
12
|
+
ConversationParameters,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ChannelAdapterProtocol(Protocol):
|
|
17
|
+
on_turn_error: Optional[Callable[[TurnContextProtocol, Exception], Awaitable]]
|
|
18
|
+
|
|
19
|
+
@abstractmethod
|
|
20
|
+
async def send_activities(
|
|
21
|
+
self, context: TurnContextProtocol, activities: List[Activity]
|
|
22
|
+
) -> List[ResourceResponse]:
|
|
23
|
+
pass
|
|
24
|
+
|
|
25
|
+
@abstractmethod
|
|
26
|
+
async def update_activity(
|
|
27
|
+
self, context: TurnContextProtocol, activity: Activity
|
|
28
|
+
) -> None:
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
@abstractmethod
|
|
32
|
+
async def delete_activity(
|
|
33
|
+
self, context: TurnContextProtocol, reference: ConversationReference
|
|
34
|
+
) -> None:
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
@abstractmethod
|
|
38
|
+
def use(self, middleware: object) -> "ChannelAdapterProtocol":
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
@abstractmethod
|
|
42
|
+
async def continue_conversation(
|
|
43
|
+
self,
|
|
44
|
+
agent_id: str,
|
|
45
|
+
reference: ConversationReference,
|
|
46
|
+
callback: Callable[[TurnContextProtocol], Awaitable],
|
|
47
|
+
) -> None:
|
|
48
|
+
pass
|
|
49
|
+
|
|
50
|
+
# TODO: potentially move ClaimsIdentity to activity
|
|
51
|
+
@abstractmethod
|
|
52
|
+
async def continue_conversation_with_claims(
|
|
53
|
+
self,
|
|
54
|
+
claims_identity: dict,
|
|
55
|
+
continuation_activity: Activity,
|
|
56
|
+
callback: Callable[[TurnContextProtocol], Awaitable],
|
|
57
|
+
audience: str = None,
|
|
58
|
+
):
|
|
59
|
+
pass
|
|
60
|
+
|
|
61
|
+
@abstractmethod
|
|
62
|
+
async def create_conversation(
|
|
63
|
+
self,
|
|
64
|
+
agent_app_id: str,
|
|
65
|
+
channel_id: str,
|
|
66
|
+
service_url: str,
|
|
67
|
+
audience: str,
|
|
68
|
+
conversation_parameters: ConversationParameters,
|
|
69
|
+
callback: Callable[[TurnContextProtocol], Awaitable],
|
|
70
|
+
) -> None:
|
|
71
|
+
pass
|
|
72
|
+
|
|
73
|
+
@abstractmethod
|
|
74
|
+
async def run_pipeline(
|
|
75
|
+
self,
|
|
76
|
+
context: TurnContextProtocol,
|
|
77
|
+
callback: Callable[[TurnContextProtocol], Awaitable],
|
|
78
|
+
) -> None:
|
|
79
|
+
pass
|