microsoft-agents-activity 0.4.0.dev16__py3-none-any.whl → 0.5.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.
- microsoft_agents/activity/__init__.py +12 -0
- microsoft_agents/activity/_channel_id_field_mixin.py +96 -0
- microsoft_agents/activity/_load_configuration.py +3 -0
- microsoft_agents/activity/_model_utils.py +3 -0
- microsoft_agents/activity/_type_aliases.py +3 -1
- microsoft_agents/activity/action_types.py +3 -0
- microsoft_agents/activity/activity.py +132 -11
- microsoft_agents/activity/activity_event_names.py +3 -0
- microsoft_agents/activity/activity_importance.py +3 -0
- microsoft_agents/activity/activity_types.py +3 -0
- microsoft_agents/activity/adaptive_card_invoke_action.py +3 -0
- microsoft_agents/activity/adaptive_card_invoke_response.py +3 -0
- microsoft_agents/activity/adaptive_card_invoke_value.py +3 -0
- microsoft_agents/activity/agents_model.py +3 -0
- microsoft_agents/activity/animation_card.py +3 -0
- microsoft_agents/activity/attachment.py +3 -0
- microsoft_agents/activity/attachment_data.py +3 -0
- microsoft_agents/activity/attachment_info.py +3 -0
- microsoft_agents/activity/attachment_layout_types.py +3 -0
- microsoft_agents/activity/attachment_view.py +3 -0
- microsoft_agents/activity/audio_card.py +3 -0
- microsoft_agents/activity/basic_card.py +3 -0
- microsoft_agents/activity/caller_id_constants.py +3 -0
- microsoft_agents/activity/card_action.py +3 -0
- microsoft_agents/activity/card_image.py +3 -0
- microsoft_agents/activity/channel_account.py +3 -0
- microsoft_agents/activity/channel_adapter_protocol.py +3 -0
- microsoft_agents/activity/channel_id.py +95 -0
- microsoft_agents/activity/channels.py +2 -2
- microsoft_agents/activity/contact_relation_update_action_types.py +3 -0
- microsoft_agents/activity/conversation_account.py +3 -0
- microsoft_agents/activity/conversation_members.py +3 -0
- microsoft_agents/activity/conversation_parameters.py +3 -0
- microsoft_agents/activity/conversation_reference.py +12 -3
- microsoft_agents/activity/conversation_resource_response.py +3 -0
- microsoft_agents/activity/conversation_update_types.py +3 -0
- microsoft_agents/activity/conversations_result.py +3 -0
- microsoft_agents/activity/delivery_modes.py +3 -0
- microsoft_agents/activity/end_of_conversation_codes.py +3 -0
- microsoft_agents/activity/entity/__init__.py +7 -0
- microsoft_agents/activity/entity/entity.py +4 -3
- microsoft_agents/activity/entity/entity_types.py +14 -0
- microsoft_agents/activity/entity/geo_coordinates.py +9 -3
- microsoft_agents/activity/entity/mention.py +5 -2
- microsoft_agents/activity/entity/place.py +9 -3
- microsoft_agents/activity/entity/product_info.py +20 -0
- microsoft_agents/activity/entity/thing.py +9 -3
- microsoft_agents/activity/error.py +3 -0
- microsoft_agents/activity/error_response.py +3 -0
- microsoft_agents/activity/expected_replies.py +3 -0
- microsoft_agents/activity/fact.py +3 -0
- microsoft_agents/activity/hero_card.py +3 -0
- microsoft_agents/activity/inner_http_error.py +3 -0
- microsoft_agents/activity/installation_update_action_types.py +3 -0
- microsoft_agents/activity/invoke_response.py +3 -0
- microsoft_agents/activity/media_card.py +3 -0
- microsoft_agents/activity/media_event_value.py +3 -0
- microsoft_agents/activity/media_url.py +3 -0
- microsoft_agents/activity/message_reaction.py +3 -0
- microsoft_agents/activity/message_reaction_types.py +3 -0
- microsoft_agents/activity/message_update_types.py +3 -0
- microsoft_agents/activity/oauth_card.py +3 -0
- microsoft_agents/activity/paged_members_result.py +3 -0
- microsoft_agents/activity/receipt_card.py +3 -0
- microsoft_agents/activity/receipt_item.py +3 -0
- microsoft_agents/activity/resource_response.py +3 -0
- microsoft_agents/activity/role_types.py +3 -0
- microsoft_agents/activity/semantic_action.py +4 -1
- microsoft_agents/activity/semantic_actions_states.py +3 -0
- microsoft_agents/activity/sign_in_resource.py +3 -0
- microsoft_agents/activity/signin_card.py +3 -0
- microsoft_agents/activity/suggested_actions.py +3 -0
- microsoft_agents/activity/text_format_types.py +3 -0
- microsoft_agents/activity/text_highlight.py +3 -0
- microsoft_agents/activity/thumbnail_card.py +3 -0
- microsoft_agents/activity/thumbnail_url.py +3 -0
- microsoft_agents/activity/token_exchange_invoke_request.py +3 -0
- microsoft_agents/activity/token_exchange_invoke_response.py +3 -0
- microsoft_agents/activity/token_exchange_resource.py +3 -0
- microsoft_agents/activity/token_exchange_state.py +3 -0
- microsoft_agents/activity/token_or_sign_in_resource_response.py +21 -0
- microsoft_agents/activity/token_post_resource.py +3 -0
- microsoft_agents/activity/token_request.py +3 -0
- microsoft_agents/activity/transcript.py +3 -0
- microsoft_agents/activity/turn_context_protocol.py +3 -0
- microsoft_agents/activity/video_card.py +3 -0
- microsoft_agents_activity-0.5.0.dist-info/METADATA +173 -0
- {microsoft_agents_activity-0.4.0.dev16.dist-info → microsoft_agents_activity-0.5.0.dist-info}/RECORD +91 -85
- microsoft_agents_activity-0.5.0.dist-info/licenses/LICENSE +21 -0
- microsoft_agents_activity-0.4.0.dev16.dist-info/METADATA +0 -11
- {microsoft_agents_activity-0.4.0.dev16.dist-info → microsoft_agents_activity-0.5.0.dist-info}/WHEEL +0 -0
- {microsoft_agents_activity-0.4.0.dev16.dist-info → microsoft_agents_activity-0.5.0.dist-info}/top_level.txt +0 -0
|
@@ -74,7 +74,7 @@ class Channels(str, Enum):
|
|
|
74
74
|
|
|
75
75
|
Args:
|
|
76
76
|
channel_id (str): The Channel to check the if Suggested Actions are supported in.
|
|
77
|
-
button_cnt (int,
|
|
77
|
+
button_cnt (int, Optional): Defaults to 100. The number of Suggested Actions to check for the Channel.
|
|
78
78
|
|
|
79
79
|
Returns:
|
|
80
80
|
bool: True if the Channel supports the button_cnt total Suggested Actions, False if the Channel does not
|
|
@@ -107,7 +107,7 @@ class Channels(str, Enum):
|
|
|
107
107
|
|
|
108
108
|
Args:
|
|
109
109
|
channel_id (str): The Channel to check if the Card Actions are supported in.
|
|
110
|
-
button_cnt (int,
|
|
110
|
+
button_cnt (int, Optional): Defaults to 100. The number of Card Actions to check for the Channel.
|
|
111
111
|
|
|
112
112
|
Returns:
|
|
113
113
|
bool: True if the Channel supports the button_cnt total Card Actions, False if the Channel does not support
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
1
6
|
from uuid import uuid4 as uuid
|
|
2
7
|
from typing import Optional
|
|
8
|
+
import logging
|
|
3
9
|
|
|
4
10
|
from pydantic import Field
|
|
5
11
|
|
|
6
12
|
from .channel_account import ChannelAccount
|
|
13
|
+
from ._channel_id_field_mixin import _ChannelIdFieldMixin
|
|
14
|
+
from .channel_id import ChannelId
|
|
7
15
|
from .conversation_account import ConversationAccount
|
|
8
16
|
from .agents_model import AgentsModel
|
|
9
17
|
from ._type_aliases import NonEmptyString
|
|
10
18
|
from .activity_types import ActivityTypes
|
|
11
19
|
from .activity_event_names import ActivityEventNames
|
|
12
20
|
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
22
|
+
|
|
13
23
|
|
|
14
|
-
class ConversationReference(AgentsModel):
|
|
24
|
+
class ConversationReference(AgentsModel, _ChannelIdFieldMixin):
|
|
15
25
|
"""An object relating to a particular point in a conversation.
|
|
16
26
|
|
|
17
27
|
:param activity_id: (Optional) ID of the activity to refer to
|
|
@@ -23,7 +33,7 @@ class ConversationReference(AgentsModel):
|
|
|
23
33
|
:param conversation: Conversation reference
|
|
24
34
|
:type conversation: ~microsoft_agents.activity.ConversationAccount
|
|
25
35
|
:param channel_id: Channel ID
|
|
26
|
-
:type channel_id:
|
|
36
|
+
:type channel_id: ~microsoft_agents.activity.ChannelId
|
|
27
37
|
:param locale: A locale name for the contents of the text field.
|
|
28
38
|
The locale name is a combination of an ISO 639 two- or three-letter
|
|
29
39
|
culture code associated with a language and an ISO 3166 two-letter
|
|
@@ -40,7 +50,6 @@ class ConversationReference(AgentsModel):
|
|
|
40
50
|
user: Optional[ChannelAccount] = None
|
|
41
51
|
agent: ChannelAccount = Field(None, alias="bot")
|
|
42
52
|
conversation: ConversationAccount
|
|
43
|
-
channel_id: NonEmptyString
|
|
44
53
|
locale: Optional[NonEmptyString] = None
|
|
45
54
|
service_url: NonEmptyString = None
|
|
46
55
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
1
4
|
from .mention import Mention
|
|
2
5
|
from .entity import Entity
|
|
6
|
+
from .entity_types import EntityTypes
|
|
3
7
|
from .ai_entity import (
|
|
4
8
|
ClientCitation,
|
|
5
9
|
ClientCitationAppearance,
|
|
@@ -11,10 +15,12 @@ from .ai_entity import (
|
|
|
11
15
|
)
|
|
12
16
|
from .geo_coordinates import GeoCoordinates
|
|
13
17
|
from .place import Place
|
|
18
|
+
from .product_info import ProductInfo
|
|
14
19
|
from .thing import Thing
|
|
15
20
|
|
|
16
21
|
__all__ = [
|
|
17
22
|
"Entity",
|
|
23
|
+
"EntityTypes",
|
|
18
24
|
"AIEntity",
|
|
19
25
|
"ClientCitation",
|
|
20
26
|
"ClientCitationAppearance",
|
|
@@ -25,5 +31,6 @@ __all__ = [
|
|
|
25
31
|
"SensitivityPattern",
|
|
26
32
|
"GeoCoordinates",
|
|
27
33
|
"Place",
|
|
34
|
+
"ProductInfo",
|
|
28
35
|
"Thing",
|
|
29
36
|
]
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Any
|
|
3
5
|
|
|
4
6
|
from pydantic import model_serializer, model_validator
|
|
5
7
|
from pydantic.alias_generators import to_camel, to_snake
|
|
6
8
|
|
|
7
9
|
from ..agents_model import AgentsModel, ConfigDict
|
|
8
|
-
from .._type_aliases import NonEmptyString
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class Entity(AgentsModel):
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from enum import Enum
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class EntityTypes(str, Enum):
|
|
8
|
+
"""Well-known enumeration of entity types."""
|
|
9
|
+
|
|
10
|
+
GEO_COORDINATES = "GeoCoordinates"
|
|
11
|
+
MENTION = "mention"
|
|
12
|
+
PLACE = "Place"
|
|
13
|
+
THING = "Thing"
|
|
14
|
+
PRODUCT_INFO = "ProductInfo"
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Literal
|
|
5
|
+
|
|
2
6
|
from .._type_aliases import NonEmptyString
|
|
7
|
+
from .entity import Entity
|
|
8
|
+
from .entity_types import EntityTypes
|
|
3
9
|
|
|
4
10
|
|
|
5
|
-
class GeoCoordinates(
|
|
11
|
+
class GeoCoordinates(Entity):
|
|
6
12
|
"""GeoCoordinates (entity type: "https://schema.org/GeoCoordinates").
|
|
7
13
|
|
|
8
14
|
:param elevation: Elevation of the location [WGS
|
|
@@ -23,5 +29,5 @@ class GeoCoordinates(AgentsModel):
|
|
|
23
29
|
elevation: float = None
|
|
24
30
|
latitude: float = None
|
|
25
31
|
longitude: float = None
|
|
26
|
-
type:
|
|
32
|
+
type: Literal[EntityTypes.GEO_COORDINATES] = EntityTypes.GEO_COORDINATES
|
|
27
33
|
name: NonEmptyString = None
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
1
4
|
from typing import Literal
|
|
2
5
|
|
|
3
6
|
from ..channel_account import ChannelAccount
|
|
4
7
|
from .entity import Entity
|
|
5
|
-
from
|
|
8
|
+
from .entity_types import EntityTypes
|
|
6
9
|
|
|
7
10
|
|
|
8
11
|
class Mention(Entity):
|
|
@@ -18,4 +21,4 @@ class Mention(Entity):
|
|
|
18
21
|
|
|
19
22
|
mentioned: ChannelAccount = None
|
|
20
23
|
text: str = None
|
|
21
|
-
type: Literal[
|
|
24
|
+
type: Literal[EntityTypes.MENTION] = EntityTypes.MENTION
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Literal
|
|
5
|
+
|
|
2
6
|
from .._type_aliases import NonEmptyString
|
|
7
|
+
from .entity import Entity
|
|
8
|
+
from .entity_types import EntityTypes
|
|
3
9
|
|
|
4
10
|
|
|
5
|
-
class Place(
|
|
11
|
+
class Place(Entity):
|
|
6
12
|
"""Place (entity type: "https://schema.org/Place").
|
|
7
13
|
|
|
8
14
|
:param address: Address of the place (may be `string` or complex object of
|
|
@@ -23,5 +29,5 @@ class Place(AgentsModel):
|
|
|
23
29
|
address: object = None
|
|
24
30
|
geo: object = None
|
|
25
31
|
has_map: object = None
|
|
26
|
-
type:
|
|
32
|
+
type: Literal[EntityTypes.PLACE] = EntityTypes.PLACE
|
|
27
33
|
name: NonEmptyString = None
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Literal
|
|
5
|
+
|
|
6
|
+
from .entity import Entity
|
|
7
|
+
from .entity_types import EntityTypes
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ProductInfo(Entity):
|
|
11
|
+
"""Product information (entity type: "productInfo").
|
|
12
|
+
|
|
13
|
+
:param type: The type of the entity, always "productInfo".
|
|
14
|
+
:type type: str
|
|
15
|
+
:param id: The unique identifier for the product.
|
|
16
|
+
:type id: str
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
type: Literal[EntityTypes.PRODUCT_INFO] = EntityTypes.PRODUCT_INFO
|
|
20
|
+
id: str = None
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from typing import Literal
|
|
5
|
+
|
|
2
6
|
from .._type_aliases import NonEmptyString
|
|
7
|
+
from .entity import Entity
|
|
8
|
+
from .entity_types import EntityTypes
|
|
3
9
|
|
|
4
10
|
|
|
5
|
-
class Thing(
|
|
11
|
+
class Thing(Entity):
|
|
6
12
|
"""Thing (entity type: "https://schema.org/Thing").
|
|
7
13
|
|
|
8
14
|
:param type: The type of the thing
|
|
@@ -11,5 +17,5 @@ class Thing(AgentsModel):
|
|
|
11
17
|
:type name: str
|
|
12
18
|
"""
|
|
13
19
|
|
|
14
|
-
type:
|
|
20
|
+
type: Literal[EntityTypes.THING] = EntityTypes.THING
|
|
15
21
|
name: NonEmptyString = None
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
1
4
|
from .agents_model import AgentsModel
|
|
2
5
|
from ._type_aliases import NonEmptyString
|
|
3
6
|
|
|
@@ -10,7 +13,7 @@ class SemanticAction(AgentsModel):
|
|
|
10
13
|
:param entities: Entities associated with this action
|
|
11
14
|
:type entities: dict[str, :class:`microsoft_agents.activity.entity.Entity`]
|
|
12
15
|
:param state: State of this action. Allowed values: `start`, `continue`, `done`
|
|
13
|
-
:type state: str or :class:`microsoft_agents.activity.
|
|
16
|
+
:type state: str or :class:`microsoft_agents.activity.semantic_actions_states.SemanticActionsStates`
|
|
14
17
|
"""
|
|
15
18
|
|
|
16
19
|
id: NonEmptyString
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
from .agents_model import AgentsModel
|
|
5
|
+
from .token_response import TokenResponse
|
|
6
|
+
from .sign_in_resource import SignInResource
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class TokenOrSignInResourceResponse(AgentsModel):
|
|
10
|
+
"""Represents the response containing either a token or a sign-in resource.
|
|
11
|
+
|
|
12
|
+
One of the two properties should be set (if returned from the 'getTokenOrSignInResource' endpoint), not both.
|
|
13
|
+
|
|
14
|
+
:param token_response: The token response.
|
|
15
|
+
:type token_response: TokenResponse
|
|
16
|
+
:param sign_in_resource: The sign-in resource.
|
|
17
|
+
:type sign_in_resource: SignInResource
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
token_response: TokenResponse = None
|
|
21
|
+
sign_in_resource: SignInResource = None
|