-
Notifications
You must be signed in to change notification settings - Fork 86
AgentApplication.AdaptiveCard support
#518
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
Merged
Rodrigo Brandão (rodrigobr-msft)
merged 11 commits into
main
from
users/robrandao/adaptive-cards
Aug 7, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4701807
First commit for AdaptiveCard support in AgentApplication
rodrigobr-msft 1a97d0e
Polish
rodrigobr-msft d10380c
Adding integration with AgentApplication
rodrigobr-msft dc140de
Tests and formatting
rodrigobr-msft 073917b
Another commit
rodrigobr-msft 33224ac
Adding cards sample
rodrigobr-msft 7feaa3d
Merge branch 'main' into users/robrandao/adaptive-cards
rodrigobr-msft 8e5888d
Updating changelog.md
rodrigobr-msft 14bfdd3
Update
rodrigobr-msft bf1b775
Merge branch 'main' into users/robrandao/adaptive-cards
rodrigobr-msft 8ce4b37
Merge branch 'main' into users/robrandao/adaptive-cards
rodrigobr-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
.../microsoft-agents-activity/microsoft_agents/activity/adaptive_card_search_invoke_value.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
|
|
||
| from .search_invoke_value import SearchInvokeValue | ||
|
|
||
|
|
||
| class AdaptiveCardSearchInvokeValue(SearchInvokeValue): | ||
| """ | ||
| :param dataset: The dataset for this adaptive card search value. | ||
| :type dataset: str | ||
| """ | ||
|
|
||
| dataset: str | None = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
libraries/microsoft-agents-activity/microsoft_agents/activity/search_invoke_options.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
|
|
||
| from .agents_model import AgentsModel | ||
|
|
||
|
|
||
| class SearchInvokeOptions(AgentsModel): | ||
| """Defines the query options in the 'SearchInvokeValue' for Invoke activity with name of 'application/search'. | ||
|
|
||
| :param skip: The number of items to skip in the search results. This is an integer that specifies how many items to skip in the search results. | ||
| :type skip: int | ||
| :param top: The maximum number of items to return in the search results. This is an integer that specifies the maximum number of items to return in the search results. | ||
| :type top: int | ||
| """ | ||
|
|
||
| skip: int | ||
| top: int |
21 changes: 21 additions & 0 deletions
21
libraries/microsoft-agents-activity/microsoft_agents/activity/search_invoke_value.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
|
|
||
| from .agents_model import AgentsModel | ||
| from .search_invoke_options import SearchInvokeOptions | ||
|
|
||
|
|
||
| class SearchInvokeValue(AgentsModel): | ||
| """Defines the structure that arrives in Activity.value for invoke activity with name of 'application/search'. | ||
|
|
||
| :param kind: The kind of search being performed. This is a string that is used to identify the type of search being performed. | ||
| :type kind: str | ||
| :param query_text: The text of the search query. This is a string that contains the text of the search query being performed. | ||
| :type query_text: str | ||
| :param query_options: The options for the search query. This is an object that contains the options for the search query being performed. | ||
| :type query_options: :class:`microsoft_agents.activity.search_invoke_options.SearchInvokeOptions` | ||
| """ | ||
|
|
||
| kind: str | ||
| query_text: str | ||
| query_options: SearchInvokeOptions | ||
|
rodrigobr-msft marked this conversation as resolved.
|
||
6 changes: 6 additions & 0 deletions
6
...microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/adaptive_card/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
|
|
||
| from .adaptive_card import AdaptiveCard | ||
|
|
||
| __all__ = ["AdaptiveCard"] |
46 changes: 46 additions & 0 deletions
46
...crosoft-agents-hosting-core/microsoft_agents/hosting/core/app/adaptive_card/_type_defs.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
|
|
||
| from typing import Awaitable, Protocol | ||
|
|
||
| from microsoft_agents.activity import ( | ||
| AdaptiveCardInvokeResponse, | ||
| AdaptiveCardInvokeValue, | ||
| ) | ||
|
|
||
| from microsoft_agents.hosting.core.turn_context import TurnContext | ||
| from microsoft_agents.hosting.core.app.state import TurnState | ||
|
|
||
| from .models import ( | ||
| AdaptiveCardSearchParams, | ||
| AdaptiveCardSearchResult, | ||
| Query, | ||
| ) | ||
|
|
||
|
|
||
| class ActionExecuteHandler(Protocol): | ||
| def __call__( | ||
| self, context: TurnContext, state: TurnState, data: object, / | ||
| ) -> Awaitable[AdaptiveCardInvokeResponse]: ... | ||
|
|
||
|
|
||
| class ActionExecuteValueHandler(Protocol): | ||
| def __call__( | ||
| self, context: TurnContext, state: TurnState, value: AdaptiveCardInvokeValue, / | ||
| ) -> Awaitable[AdaptiveCardInvokeResponse]: ... | ||
|
|
||
|
|
||
| class ActionSubmitHandler(Protocol): | ||
| def __call__( | ||
| self, context: TurnContext, state: TurnState, data: object, / | ||
| ) -> Awaitable[None]: ... | ||
|
|
||
|
|
||
| class SearchHandler(Protocol): | ||
| def __call__( | ||
| self, | ||
| context: TurnContext, | ||
| state: TurnState, | ||
| query: Query[AdaptiveCardSearchParams], | ||
| /, | ||
| ) -> Awaitable[list[AdaptiveCardSearchResult]]: ... |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.