-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathai_entity.py
More file actions
117 lines (87 loc) · 3.52 KB
/
Copy pathai_entity.py
File metadata and controls
117 lines (87 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from enum import Enum
from typing import List, Optional, Literal
from pydantic import Field
from ..agents_model import AgentsModel
from ._schema_mixin import _SchemaMixin
from .entity import Entity
class ClientCitationIconName(str, Enum):
"""Supported citation icon names for ``citation.appearance.image.name``.
The values mirror the predefined icon names documented for Teams bot
messages with AI-generated content. See "Add citations":
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content#add-citations
"""
MICROSOFT_WORD = "Microsoft Word"
MICROSOFT_EXCEL = "Microsoft Excel"
MICROSOFT_POWERPOINT = "Microsoft PowerPoint"
MICROSOFT_ONENOTE = "Microsoft OneNote"
MICROSOFT_SHAREPOINT = "Microsoft SharePoint"
MICROSOFT_VISIO = "Microsoft Visio"
MICROSOFT_LOOP = "Microsoft Loop"
MICROSOFT_WHITEBOARD = "Microsoft Whiteboard"
SOURCE_CODE = "Source Code"
SKETCH = "Sketch"
ADOBE_ILLUSTRATOR = "Adobe Illustrator"
ADOBE_PHOTOSHOP = "Adobe Photoshop"
ADOBE_INDESIGN = "Adobe InDesign"
ADOBE_FLASH = "Adobe Flash"
IMAGE = "Image"
GIF = "GIF"
VIDEO = "Video"
SOUND = "Sound"
ZIP = "ZIP"
TEXT = "Text"
PDF = "PDF"
class ClientCitationImage(AgentsModel):
"""Information about the citation's icon."""
type: str = "ImageObject"
name: str = ""
class SensitivityPattern(AgentsModel, _SchemaMixin):
"""Pattern information for sensitivity usage info."""
at_type: Literal["DefinedTerm"] = "DefinedTerm"
in_defined_term_set: str = ""
name: str = ""
term_code: str = ""
class SensitivityUsageInfo(AgentsModel, _SchemaMixin):
"""
Sensitivity usage info for content sent to the user.
This is used to provide information about the content to the user.
"""
type: str = "https://schema.org/Message"
at_type: Literal["CreativeWork"] = "CreativeWork"
description: Optional[str] = None
name: str = ""
position: Optional[int] = None
pattern: Optional[SensitivityPattern] = None
class ClientCitationAppearance(AgentsModel, _SchemaMixin):
"""Appearance information for a client citation."""
at_type: Literal["DigitalDocument"] = "DigitalDocument"
name: str = ""
text: Optional[str] = None
url: Optional[str] = None
abstract: str = ""
encoding_format: Optional[str] = None
image: Optional[ClientCitationImage] = None
keywords: Optional[List[str]] = None
usage_info: Optional[SensitivityUsageInfo] = None
class ClientCitation(AgentsModel, _SchemaMixin):
"""
Represents a Teams client citation to be included in a message.
See Bot messages with AI-generated content for more details.
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage
"""
at_type: Literal["Claim"] = "Claim"
position: int = 0
appearance: ClientCitationAppearance = Field(
default_factory=ClientCitationAppearance
)
class AIEntity(Entity):
"""Entity indicating AI-generated content."""
at_type: Literal["Message"] = "Message"
at_context: Literal["https://schema.org"] = "https://schema.org"
type: str = "https://schema.org/Message"
id: str = ""
additional_type: List[str] = Field(default_factory=lambda: ["AIGeneratedContent"])
citation: Optional[List[ClientCitation]] = None
usage_info: Optional[SensitivityUsageInfo] = None