microsoft-agents-activity 0.4.0.dev1__py3-none-any.whl → 0.4.0.dev4__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 +6 -9
- microsoft_agents/activity/_model_utils.py +61 -0
- microsoft_agents/activity/activity.py +80 -43
- microsoft_agents/activity/agents_model.py +28 -0
- microsoft_agents/activity/animation_card.py +1 -1
- microsoft_agents/activity/audio_card.py +1 -1
- microsoft_agents/activity/basic_card.py +1 -1
- microsoft_agents/activity/entity/__init__.py +29 -0
- microsoft_agents/activity/{ai_entity.py → entity/ai_entity.py} +1 -32
- microsoft_agents/activity/{entity.py → entity/entity.py} +5 -3
- microsoft_agents/activity/{geo_coordinates.py → entity/geo_coordinates.py} +2 -2
- microsoft_agents/activity/{mention.py → entity/mention.py} +6 -4
- microsoft_agents/activity/{place.py → entity/place.py} +2 -2
- microsoft_agents/activity/{thing.py → entity/thing.py} +2 -2
- microsoft_agents/activity/hero_card.py +1 -1
- microsoft_agents/activity/media_card.py +1 -1
- microsoft_agents/activity/oauth_card.py +1 -1
- microsoft_agents/activity/receipt_item.py +1 -1
- microsoft_agents/activity/signin_card.py +1 -1
- microsoft_agents/activity/text_highlight.py +1 -1
- microsoft_agents/activity/thumbnail_card.py +1 -1
- microsoft_agents/activity/video_card.py +1 -1
- {microsoft_agents_activity-0.4.0.dev1.dist-info → microsoft_agents_activity-0.4.0.dev4.dist-info}/METADATA +1 -1
- {microsoft_agents_activity-0.4.0.dev1.dist-info → microsoft_agents_activity-0.4.0.dev4.dist-info}/RECORD +26 -24
- {microsoft_agents_activity-0.4.0.dev1.dist-info → microsoft_agents_activity-0.4.0.dev4.dist-info}/WHEEL +0 -0
- {microsoft_agents_activity-0.4.0.dev1.dist-info → microsoft_agents_activity-0.4.0.dev4.dist-info}/top_level.txt +0 -0
|
@@ -24,32 +24,32 @@ from .conversation_reference import ConversationReference
|
|
|
24
24
|
from .conversation_resource_response import ConversationResourceResponse
|
|
25
25
|
from .conversations_result import ConversationsResult
|
|
26
26
|
from .expected_replies import ExpectedReplies
|
|
27
|
-
from .entity import
|
|
28
|
-
|
|
27
|
+
from .entity import (
|
|
28
|
+
Entity,
|
|
29
29
|
AIEntity,
|
|
30
30
|
ClientCitation,
|
|
31
31
|
ClientCitationAppearance,
|
|
32
32
|
ClientCitationImage,
|
|
33
33
|
ClientCitationIconName,
|
|
34
|
+
Mention,
|
|
34
35
|
SensitivityUsageInfo,
|
|
35
36
|
SensitivityPattern,
|
|
36
|
-
|
|
37
|
+
GeoCoordinates,
|
|
38
|
+
Place,
|
|
39
|
+
Thing,
|
|
37
40
|
)
|
|
38
41
|
from .error import Error
|
|
39
42
|
from .error_response import ErrorResponse
|
|
40
43
|
from .fact import Fact
|
|
41
|
-
from .geo_coordinates import GeoCoordinates
|
|
42
44
|
from .hero_card import HeroCard
|
|
43
45
|
from .inner_http_error import InnerHttpError
|
|
44
46
|
from .invoke_response import InvokeResponse
|
|
45
47
|
from .media_card import MediaCard
|
|
46
48
|
from .media_event_value import MediaEventValue
|
|
47
49
|
from .media_url import MediaUrl
|
|
48
|
-
from .mention import Mention
|
|
49
50
|
from .message_reaction import MessageReaction
|
|
50
51
|
from .oauth_card import OAuthCard
|
|
51
52
|
from .paged_members_result import PagedMembersResult
|
|
52
|
-
from .place import Place
|
|
53
53
|
from .receipt_card import ReceiptCard
|
|
54
54
|
from .receipt_item import ReceiptItem
|
|
55
55
|
from .resource_response import ResourceResponse
|
|
@@ -57,7 +57,6 @@ from .semantic_action import SemanticAction
|
|
|
57
57
|
from .signin_card import SigninCard
|
|
58
58
|
from .suggested_actions import SuggestedActions
|
|
59
59
|
from .text_highlight import TextHighlight
|
|
60
|
-
from .thing import Thing
|
|
61
60
|
from .thumbnail_card import ThumbnailCard
|
|
62
61
|
from .thumbnail_url import ThumbnailUrl
|
|
63
62
|
from .token_exchange_invoke_request import TokenExchangeInvokeRequest
|
|
@@ -92,7 +91,6 @@ from .caller_id_constants import CallerIdConstants
|
|
|
92
91
|
from .conversation_update_types import ConversationUpdateTypes
|
|
93
92
|
from .message_update_types import MessageUpdateTypes
|
|
94
93
|
|
|
95
|
-
|
|
96
94
|
from .channel_adapter_protocol import ChannelAdapterProtocol
|
|
97
95
|
from .turn_context_protocol import TurnContextProtocol
|
|
98
96
|
from ._load_configuration import load_configuration_from_env
|
|
@@ -131,7 +129,6 @@ __all__ = [
|
|
|
131
129
|
"ClientCitationIconName",
|
|
132
130
|
"SensitivityUsageInfo",
|
|
133
131
|
"SensitivityPattern",
|
|
134
|
-
"add_ai_to_activity",
|
|
135
132
|
"Error",
|
|
136
133
|
"ErrorResponse",
|
|
137
134
|
"Fact",
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from abc import ABC
|
|
2
|
+
from typing import Any, Callable
|
|
3
|
+
|
|
4
|
+
from .agents_model import AgentsModel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ModelFieldHelper(ABC):
|
|
8
|
+
"""Base class for model field processing prior to initialization of an AgentsModel"""
|
|
9
|
+
|
|
10
|
+
def process(self, key: str) -> dict[str, Any]:
|
|
11
|
+
"""Takes the key in the destination object and returns a dictionary of new fields to add"""
|
|
12
|
+
raise NotImplementedError()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class SkipIf(ModelFieldHelper):
|
|
16
|
+
"""Skip if the value meets the given condition."""
|
|
17
|
+
|
|
18
|
+
def __init__(self, value, skip_condition: Callable[[Any], bool]):
|
|
19
|
+
self.value = value
|
|
20
|
+
self._skip_condition = skip_condition
|
|
21
|
+
|
|
22
|
+
def process(self, key: str) -> dict[str, Any]:
|
|
23
|
+
if self._skip_condition(self.value):
|
|
24
|
+
return {}
|
|
25
|
+
return {key: self.value}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class SkipNone(SkipIf):
|
|
29
|
+
"""Skip if the value is None."""
|
|
30
|
+
|
|
31
|
+
def __init__(self, value):
|
|
32
|
+
super().__init__(value, lambda v: v is None)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def pick_model_dict(**kwargs):
|
|
36
|
+
"""Processes a list of keyword arguments, using ModelFieldHelper subclasses to determine which fields to include in the final model.
|
|
37
|
+
|
|
38
|
+
This function is useful for dynamically constructing models based on varying input data.
|
|
39
|
+
|
|
40
|
+
Usage:
|
|
41
|
+
activity_dict = pick_model_dict(type="message", id="123", text=SkipNone(text_variable))
|
|
42
|
+
activity = Activity.model_validate(activity_dict)
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
model_dict = {}
|
|
46
|
+
for key, value in kwargs.items():
|
|
47
|
+
if not isinstance(value, ModelFieldHelper):
|
|
48
|
+
model_dict[key] = value
|
|
49
|
+
else:
|
|
50
|
+
model_dict.update(value.process(key))
|
|
51
|
+
|
|
52
|
+
return model_dict
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def pick_model(model_class: type[AgentsModel], **kwargs) -> AgentsModel:
|
|
56
|
+
"""Picks model fields from the given keyword arguments.
|
|
57
|
+
|
|
58
|
+
Usage:
|
|
59
|
+
activity = pick_model(Activity, type="message", id="123", text=SkipNone(text_variable))
|
|
60
|
+
"""
|
|
61
|
+
return model_class(**pick_model_dict(**kwargs))
|
|
@@ -5,16 +5,22 @@ from pydantic import Field, SerializeAsAny
|
|
|
5
5
|
from .activity_types import ActivityTypes
|
|
6
6
|
from .channel_account import ChannelAccount
|
|
7
7
|
from .conversation_account import ConversationAccount
|
|
8
|
-
from .mention import Mention
|
|
9
8
|
from .message_reaction import MessageReaction
|
|
10
9
|
from .resource_response import ResourceResponse
|
|
11
10
|
from .suggested_actions import SuggestedActions
|
|
12
11
|
from .attachment import Attachment
|
|
13
|
-
from .entity import
|
|
12
|
+
from .entity import (
|
|
13
|
+
Entity,
|
|
14
|
+
Mention,
|
|
15
|
+
AIEntity,
|
|
16
|
+
ClientCitation,
|
|
17
|
+
SensitivityUsageInfo,
|
|
18
|
+
)
|
|
14
19
|
from .conversation_reference import ConversationReference
|
|
15
20
|
from .text_highlight import TextHighlight
|
|
16
21
|
from .semantic_action import SemanticAction
|
|
17
22
|
from .agents_model import AgentsModel
|
|
23
|
+
from ._model_utils import pick_model, SkipNone
|
|
18
24
|
from ._type_aliases import NonEmptyString
|
|
19
25
|
|
|
20
26
|
|
|
@@ -390,32 +396,31 @@ class Activity(AgentsModel):
|
|
|
390
396
|
.. remarks::
|
|
391
397
|
The new activity sets up routing information based on this activity.
|
|
392
398
|
"""
|
|
393
|
-
return
|
|
399
|
+
return pick_model(
|
|
400
|
+
Activity,
|
|
394
401
|
type=ActivityTypes.message,
|
|
395
402
|
timestamp=datetime.now(timezone.utc),
|
|
396
|
-
from_property=
|
|
397
|
-
|
|
398
|
-
name=self.recipient.name if self.recipient else None,
|
|
403
|
+
from_property=SkipNone(
|
|
404
|
+
ChannelAccount.pick_properties(self.recipient, ["id", "name"])
|
|
399
405
|
),
|
|
400
|
-
recipient=
|
|
401
|
-
|
|
402
|
-
name=self.from_property.name if self.from_property else None,
|
|
406
|
+
recipient=SkipNone(
|
|
407
|
+
ChannelAccount.pick_properties(self.from_property, ["id", "name"])
|
|
403
408
|
),
|
|
404
409
|
reply_to_id=(
|
|
405
|
-
self.id
|
|
410
|
+
SkipNone(self.id)
|
|
406
411
|
if type != ActivityTypes.conversation_update
|
|
407
412
|
or self.channel_id not in ["directline", "webchat"]
|
|
408
413
|
else None
|
|
409
414
|
),
|
|
410
415
|
service_url=self.service_url,
|
|
411
416
|
channel_id=self.channel_id,
|
|
412
|
-
conversation=
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
417
|
+
conversation=SkipNone(
|
|
418
|
+
ConversationAccount.pick_properties(
|
|
419
|
+
self.conversation, ["is_group", "id", "name"]
|
|
420
|
+
)
|
|
416
421
|
),
|
|
417
422
|
text=text if text else "",
|
|
418
|
-
locale=locale if locale else self.locale,
|
|
423
|
+
locale=locale if locale else SkipNone(self.locale),
|
|
419
424
|
attachments=[],
|
|
420
425
|
entities=[],
|
|
421
426
|
)
|
|
@@ -423,6 +428,7 @@ class Activity(AgentsModel):
|
|
|
423
428
|
def create_trace(
|
|
424
429
|
self, name: str, value: object = None, value_type: str = None, label: str = None
|
|
425
430
|
):
|
|
431
|
+
# robrandao: TODO -> needs to handle Nones like create_reply
|
|
426
432
|
"""
|
|
427
433
|
Creates a new trace activity based on this activity.
|
|
428
434
|
|
|
@@ -434,42 +440,42 @@ class Activity(AgentsModel):
|
|
|
434
440
|
:returns: The new trace activity.
|
|
435
441
|
"""
|
|
436
442
|
if not value_type and value:
|
|
437
|
-
value_type = type(value)
|
|
443
|
+
value_type = type(value).__name__
|
|
438
444
|
|
|
439
|
-
return
|
|
445
|
+
return pick_model(
|
|
446
|
+
Activity,
|
|
440
447
|
type=ActivityTypes.trace,
|
|
441
448
|
timestamp=datetime.now(timezone.utc),
|
|
442
|
-
from_property=
|
|
443
|
-
|
|
444
|
-
name=self.recipient.name if self.recipient else None,
|
|
449
|
+
from_property=SkipNone(
|
|
450
|
+
ChannelAccount.pick_properties(self.recipient, ["id", "name"])
|
|
445
451
|
),
|
|
446
|
-
recipient=
|
|
447
|
-
|
|
448
|
-
name=self.from_property.name if self.from_property else None,
|
|
452
|
+
recipient=SkipNone(
|
|
453
|
+
ChannelAccount.pick_properties(self.from_property, ["id", "name"])
|
|
449
454
|
),
|
|
450
455
|
reply_to_id=(
|
|
451
|
-
self.id
|
|
456
|
+
SkipNone(self.id) # preserve unset
|
|
452
457
|
if type != ActivityTypes.conversation_update
|
|
453
458
|
or self.channel_id not in ["directline", "webchat"]
|
|
454
459
|
else None
|
|
455
460
|
),
|
|
456
461
|
service_url=self.service_url,
|
|
457
462
|
channel_id=self.channel_id,
|
|
458
|
-
conversation=
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
463
|
+
conversation=SkipNone(
|
|
464
|
+
ConversationAccount.pick_properties(
|
|
465
|
+
self.conversation, ["is_group", "id", "name"]
|
|
466
|
+
)
|
|
462
467
|
),
|
|
463
|
-
name=name,
|
|
464
|
-
label=label,
|
|
465
|
-
value_type=value_type,
|
|
466
|
-
value=value,
|
|
468
|
+
name=SkipNone(name),
|
|
469
|
+
label=SkipNone(label),
|
|
470
|
+
value_type=SkipNone(value_type),
|
|
471
|
+
value=SkipNone(value),
|
|
467
472
|
).as_trace_activity()
|
|
468
473
|
|
|
469
474
|
@staticmethod
|
|
470
475
|
def create_trace_activity(
|
|
471
476
|
name: str, value: object = None, value_type: str = None, label: str = None
|
|
472
477
|
):
|
|
478
|
+
# robrandao: TODO -> SkipNone
|
|
473
479
|
"""
|
|
474
480
|
Creates an instance of the :class:`Activity` class as a TraceActivity object.
|
|
475
481
|
|
|
@@ -481,14 +487,15 @@ class Activity(AgentsModel):
|
|
|
481
487
|
:returns: The new trace activity.
|
|
482
488
|
"""
|
|
483
489
|
if not value_type and value:
|
|
484
|
-
value_type = type(value)
|
|
490
|
+
value_type = type(value).__name__
|
|
485
491
|
|
|
486
|
-
return
|
|
492
|
+
return pick_model(
|
|
493
|
+
Activity,
|
|
487
494
|
type=ActivityTypes.trace,
|
|
488
495
|
name=name,
|
|
489
|
-
label=label,
|
|
490
|
-
value_type=value_type,
|
|
491
|
-
value=value,
|
|
496
|
+
label=SkipNone(label),
|
|
497
|
+
value_type=SkipNone(value_type),
|
|
498
|
+
value=SkipNone(value),
|
|
492
499
|
)
|
|
493
500
|
|
|
494
501
|
@staticmethod
|
|
@@ -506,10 +513,10 @@ class Activity(AgentsModel):
|
|
|
506
513
|
|
|
507
514
|
:returns: A conversation reference for the conversation that contains this activity.
|
|
508
515
|
"""
|
|
509
|
-
|
|
510
|
-
|
|
516
|
+
return pick_model(
|
|
517
|
+
ConversationReference,
|
|
511
518
|
activity_id=(
|
|
512
|
-
self.id
|
|
519
|
+
SkipNone(self.id)
|
|
513
520
|
if self.type != ActivityTypes.conversation_update
|
|
514
521
|
or self.channel_id not in ["directline", "webchat"]
|
|
515
522
|
else None
|
|
@@ -532,8 +539,9 @@ class Activity(AgentsModel):
|
|
|
532
539
|
This method is defined on the :class:`Activity` class, but is only intended for use with a message activity,
|
|
533
540
|
where the activity Activity.Type is set to ActivityTypes.Message.
|
|
534
541
|
"""
|
|
535
|
-
|
|
536
|
-
|
|
542
|
+
if not self.entities:
|
|
543
|
+
return []
|
|
544
|
+
return [x for x in self.entities if x.type.lower() == "mention"]
|
|
537
545
|
|
|
538
546
|
def get_reply_conversation_reference(
|
|
539
547
|
self, reply: ResourceResponse
|
|
@@ -596,7 +604,7 @@ class Activity(AgentsModel):
|
|
|
596
604
|
if self.type is None:
|
|
597
605
|
return False
|
|
598
606
|
|
|
599
|
-
type_attribute = str(self.type).lower()
|
|
607
|
+
type_attribute = f"ActivityTypes.{str(self.type)}".lower()
|
|
600
608
|
activity_type = str(activity_type).lower()
|
|
601
609
|
|
|
602
610
|
result = type_attribute.startswith(activity_type)
|
|
@@ -611,3 +619,32 @@ class Activity(AgentsModel):
|
|
|
611
619
|
)
|
|
612
620
|
|
|
613
621
|
return result
|
|
622
|
+
|
|
623
|
+
def add_ai_metadata(
|
|
624
|
+
self,
|
|
625
|
+
citations: Optional[list[ClientCitation]] = None,
|
|
626
|
+
usage_info: Optional[SensitivityUsageInfo] = None,
|
|
627
|
+
) -> None:
|
|
628
|
+
"""
|
|
629
|
+
Adds AI entity to an activity to indicate AI-generated content.
|
|
630
|
+
|
|
631
|
+
Args:
|
|
632
|
+
activity: The activity to modify
|
|
633
|
+
citations: Optional list of citations
|
|
634
|
+
usage_info: Optional sensitivity usage information
|
|
635
|
+
"""
|
|
636
|
+
if citations:
|
|
637
|
+
ai_entity = AIEntity(
|
|
638
|
+
type="https://schema.org/Message",
|
|
639
|
+
schema_type="Message",
|
|
640
|
+
context="https://schema.org",
|
|
641
|
+
id="",
|
|
642
|
+
additional_type=["AIGeneratedContent"],
|
|
643
|
+
citation=citations,
|
|
644
|
+
usage_info=usage_info,
|
|
645
|
+
)
|
|
646
|
+
|
|
647
|
+
if self.entities is None:
|
|
648
|
+
self.entities = []
|
|
649
|
+
|
|
650
|
+
self.entities.append(ai_entity)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
from pydantic import BaseModel, ConfigDict
|
|
2
4
|
from pydantic.alias_generators import to_camel
|
|
3
5
|
|
|
@@ -16,3 +18,29 @@ class AgentsModel(BaseModel):
|
|
|
16
18
|
|
|
17
19
|
return {k: v for k, v in self if k not in omit_if_empty and v is not None}
|
|
18
20
|
"""
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def pick_properties(cls, original: AgentsModel, fields_to_copy=None, **kwargs):
|
|
24
|
+
"""Picks properties from the original model and returns a new instance (of a possibly different AgentsModel) with those properties.
|
|
25
|
+
|
|
26
|
+
This method preserves unset values.
|
|
27
|
+
|
|
28
|
+
args:
|
|
29
|
+
original: The original model instance to copy properties from. If None, returns None.
|
|
30
|
+
fields_to_copy: The specific fields to copy. If None, all fields are copied.
|
|
31
|
+
**kwargs: Additional fields to include in the new instance.
|
|
32
|
+
"""
|
|
33
|
+
if not original:
|
|
34
|
+
return None
|
|
35
|
+
|
|
36
|
+
if fields_to_copy is None:
|
|
37
|
+
fields_to_copy = original.model_fields_set
|
|
38
|
+
else:
|
|
39
|
+
fields_to_copy = original.model_fields_set & set(fields_to_copy)
|
|
40
|
+
|
|
41
|
+
dest = {}
|
|
42
|
+
for field in fields_to_copy:
|
|
43
|
+
dest[field] = getattr(original, field)
|
|
44
|
+
|
|
45
|
+
dest.update(kwargs)
|
|
46
|
+
return cls.model_validate(dest)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from .mention import Mention
|
|
2
|
+
from .entity import Entity
|
|
3
|
+
from .ai_entity import (
|
|
4
|
+
ClientCitation,
|
|
5
|
+
ClientCitationAppearance,
|
|
6
|
+
ClientCitationImage,
|
|
7
|
+
ClientCitationIconName,
|
|
8
|
+
AIEntity,
|
|
9
|
+
SensitivityPattern,
|
|
10
|
+
SensitivityUsageInfo,
|
|
11
|
+
)
|
|
12
|
+
from .geo_coordinates import GeoCoordinates
|
|
13
|
+
from .place import Place
|
|
14
|
+
from .thing import Thing
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"Entity",
|
|
18
|
+
"AIEntity",
|
|
19
|
+
"ClientCitation",
|
|
20
|
+
"ClientCitationAppearance",
|
|
21
|
+
"ClientCitationImage",
|
|
22
|
+
"ClientCitationIconName",
|
|
23
|
+
"Mention",
|
|
24
|
+
"SensitivityUsageInfo",
|
|
25
|
+
"SensitivityPattern",
|
|
26
|
+
"GeoCoordinates",
|
|
27
|
+
"Place",
|
|
28
|
+
"Thing",
|
|
29
|
+
]
|
|
@@ -5,8 +5,7 @@ from enum import Enum
|
|
|
5
5
|
from typing import List, Optional, Union, Literal
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from .activity import Activity
|
|
8
|
+
from ..agents_model import AgentsModel
|
|
10
9
|
from .entity import Entity
|
|
11
10
|
|
|
12
11
|
|
|
@@ -110,33 +109,3 @@ class AIEntity(Entity):
|
|
|
110
109
|
def __post_init__(self):
|
|
111
110
|
if self.additional_type is None:
|
|
112
111
|
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)
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
from typing import Any, Optional
|
|
2
|
+
from enum import Enum
|
|
2
3
|
|
|
3
4
|
from pydantic import model_serializer, model_validator
|
|
4
|
-
from .agents_model import AgentsModel, ConfigDict
|
|
5
5
|
from pydantic.alias_generators import to_camel, to_snake
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
from ..agents_model import AgentsModel, ConfigDict
|
|
8
|
+
from .._type_aliases import NonEmptyString
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
class Entity(AgentsModel):
|
|
@@ -15,7 +17,7 @@ class Entity(AgentsModel):
|
|
|
15
17
|
|
|
16
18
|
model_config = ConfigDict(extra="allow")
|
|
17
19
|
|
|
18
|
-
type:
|
|
20
|
+
type: str
|
|
19
21
|
|
|
20
22
|
@property
|
|
21
23
|
def additional_properties(self) -> dict[str, Any]:
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
from
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from ..channel_account import ChannelAccount
|
|
2
4
|
from .entity import Entity
|
|
3
|
-
from
|
|
5
|
+
from .._type_aliases import NonEmptyString
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
class Mention(Entity):
|
|
@@ -15,5 +17,5 @@ class Mention(Entity):
|
|
|
15
17
|
"""
|
|
16
18
|
|
|
17
19
|
mentioned: ChannelAccount = None
|
|
18
|
-
text:
|
|
19
|
-
type:
|
|
20
|
+
text: str = None
|
|
21
|
+
type: Literal["mention"] = "mention"
|
|
@@ -17,7 +17,7 @@ class OAuthCard(AgentsModel):
|
|
|
17
17
|
:type buttons: list[~microsoft_agents.activity.CardAction]
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
|
-
text:
|
|
20
|
+
text: str = None
|
|
21
21
|
connection_name: NonEmptyString = None
|
|
22
22
|
buttons: list[CardAction] = None
|
|
23
23
|
token_exchange_resource: Optional[TokenExchangeResource] = None
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
microsoft_agents/activity/__init__.py,sha256=
|
|
1
|
+
microsoft_agents/activity/__init__.py,sha256=07QcOO-VhyFua5npkmn19vKzB_cPBixxSFDaDpYgUZA,5978
|
|
2
2
|
microsoft_agents/activity/_load_configuration.py,sha256=Sepf-xe0pD_xuDwZEFmAEchMJURqIXmL2az78LIJLyw,833
|
|
3
|
+
microsoft_agents/activity/_model_utils.py,sha256=2y6TedLAIFGuaj-VWMZgiFHYt39Df10ed5j3aOAPLps,1909
|
|
3
4
|
microsoft_agents/activity/_type_aliases.py,sha256=7kkx_rIxA1B-z2T6HU6OMBm5lgD1t6KGNznJzAX-VgE,135
|
|
4
5
|
microsoft_agents/activity/action_types.py,sha256=DY0RkEFquJ_SjMKJvHsD5Ring4j_HPrchEvIsFunIfI,324
|
|
5
|
-
microsoft_agents/activity/activity.py,sha256=
|
|
6
|
+
microsoft_agents/activity/activity.py,sha256=ZDG9cdDC0EO2ZuARH0JHRFh2X4Da13c5c9LMLdU7tWw,27258
|
|
6
7
|
microsoft_agents/activity/activity_event_names.py,sha256=3X5u4xppN86wY-KpBAwRr4sfYB3-V4MSlB5SsrcI7l0,159
|
|
7
8
|
microsoft_agents/activity/activity_importance.py,sha256=kdwdcVa9fsCEk5hvxOsGhqsE4uu7gpTYKtACEgmva0A,117
|
|
8
9
|
microsoft_agents/activity/activity_types.py,sha256=a9XvGgWsFI1Rur4JC-n5YIDpdSooxqaMNna3VS1CW1s,667
|
|
9
10
|
microsoft_agents/activity/adaptive_card_invoke_action.py,sha256=X4weYdv8uzeNyBPpeTYD4631O19aaQdvvyrYi5PUJdU,779
|
|
10
11
|
microsoft_agents/activity/adaptive_card_invoke_response.py,sha256=lWlB9bL6I7F1Sr2-xV1XFq6ddB2UGi8GRCOOt4kyffs,640
|
|
11
12
|
microsoft_agents/activity/adaptive_card_invoke_value.py,sha256=9AWQF2maf48GMAoWRgljquMZHZX1r_y3wqULprygJKI,995
|
|
12
|
-
microsoft_agents/activity/agents_model.py,sha256=
|
|
13
|
-
microsoft_agents/activity/
|
|
14
|
-
microsoft_agents/activity/animation_card.py,sha256=ZnXiX5TXj32TS5lDXjZ5TrnYzHnPTVr2Tz3TYyjUlTQ,2005
|
|
13
|
+
microsoft_agents/activity/agents_model.py,sha256=3v3UOdEvNEGOyYPgk-3IP6cgtHdoYfeK_9x0VVrG6l4,1490
|
|
14
|
+
microsoft_agents/activity/animation_card.py,sha256=Cqpuni9t19PIroPYiLiTSsaS_3o8tUOwTc_98bkuzv0,1994
|
|
15
15
|
microsoft_agents/activity/attachment.py,sha256=Z2FtaHURYHPRDMdVWgeaxMlFENBMHCBCUKoRGEc2bVY,727
|
|
16
16
|
microsoft_agents/activity/attachment_data.py,sha256=qY7Ue3IPWq45mFhFrDqUPa_PBqLHYGGCcrAdKHVnXHM,576
|
|
17
17
|
microsoft_agents/activity/attachment_info.py,sha256=qrQPNYc5cFdaUMCcaBynhLNVTQGAMFD-pZbUIOcfAa0,536
|
|
18
18
|
microsoft_agents/activity/attachment_layout_types.py,sha256=iXmEtlV-arcXmdZ2anlJVFs4Jjd7QHF2IHS4OfblpYI,108
|
|
19
19
|
microsoft_agents/activity/attachment_view.py,sha256=-rIphRFMJ_DnARoX2WhL6OeKPciDSd4zvwQjLWAbchM,345
|
|
20
|
-
microsoft_agents/activity/audio_card.py,sha256=
|
|
21
|
-
microsoft_agents/activity/basic_card.py,sha256=
|
|
20
|
+
microsoft_agents/activity/audio_card.py,sha256=85s0iGSU4qXYHPU58qRPihhCmQIcbrifWs_PLjuJU6s,1953
|
|
21
|
+
microsoft_agents/activity/basic_card.py,sha256=dLIGAPrxSwEqCo2tHLhX85Nm61aR5xowYnaPxrAn82k,956
|
|
22
22
|
microsoft_agents/activity/caller_id_constants.py,sha256=9VhHXo0XyTkknm6NTSGpHOLEMZQp7d3A5B5DOX5L0Kk,220
|
|
23
23
|
microsoft_agents/activity/card_action.py,sha256=uVlxGFNE7H-ZIjE2YYESuuMDy24mp7MCvenhp83_xII,1414
|
|
24
24
|
microsoft_agents/activity/card_image.py,sha256=yYyo8RBG3z1Heoorj3zEG32oMkLV_mzJWDJetRnszSg,545
|
|
@@ -35,41 +35,36 @@ microsoft_agents/activity/conversation_update_types.py,sha256=VEUqDxPcohg68El9RO
|
|
|
35
35
|
microsoft_agents/activity/conversations_result.py,sha256=3D0dqPBAfo9ZUmpP1bCTEROh8aLF3kqBxvDON7HWNd4,522
|
|
36
36
|
microsoft_agents/activity/delivery_modes.py,sha256=kwSrdeVxevLEG7lzn8MfRPAO8hQQgbPYqz7kdPWbHjI,199
|
|
37
37
|
microsoft_agents/activity/end_of_conversation_codes.py,sha256=NJBRgjwHkzbJvmTSGgy-RnjbBlWDIHmZ9dhN118BGDc,301
|
|
38
|
-
microsoft_agents/activity/entity.py,sha256=b_WPdzJg55n0qiz9cpfml-aEs-f_95VBNb-ihV9Ne6I,1071
|
|
39
38
|
microsoft_agents/activity/error.py,sha256=N5DsUr9RYXj0HOu2h89RkNasbSrtvBL-hS9-oKrxt3o,551
|
|
40
39
|
microsoft_agents/activity/error_response.py,sha256=XbCk_B347r69uD2QPkW_1Ld42_yBZMmEZoAF8rWr99o,244
|
|
41
40
|
microsoft_agents/activity/expected_replies.py,sha256=FbJ0yoXhn2XvQ-PN4vo60O_knte-1R2bBPFQy49jZtM,343
|
|
42
41
|
microsoft_agents/activity/fact.py,sha256=ljgtTptRLpPiBubCrc29SdiTFEQXJvOK4LHRz4CcIlc,549
|
|
43
|
-
microsoft_agents/activity/
|
|
44
|
-
microsoft_agents/activity/hero_card.py,sha256=KNCT3p9jr-tK_zlczPFwKZbpfEFDE-rmjA-PBs7v6Ik,999
|
|
42
|
+
microsoft_agents/activity/hero_card.py,sha256=XawZNJMVSJwJMjbQBV8onYdHshw9kewLNEU3LgLTaZo,988
|
|
45
43
|
microsoft_agents/activity/inner_http_error.py,sha256=1hcteIiy3LsXTtVT3pD4-83s7sichQsfkV4LaQ0-QhM,333
|
|
46
44
|
microsoft_agents/activity/input_hints.py,sha256=14us7b1Km-uApAQUpjC5VYnm12QaD-NhpwBQZwwRg0o,263
|
|
47
45
|
microsoft_agents/activity/installation_update_action_types.py,sha256=Ge-4MqT_TG6JFG5yMR9a_CK3pA5q81_g8GyKM2TWKNE,110
|
|
48
46
|
microsoft_agents/activity/invoke_response.py,sha256=Unn1fMk2rW-EJx7rvYOFqdBqWnPvD8W5sPRkhqNDG-I,861
|
|
49
|
-
microsoft_agents/activity/media_card.py,sha256=
|
|
47
|
+
microsoft_agents/activity/media_card.py,sha256=AvW7B5Xp6VaXLNF3Dq-ld4SHd4ZcHJHnLqBeaEFYUGo,1953
|
|
50
48
|
microsoft_agents/activity/media_event_value.py,sha256=8GUi5uofatEavSuWEMo6sydlOD9_ntd5XDmmQT-hwLM,314
|
|
51
49
|
microsoft_agents/activity/media_url.py,sha256=tui_uIU93lwLefb7xeRArwvE410w__hFllgi-uLnB8A,401
|
|
52
|
-
microsoft_agents/activity/mention.py,sha256=MMcsFWHV8w8L478L-7iOswP5uXXliUnhnXC8k7X14HA,576
|
|
53
50
|
microsoft_agents/activity/message_reaction.py,sha256=wIfLWZl-LstuVMKqmzPagOi6LhsGsUu8Tlcf75-CgAs,344
|
|
54
51
|
microsoft_agents/activity/message_reaction_types.py,sha256=cAdeuthZmDLu-DZ2IRnuVDFC_ldTSBPjwDRuuSZfcGs,219
|
|
55
52
|
microsoft_agents/activity/message_update_types.py,sha256=LTIXbGk3NVmraRDPRokdxxD81f-tyg_n7KuNCmX4vcA,181
|
|
56
|
-
microsoft_agents/activity/oauth_card.py,sha256=
|
|
53
|
+
microsoft_agents/activity/oauth_card.py,sha256=4ZLUIEQ-9GFRXAruxNCglRdPyungRrlPg8EdXyl-xWU,857
|
|
57
54
|
microsoft_agents/activity/paged_members_result.py,sha256=ABwhTA3znOO0HCam1_-26lmAiEnYRe6AICkrTe8npR0,473
|
|
58
|
-
microsoft_agents/activity/place.py,sha256=KwoNIZ06MhTdYkevzIr6auAR65Z_aXALqunZt7Ze5XE,824
|
|
59
55
|
microsoft_agents/activity/receipt_card.py,sha256=P-FQYuIsGGx9yLjpF8KZO4ZzaFf0rd_ocM5DOk0mRgU,1245
|
|
60
|
-
microsoft_agents/activity/receipt_item.py,sha256=
|
|
56
|
+
microsoft_agents/activity/receipt_item.py,sha256=v6d7GBlB7nDGbV6ME8CRCkmzDhGzMRFhFVd5ybvsoLw,1107
|
|
61
57
|
microsoft_agents/activity/resource_response.py,sha256=qTN6C2wXTP_euH5_LDL47DOfMfofe4_o1z7ZO39OEpU,255
|
|
62
58
|
microsoft_agents/activity/role_types.py,sha256=Y-bnda7PFFBhXd-zZaL5RlIDbgAhdZbeW8TLV_fYjf0,108
|
|
63
59
|
microsoft_agents/activity/semantic_action.py,sha256=HjkK0yq_w5hHLaP_DAsPNaBRReRplyupcvUroZeVQr8,595
|
|
64
60
|
microsoft_agents/activity/semantic_actions_states.py,sha256=xCcSWGmCKizL9J7lycEBIYPIGeQb2dQmsLLObph7s00,149
|
|
65
61
|
microsoft_agents/activity/sign_in_constants.py,sha256=3juR-nSfP0vr3TvFPhQ2foEivt1lLgWxsG6LQmWhhkc,534
|
|
66
62
|
microsoft_agents/activity/sign_in_resource.py,sha256=Ygy5wjCvyW1fQ5aLf29214_LFeF9zJnd7ZsUxice5JY,446
|
|
67
|
-
microsoft_agents/activity/signin_card.py,sha256=
|
|
63
|
+
microsoft_agents/activity/signin_card.py,sha256=Bbq8B4MjvcVU5J6pEuuaDJALyS_G2t4c0Z1oBatVQd8,442
|
|
68
64
|
microsoft_agents/activity/suggested_actions.py,sha256=R9jHYkL5nau9Mlz7q0UJqv4PeQ2_H4P3WvTtrGMaLXQ,587
|
|
69
65
|
microsoft_agents/activity/text_format_types.py,sha256=cMYHz1LQY1FwUgh1odOAVyfidKl1RZKPVFrxLW9SQ1Q,120
|
|
70
|
-
microsoft_agents/activity/text_highlight.py,sha256=
|
|
71
|
-
microsoft_agents/activity/
|
|
72
|
-
microsoft_agents/activity/thumbnail_card.py,sha256=gvbWnvWCV4AoXfBjnAorUKXNmLBZJ0YAvd4tDNjDW_E,1019
|
|
66
|
+
microsoft_agents/activity/text_highlight.py,sha256=Cj0JyUjyW_EQVpYyG4v2I5Gb3Zct8RJH3s5vq5tkfaM,430
|
|
67
|
+
microsoft_agents/activity/thumbnail_card.py,sha256=wRF78XIGeUtaa_cieAAAXUZHgPrHvht58h9z0IQQiBg,1008
|
|
73
68
|
microsoft_agents/activity/thumbnail_url.py,sha256=1gGTFfKmjGi3Rrtgh4RF4nmx13ZlwZVgvpeAtTUfS0E,383
|
|
74
69
|
microsoft_agents/activity/token_exchange_invoke_request.py,sha256=MQ2WskGT3rOOZYMZTtRiA9W4vmJ8TWSgkkx29-4LH-o,631
|
|
75
70
|
microsoft_agents/activity/token_exchange_invoke_response.py,sha256=U2rIXQJkqEl9y_9zQuBz1CEXZ9_0k4w77jxNkYSLXG4,668
|
|
@@ -81,7 +76,14 @@ microsoft_agents/activity/token_response.py,sha256=jQbDEyQqApsF85Zse03D_FsW6ATGf
|
|
|
81
76
|
microsoft_agents/activity/token_status.py,sha256=o3pGTKRjuqEndRWClMe91Cmox6cW8aDrOTvE3_k5jFI,1174
|
|
82
77
|
microsoft_agents/activity/transcript.py,sha256=yV5s5rONGC1uM5pKnVv0HbY2SVzQ9qKOBawM0fzJOJc,328
|
|
83
78
|
microsoft_agents/activity/turn_context_protocol.py,sha256=ETR6L5aMoZdPkLUcULmDHfmQo21-_bFF_yzxZmiG_6g,1692
|
|
84
|
-
microsoft_agents/activity/video_card.py,sha256=
|
|
79
|
+
microsoft_agents/activity/video_card.py,sha256=nJb0l8NuhLuH2mFOvozzKao4uQiCGko9LZHnno_QS0k,1953
|
|
80
|
+
microsoft_agents/activity/entity/__init__.py,sha256=WqUL3e79ifcn8UhHVIHcSqQ6MHaEEyGgKi3v65-jQls,617
|
|
81
|
+
microsoft_agents/activity/entity/ai_entity.py,sha256=VOjU9Y6m68vkiKUHnqG5XmNPRu4KCSKmd0XPDCJ6B0s,3280
|
|
82
|
+
microsoft_agents/activity/entity/entity.py,sha256=c9zCbP7uGmc-_a18qfe5uFWHWmofpfnJqSmINNWvV1E,1085
|
|
83
|
+
microsoft_agents/activity/entity/geo_coordinates.py,sha256=GnBGkBZMUg7Q6Aonqpcr1e_CVobZzh3eGAqh_qSGAZA,891
|
|
84
|
+
microsoft_agents/activity/entity/mention.py,sha256=zhzJRKiQNuS2mtOK-_3CVswTM-PiGTOOU7tvzEPqytc,604
|
|
85
|
+
microsoft_agents/activity/entity/place.py,sha256=Y-wuCxovDVIf9QwTkXJYDrkcAx73wIgWY4mqD-oyDOo,826
|
|
86
|
+
microsoft_agents/activity/entity/thing.py,sha256=wAgviXeu1s4dGHDnm8mXSCvYZIiV_fWT7dpHD-FjxfE,358
|
|
85
87
|
microsoft_agents/activity/teams/__init__.py,sha256=pdcnd_Ud92Eox_fHSgm1kwzwFmG8LVeatF9MRI8IaVY,8532
|
|
86
88
|
microsoft_agents/activity/teams/app_based_link_query.py,sha256=-2uuPbyElN0DbU5R_mTJ_o7jphBNFr1ZFlLeziXuxn0,462
|
|
87
89
|
microsoft_agents/activity/teams/batch_failed_entries_response.py,sha256=Q6Mgbdu_OdFGEKmaMu3jr71BSfwNtAgCMLyDSrfLf7I,439
|
|
@@ -189,7 +191,7 @@ microsoft_agents/activity/teams/teams_member.py,sha256=vRcLRHy6wTfH7DP6k6QbrKkOR
|
|
|
189
191
|
microsoft_agents/activity/teams/teams_paged_members_result.py,sha256=cG4eKHjA0u1EMioC2ErVpydnoPJrtTDcdhdzYET9xto,555
|
|
190
192
|
microsoft_agents/activity/teams/tenant_info.py,sha256=h8OxMd6LD5lWVj_LK2ut8z7SB0I7Gx74W1wwEiYOzXk,296
|
|
191
193
|
microsoft_agents/activity/teams/user_meeting_details.py,sha256=tvk2CWYf7Bo-DhK8NSojhanJDXEOGVrKXxJDca03CAo,467
|
|
192
|
-
microsoft_agents_activity-0.4.0.
|
|
193
|
-
microsoft_agents_activity-0.4.0.
|
|
194
|
-
microsoft_agents_activity-0.4.0.
|
|
195
|
-
microsoft_agents_activity-0.4.0.
|
|
194
|
+
microsoft_agents_activity-0.4.0.dev4.dist-info/METADATA,sha256=-eSa6rLKW8qndESghkHUpo-wh7pqG8no6CXSsRj8umM,413
|
|
195
|
+
microsoft_agents_activity-0.4.0.dev4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
196
|
+
microsoft_agents_activity-0.4.0.dev4.dist-info/top_level.txt,sha256=lWKcT4v6fTA_NgsuHdNvuMjSrkiBMXohn64ApY7Xi8A,17
|
|
197
|
+
microsoft_agents_activity-0.4.0.dev4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|