-
Notifications
You must be signed in to change notification settings - Fork 20
Prompt Preview Support #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6842a78
1b142c4
807e990
1106f00
1511b56
ffe8249
caa74f6
2d024dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| """ | ||
| Copyright (c) Microsoft Corporation. All rights reserved. | ||
| Licensed under the MIT License. | ||
| """ | ||
|
|
||
| from typing import Literal | ||
|
|
||
| from microsoft_teams.common.experimental import experimental | ||
|
|
||
| from ..custom_base_model import CustomBaseModel | ||
|
|
||
|
|
||
| @experimental("ExperimentalTeamsTargeted") | ||
| class TargetedMessageInfoEntity(CustomBaseModel): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No preview marker on this class. For parity with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added experimental and preview markers.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A parallel
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added on MessageActivityInput with one-PP-per-message dedup and experimental decorator; the reactive flow delegates to it. |
||
| """Entity containing targeted message information for prompt preview. | ||
|
|
||
| .. warning:: Preview | ||
| This class is in preview and may change in the future. | ||
| Diagnostic: ExperimentalTeamsTargeted | ||
| """ | ||
|
|
||
| type: Literal["targetedMessageInfo"] = "targetedMessageInfo" | ||
| "Type identifier for targeted message info" | ||
|
|
||
| message_id: str | ||
| "The ID of the targeted message this activity is replying to" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| """ | ||
| Copyright (c) Microsoft Corporation. All rights reserved. | ||
| Licensed under the MIT License. | ||
| """ | ||
| # pyright: basic | ||
|
|
||
| import pytest | ||
| from microsoft_teams.api.models.entity.targeted_message_info_entity import TargetedMessageInfoEntity | ||
|
|
||
|
|
||
| @pytest.mark.unit | ||
| class TestTargetedMessageInfoEntity: | ||
| """Unit tests for TargetedMessageInfoEntity.""" | ||
|
|
||
| def test_default_type(self) -> None: | ||
| entity = TargetedMessageInfoEntity(message_id="1772129782775") | ||
| assert entity.type == "targetedMessageInfo" | ||
|
|
||
| def test_message_id(self) -> None: | ||
| entity = TargetedMessageInfoEntity(message_id="1772129782775") | ||
| assert entity.message_id == "1772129782775" | ||
|
|
||
| def test_serialization_camel_case(self) -> None: | ||
| entity = TargetedMessageInfoEntity(message_id="1772129782775") | ||
| data = entity.model_dump(by_alias=True, exclude_none=True) | ||
| assert data == { | ||
| "type": "targetedMessageInfo", | ||
| "messageId": "1772129782775", | ||
| } | ||
|
|
||
| def test_deserialization_camel_case(self) -> None: | ||
| entity = TargetedMessageInfoEntity.model_validate( | ||
| { | ||
| "type": "targetedMessageInfo", | ||
| "messageId": "1772129782775", | ||
| } | ||
| ) | ||
| assert entity.type == "targetedMessageInfo" | ||
| assert entity.message_id == "1772129782775" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testwas removed