Skip to content

Commit d5eedca

Browse files
authored
Add Product Info Entity for Copilot (#180)
Original Payload: ```json { "text":"my pet's name is barnie!", "textFormat":"plain", "type":"message", "timestamp":"2025-10-16T23:15:20.113832Z", "id":"1760656520090", "channelId":"msteams", "serviceUrl":"https://smba.trafficmanager.net/amer/56653e9d-2158-46ee-90d7-675c39642038/", "from":{ "id":"29:1J7sNKMNCijOoy412liJJHxliedKeLKozaInQ6ZSToFi_aTcVuoXJTfkLpwZ8yuWNKhJ4_4N3fTyxucoBHKYTDg", "name":"", "aadObjectId":"4816e27f-5665-4904-a182-f74d3bd509ac" }, "conversation":{ "isGroup":true, "conversationType":"groupChat", "tenantId":"56653e9d-2158-46ee-90d7-675c39642038", "id":"19:[email protected]" }, "recipient":{ "id":"28:9707ff8c-f4e0-47c4-beb6-a10d61e7e7f7", "name":"aamirjtester" }, "entities":[ { "mentioned":{ "id":"28:9707ff8c-f4e0-47c4-beb6-a10d61e7e7f7", "name":"ai-test" }, "type":"mention" }, { "locale":"en-US", "timezone":"America/Los_Angeles", "type":"clientInfo" }, { "id":"COPILOT", "type":"ProductInfo" } ], "channelData":{ "tenant":{ "id":"56653e9d-2158-46ee-90d7-675c39642038" }, "productContext":"COPILOT" }, "locale":"en-US", "localTimezone":"America/Los_Angeles" } ``` Error: ``` [ERROR] @teams/app.HttpPlugin [ [ERROR] @teams/app.HttpPlugin { [ERROR] @teams/app.HttpPlugin "type": "literal_error", [ERROR] @teams/app.HttpPlugin "loc": [ [ERROR] @teams/app.HttpPlugin "message", [ERROR] @teams/app.HttpPlugin "entities", [ERROR] @teams/app.HttpPlugin 2, [ERROR] @teams/app.HttpPlugin "ClientInfoEntity", [ERROR] @teams/app.HttpPlugin "type" [ERROR] @teams/app.HttpPlugin ], [ERROR] @teams/app.HttpPlugin "msg": "Input should be 'clientInfo'", [ERROR] @teams/app.HttpPlugin "input": "ProductInfo", [ERROR] @teams/app.HttpPlugin "ctx": { [ERROR] @teams/app.HttpPlugin "expected": "'clientInfo'" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin "url": "https://errors.pydantic.dev/2.11/v/literal_error" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin { [ERROR] @teams/app.HttpPlugin "type": "literal_error", [ERROR] @teams/app.HttpPlugin "loc": [ [ERROR] @teams/app.HttpPlugin "message", [ERROR] @teams/app.HttpPlugin "entities", [ERROR] @teams/app.HttpPlugin 2, [ERROR] @teams/app.HttpPlugin "MentionEntity", [ERROR] @teams/app.HttpPlugin "type" [ERROR] @teams/app.HttpPlugin ], [ERROR] @teams/app.HttpPlugin "msg": "Input should be 'mention'", [ERROR] @teams/app.HttpPlugin "input": "ProductInfo", [ERROR] @teams/app.HttpPlugin "ctx": { [ERROR] @teams/app.HttpPlugin "expected": "'mention'" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin "url": "https://errors.pydantic.dev/2.11/v/literal_error" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin { [ERROR] @teams/app.HttpPlugin "type": "missing", [ERROR] @teams/app.HttpPlugin "loc": [ [ERROR] @teams/app.HttpPlugin "message", [ERROR] @teams/app.HttpPlugin "entities", [ERROR] @teams/app.HttpPlugin 2, [ERROR] @teams/app.HttpPlugin "MentionEntity", [ERROR] @teams/app.HttpPlugin "mentioned" [ERROR] @teams/app.HttpPlugin ], [ERROR] @teams/app.HttpPlugin "msg": "Field required", [ERROR] @teams/app.HttpPlugin "input": { [ERROR] @teams/app.HttpPlugin "id": "COPILOT", [ERROR] @teams/app.HttpPlugin "type": "ProductInfo" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin "url": "https://errors.pydantic.dev/2.11/v/missing" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin { [ERROR] @teams/app.HttpPlugin "type": "literal_error", [ERROR] @teams/app.HttpPlugin "loc": [ [ERROR] @teams/app.HttpPlugin "message", [ERROR] @teams/app.HttpPlugin "entities", [ERROR] @teams/app.HttpPlugin 2, [ERROR] @teams/app.HttpPlugin "MessageEntity", [ERROR] @teams/app.HttpPlugin "type" [ERROR] @teams/app.HttpPlugin ], [ERROR] @teams/app.HttpPlugin "msg": "Input should be 'https://schema.org/Message'", [ERROR] @teams/app.HttpPlugin "input": "ProductInfo", [ERROR] @teams/app.HttpPlugin "ctx": { [ERROR] @teams/app.HttpPlugin "expected": "'https://schema.org/Message'" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin "url": "https://errors.pydantic.dev/2.11/v/literal_error" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin { [ERROR] @teams/app.HttpPlugin "type": "literal_error", [ERROR] @teams/app.HttpPlugin "loc": [ [ERROR] @teams/app.HttpPlugin "message", [ERROR] @teams/app.HttpPlugin "entities", [ERROR] @teams/app.HttpPlugin 2, [ERROR] @teams/app.HttpPlugin "AIMessageEntity", [ERROR] @teams/app.HttpPlugin "type" [ERROR] @teams/app.HttpPlugin ], [ERROR] @teams/app.HttpPlugin "msg": "Input should be 'https://schema.org/Message'", [ERROR] @teams/app.HttpPlugin "input": "ProductInfo", [ERROR] @teams/app.HttpPlugin "ctx": { [ERROR] @teams/app.HttpPlugin "expected": "'https://schema.org/Message'" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin "url": "https://errors.pydantic.dev/2.11/v/literal_error" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin { [ERROR] @teams/app.HttpPlugin "type": "literal_error", [ERROR] @teams/app.HttpPlugin "loc": [ [ERROR] @teams/app.HttpPlugin "message", [ERROR] @teams/app.HttpPlugin "entities", [ERROR] @teams/app.HttpPlugin 2, [ERROR] @teams/app.HttpPlugin "StreamInfoEntity", [ERROR] @teams/app.HttpPlugin "type" [ERROR] @teams/app.HttpPlugin ], [ERROR] @teams/app.HttpPlugin "msg": "Input should be 'streaminfo'", [ERROR] @teams/app.HttpPlugin "input": "ProductInfo", [ERROR] @teams/app.HttpPlugin "ctx": { [ERROR] @teams/app.HttpPlugin "expected": "'streaminfo'" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin "url": "https://errors.pydantic.dev/2.11/v/literal_error" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin { [ERROR] @teams/app.HttpPlugin "type": "literal_error", [ERROR] @teams/app.HttpPlugin "loc": [ [ERROR] @teams/app.HttpPlugin "message", [ERROR] @teams/app.HttpPlugin "entities", [ERROR] @teams/app.HttpPlugin 2, [ERROR] @teams/app.HttpPlugin "CitationEntity", [ERROR] @teams/app.HttpPlugin "type" [ERROR] @teams/app.HttpPlugin ], [ERROR] @teams/app.HttpPlugin "msg": "Input should be 'https://schema.org/Message'", [ERROR] @teams/app.HttpPlugin "input": "ProductInfo", [ERROR] @teams/app.HttpPlugin "ctx": { [ERROR] @teams/app.HttpPlugin "expected": "'https://schema.org/Message'" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin "url": "https://errors.pydantic.dev/2.11/v/literal_error" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin { [ERROR] @teams/app.HttpPlugin "type": "literal_error", [ERROR] @teams/app.HttpPlugin "loc": [ [ERROR] @teams/app.HttpPlugin "message", [ERROR] @teams/app.HttpPlugin "entities", [ERROR] @teams/app.HttpPlugin 2, [ERROR] @teams/app.HttpPlugin "SensitiveUsageEntity", [ERROR] @teams/app.HttpPlugin "type" [ERROR] @teams/app.HttpPlugin ], [ERROR] @teams/app.HttpPlugin "msg": "Input should be 'https://schema.org/Message'", [ERROR] @teams/app.HttpPlugin "input": "ProductInfo", [ERROR] @teams/app.HttpPlugin "ctx": { [ERROR] @teams/app.HttpPlugin "expected": "'https://schema.org/Message'" [ERROR] @teams/app.HttpPlugin }, [ERROR] @teams/app.HttpPlugin "url": "https://errors.pydantic.dev/2.11/v/literal_error" [ERROR] @teams/app.HttpPlugin } [ERROR] @teams/app.HttpPlugin ] ```
1 parent 731d207 commit d5eedca

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

packages/api/src/microsoft/teams/api/models/entity/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from .entity import Entity # noqa: F401
1818
from .mention_entity import MentionEntity
1919
from .message_entity import MessageEntity
20+
from .product_info_entity import ProductInfoEntity
2021
from .sensitive_usage_entity import SensitiveUsage, SensitiveUsageEntity, SensitiveUsagePattern
2122
from .stream_info_entity import StreamInfoEntity
2223

@@ -32,6 +33,7 @@
3233
"ClientInfoEntity",
3334
"MentionEntity",
3435
"MessageEntity",
36+
"ProductInfoEntity",
3537
"SensitiveUsageEntity",
3638
"SensitiveUsage",
3739
"SensitiveUsagePattern",

packages/api/src/microsoft/teams/api/models/entity/entity.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .client_info_entity import ClientInfoEntity
1111
from .mention_entity import MentionEntity
1212
from .message_entity import MessageEntity
13+
from .product_info_entity import ProductInfoEntity
1314
from .sensitive_usage_entity import SensitiveUsageEntity
1415
from .stream_info_entity import StreamInfoEntity
1516

@@ -21,4 +22,5 @@
2122
StreamInfoEntity,
2223
CitationEntity,
2324
SensitiveUsageEntity,
25+
ProductInfoEntity,
2426
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the MIT License.
4+
"""
5+
6+
from typing import Literal
7+
8+
from ..custom_base_model import CustomBaseModel
9+
10+
11+
class ProductInfoEntity(CustomBaseModel):
12+
"""Product information entity"""
13+
14+
id: str
15+
"Product identifier (ex COPILOT)"
16+
17+
type: Literal["ProductInfo"] = "ProductInfo"
18+
"Type identifier for product info"

0 commit comments

Comments
 (0)