├── .azdo └── ci-pr.yaml ├── .devcontainer └── devcontainer.json ├── .flake8 ├── .github └── workflows │ ├── codeql.yml │ └── python-package.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── SUPPORT.md ├── libraries ├── Authentication │ └── microsoft-agents-authentication-msal │ │ ├── microsoft │ │ └── agents │ │ │ └── authentication │ │ │ └── msal │ │ │ ├── __init__.py │ │ │ ├── msal_auth.py │ │ │ └── msal_connection_manager.py │ │ └── pyproject.toml ├── Builder │ └── microsoft-agents-builder │ │ ├── microsoft │ │ └── agents │ │ │ └── builder │ │ │ ├── __init__.py │ │ │ ├── activity_handler.py │ │ │ ├── agent.py │ │ │ ├── app │ │ │ ├── __init__.py │ │ │ ├── agent_application.py │ │ │ ├── app_error.py │ │ │ ├── app_options.py │ │ │ ├── input_file.py │ │ │ ├── oauth │ │ │ │ ├── __init__.py │ │ │ │ └── authorization.py │ │ │ ├── query.py │ │ │ ├── route.py │ │ │ ├── state │ │ │ │ ├── __init__.py │ │ │ │ ├── conversation_state.py │ │ │ │ ├── state.py │ │ │ │ ├── temp_state.py │ │ │ │ └── turn_state.py │ │ │ └── typing_indicator.py │ │ │ ├── card_factory.py │ │ │ ├── channel_adapter.py │ │ │ ├── channel_api_handler_protocol.py │ │ │ ├── channel_service_adapter.py │ │ │ ├── channel_service_client_factory_base.py │ │ │ ├── message_factory.py │ │ │ ├── middleware_set.py │ │ │ ├── oauth_flow.py │ │ │ ├── rest_channel_service_client_factory.py │ │ │ ├── state │ │ │ ├── __init__.py │ │ │ ├── agent_state.py │ │ │ ├── state_property_accessor.py │ │ │ └── user_state.py │ │ │ └── turn_context.py │ │ ├── pyproject.toml │ │ └── tests │ │ ├── __init__.py │ │ ├── test_activity_handler.py │ │ ├── test_agent_state.py │ │ ├── test_state.py │ │ ├── test_turn_context.py │ │ └── tools │ │ ├── testing_adapter.py │ │ ├── testing_flow.py │ │ └── testing_utility.py ├── Client │ ├── microsoft-agents-client │ │ ├── microsoft │ │ │ └── agents │ │ │ │ └── client │ │ │ │ ├── __init__.py │ │ │ │ ├── agent_conversation_reference.py │ │ │ │ ├── channel_factory_protocol.py │ │ │ │ ├── channel_host_protocol.py │ │ │ │ ├── channel_info_protocol.py │ │ │ │ ├── channel_protocol.py │ │ │ │ ├── channels_configuration.py │ │ │ │ ├── configuration_channel_host.py │ │ │ │ ├── conversation_constants.py │ │ │ │ ├── conversation_id_factory.py │ │ │ │ ├── conversation_id_factory_options.py │ │ │ │ ├── conversation_id_factory_protocol.py │ │ │ │ ├── http_agent_channel.py │ │ │ │ └── http_agent_channel_factory.py │ │ └── pyproject.toml │ ├── microsoft-agents-connector │ │ ├── microsoft │ │ │ └── agents │ │ │ │ └── connector │ │ │ │ ├── __init__.py │ │ │ │ ├── agent_sign_in_base.py │ │ │ │ ├── attachments_base.py │ │ │ │ ├── client │ │ │ │ ├── __init__.py │ │ │ │ ├── connector_client.py │ │ │ │ └── user_token_client.py │ │ │ │ ├── connector_client_base.py │ │ │ │ ├── conversations_base.py │ │ │ │ ├── get_product_info.py │ │ │ │ ├── teams │ │ │ │ ├── __init__.py │ │ │ │ └── teams_connector_client.py │ │ │ │ ├── user_token_base.py │ │ │ │ └── user_token_client_base.py │ │ └── pyproject.toml │ └── microsoft-agents-copilotstudio-client │ │ ├── microsoft │ │ └── agents │ │ │ └── copilotstudio │ │ │ └── client │ │ │ ├── __init__.py │ │ │ ├── agent_type.py │ │ │ ├── connection_settings.py │ │ │ ├── copilot_client.py │ │ │ ├── direct_to_engine_connection_settings_protocol.py │ │ │ ├── execute_turn_request.py │ │ │ ├── power_platform_cloud.py │ │ │ └── power_platform_environment.py │ │ └── pyproject.toml ├── Core │ ├── microsoft-agents-authorization │ │ ├── microsoft │ │ │ └── agents │ │ │ │ └── authorization │ │ │ │ ├── __init__.py │ │ │ │ ├── access_token_provider_base.py │ │ │ │ ├── agent_auth_configuration.py │ │ │ │ ├── anonymous_token_provider.py │ │ │ │ ├── auth_types.py │ │ │ │ ├── authentication_constants.py │ │ │ │ ├── claims_identity.py │ │ │ │ ├── connections.py │ │ │ │ └── jwt_token_validator.py │ │ └── pyproject.toml │ └── microsoft-agents-core │ │ ├── microsoft │ │ └── agents │ │ │ └── core │ │ │ ├── __init__.py │ │ │ ├── _load_configuration.py │ │ │ ├── channel_adapter_protocol.py │ │ │ ├── models │ │ │ ├── __init__.py │ │ │ ├── _type_aliases.py │ │ │ ├── action_types.py │ │ │ ├── activity.py │ │ │ ├── activity_event_names.py │ │ │ ├── activity_importance.py │ │ │ ├── activity_types.py │ │ │ ├── adaptive_card_invoke_action.py │ │ │ ├── adaptive_card_invoke_response.py │ │ │ ├── adaptive_card_invoke_value.py │ │ │ ├── agents_model.py │ │ │ ├── ai_entity.py │ │ │ ├── animation_card.py │ │ │ ├── attachment.py │ │ │ ├── attachment_data.py │ │ │ ├── attachment_info.py │ │ │ ├── attachment_layout_types.py │ │ │ ├── attachment_view.py │ │ │ ├── audio_card.py │ │ │ ├── basic_card.py │ │ │ ├── caller_id_constants.py │ │ │ ├── card_action.py │ │ │ ├── card_image.py │ │ │ ├── channel_account.py │ │ │ ├── channels.py │ │ │ ├── contact_relation_update_action_types.py │ │ │ ├── conversation_account.py │ │ │ ├── conversation_members.py │ │ │ ├── conversation_parameters.py │ │ │ ├── conversation_reference.py │ │ │ ├── conversation_resource_response.py │ │ │ ├── conversation_update_types.py │ │ │ ├── conversations_result.py │ │ │ ├── delivery_modes.py │ │ │ ├── end_of_conversation_codes.py │ │ │ ├── entity.py │ │ │ ├── error.py │ │ │ ├── error_response.py │ │ │ ├── expected_replies.py │ │ │ ├── fact.py │ │ │ ├── geo_coordinates.py │ │ │ ├── hero_card.py │ │ │ ├── inner_http_error.py │ │ │ ├── input_hints.py │ │ │ ├── installation_update_action_types.py │ │ │ ├── invoke_response.py │ │ │ ├── media_card.py │ │ │ ├── media_event_value.py │ │ │ ├── media_url.py │ │ │ ├── mention.py │ │ │ ├── message_reaction.py │ │ │ ├── message_reaction_types.py │ │ │ ├── message_update_types.py │ │ │ ├── oauth_card.py │ │ │ ├── paged_members_result.py │ │ │ ├── place.py │ │ │ ├── receipt_card.py │ │ │ ├── receipt_item.py │ │ │ ├── resource_response.py │ │ │ ├── role_types.py │ │ │ ├── semantic_action.py │ │ │ ├── semantic_actions_states.py │ │ │ ├── sign_in_constants.py │ │ │ ├── sign_in_resource.py │ │ │ ├── signin_card.py │ │ │ ├── suggested_actions.py │ │ │ ├── teams │ │ │ │ ├── __init__.py │ │ │ │ ├── app_based_link_query.py │ │ │ │ ├── batch_failed_entries_response.py │ │ │ │ ├── batch_failed_entry.py │ │ │ │ ├── batch_operation_response.py │ │ │ │ ├── batch_operation_state_response.py │ │ │ │ ├── bot_config_auth.py │ │ │ │ ├── cache_info.py │ │ │ │ ├── cancel_operation_response.py │ │ │ │ ├── channel_info.py │ │ │ │ ├── config_auth_response.py │ │ │ │ ├── config_response.py │ │ │ │ ├── config_response_base.py │ │ │ │ ├── config_task_response.py │ │ │ │ ├── conversation_list.py │ │ │ │ ├── file_consent_card.py │ │ │ │ ├── file_consent_card_response.py │ │ │ │ ├── file_download_info.py │ │ │ │ ├── file_info_card.py │ │ │ │ ├── file_upload_info.py │ │ │ │ ├── meeting_details.py │ │ │ │ ├── meeting_details_base.py │ │ │ │ ├── meeting_end_event_details.py │ │ │ │ ├── meeting_event_details.py │ │ │ │ ├── meeting_info.py │ │ │ │ ├── meeting_notification.py │ │ │ │ ├── meeting_notification_base.py │ │ │ │ ├── meeting_notification_channel_data.py │ │ │ │ ├── meeting_notification_recipient_failure_info.py │ │ │ │ ├── meeting_notification_response.py │ │ │ │ ├── meeting_participant_info.py │ │ │ │ ├── meeting_participants_event_details.py │ │ │ │ ├── meeting_stage_surface.py │ │ │ │ ├── meeting_start_event_details.py │ │ │ │ ├── meeting_tab_icon_surface.py │ │ │ │ ├── message_actions_payload.py │ │ │ │ ├── message_actions_payload_app.py │ │ │ │ ├── message_actions_payload_attachment.py │ │ │ │ ├── message_actions_payload_body.py │ │ │ │ ├── message_actions_payload_conversation.py │ │ │ │ ├── message_actions_payload_from.py │ │ │ │ ├── message_actions_payload_mention.py │ │ │ │ ├── message_actions_payload_reaction.py │ │ │ │ ├── message_actions_payload_user.py │ │ │ │ ├── messaging_extension_action.py │ │ │ │ ├── messaging_extension_action_response.py │ │ │ │ ├── messaging_extension_attachment.py │ │ │ │ ├── messaging_extension_parameter.py │ │ │ │ ├── messaging_extension_query.py │ │ │ │ ├── messaging_extension_query_options.py │ │ │ │ ├── messaging_extension_response.py │ │ │ │ ├── messaging_extension_result.py │ │ │ │ ├── messaging_extension_suggested_action.py │ │ │ │ ├── notification_info.py │ │ │ │ ├── o365_connector_card.py │ │ │ │ ├── o365_connector_card_action_base.py │ │ │ │ ├── o365_connector_card_action_card.py │ │ │ │ ├── o365_connector_card_action_query.py │ │ │ │ ├── o365_connector_card_date_input.py │ │ │ │ ├── o365_connector_card_fact.py │ │ │ │ ├── o365_connector_card_http_post.py │ │ │ │ ├── o365_connector_card_image.py │ │ │ │ ├── o365_connector_card_input_base.py │ │ │ │ ├── o365_connector_card_multichoice_input.py │ │ │ │ ├── o365_connector_card_multichoice_input_choice.py │ │ │ │ ├── o365_connector_card_open_uri.py │ │ │ │ ├── o365_connector_card_open_uri_target.py │ │ │ │ ├── o365_connector_card_section.py │ │ │ │ ├── o365_connector_card_text_input.py │ │ │ │ ├── o365_connector_card_view_action.py │ │ │ │ ├── on_behalf_of.py │ │ │ │ ├── read_receipt_info.py │ │ │ │ ├── signin_state_verification_query.py │ │ │ │ ├── surface.py │ │ │ │ ├── tab_context.py │ │ │ │ ├── tab_entity_context.py │ │ │ │ ├── tab_request.py │ │ │ │ ├── tab_response.py │ │ │ │ ├── tab_response_card.py │ │ │ │ ├── tab_response_cards.py │ │ │ │ ├── tab_response_payload.py │ │ │ │ ├── tab_submit.py │ │ │ │ ├── tab_submit_data.py │ │ │ │ ├── tab_suggested_actions.py │ │ │ │ ├── targeted_meeting_notification.py │ │ │ │ ├── targeted_meeting_notification_value.py │ │ │ │ ├── task_module_card_response.py │ │ │ │ ├── task_module_continue_response.py │ │ │ │ ├── task_module_message_response.py │ │ │ │ ├── task_module_request.py │ │ │ │ ├── task_module_request_context.py │ │ │ │ ├── task_module_response.py │ │ │ │ ├── task_module_response_base.py │ │ │ │ ├── task_module_task_info.py │ │ │ │ ├── team_details.py │ │ │ │ ├── team_info.py │ │ │ │ ├── teams_batch_operation_response.py │ │ │ │ ├── teams_channel_account.py │ │ │ │ ├── teams_channel_data.py │ │ │ │ ├── teams_channel_data_settings.py │ │ │ │ ├── teams_meeting_info.py │ │ │ │ ├── teams_meeting_member.py │ │ │ │ ├── teams_meeting_participant.py │ │ │ │ ├── teams_member.py │ │ │ │ ├── teams_paged_members_result.py │ │ │ │ ├── tenant_info.py │ │ │ │ └── user_meeting_details.py │ │ │ ├── text_format_types.py │ │ │ ├── text_highlight.py │ │ │ ├── thing.py │ │ │ ├── thumbnail_card.py │ │ │ ├── thumbnail_url.py │ │ │ ├── token_exchange_invoke_request.py │ │ │ ├── token_exchange_invoke_response.py │ │ │ ├── token_exchange_resource.py │ │ │ ├── token_exchange_state.py │ │ │ ├── token_post_resource.py │ │ │ ├── token_request.py │ │ │ ├── token_response.py │ │ │ ├── token_status.py │ │ │ ├── transcript.py │ │ │ └── video_card.py │ │ │ └── turn_context_protocol.py │ │ ├── pyproject.toml │ │ └── tests │ │ └── test_activity_types.py ├── Hosting │ ├── microsoft-agents-hosting-aiohttp │ │ ├── microsoft │ │ │ └── agents │ │ │ │ └── hosting │ │ │ │ └── aiohttp │ │ │ │ ├── __init__.py │ │ │ │ ├── _start_agent_process.py │ │ │ │ ├── agent_http_adapter.py │ │ │ │ ├── app │ │ │ │ ├── __init__.py │ │ │ │ └── streaming │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── citation.py │ │ │ │ │ ├── citation_util.py │ │ │ │ │ └── streaming_response.py │ │ │ │ ├── channel_service_route_table.py │ │ │ │ ├── cloud_adapter.py │ │ │ │ └── jwt_authorization_middleware.py │ │ └── pyproject.toml │ └── microsoft-agents-hosting-teams │ │ ├── microsoft │ │ └── agents │ │ │ └── hosting │ │ │ └── teams │ │ │ ├── __init__.py │ │ │ ├── teams_activity_handler.py │ │ │ ├── teams_cloud_adapter.py │ │ │ └── teams_info.py │ │ └── pyproject.toml └── Storage │ ├── microsoft-agents-blob │ ├── microsoft │ │ └── agents │ │ │ └── blob │ │ │ ├── __init__.py │ │ │ ├── blob_storage.py │ │ │ └── blob_storage_config.py │ ├── pyproject.toml │ └── tests │ │ └── test_blob_storage.py │ └── microsoft-agents-storage │ ├── microsoft │ └── agents │ │ └── storage │ │ ├── __init__.py │ │ ├── _type_aliases.py │ │ ├── error_handling.py │ │ ├── memory_storage.py │ │ ├── storage.py │ │ ├── storage_test_utils.py │ │ └── store_item.py │ ├── pyproject.toml │ └── tests │ ├── test_error_handling.py │ ├── test_memory_storage.py │ └── test_utils.py └── test_samples ├── README.md ├── agent_to_agent ├── agent_1 │ ├── agent1.py │ ├── app.py │ ├── config.py │ └── env.TEMPLATE └── agent_2 │ ├── agent2.py │ ├── app.py │ ├── config.py │ └── env.TEMPLATE ├── app_style ├── authorization_agent.py ├── auto_auth.py ├── emtpy_agent.py ├── env.TEMPLATE ├── mcs_agent.py ├── shared │ ├── __init__.py │ ├── github_api_client.py │ ├── start_server.py │ └── user_graph_client.py └── streaming_agent.py ├── copilot_studio_client_sample ├── app.py ├── chat_console_service.py ├── config.py ├── env.TEMPLATE └── msal_cache_plugin.py ├── empty_agent ├── README.md ├── app.py ├── config.py ├── empty_agent.py ├── env.TEMPLATE └── requirements.txt ├── teams_agent ├── app.py ├── cards │ ├── AdaptiveCard.json │ ├── AdaptiveCard_TaskModule.json │ ├── RestaurantCard.json │ └── UserProfileCard.json ├── config.py ├── env.TEMPLATE ├── graph_client.py ├── helpers │ ├── task_module_ids.py │ ├── task_module_response_factory.py │ ├── task_module_ui_constants.py │ └── ui_settings.py ├── pages │ ├── customForm.html │ └── youtube.html ├── teams_handler.py ├── teams_multi_feature.py └── teams_sso.py └── weather-agent-open-ai ├── app.py ├── config.py ├── env.TEMPLATE ├── requirements.txt ├── tools ├── date_time_tool.py └── get_weather_tool.py └── weather_agent.py /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "image": "mcr.microsoft.com/devcontainers/universal:2", 3 | "features": { 4 | "ghcr.io/roul/devcontainer-features/mise-python:1": { 5 | "version": "4.0" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 127 3 | max-complexity = 10 4 | per-file-ignores = 5 | libraries/Core/Protocols/microsoft-agents-protocols/microsoft/agents/protocols/connector/*: C901, E722 6 | exclude = 7 | migrations 8 | __pycache__ 9 | manage.py 10 | settings.py 11 | env 12 | .env 13 | venv 14 | .venv -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # TODO: The maintainer of this repo has not yet edited this file 2 | 3 | **REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project? 4 | 5 | - **No CSS support:** Fill out this template with information about how to file issues and get help. 6 | - **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps. 7 | - **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide. 8 | 9 | *Then remove this first heading from this SUPPORT.MD file before publishing your repo.* 10 | 11 | # Support 12 | 13 | ## How to file issues and get help 14 | 15 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing 16 | issues before filing new issues to avoid duplicates. For new issues, file your bug or 17 | feature request as a new Issue. 18 | 19 | For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE 20 | FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER 21 | CHANNEL. WHERE WILL YOU HELP PEOPLE?**. 22 | 23 | ## Microsoft Support Policy 24 | 25 | Support for this **PROJECT or PRODUCT** is limited to the resources listed above. 26 | -------------------------------------------------------------------------------- /libraries/Authentication/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/__init__.py: -------------------------------------------------------------------------------- 1 | from .msal_auth import MsalAuth 2 | from .msal_connection_manager import MsalConnectionManager 3 | 4 | __all__ = [ 5 | "MsalAuth", 6 | "MsalConnectionManager", 7 | ] 8 | -------------------------------------------------------------------------------- /libraries/Authentication/microsoft-agents-authentication-msal/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-authentication-msal" 7 | version = "0.0.0a1" 8 | description = "A msal-based authentication library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "microsoft-agents-authorization", 18 | "msal>=1.31.1", 19 | "requests>=2.32.3", 20 | "cryptography>=44.0.0", 21 | ] 22 | 23 | [project.urls] 24 | "Homepage" = "https://github.com/microsoft/microsoft-agents-protocol" 25 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/__init__.py: -------------------------------------------------------------------------------- 1 | # Import necessary modules 2 | from .activity_handler import ActivityHandler 3 | from .agent import Agent 4 | from .oauth_flow import OAuthFlow 5 | from .card_factory import CardFactory 6 | from .channel_adapter import ChannelAdapter 7 | from .channel_api_handler_protocol import ChannelApiHandlerProtocol 8 | from .channel_service_adapter import ChannelServiceAdapter 9 | from .channel_service_client_factory_base import ChannelServiceClientFactoryBase 10 | from .message_factory import MessageFactory 11 | from .middleware_set import Middleware 12 | from .rest_channel_service_client_factory import RestChannelServiceClientFactory 13 | from .turn_context import TurnContext 14 | 15 | # Define the package's public interface 16 | __all__ = [ 17 | "ActivityHandler", 18 | "Agent", 19 | "OAuthFlow", 20 | "CardFactory", 21 | "ChannelAdapter", 22 | "ChannelApiHandlerProtocol", 23 | "ChannelServiceAdapter", 24 | "ChannelServiceClientFactoryBase", 25 | "MessageFactory", 26 | "Middleware", 27 | "RestChannelServiceClientFactory", 28 | "TurnContext", 29 | ] 30 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/agent.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from abc import abstractmethod 5 | from typing import Protocol 6 | 7 | from .turn_context import TurnContext 8 | 9 | 10 | class Agent(Protocol): 11 | """ 12 | Represents an agent that can operate on incoming activities. 13 | """ 14 | 15 | @abstractmethod 16 | async def on_turn(self, context: TurnContext): 17 | """ 18 | When implemented in an agent, handles an incoming activity. 19 | :param context: The context object for this turn. 20 | :return: 21 | """ 22 | raise NotImplementedError() 23 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/app/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the MIT License. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | from .agent_application import AgentApplication 9 | from .app_error import ApplicationError 10 | from .app_options import ApplicationOptions 11 | from .input_file import InputFile, InputFileDownloader 12 | from .query import Query 13 | from .route import Route, RouteHandler 14 | from .typing_indicator import TypingIndicator 15 | from .state.conversation_state import ConversationState 16 | from .state.state import State, StatePropertyAccessor, state 17 | from .state.temp_state import TempState 18 | from .state.turn_state import TurnState 19 | 20 | __all__ = [ 21 | "ActivityType", 22 | "AgentApplication", 23 | "ApplicationError", 24 | "ApplicationOptions", 25 | "ConversationUpdateType", 26 | "InputFile", 27 | "InputFileDownloader", 28 | "MessageReactionType", 29 | "MessageUpdateType", 30 | "Query", 31 | "Route", 32 | "RouteHandler", 33 | "TypingIndicator", 34 | "StatePropertyAccessor", 35 | "ConversationState", 36 | "state", 37 | "State", 38 | "StatePropertyAccessor", 39 | "TurnState", 40 | "TempState", 41 | ] 42 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/app/app_error.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the MIT License. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | 9 | class ApplicationError(Exception): 10 | """ 11 | Teams AgentApplication Error 12 | """ 13 | 14 | def __init__(self, message: str) -> None: 15 | super().__init__(message) 16 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/app/input_file.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the MIT License. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | from abc import ABC, abstractmethod 9 | from dataclasses import dataclass 10 | from typing import List, Optional 11 | 12 | from .. import TurnContext 13 | 14 | 15 | @dataclass 16 | class InputFile: 17 | """A file sent by the user to the bot. 18 | 19 | Attributes: 20 | content (bytes): The downloaded content of the file. 21 | content_type (str): The content type of the file. 22 | content_url (Optional[str]): Optional. URL to the content of the file. 23 | """ 24 | 25 | content: bytes 26 | content_type: str 27 | content_url: Optional[str] 28 | 29 | 30 | class InputFileDownloader(ABC): 31 | """ 32 | A plugin responsible for downloading files relative to the current user's input. 33 | """ 34 | 35 | @abstractmethod 36 | async def download_files(self, context: TurnContext) -> List[InputFile]: 37 | """ 38 | Download any files relative to the current user's input. 39 | 40 | Args: 41 | context (TurnContext): Context for the current turn of conversation. 42 | 43 | Returns: 44 | List[InputFile]: A list of input files. 45 | """ 46 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/app/oauth/__init__.py: -------------------------------------------------------------------------------- 1 | from .authorization import ( 2 | Authorization, 3 | AuthorizationHandlers, 4 | AuthHandler, 5 | SignInState, 6 | ) 7 | 8 | __all__ = ["Authorization", "AuthorizationHandlers", "AuthHandler", "SignInState"] 9 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/app/query.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the MIT License. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | from dataclasses import dataclass 9 | from typing import Generic, TypeVar 10 | 11 | ParamT = TypeVar("ParamT") 12 | 13 | 14 | @dataclass 15 | class Query(Generic[ParamT]): 16 | count: int 17 | skip: int 18 | parameters: ParamT 19 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/app/route.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the MIT License. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | from typing import Awaitable, Callable, Generic, List, TypeVar 9 | 10 | from .. import TurnContext 11 | from .state import TurnState 12 | 13 | StateT = TypeVar("StateT", bound=TurnState) 14 | RouteHandler = Callable[[TurnContext, StateT], Awaitable[None]] 15 | 16 | 17 | class Route(Generic[StateT]): 18 | selector: Callable[[TurnContext], bool] 19 | handler: RouteHandler[StateT] 20 | is_invoke: bool 21 | 22 | def __init__( 23 | self, 24 | selector: Callable[[TurnContext], bool], 25 | handler: RouteHandler, 26 | is_invoke: bool = False, 27 | auth_handlers: List[str] = None, 28 | ) -> None: 29 | self.selector = selector 30 | self.handler = handler 31 | self.is_invoke = is_invoke 32 | self.auth_handlers = auth_handlers or [] 33 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/app/state/__init__.py: -------------------------------------------------------------------------------- 1 | from .conversation_state import ConversationState 2 | from .state import State, StatePropertyAccessor, state 3 | from .temp_state import TempState 4 | from .turn_state import TurnState 5 | 6 | __all__ = [ 7 | "StatePropertyAccessor", 8 | "ConversationState", 9 | "state", 10 | "State", 11 | "StatePropertyAccessor", 12 | "TurnState", 13 | "TempState", 14 | ] 15 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/app/state/conversation_state.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the MIT License. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | from typing import Type 9 | 10 | from microsoft.agents.storage import Storage, StoreItem 11 | 12 | from microsoft.agents.builder.turn_context import TurnContext 13 | from microsoft.agents.builder.state import AgentState 14 | 15 | 16 | class ConversationState(AgentState): 17 | """ 18 | Default Conversation State 19 | """ 20 | 21 | CONTEXT_SERVICE_KEY = "ConversationState" 22 | 23 | def __init__(self, storage: Storage) -> None: 24 | """ 25 | Initialize ConversationState with a key and optional properties. 26 | 27 | param storage: Storage instance to use for state management. 28 | type storage: Storage 29 | """ 30 | super().__init__(storage=storage, context_service_key=self.CONTEXT_SERVICE_KEY) 31 | 32 | def get_storage_key( 33 | self, turn_context: TurnContext, *, target_cls: Type[StoreItem] = None 34 | ): 35 | channel_id = turn_context.activity.channel_id 36 | if not channel_id: 37 | raise ValueError("Invalid activity: missing channel_id.") 38 | 39 | conversation_id = turn_context.activity.conversation.id 40 | if not conversation_id: 41 | raise ValueError("Invalid activity: missing conversation_id.") 42 | 43 | return f"{channel_id}/conversations/{conversation_id}" 44 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/app/typing_indicator.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the MIT License. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | from threading import Timer 9 | from typing import Optional 10 | 11 | from .. import TurnContext 12 | from microsoft.agents.core.models import Activity, ActivityTypes 13 | 14 | 15 | class TypingIndicator: 16 | """ 17 | Encapsulates the logic for sending "typing" activity to the user. 18 | """ 19 | 20 | _interval: int 21 | _timer: Optional[Timer] = None 22 | 23 | def __init__(self, interval=1000) -> None: 24 | self._interval = interval 25 | 26 | async def start(self, context: TurnContext) -> None: 27 | if self._timer is not None: 28 | return 29 | 30 | func = self._on_timer(context) 31 | self._timer = Timer(self._interval, func) 32 | self._timer.start() 33 | await func() 34 | 35 | def stop(self) -> None: 36 | if self._timer: 37 | self._timer.cancel() 38 | self._timer = None 39 | 40 | def _on_timer(self, context: TurnContext): 41 | async def __call__(): 42 | try: 43 | await context.send_activity(Activity(type=ActivityTypes.typing)) 44 | except Exception as e: 45 | # TODO: Improve when adding logging 46 | print(f"Error sending typing activity: {e}") 47 | self.stop() 48 | 49 | return __call__ 50 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/state/__init__.py: -------------------------------------------------------------------------------- 1 | from .agent_state import AgentState 2 | from .state_property_accessor import StatePropertyAccessor 3 | from .user_state import UserState 4 | 5 | __all__ = [ 6 | "AgentState", 7 | "StatePropertyAccessor", 8 | "UserState", 9 | ] 10 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-builder" 7 | version = "0.0.0a1" 8 | description = "A protocol library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "microsoft-agents-connector", 18 | "microsoft-agents-core", 19 | "python-dotenv>=1.1.1", 20 | ] 21 | 22 | [project.urls] 23 | "Homepage" = "https://github.com/microsoft/microsoft-agents-protocol" 24 | -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Agents-for-python/b367489e023e2c734d93da01098ae138bc16ee5b/libraries/Builder/microsoft-agents-builder/tests/__init__.py -------------------------------------------------------------------------------- /libraries/Builder/microsoft-agents-builder/tests/tools/testing_utility.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .testing_adapter import TestingAdapter 5 | from microsoft.agents.core.models import ( 6 | Activity, 7 | ActivityTypes, 8 | ConversationAccount, 9 | ChannelAccount, 10 | ) 11 | from microsoft.agents.builder import TurnContext 12 | 13 | 14 | class TestingUtility: 15 | """Utility methods for testing Microsoft Agents.""" 16 | 17 | @staticmethod 18 | def create_empty_context(): 19 | """ 20 | Creates an empty turn context for testing. 21 | 22 | Returns: 23 | TurnContext: A turn context with minimal configuration for testing. 24 | """ 25 | adapter = TestingAdapter() 26 | activity = Activity( 27 | type=ActivityTypes.message, 28 | channel_id="EmptyContext", 29 | conversation=ConversationAccount( 30 | id="test", 31 | ), 32 | from_property=ChannelAccount( 33 | id="empty@empty.context.org", 34 | ), 35 | ) 36 | 37 | context = TurnContext(adapter, activity) 38 | 39 | return context 40 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/__init__.py: -------------------------------------------------------------------------------- 1 | from .agent_conversation_reference import AgentConversationReference 2 | from .channel_factory_protocol import ChannelFactoryProtocol 3 | from .channel_host_protocol import ChannelHostProtocol 4 | from .channel_info_protocol import ChannelInfoProtocol 5 | from .channel_protocol import ChannelProtocol 6 | from .channels_configuration import ( 7 | ChannelsConfiguration, 8 | ChannelHostConfiguration, 9 | ChannelInfo, 10 | ) 11 | from .configuration_channel_host import ConfigurationChannelHost 12 | from .conversation_constants import ConversationConstants 13 | from .conversation_id_factory_options import ConversationIdFactoryOptions 14 | from .conversation_id_factory_protocol import ConversationIdFactoryProtocol 15 | from .conversation_id_factory import ConversationIdFactory 16 | from .http_agent_channel_factory import HttpAgentChannelFactory 17 | from .http_agent_channel import HttpAgentChannel 18 | 19 | __all__ = [ 20 | "AgentConversationReference", 21 | "ChannelFactoryProtocol", 22 | "ChannelHostProtocol", 23 | "ChannelInfoProtocol", 24 | "ChannelProtocol", 25 | "ChannelsConfiguration", 26 | "ChannelHostConfiguration", 27 | "ChannelInfo", 28 | "ConfigurationChannelHost", 29 | "ConversationConstants", 30 | "ConversationIdFactoryOptions", 31 | "ConversationIdFactoryProtocol", 32 | "ConversationIdFactory", 33 | "HttpAgentChannelFactory", 34 | "HttpAgentChannel", 35 | ] 36 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/agent_conversation_reference.py: -------------------------------------------------------------------------------- 1 | from microsoft.agents.core.models import AgentsModel, ConversationReference 2 | 3 | 4 | class AgentConversationReference(AgentsModel): 5 | conversation_reference: ConversationReference 6 | oauth_scope: str 7 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/channel_factory_protocol.py: -------------------------------------------------------------------------------- 1 | from typing import Protocol 2 | 3 | from microsoft.agents.authorization import AccessTokenProviderBase 4 | 5 | from .channel_protocol import ChannelProtocol 6 | 7 | 8 | class ChannelFactoryProtocol(Protocol): 9 | def create_channel(self, token_access: AccessTokenProviderBase) -> ChannelProtocol: 10 | pass 11 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/channel_host_protocol.py: -------------------------------------------------------------------------------- 1 | from typing import Protocol 2 | 3 | from .channel_protocol import ChannelProtocol 4 | from .channel_info_protocol import ChannelInfoProtocol 5 | 6 | 7 | class ChannelHostProtocol(Protocol): 8 | def __init__( 9 | self, 10 | host_endpoint: str, 11 | host_app_id: str, 12 | channels: dict[str, ChannelInfoProtocol], 13 | ): 14 | self.host_endpoint = host_endpoint 15 | self.host_app_id = host_app_id 16 | self.channels = channels 17 | 18 | def get_channel_from_channel_info( 19 | self, channel_info: ChannelInfoProtocol 20 | ) -> ChannelProtocol: 21 | raise NotImplementedError() 22 | 23 | def get_channel_from_name(self, name: str) -> ChannelProtocol: 24 | raise NotImplementedError() 25 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/channel_info_protocol.py: -------------------------------------------------------------------------------- 1 | from typing import Protocol 2 | 3 | 4 | class ChannelInfoProtocol(Protocol): 5 | id: str 6 | app_id: str 7 | resource_url: str 8 | token_provider: str 9 | channel_factory: str 10 | endpoint: str 11 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/channel_protocol.py: -------------------------------------------------------------------------------- 1 | from typing import Protocol 2 | 3 | from microsoft.agents.core.models import AgentsModel, Activity, InvokeResponse 4 | 5 | 6 | class ChannelProtocol(Protocol): 7 | async def post_activity( 8 | self, 9 | to_agent_id: str, 10 | to_agent_resource: str, 11 | endpoint: str, 12 | service_url: str, 13 | conversation_id: str, 14 | activity: Activity, 15 | *, 16 | response_body_type: type[AgentsModel] = None, 17 | **kwargs, 18 | ) -> InvokeResponse: 19 | raise NotImplementedError() 20 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/channels_configuration.py: -------------------------------------------------------------------------------- 1 | from typing import Protocol 2 | 3 | from .channel_info_protocol import ChannelInfoProtocol 4 | 5 | 6 | class ChannelInfo(ChannelInfoProtocol): 7 | 8 | def __init__( 9 | self, 10 | id: str = None, 11 | app_id: str = None, 12 | resource_url: str = None, 13 | token_provider: str = None, 14 | channel_factory: str = None, 15 | endpoint: str = None, 16 | **kwargs 17 | ): 18 | self.id = id 19 | self.app_id = app_id 20 | self.resource_url = resource_url 21 | self.token_provider = token_provider 22 | self.channel_factory = channel_factory 23 | self.endpoint = endpoint 24 | 25 | 26 | class ChannelHostConfiguration: 27 | def __init__( 28 | self, CHANNELS: list[ChannelInfoProtocol], HOST_ENDPOINT: str, HOST_APP_ID: str 29 | ): 30 | self.CHANNELS = CHANNELS 31 | self.HOST_ENDPOINT = HOST_ENDPOINT 32 | self.HOST_APP_ID = HOST_APP_ID 33 | 34 | 35 | class ChannelsConfiguration(Protocol): 36 | 37 | @staticmethod 38 | def CHANNEL_HOST_CONFIGURATION() -> ChannelHostConfiguration: 39 | pass 40 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/conversation_constants.py: -------------------------------------------------------------------------------- 1 | from abc import ABC 2 | 3 | 4 | class ConversationConstants(ABC): 5 | CONVERSATION_ID_HTTP_HEADER_NAME = "x-ms-conversation-id" 6 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/conversation_id_factory_options.py: -------------------------------------------------------------------------------- 1 | from microsoft.agents.core.models import Activity 2 | 3 | from .channel_info_protocol import ChannelInfoProtocol 4 | 5 | 6 | class ConversationIdFactoryOptions: 7 | def __init__( 8 | self, 9 | from_oauth_scope: str, 10 | from_agent_id: str, 11 | activity: Activity, 12 | agent: ChannelInfoProtocol, 13 | ) -> None: 14 | self.from_oauth_scope = from_oauth_scope 15 | self.from_agent_id = from_agent_id 16 | # TODO: implement Activity and types as protocols and replace here 17 | self.activity = activity 18 | self.agent = agent 19 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/conversation_id_factory_protocol.py: -------------------------------------------------------------------------------- 1 | from typing import Protocol 2 | from abc import abstractmethod 3 | 4 | from .agent_conversation_reference import AgentConversationReference 5 | from .conversation_id_factory_options import ConversationIdFactoryOptions 6 | 7 | 8 | class ConversationIdFactoryProtocol(Protocol): 9 | @abstractmethod 10 | async def create_conversation_id( 11 | self, options: ConversationIdFactoryOptions 12 | ) -> str: 13 | """ 14 | Creates a conversation ID for an agent conversation. 15 | :param options: A ConversationIdFactoryOptions instance. 16 | :return: A unique conversation ID. 17 | """ 18 | 19 | @abstractmethod 20 | async def get_agent_conversation_reference( 21 | self, agent_conversation_id: str 22 | ) -> AgentConversationReference: 23 | """ 24 | Gets the AgentConversationReference for a conversation ID. 25 | :param agent_conversation_id: An ID created with create_conversation_id. 26 | :return: AgentConversationReference or None if not found. 27 | """ 28 | 29 | @abstractmethod 30 | async def delete_conversation_reference(self, agent_conversation_id: str) -> None: 31 | """ 32 | Deletes an agent conversation reference. 33 | :param agent_conversation_id: A conversation ID created with create_conversation_id. 34 | """ 35 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/microsoft/agents/client/http_agent_channel_factory.py: -------------------------------------------------------------------------------- 1 | from microsoft.agents.authorization import AccessTokenProviderBase 2 | 3 | from .channel_factory_protocol import ChannelFactoryProtocol 4 | from .channel_protocol import ChannelProtocol 5 | from .http_agent_channel import HttpAgentChannel 6 | 7 | 8 | class HttpAgentChannelFactory(ChannelFactoryProtocol): 9 | def create_channel(self, token_access: AccessTokenProviderBase) -> ChannelProtocol: 10 | return HttpAgentChannel(token_access) 11 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-client/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-client" 7 | version = "0.0.0a1" 8 | description = "A client library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "microsoft-agents-core", 18 | "microsoft-agents-authorization", 19 | ] 20 | 21 | [project.urls] 22 | "Homepage" = "https://github.com/microsoft/microsoft-agents-protocol" 23 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/microsoft/agents/connector/__init__.py: -------------------------------------------------------------------------------- 1 | from .user_token_client_base import UserTokenClientBase 2 | from .connector_client_base import ConnectorClientBase 3 | from .client.connector_client import ConnectorClient 4 | from .client.user_token_client import UserTokenClient 5 | from .get_product_info import get_product_info 6 | 7 | __all__ = [ 8 | "ConnectorClient", 9 | "UserTokenClient", 10 | "UserTokenClientBase", 11 | "ConnectorClientBase", 12 | "get_product_info", 13 | ] 14 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/microsoft/agents/connector/agent_sign_in_base.py: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod 2 | from typing import Protocol 3 | 4 | from microsoft.agents.core.models import SignInResource 5 | 6 | 7 | class AgentSignInBase(Protocol): 8 | @abstractmethod 9 | async def get_sign_in_url( 10 | self, 11 | state: str, 12 | code_challenge: str = None, 13 | emulator_url: str = None, 14 | final_redirect: str = None, 15 | ) -> str: 16 | raise NotImplementedError() 17 | 18 | @abstractmethod 19 | async def get_sign_in_resource( 20 | self, 21 | state: str, 22 | code_challenge: str = None, 23 | emulator_url: str = None, 24 | final_redirect: str = None, 25 | ) -> SignInResource: 26 | raise NotImplementedError() 27 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/microsoft/agents/connector/attachments_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from abc import abstractmethod 5 | from typing import AsyncIterator, Optional, Protocol 6 | 7 | from microsoft.agents.core.models import AttachmentInfo 8 | 9 | 10 | class AttachmentsBase(Protocol): 11 | @abstractmethod 12 | async def get_attachment_info(self, attachment_id: str) -> AttachmentInfo: 13 | raise NotImplementedError() 14 | 15 | @abstractmethod 16 | async def get_attachment(self) -> Optional[AsyncIterator[bytes]]: 17 | pass 18 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/microsoft/agents/connector/client/__init__.py: -------------------------------------------------------------------------------- 1 | from .connector_client import ConnectorClient 2 | from .user_token_client import UserTokenClient 3 | 4 | __all__ = ["ConnectorClient", "UserTokenClient"] 5 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/microsoft/agents/connector/connector_client_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from abc import abstractmethod 5 | from typing import Protocol 6 | 7 | from .attachments_base import AttachmentsBase 8 | from .conversations_base import ConversationsBase 9 | 10 | 11 | class ConnectorClientBase(Protocol): 12 | @property 13 | @abstractmethod 14 | def base_uri(self) -> str: 15 | raise NotImplementedError() 16 | 17 | @property 18 | @abstractmethod 19 | def attachments(self) -> AttachmentsBase: 20 | pass 21 | 22 | @property 23 | @abstractmethod 24 | def conversations(self) -> ConversationsBase: 25 | pass 26 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/microsoft/agents/connector/get_product_info.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import importlib.metadata 4 | 5 | 6 | def get_product_info() -> str: 7 | """ 8 | Generates a string containing information about the SDK version and runtime environment. 9 | This is used for telemetry and User-Agent headers in HTTP requests. 10 | 11 | Returns: 12 | A formatted string containing the SDK version, Python version, and OS details 13 | """ 14 | try: 15 | # Try to get package version from metadata 16 | sdk_version = importlib.metadata.version("microsoft-agents-connector") 17 | except importlib.metadata.PackageNotFoundError: 18 | # Fallback if package is not installed 19 | sdk_version = "unknown" 20 | 21 | python_version = sys.version.split()[0] 22 | platform = sys.platform 23 | architecture = os.uname().machine if hasattr(os, "uname") else "unknown" 24 | os_release = os.uname().release if hasattr(os, "uname") else "unknown" 25 | 26 | return f"agents-sdk-py/{sdk_version} python/{python_version} {platform}-{architecture}/{os_release}" 27 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/microsoft/agents/connector/teams/__init__.py: -------------------------------------------------------------------------------- 1 | from .teams_connector_client import TeamsConnectorClient 2 | 3 | __all__ = [ 4 | "TeamsConnectorClient", 5 | ] 6 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/microsoft/agents/connector/user_token_base.py: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod 2 | from typing import Protocol 3 | 4 | from microsoft.agents.core.models import TokenResponse, TokenStatus 5 | 6 | 7 | class UserTokenBase(Protocol): 8 | @abstractmethod 9 | async def get_token( 10 | self, 11 | user_id: str, 12 | connection_name: str, 13 | channel_id: str = None, 14 | code: str = None, 15 | ) -> TokenResponse: 16 | raise NotImplementedError() 17 | 18 | @abstractmethod 19 | async def get_aad_tokens( 20 | self, 21 | user_id: str, 22 | connection_name: str, 23 | channel_id: str = None, 24 | body: dict = None, 25 | ) -> dict[str, TokenResponse]: 26 | raise NotImplementedError() 27 | 28 | @abstractmethod 29 | async def sign_out( 30 | self, user_id: str, connection_name: str = None, channel_id: str = None 31 | ) -> None: 32 | raise NotImplementedError() 33 | 34 | @abstractmethod 35 | async def get_token_status( 36 | self, user_id: str, channel_id: str = None, include: str = None 37 | ) -> list[TokenStatus]: 38 | raise NotImplementedError() 39 | 40 | @abstractmethod 41 | async def exchange_token( 42 | self, user_id: str, connection_name: str, channel_id: str, body: dict = None 43 | ) -> TokenResponse: 44 | raise NotImplementedError() 45 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/microsoft/agents/connector/user_token_client_base.py: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod 2 | from typing import Protocol 3 | 4 | from .agent_sign_in_base import AgentSignInBase 5 | from .user_token_base import UserTokenBase 6 | 7 | 8 | class UserTokenClientBase(Protocol): 9 | @property 10 | @abstractmethod 11 | def agent_sign_in(self) -> AgentSignInBase: 12 | pass 13 | 14 | @property 15 | @abstractmethod 16 | def user_token(self) -> UserTokenBase: 17 | pass 18 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-connector/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-connector" 7 | version = "0.0.0a1" 8 | description = "A client library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "isodate>=0.6.1", 18 | "azure-core>=1.30.0", 19 | "microsoft-agents-core", 20 | "microsoft-agents-authorization", 21 | ] 22 | 23 | [project.urls] 24 | "Homepage" = "https://github.com/yourusername/microsoft-agents-client" 25 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/__init__.py: -------------------------------------------------------------------------------- 1 | from .agent_type import AgentType 2 | from .connection_settings import ConnectionSettings 3 | from .copilot_client import CopilotClient 4 | from .direct_to_engine_connection_settings_protocol import ( 5 | DirectToEngineConnectionSettingsProtocol, 6 | ) 7 | from .execute_turn_request import ExecuteTurnRequest 8 | from .power_platform_cloud import PowerPlatformCloud 9 | from .power_platform_environment import PowerPlatformEnvironment 10 | 11 | __all__ = [ 12 | "AgentType", 13 | "ConnectionSettings", 14 | "CopilotClient", 15 | "DirectToEngineConnectionSettingsProtocol", 16 | "ExecuteTurnRequest", 17 | "PowerPlatformCloud", 18 | "PowerPlatformEnvironment", 19 | ] 20 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/agent_type.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class AgentType(str, Enum): 5 | PUBLISHED = "published" 6 | PREBUILT = "prebuilt" 7 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/connection_settings.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | from .direct_to_engine_connection_settings_protocol import ( 3 | DirectToEngineConnectionSettingsProtocol, 4 | ) 5 | from .power_platform_cloud import PowerPlatformCloud 6 | from .agent_type import AgentType 7 | 8 | 9 | class ConnectionSettings(DirectToEngineConnectionSettingsProtocol): 10 | """ 11 | Connection settings for the DirectToEngineConnectionConfiguration. 12 | """ 13 | 14 | def __init__( 15 | self, 16 | environment_id: str, 17 | agent_identifier: str, 18 | cloud: Optional[PowerPlatformCloud], 19 | copilot_agent_type: Optional[AgentType], 20 | custom_power_platform_cloud: Optional[str], 21 | ) -> None: 22 | self.environment_id = environment_id 23 | self.agent_identifier = agent_identifier 24 | 25 | if not self.environment_id: 26 | raise ValueError("Environment ID must be provided") 27 | if not self.agent_identifier: 28 | raise ValueError("Agent Identifier must be provided") 29 | 30 | self.cloud = cloud or PowerPlatformCloud.UNKNOWN 31 | self.copilot_agent_type = copilot_agent_type or AgentType.PUBLISHED 32 | self.custom_power_platform_cloud = custom_power_platform_cloud 33 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/direct_to_engine_connection_settings_protocol.py: -------------------------------------------------------------------------------- 1 | from typing import Protocol, Optional 2 | 3 | from .agent_type import AgentType 4 | from .power_platform_cloud import PowerPlatformCloud 5 | 6 | 7 | class DirectToEngineConnectionSettingsProtocol(Protocol): 8 | """ 9 | Protocol for DirectToEngineConnectionConfiguration. 10 | """ 11 | 12 | # Schema name for the Copilot Studio Hosted Copilot. 13 | agent_identifier: Optional[str] 14 | 15 | # if PowerPlatformCloud is set to Other, this is the url for the power platform API endpoint. 16 | custom_power_platform_cloud: Optional[str] 17 | 18 | # Environment ID for the environment that hosts the agent 19 | environment_id: Optional[str] 20 | 21 | # Power Platform Cloud where the environment is hosted 22 | cloud: Optional[PowerPlatformCloud] 23 | 24 | # Type of Agent hosted in Copilot Studio 25 | copilot_agent_type: Optional[AgentType] 26 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/execute_turn_request.py: -------------------------------------------------------------------------------- 1 | from microsoft.agents.core.models import AgentsModel, Activity 2 | 3 | 4 | class ExecuteTurnRequest(AgentsModel): 5 | 6 | activity: Activity 7 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-copilotstudio-client/microsoft/agents/copilotstudio/client/power_platform_cloud.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class PowerPlatformCloud(str, Enum): 5 | """ 6 | Enum representing different Power Platform Clouds. 7 | """ 8 | 9 | UNKNOWN = "Unknown" 10 | EXP = "Exp" 11 | DEV = "Dev" 12 | TEST = "Test" 13 | PREPROD = "Preprod" 14 | FIRST_RELEASE = "FirstRelease" 15 | PROD = "Prod" 16 | GOV = "Gov" 17 | HIGH = "High" 18 | DOD = "DoD" 19 | MOONCAKE = "Mooncake" 20 | EX = "Ex" 21 | RX = "Rx" 22 | PRV = "Prv" 23 | LOCAL = "Local" 24 | GOV_FR = "GovFR" 25 | OTHER = "Other" 26 | -------------------------------------------------------------------------------- /libraries/Client/microsoft-agents-copilotstudio-client/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-copilotstudio-client" 7 | version = "0.0.0a1" 8 | description = "A client library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "microsoft-agents-core", 18 | ] 19 | 20 | [project.urls] 21 | "Homepage" = "https://github.com/yourusername/microsoft-agents-client" 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-authorization/microsoft/agents/authorization/__init__.py: -------------------------------------------------------------------------------- 1 | from .access_token_provider_base import AccessTokenProviderBase 2 | from .authentication_constants import AuthenticationConstants 3 | from .anonymous_token_provider import AnonymousTokenProvider 4 | from .connections import Connections 5 | from .agent_auth_configuration import AgentAuthConfiguration 6 | from .claims_identity import ClaimsIdentity 7 | from .jwt_token_validator import JwtTokenValidator 8 | 9 | __all__ = [ 10 | "AccessTokenProviderBase", 11 | "AuthenticationConstants", 12 | "AnonymousTokenProvider", 13 | "Connections", 14 | "AgentAuthConfiguration", 15 | "ClaimsIdentity", 16 | "JwtTokenValidator", 17 | ] 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-authorization/microsoft/agents/authorization/access_token_provider_base.py: -------------------------------------------------------------------------------- 1 | from typing import Protocol 2 | from abc import abstractmethod 3 | 4 | 5 | class AccessTokenProviderBase(Protocol): 6 | @abstractmethod 7 | async def get_access_token( 8 | self, resource_url: str, scopes: list[str], force_refresh: bool = False 9 | ) -> str: 10 | """ 11 | Used by Agents SDK to acquire access tokens for connection to agent services or clients. 12 | 13 | :param resource_url: The resource URL for which to get the token. 14 | :param scopes: The scopes for which to get the token. 15 | :param force_refresh: True to force a refresh of the token; or false to get the token only if it is necessary. 16 | :return: The access token as a string. 17 | """ 18 | pass 19 | 20 | async def aquire_token_on_behalf_of( 21 | self, scopes: list[str], user_assertion: str 22 | ) -> str: 23 | """ 24 | Acquire a token on behalf of a user. 25 | 26 | :param scopes: The scopes for which to get the token. 27 | :param user_assertion: The user assertion token. 28 | :return: The access token as a string. 29 | """ 30 | raise NotImplementedError() 31 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-authorization/microsoft/agents/authorization/anonymous_token_provider.py: -------------------------------------------------------------------------------- 1 | from .access_token_provider_base import AccessTokenProviderBase 2 | 3 | 4 | class AnonymousTokenProvider(AccessTokenProviderBase): 5 | """ 6 | A class that provides an anonymous token for authentication. 7 | This is used when no authentication is required. 8 | """ 9 | 10 | async def get_access_token( 11 | self, resource_url: str, scopes: list[str], force_refresh: bool = False 12 | ) -> str: 13 | return "" 14 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-authorization/microsoft/agents/authorization/auth_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class AuthTypes(str, Enum): 5 | certificate = "certificate" 6 | certificate_subject_name = "CertificateSubjectName" 7 | client_secret = "ClientSecret" 8 | user_managed_identity = "UserManagedIdentity" 9 | system_managed_identity = "SystemManagedIdentity" 10 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-authorization/microsoft/agents/authorization/connections.py: -------------------------------------------------------------------------------- 1 | from abc import abstractmethod 2 | from typing import Protocol 3 | 4 | from .agent_auth_configuration import AgentAuthConfiguration 5 | from .access_token_provider_base import AccessTokenProviderBase 6 | from .claims_identity import ClaimsIdentity 7 | 8 | 9 | class Connections(Protocol): 10 | 11 | @abstractmethod 12 | def get_connection(self, connection_name: str) -> AccessTokenProviderBase: 13 | """ 14 | Get the OAuth connection for the agent. 15 | """ 16 | raise NotImplementedError() 17 | 18 | @abstractmethod 19 | def get_default_connection(self) -> AccessTokenProviderBase: 20 | """ 21 | Get the default OAuth connection for the agent. 22 | """ 23 | raise NotImplementedError() 24 | 25 | @abstractmethod 26 | def get_token_provider( 27 | self, claims_identity: ClaimsIdentity, service_url: str 28 | ) -> AccessTokenProviderBase: 29 | """ 30 | Get the OAuth token provider for the agent. 31 | """ 32 | raise NotImplementedError() 33 | 34 | @abstractmethod 35 | def get_default_connection_configuration(self) -> AgentAuthConfiguration: 36 | """ 37 | Get the default connection configuration for the agent. 38 | """ 39 | raise NotImplementedError() 40 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-authorization/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-authorization" 7 | version = "0.0.0a1" 8 | description = "An authorization library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "pyjwt>=2.10.1" 18 | ] 19 | 20 | [project.urls] 21 | "Homepage" = "https://github.com/microsoft/microsoft-agents-protocol" 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/__init__.py: -------------------------------------------------------------------------------- 1 | from .channel_adapter_protocol import ChannelAdapterProtocol 2 | from .turn_context_protocol import TurnContextProtocol 3 | from ._load_configuration import load_configuration_from_env 4 | 5 | __all__ = [ 6 | "load_configuration_from_env", 7 | "ChannelAdapterProtocol", 8 | "TurnContextProtocol", 9 | ] 10 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/_load_configuration.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | def load_configuration_from_env(env_vars: Dict[str, Any]) -> dict: 5 | """ 6 | Parses environment variables and returns a dictionary with the relevant configuration. 7 | """ 8 | vars = env_vars.copy() 9 | result = {} 10 | for key, value in vars.items(): 11 | levels = key.split("__") 12 | current_level = result 13 | last_level = None 14 | for next_level in levels: 15 | if next_level not in current_level: 16 | current_level[next_level] = {} 17 | last_level = current_level 18 | current_level = current_level[next_level] 19 | last_level[levels[-1]] = value 20 | 21 | return { 22 | "AGENTAPPLICATION": result.get("AGENTAPPLICATION", {}), 23 | "CONNECTIONS": result.get("CONNECTIONS", {}), 24 | "CONNECTIONSMAP": result.get("CONNECTIONSMAP", {}), 25 | } 26 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/_type_aliases.py: -------------------------------------------------------------------------------- 1 | from typing import Annotated 2 | from pydantic import StringConstraints 3 | 4 | 5 | NonEmptyString = Annotated[str, StringConstraints(min_length=1)] 6 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/action_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class ActionTypes(str, Enum): 5 | open_url = "openUrl" 6 | im_back = "imBack" 7 | post_back = "postBack" 8 | play_audio = "playAudio" 9 | play_video = "playVideo" 10 | show_image = "showImage" 11 | download_file = "downloadFile" 12 | signin = "signin" 13 | call = "call" 14 | message_back = "messageBack" 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/activity_event_names.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class ActivityEventNames(str, Enum): 5 | continue_conversation = "ContinueConversation" 6 | create_conversation = "CreateConversation" 7 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/activity_importance.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class ActivityImportance(str, Enum): 5 | low = "low" 6 | normal = "normal" 7 | high = "high" 8 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/activity_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class ActivityTypes(str, Enum): 5 | message = "message" 6 | contact_relation_update = "contactRelationUpdate" 7 | conversation_update = "conversationUpdate" 8 | typing = "typing" 9 | end_of_conversation = "endOfConversation" 10 | event = "event" 11 | invoke = "invoke" 12 | invoke_response = "invokeResponse" 13 | delete_user_data = "deleteUserData" 14 | message_update = "messageUpdate" 15 | message_delete = "messageDelete" 16 | installation_update = "installationUpdate" 17 | message_reaction = "messageReaction" 18 | suggestion = "suggestion" 19 | trace = "trace" 20 | handoff = "handoff" 21 | command = "command" 22 | command_result = "commandResult" 23 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/adaptive_card_invoke_action.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class AdaptiveCardInvokeAction(AgentsModel): 6 | """AdaptiveCardInvokeAction. 7 | 8 | Defines the structure that arrives in the Activity.Value.Action for Invoke activity with 9 | name of 'adaptiveCard/action'. 10 | 11 | :param type: The Type of this Adaptive Card Invoke Action. 12 | :type type: str 13 | :param id: The Id of this Adaptive Card Invoke Action. 14 | :type id: str 15 | :param verb: The Verb of this Adaptive Card Invoke Action. 16 | :type verb: str 17 | :param data: The data of this Adaptive Card Invoke Action. 18 | :type data: dict[str, object] 19 | """ 20 | 21 | type: NonEmptyString = None 22 | id: NonEmptyString = None 23 | verb: NonEmptyString = None 24 | data: dict[NonEmptyString, object] = None 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/adaptive_card_invoke_response.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class AdaptiveCardInvokeResponse(AgentsModel): 6 | """AdaptiveCardInvokeResponse. 7 | 8 | Defines the structure that is returned as the result of an Invoke activity with Name of 'adaptiveCard/action'. 9 | 10 | :param status_code: The Card Action Response StatusCode. 11 | :type status_code: int 12 | :param type: The type of this Card Action Response. 13 | :type type: str 14 | :param value: The JSON response object. 15 | :type value: dict[str, object] 16 | """ 17 | 18 | status_code: int = None 19 | type: NonEmptyString = None 20 | value: dict[NonEmptyString, object] = None 21 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/adaptive_card_invoke_value.py: -------------------------------------------------------------------------------- 1 | from .adaptive_card_invoke_action import AdaptiveCardInvokeAction 2 | from .token_exchange_invoke_request import TokenExchangeInvokeRequest 3 | from .agents_model import AgentsModel 4 | from ._type_aliases import NonEmptyString 5 | 6 | 7 | class AdaptiveCardInvokeValue(AgentsModel): 8 | """AdaptiveCardInvokeResponse. 9 | 10 | Defines the structure that arrives in the Activity.Value for Invoke activity with Name of 'adaptiveCard/action'. 11 | 12 | :param action: The action of this adaptive card invoke action value. 13 | :type action: :class:`microsoft.agents.core.models.AdaptiveCardInvokeAction` 14 | :param authentication: The TokenExchangeInvokeRequest for this adaptive card invoke action value. 15 | :type authentication: :class:`microsoft.agents.core.models.TokenExchangeInvokeRequest` 16 | :param state: The 'state' or magic code for an OAuth flow. 17 | :type state: str 18 | """ 19 | 20 | action: AdaptiveCardInvokeAction = None 21 | authentication: TokenExchangeInvokeRequest = None 22 | state: NonEmptyString = None 23 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/agents_model.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseModel, ConfigDict 2 | from pydantic.alias_generators import to_camel 3 | 4 | 5 | class AgentsModel(BaseModel): 6 | model_config = ConfigDict(alias_generator=to_camel, populate_by_name=True) 7 | 8 | """ 9 | @model_serializer 10 | def _serialize(self): 11 | omit_if_empty = { 12 | k 13 | for k, v in self 14 | if isinstance(v, list) and not v 15 | } 16 | 17 | return {k: v for k, v in self if k not in omit_if_empty and v is not None} 18 | """ 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/attachment.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class Attachment(AgentsModel): 6 | """An attachment within an activity. 7 | 8 | :param content_type: mimetype/Contenttype for the file 9 | :type content_type: str 10 | :param content_url: Content Url 11 | :type content_url: str 12 | :param content: Embedded content 13 | :type content: object 14 | :param name: (OPTIONAL) The name of the attachment 15 | :type name: str 16 | :param thumbnail_url: (OPTIONAL) Thumbnail associated with attachment 17 | :type thumbnail_url: str 18 | """ 19 | 20 | content_type: NonEmptyString 21 | content_url: NonEmptyString = None 22 | content: object = None 23 | name: NonEmptyString = None 24 | thumbnail_url: NonEmptyString = None 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/attachment_data.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class AttachmentData(AgentsModel): 6 | """Attachment data. 7 | 8 | :param type: Content-Type of the attachment 9 | :type type: str 10 | :param name: Name of the attachment 11 | :type name: str 12 | :param original_base64: Attachment content 13 | :type original_base64: bytes 14 | :param thumbnail_base64: Attachment thumbnail 15 | :type thumbnail_base64: bytes 16 | """ 17 | 18 | type: NonEmptyString = None 19 | name: NonEmptyString = None 20 | original_base64: bytes = None 21 | thumbnail_base64: bytes = None 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/attachment_info.py: -------------------------------------------------------------------------------- 1 | from .attachment_view import AttachmentView 2 | from .agents_model import AgentsModel 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class AttachmentInfo(AgentsModel): 7 | """Metadata for an attachment. 8 | 9 | :param name: Name of the attachment 10 | :type name: str 11 | :param type: ContentType of the attachment 12 | :type type: str 13 | :param views: attachment views 14 | :type views: list[~microsoft.agents.protocols.models.AttachmentView] 15 | """ 16 | 17 | name: NonEmptyString = None 18 | type: NonEmptyString = None 19 | views: list[AttachmentView] = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/attachment_layout_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class AttachmentLayoutTypes(str, Enum): 5 | list = "list" 6 | carousel = "carousel" 7 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/attachment_view.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class AttachmentView(AgentsModel): 6 | """Attachment View name and size. 7 | 8 | :param view_id: Id of the attachment 9 | :type view_id: str 10 | :param size: Size of the attachment 11 | :type size: int 12 | """ 13 | 14 | view_id: NonEmptyString = None 15 | size: int = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/basic_card.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from .card_image import CardImage 3 | from .card_action import CardAction 4 | from ._type_aliases import NonEmptyString 5 | 6 | 7 | class BasicCard(AgentsModel): 8 | """A basic card. 9 | 10 | :param title: Title of the card 11 | :type title: str 12 | :param subtitle: Subtitle of the card 13 | :type subtitle: str 14 | :param text: Text for the card 15 | :type text: str 16 | :param images: Array of images for the card 17 | :type images: list[~microsoft.agents.protocols.models.CardImage] 18 | :param buttons: Set of actions applicable to the current card 19 | :type buttons: list[~microsoft.agents.protocols.models.CardAction] 20 | :param tap: This action will be activated when user taps on the card 21 | itself 22 | :type tap: ~microsoft.agents.protocols.models.CardAction 23 | """ 24 | 25 | title: NonEmptyString = None 26 | subtitle: NonEmptyString = None 27 | text: NonEmptyString = None 28 | images: list[CardImage] = None 29 | buttons: list[CardAction] = None 30 | tap: CardAction = None 31 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/caller_id_constants.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class CallerIdConstants(str, Enum): 5 | public_azure_channel = "urn:botframework:azure" 6 | us_gov_channel = "urn:botframework:azureusgov" 7 | agent_to_agent_prefix = "urn:botframework:aadappid:" 8 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/card_image.py: -------------------------------------------------------------------------------- 1 | from .card_action import CardAction 2 | from .agents_model import AgentsModel 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class CardImage(AgentsModel): 7 | """An image on a card. 8 | 9 | :param url: URL thumbnail image for major content property 10 | :type url: str 11 | :param alt: Image description intended for screen readers 12 | :type alt: str 13 | :param tap: Action assigned to specific Attachment 14 | :type tap: ~microsoft.agents.protocols.models.CardAction 15 | """ 16 | 17 | url: NonEmptyString = None 18 | alt: NonEmptyString = None 19 | tap: CardAction = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/channel_account.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | from pydantic import ConfigDict 4 | from .agents_model import AgentsModel 5 | from ._type_aliases import NonEmptyString 6 | 7 | 8 | class ChannelAccount(AgentsModel): 9 | """Channel account information needed to route a message. 10 | 11 | :param id: Channel id for the user or agent on this channel (Example: 12 | joe@smith.com, or @joesmith or 123456) 13 | :type id: str 14 | :param name: Display friendly name 15 | :type name: str 16 | :param aad_object_id: This account's object ID within Azure Active 17 | Directory (AAD) 18 | :type aad_object_id: str 19 | :param role: Role of the entity behind the account 20 | :type role: str or ~microsoft.agents.protocols.models.RoleTypes 21 | """ 22 | 23 | model_config = ConfigDict(extra="allow") 24 | 25 | id: NonEmptyString 26 | name: str = None 27 | aad_object_id: NonEmptyString = None 28 | role: NonEmptyString = None 29 | 30 | @property 31 | def properties(self) -> dict[str, Any]: 32 | """Returns the set of properties that are not None.""" 33 | return self.model_extra 34 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/contact_relation_update_action_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class ContactRelationUpdateActionTypes(str, Enum): 5 | add = "add" 6 | remove = "remove" 7 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/conversation_members.py: -------------------------------------------------------------------------------- 1 | from .channel_account import ChannelAccount 2 | from .agents_model import AgentsModel 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class ConversationMembers(AgentsModel): 7 | """Conversation and its members. 8 | 9 | :param id: Conversation ID 10 | :type id: str 11 | :param members: List of members in this conversation 12 | :type members: list[~microsoft.agents.protocols.models.ChannelAccount] 13 | """ 14 | 15 | id: NonEmptyString = None 16 | members: list[ChannelAccount] = None 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/conversation_resource_response.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class ConversationResourceResponse(AgentsModel): 6 | """A response containing a resource. 7 | 8 | :param activity_id: ID of the Activity (if sent) 9 | :type activity_id: str 10 | :param service_url: Service endpoint where operations concerning the 11 | conversation may be performed 12 | :type service_url: str 13 | :param id: Id of the resource 14 | :type id: str 15 | """ 16 | 17 | activity_id: NonEmptyString = None 18 | service_url: NonEmptyString = None 19 | id: NonEmptyString = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/conversation_update_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class ConversationUpdateTypes(str, Enum): 5 | CHANNEL_CREATED = "channelCreated" 6 | CHANNEL_RENAMED = "channelRenamed" 7 | CHANNEL_DELETED = "channelDeleted" 8 | CHANNEL_RESTORED = "channelRestored" 9 | MEMBERS_ADDED = "membersAdded" 10 | MEMBERS_REMOVED = "membersRemoved" 11 | TEAM_RENAMED = "teamRenamed" 12 | TEAM_DELETED = "teamDeleted" 13 | TEAM_ARCHIVED = "teamArchived" 14 | TEAM_UNARCHIVED = "teamUnarchived" 15 | TEAM_RESTORED = "teamRestored" 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/conversations_result.py: -------------------------------------------------------------------------------- 1 | from .conversation_members import ConversationMembers 2 | from .agents_model import AgentsModel 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class ConversationsResult(AgentsModel): 7 | """Conversations result. 8 | 9 | :param continuation_token: Paging token 10 | :type continuation_token: str 11 | :param conversations: List of conversations 12 | :type conversations: 13 | list[~microsoft.agents.protocols.models.ConversationMembers] 14 | """ 15 | 16 | continuation_token: NonEmptyString = None 17 | conversations: list[ConversationMembers] = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/delivery_modes.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class DeliveryModes(str, Enum): 5 | normal = "normal" 6 | notification = "notification" 7 | expect_replies = "expectReplies" 8 | ephemeral = "ephemeral" 9 | stream = "stream" 10 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/end_of_conversation_codes.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class EndOfConversationCodes(str, Enum): 5 | unknown = "unknown" 6 | completed_successfully = "completedSuccessfully" 7 | user_cancelled = "userCancelled" 8 | timed_out = "botTimedOut" 9 | issued_invalid_message = "botIssuedInvalidMessage" 10 | channel_failed = "channelFailed" 11 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/entity.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Optional 2 | 3 | from pydantic import model_serializer, model_validator 4 | from .agents_model import AgentsModel, ConfigDict 5 | from pydantic.alias_generators import to_camel, to_snake 6 | from ._type_aliases import NonEmptyString 7 | 8 | 9 | class Entity(AgentsModel): 10 | """Metadata object pertaining to an activity. 11 | 12 | :param type: Type of this entity (RFC 3987 IRI) 13 | :type type: str 14 | """ 15 | 16 | model_config = ConfigDict(extra="allow") 17 | 18 | type: NonEmptyString 19 | 20 | @property 21 | def additional_properties(self) -> dict[str, Any]: 22 | """Returns the set of properties that are not None.""" 23 | return self.model_extra 24 | 25 | @model_validator(mode="before") 26 | @classmethod 27 | def to_snake_for_all(cls, data): 28 | ret = {to_snake(k): v for k, v in data.items()} 29 | return ret 30 | 31 | @model_serializer(mode="plain") 32 | def to_camel_for_all(self, config): 33 | if config.by_alias: 34 | new_data = {} 35 | for k, v in self: 36 | new_data[to_camel(k)] = v 37 | return new_data 38 | return {k: v for k, v in self} 39 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/error.py: -------------------------------------------------------------------------------- 1 | from .inner_http_error import InnerHttpError 2 | from .agents_model import AgentsModel 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class Error(AgentsModel): 7 | """Object representing error information. 8 | 9 | :param code: Error code 10 | :type code: str 11 | :param message: Error message 12 | :type message: str 13 | :param inner_http_error: Error from inner http call 14 | :type inner_http_error: ~microsoft.agents.protocols.models.InnerHttpError 15 | """ 16 | 17 | code: NonEmptyString = None 18 | message: NonEmptyString = None 19 | inner_http_error: InnerHttpError = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/error_response.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from .error import Error 3 | 4 | 5 | class ErrorResponse(AgentsModel): 6 | """An HTTP API response. 7 | 8 | :param error: Error message 9 | :type error: ~microsoft.agents.protocols.models.Error 10 | """ 11 | 12 | error: Error = None 13 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/expected_replies.py: -------------------------------------------------------------------------------- 1 | from .activity import Activity 2 | from .agents_model import AgentsModel 3 | 4 | 5 | class ExpectedReplies(AgentsModel): 6 | """ExpectedReplies. 7 | 8 | :param activities: A collection of Activities that conforms to the 9 | ExpectedReplies schema. 10 | :type activities: list[~microsoft.agents.protocols.models.Activity] 11 | """ 12 | 13 | activities: list[Activity] = None 14 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/fact.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class Fact(AgentsModel): 6 | """Set of key-value pairs. Advantage of this section is that key and value 7 | properties will be 8 | rendered with default style information with some delimiter between them. 9 | So there is no need for developer to specify style information. 10 | 11 | :param key: The key for this Fact 12 | :type key: str 13 | :param value: The value for this Fact 14 | :type value: str 15 | """ 16 | 17 | key: NonEmptyString = None 18 | value: NonEmptyString = None 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/geo_coordinates.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class GeoCoordinates(AgentsModel): 6 | """GeoCoordinates (entity type: "https://schema.org/GeoCoordinates"). 7 | 8 | :param elevation: Elevation of the location [WGS 9 | 84](https://en.wikipedia.org/wiki/World_Geodetic_System) 10 | :type elevation: float 11 | :param latitude: Latitude of the location [WGS 12 | 84](https://en.wikipedia.org/wiki/World_Geodetic_System) 13 | :type latitude: float 14 | :param longitude: Longitude of the location [WGS 15 | 84](https://en.wikipedia.org/wiki/World_Geodetic_System) 16 | :type longitude: float 17 | :param type: The type of the thing 18 | :type type: str 19 | :param name: The name of the thing 20 | :type name: str 21 | """ 22 | 23 | elevation: float = None 24 | latitude: float = None 25 | longitude: float = None 26 | type: NonEmptyString = None 27 | name: NonEmptyString = None 28 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/hero_card.py: -------------------------------------------------------------------------------- 1 | from .card_action import CardAction 2 | from .card_image import CardImage 3 | from .agents_model import AgentsModel 4 | from ._type_aliases import NonEmptyString 5 | 6 | 7 | class HeroCard(AgentsModel): 8 | """A Hero card (card with a single, large image). 9 | 10 | :param title: Title of the card 11 | :type title: str 12 | :param subtitle: Subtitle of the card 13 | :type subtitle: str 14 | :param text: Text for the card 15 | :type text: str 16 | :param images: Array of images for the card 17 | :type images: list[~microsoft.agents.protocols.models.CardImage] 18 | :param buttons: Set of actions applicable to the current card 19 | :type buttons: list[~microsoft.agents.protocols.models.CardAction] 20 | :param tap: This action will be activated when user taps on the card 21 | itself 22 | :type tap: ~microsoft.agents.protocols.models.CardAction 23 | """ 24 | 25 | title: NonEmptyString = None 26 | subtitle: NonEmptyString = None 27 | text: NonEmptyString = None 28 | images: list[CardImage] = None 29 | buttons: list[CardAction] = None 30 | tap: CardAction = None 31 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/inner_http_error.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | 3 | 4 | class InnerHttpError(AgentsModel): 5 | """Object representing inner http error. 6 | 7 | :param status_code: HttpStatusCode from failed request 8 | :type status_code: int 9 | :param body: Body from failed request 10 | :type body: object 11 | """ 12 | 13 | status_code: int = None 14 | body: object = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/input_hints.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from enum import Enum 5 | 6 | 7 | class InputHints(str, Enum): 8 | accepting_input = "acceptingInput" 9 | ignoring_input = "ignoringInput" 10 | expecting_input = "expectingInput" 11 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/installation_update_action_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class InstallationUpdateActionTypes(str, Enum): 5 | add = "add" 6 | remove = "remove" 7 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/invoke_response.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | 3 | 4 | class InvokeResponse(AgentsModel): 5 | """ 6 | Tuple class containing an HTTP Status Code and a JSON serializable 7 | object. The HTTP Status code is, in the invoke activity scenario, what will 8 | be set in the resulting POST. The Body of the resulting POST will be 9 | JSON serialized content. 10 | 11 | The body content is defined by the producer. The caller must know what 12 | the content is and deserialize as needed. 13 | """ 14 | 15 | status: int = None 16 | body: object = None 17 | 18 | def is_successful_status_code(self) -> bool: 19 | """ 20 | Gets a value indicating whether the invoke response was successful. 21 | :return: A value that indicates if the HTTP response was successful. true if status is in 22 | the Successful range (200-299); otherwise false. 23 | """ 24 | return 200 <= self.status <= 299 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/media_event_value.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | 3 | 4 | class MediaEventValue(AgentsModel): 5 | """Supplementary parameter for media events. 6 | 7 | :param card_value: Callback parameter specified in the Value field of the 8 | MediaCard that originated this event 9 | :type card_value: object 10 | """ 11 | 12 | card_value: object = None 13 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/media_url.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class MediaUrl(AgentsModel): 6 | """Media URL. 7 | 8 | :param url: Url for the media 9 | :type url: str 10 | :param profile: Optional profile hint to the client to differentiate 11 | multiple MediaUrl objects from each other 12 | :type profile: str 13 | """ 14 | 15 | url: NonEmptyString = None 16 | profile: NonEmptyString = None 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/mention.py: -------------------------------------------------------------------------------- 1 | from .channel_account import ChannelAccount 2 | from .entity import Entity 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class Mention(Entity): 7 | """Mention information (entity type: "mention"). 8 | 9 | :param mentioned: The mentioned user 10 | :type mentioned: ~microsoft.agents.protocols.models.ChannelAccount 11 | :param text: Sub Text which represents the mention (can be null or empty) 12 | :type text: str 13 | :param type: Type of this entity (RFC 3987 IRI) 14 | :type type: str 15 | """ 16 | 17 | mentioned: ChannelAccount = None 18 | text: NonEmptyString = None 19 | type: NonEmptyString = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/message_reaction.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class MessageReaction(AgentsModel): 6 | """Message reaction object. 7 | 8 | :param type: Message reaction type. Possible values include: 'like', 9 | 'plusOne' 10 | :type type: str or ~microsoft.agents.protocols.models.MessageReactionTypes 11 | """ 12 | 13 | type: NonEmptyString 14 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/message_reaction_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class MessageReactionTypes(str, Enum): 5 | """MessageReactionType 6 | 7 | Enum for message reaction types. 8 | """ 9 | 10 | REACTIONS_ADDED = "reactionsAdded" 11 | REACTIONS_REMOVED = "reactionsRemoved" 12 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/message_update_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class MessageUpdateTypes(str, Enum): 5 | EDIT_MESSAGE = "editMessage" 6 | SOFT_DELETE_MESSAGE = "softDeleteMessage" 7 | UNDELETE_MESSAGE = "undeleteMessage" 8 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/oauth_card.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | from .card_action import CardAction 3 | from .agents_model import AgentsModel 4 | from .token_exchange_resource import TokenExchangeResource 5 | from .token_post_resource import TokenPostResource 6 | from ._type_aliases import NonEmptyString 7 | 8 | 9 | class OAuthCard(AgentsModel): 10 | """A card representing a request to perform a sign in via OAuth. 11 | 12 | :param text: Text for signin request 13 | :type text: str 14 | :param connection_name: The name of the registered connection 15 | :type connection_name: str 16 | :param buttons: Action to use to perform signin 17 | :type buttons: list[~microsoft.agents.protocols.models.CardAction] 18 | """ 19 | 20 | text: NonEmptyString = None 21 | connection_name: NonEmptyString = None 22 | buttons: list[CardAction] = None 23 | token_exchange_resource: Optional[TokenExchangeResource] = None 24 | token_post_resource: TokenPostResource = None 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/paged_members_result.py: -------------------------------------------------------------------------------- 1 | from .channel_account import ChannelAccount 2 | from ._type_aliases import NonEmptyString 3 | from .agents_model import AgentsModel 4 | 5 | 6 | class PagedMembersResult(AgentsModel): 7 | """Page of members. 8 | 9 | :param continuation_token: Paging token 10 | :type continuation_token: str 11 | :param members: The Channel Accounts. 12 | :type members: list[~microsoft.agents.protocols.models.ChannelAccount] 13 | """ 14 | 15 | continuation_token: NonEmptyString = None 16 | members: list[ChannelAccount] = None 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/place.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class Place(AgentsModel): 6 | """Place (entity type: "https://schema.org/Place"). 7 | 8 | :param address: Address of the place (may be `string` or complex object of 9 | type `PostalAddress`) 10 | :type address: object 11 | :param geo: Geo coordinates of the place (may be complex object of type 12 | `GeoCoordinates` or `GeoShape`) 13 | :type geo: object 14 | :param has_map: Map to the place (may be `string` (URL) or complex object 15 | of type `Map`) 16 | :type has_map: object 17 | :param type: The type of the thing 18 | :type type: str 19 | :param name: The name of the thing 20 | :type name: str 21 | """ 22 | 23 | address: object = None 24 | geo: object = None 25 | has_map: object = None 26 | type: NonEmptyString = None 27 | name: NonEmptyString = None 28 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/receipt_card.py: -------------------------------------------------------------------------------- 1 | from .fact import Fact 2 | from .receipt_item import ReceiptItem 3 | from .card_action import CardAction 4 | from .agents_model import AgentsModel 5 | from ._type_aliases import NonEmptyString 6 | 7 | 8 | class ReceiptCard(AgentsModel): 9 | """A receipt card. 10 | 11 | :param title: Title of the card 12 | :type title: str 13 | :param facts: Array of Fact objects 14 | :type facts: list[~microsoft.agents.protocols.models.Fact] 15 | :param items: Array of Receipt Items 16 | :type items: list[~microsoft.agents.protocols.models.ReceiptItem] 17 | :param tap: This action will be activated when user taps on the card 18 | :type tap: ~microsoft.agents.protocols.models.CardAction 19 | :param total: Total amount of money paid (or to be paid) 20 | :type total: str 21 | :param tax: Total amount of tax paid (or to be paid) 22 | :type tax: str 23 | :param vat: Total amount of VAT paid (or to be paid) 24 | :type vat: str 25 | :param buttons: Set of actions applicable to the current card 26 | :type buttons: list[~microsoft.agents.protocols.models.CardAction] 27 | """ 28 | 29 | title: NonEmptyString = None 30 | facts: list[Fact] = None 31 | items: list[ReceiptItem] = None 32 | tap: CardAction = None 33 | total: NonEmptyString = None 34 | tax: NonEmptyString = None 35 | vat: NonEmptyString = None 36 | buttons: list[CardAction] = None 37 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/receipt_item.py: -------------------------------------------------------------------------------- 1 | from .card_image import CardImage 2 | from .card_action import CardAction 3 | from .agents_model import AgentsModel 4 | from ._type_aliases import NonEmptyString 5 | 6 | 7 | class ReceiptItem(AgentsModel): 8 | """An item on a receipt card. 9 | 10 | :param title: Title of the Card 11 | :type title: str 12 | :param subtitle: Subtitle appears just below Title field, differs from 13 | Title in font styling only 14 | :type subtitle: str 15 | :param text: Text field appears just below subtitle, differs from Subtitle 16 | in font styling only 17 | :type text: str 18 | :param image: Image 19 | :type image: ~microsoft.agents.protocols.models.CardImage 20 | :param price: Amount with currency 21 | :type price: str 22 | :param quantity: Number of items of given kind 23 | :type quantity: str 24 | :param tap: This action will be activated when user taps on the Item 25 | bubble. 26 | :type tap: ~microsoft.agents.protocols.models.CardAction 27 | """ 28 | 29 | title: NonEmptyString = None 30 | subtitle: NonEmptyString = None 31 | text: NonEmptyString = None 32 | image: CardImage = None 33 | price: NonEmptyString = None 34 | quantity: NonEmptyString = None 35 | tap: CardAction = None 36 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/resource_response.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class ResourceResponse(AgentsModel): 6 | """A response containing a resource ID. 7 | 8 | :param id: Id of the resource 9 | :type id: str 10 | """ 11 | 12 | id: NonEmptyString = None 13 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/role_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class RoleTypes(str, Enum): 5 | user = "user" 6 | agent = "bot" 7 | skill = "skill" 8 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/semantic_action.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class SemanticAction(AgentsModel): 6 | """Represents a reference to a programmatic action. 7 | 8 | :param id: ID of this action 9 | :type id: str 10 | :param entities: Entities associated with this action 11 | :type entities: dict[str, ~microsoft.agents.protocols.models.Entity] 12 | :param state: State of this action. Allowed values: `start`, `continue`, `done` 13 | :type state: str or ~microsoft.agents.protocols.models.SemanticActionStates 14 | """ 15 | 16 | id: NonEmptyString 17 | entities: dict = None 18 | state: NonEmptyString = None 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/semantic_actions_states.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class SemanticActionsStates(str, Enum): 5 | start_action = "start" 6 | continue_action = "continue" 7 | done_action = "done" 8 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/sign_in_constants.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from enum import Enum 5 | 6 | 7 | class SignInConstants(str, Enum): 8 | # Name for the signin invoke to verify the 6-digit authentication code as part of sign-in. 9 | verify_state_operation_name = "signin/verifyState" 10 | # Name for signin invoke to perform a token exchange. 11 | token_exchange_operation_name = "signin/tokenExchange" 12 | # The EventActivity name when a token is sent to the agent. 13 | token_response_event_name = "tokens/response" 14 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/sign_in_resource.py: -------------------------------------------------------------------------------- 1 | from ._type_aliases import NonEmptyString 2 | from .agents_model import AgentsModel 3 | from .token_exchange_resource import TokenExchangeResource 4 | from .token_post_resource import TokenPostResource 5 | 6 | 7 | class SignInResource(AgentsModel): 8 | """ 9 | A type containing information for single sign-on. 10 | """ 11 | 12 | sign_in_link: NonEmptyString = None 13 | token_exchange_resource: TokenExchangeResource = None 14 | token_post_resource: TokenPostResource = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/signin_card.py: -------------------------------------------------------------------------------- 1 | from .card_action import CardAction 2 | from .agents_model import AgentsModel 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class SigninCard(AgentsModel): 7 | """A card representing a request to sign in. 8 | 9 | :param text: Text for signin request 10 | :type text: str 11 | :param buttons: Action to use to perform signin 12 | :type buttons: list[~microsoft.agents.protocols.models.CardAction] 13 | """ 14 | 15 | text: NonEmptyString = None 16 | buttons: list[CardAction] = None 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/suggested_actions.py: -------------------------------------------------------------------------------- 1 | from .card_action import CardAction 2 | from .agents_model import AgentsModel 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class SuggestedActions(AgentsModel): 7 | """SuggestedActions that can be performed. 8 | 9 | :param to: Ids of the recipients that the actions should be shown to. 10 | These Ids are relative to the channelId and a subset of all recipients of 11 | the activity 12 | :type to: list[str] 13 | :param actions: Actions that can be shown to the user 14 | :type actions: list[~microsoft.agents.protocols.models.CardAction] 15 | """ 16 | 17 | to: list[NonEmptyString] 18 | actions: list[CardAction] 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/app_based_link_query.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class AppBasedLinkQuery(AgentsModel): 9 | """Invoke request body type for app-based link query. 10 | 11 | :param url: Url queried by user 12 | :type url: Optional[str] 13 | :param state: The magic code for OAuth Flow 14 | :type state: Optional[str] 15 | """ 16 | 17 | url: Optional[str] 18 | state: Optional[str] 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/batch_failed_entries_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from .batch_failed_entry import BatchFailedEntry 6 | 7 | 8 | class BatchFailedEntriesResponse(AgentsModel): 9 | """ 10 | :param operation_id: Unique identifier of the batch operation. 11 | :type operation_id: str 12 | """ 13 | 14 | continuation_token: str = None 15 | failed_entries_responses: list[BatchFailedEntry] = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/batch_failed_entry.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class BatchFailedEntry(AgentsModel): 8 | """ 9 | :param id: Unique identifier of the entry in the batch operation. 10 | :type id: str 11 | :param error: Error message associated with the entry. 12 | :type error: str 13 | """ 14 | 15 | id: str = None 16 | error: str = None 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/batch_operation_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class BatchOperationResponse(AgentsModel): 8 | """ 9 | :param operation_id: Unique identifier of the batch operation. 10 | :type operation_id: str 11 | """ 12 | 13 | operation_id: str = None 14 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/batch_operation_state_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from datetime import datetime 5 | from typing import Optional 6 | from ..agents_model import AgentsModel 7 | 8 | 9 | class BatchOperationStateResponse(AgentsModel): 10 | """ 11 | :param state: The state of the batch operation. 12 | :type state: str 13 | :param status_map: A map of status codes to their counts. 14 | :type status_map: dict[int, int] 15 | :param retry_after: The time after which the operation can be retried. 16 | :type retry_after: datetime 17 | :param total_entries_count: The total number of entries in the batch operation. 18 | :type total_entries_count: int 19 | """ 20 | 21 | state: str = None 22 | status_map: dict[int, int] = None 23 | retry_after: Optional[datetime] = None 24 | total_entries_count: int = None 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/bot_config_auth.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from ..suggested_actions import SuggestedActions 6 | 7 | 8 | class BotConfigAuth(AgentsModel): 9 | """Specifies bot config auth, including type and suggestedActions. 10 | 11 | :param type: The type of bot config auth. 12 | :type type: str 13 | :param suggested_actions: The suggested actions of bot config auth. 14 | :type suggested_actions: SuggestedActions 15 | """ 16 | 17 | type: str = "auth" 18 | suggested_actions: SuggestedActions = None 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/cache_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class CacheInfo(AgentsModel): 9 | """A cache info object which notifies Teams how long an object should be cached for. 10 | 11 | :param cache_type: Type of Cache Info 12 | :type cache_type: Optional[str] 13 | :param cache_duration: Duration of the Cached Info. 14 | :type cache_duration: Optional[int] 15 | """ 16 | 17 | cache_type: Optional[str] 18 | cache_duration: Optional[int] 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/cancel_operation_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .batch_operation_response import BatchOperationResponse 5 | 6 | 7 | class CancelOperationResponse(BatchOperationResponse): 8 | """ 9 | :param operation_id: Unique identifier of the batch operation. 10 | :type operation_id: str 11 | :param body_as_text: The body of the request as text. 12 | :type body_as_text: str 13 | :param parsed_body: The parsed body of the request. 14 | :type parsed_body: BatchOperationResponse 15 | """ 16 | 17 | operation_id: str = None 18 | body_as_text: str = None 19 | parsed_body: BatchOperationResponse = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/channel_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class ChannelInfo(AgentsModel): 9 | """A channel info object which describes the channel. 10 | 11 | :param id: Unique identifier representing a channel 12 | :type id: Optional[str] 13 | :param name: Name of the channel 14 | :type name: Optional[str] 15 | :param type: The channel type 16 | :type type: Optional[str] 17 | """ 18 | 19 | id: Optional[str] = None 20 | name: Optional[str] = None 21 | type: Optional[str] = None 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/config_auth_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | 6 | from .config_response import ConfigResponse 7 | from .bot_config_auth import BotConfigAuth 8 | 9 | 10 | class ConfigAuthResponse(ConfigResponse): 11 | """Response for configuration authentication. 12 | 13 | :param suggested_actions: Suggested actions for the configuration authentication. 14 | :type suggested_actions: object 15 | """ 16 | 17 | config: BotConfigAuth = Field(default_factory=lambda: BotConfigAuth()) 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/config_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .config_response_base import ConfigResponseBase 5 | from .cache_info import CacheInfo 6 | 7 | 8 | class ConfigResponse(ConfigResponseBase): 9 | """Envelope for Config Response Payload. 10 | 11 | :param config: The response to the config message. Possible values: 'auth', 'task' 12 | :type config: object 13 | :param cache_info: Response cache info 14 | :type cache_info: CacheInfo 15 | """ 16 | 17 | config: object = None 18 | cache_info: CacheInfo = None 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/config_response_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class ConfigResponseBase(AgentsModel): 8 | """Specifies Invoke response base, including response type. 9 | 10 | :param response_type: Response type for invoke request 11 | :type response_type: str 12 | """ 13 | 14 | response_type: str = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/config_task_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | 6 | from .config_response import ConfigResponse 7 | from .task_module_response_base import TaskModuleResponseBase 8 | 9 | 10 | class ConfigTaskResponse(ConfigResponse): 11 | """Envelope for Config Task Response. 12 | 13 | This class uses TaskModuleResponseBase as the type for the config parameter. 14 | """ 15 | 16 | config: TaskModuleResponseBase = Field( 17 | default_factory=lambda: TaskModuleResponseBase() 18 | ) 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/conversation_list.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List 6 | 7 | from .channel_info import ChannelInfo 8 | 9 | 10 | class ConversationList(AgentsModel): 11 | """List of channels under a team. 12 | 13 | :param conversations: List of ChannelInfo objects. 14 | :type conversations: List[ChannelInfo] 15 | """ 16 | 17 | conversations: List[ChannelInfo] 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/file_consent_card.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Any, Optional 6 | 7 | 8 | class FileConsentCard(AgentsModel): 9 | """File consent card attachment. 10 | 11 | :param description: File description. 12 | :type description: str 13 | :param size_in_bytes: Size of the file to be uploaded in Bytes. 14 | :type size_in_bytes: Optional[int] 15 | :param accept_context: Context sent back to the Bot if user consented to upload. 16 | :type accept_context: Any 17 | :param decline_context: Context sent back to the Bot if user declined. 18 | :type decline_context: Any 19 | """ 20 | 21 | description: str 22 | size_in_bytes: Optional[int] 23 | accept_context: Any 24 | decline_context: Any 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/file_consent_card_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Any, Optional 6 | 7 | 8 | class FileConsentCardResponse(AgentsModel): 9 | """Represents the value of the invoke activity sent when the user acts on a file consent card. 10 | 11 | :param action: The action the user took. Possible values include: 'accept', 'decline' 12 | :type action: Optional[str] 13 | :param context: The context associated with the action. 14 | :type context: Optional[Any] 15 | :param upload_info: If the user accepted the file, contains information about the file to be uploaded. 16 | :type upload_info: Optional[Any] 17 | """ 18 | 19 | action: Optional[str] 20 | context: Optional[Any] 21 | upload_info: Optional[Any] 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/file_download_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class FileDownloadInfo(AgentsModel): 9 | """File download info attachment. 10 | 11 | :param download_url: File download url. 12 | :type download_url: str 13 | :param unique_id: Unique Id for the file. 14 | :type unique_id: str 15 | :param file_type: Type of file. 16 | :type file_type: str 17 | :param etag: ETag for the file. 18 | :type etag: Optional[str] 19 | """ 20 | 21 | download_url: str 22 | unique_id: str 23 | file_type: str 24 | etag: Optional[str] 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/file_info_card.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class FileInfoCard(AgentsModel): 9 | """File info card. 10 | 11 | :param unique_id: Unique Id for the file. 12 | :type unique_id: str 13 | :param file_type: Type of file. 14 | :type file_type: str 15 | :param etag: ETag for the file. 16 | :type etag: Optional[str] 17 | """ 18 | 19 | unique_id: str 20 | file_type: str 21 | etag: Optional[str] 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/file_upload_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class FileUploadInfo(AgentsModel): 8 | """Information about the file to be uploaded. 9 | 10 | :param name: Name of the file. 11 | :type name: str 12 | :param upload_url: URL to an upload session that the bot can use to set the file contents. 13 | :type upload_url: str 14 | :param content_url: URL to file. 15 | :type content_url: str 16 | :param unique_id: ID that uniquely identifies the file. 17 | :type unique_id: str 18 | :param file_type: Type of the file. 19 | :type file_type: str 20 | """ 21 | 22 | name: str 23 | upload_url: str 24 | content_url: str 25 | unique_id: str 26 | file_type: str 27 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_details.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class MeetingDetails(AgentsModel): 8 | """Specific details of a Teams meeting. 9 | 10 | :param ms_graph_resource_id: The MsGraphResourceId, used specifically for MS Graph API calls. 11 | :type ms_graph_resource_id: str 12 | :param scheduled_start_time: The meeting's scheduled start time, in UTC. 13 | :type scheduled_start_time: str 14 | :param scheduled_end_time: The meeting's scheduled end time, in UTC. 15 | :type scheduled_end_time: str 16 | :param type: The meeting's type. 17 | :type type: str 18 | """ 19 | 20 | ms_graph_resource_id: str = None 21 | scheduled_start_time: str = None 22 | scheduled_end_time: str = None 23 | type: str = None 24 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_details_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | 7 | 8 | class MeetingDetailsBase(AgentsModel): 9 | """Specific details of a Teams meeting. 10 | 11 | :param id: The meeting's Id, encoded as a BASE64 string. 12 | :type id: str 13 | :param join_url: The URL used to join the meeting. 14 | :type join_url: str 15 | :param title: The title of the meeting. 16 | :type title: str 17 | """ 18 | 19 | id: str = Field(None, alias="uniqueId") 20 | join_url: str = None 21 | title: str = None 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_end_event_details.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class MeetingEndEventDetails(AgentsModel): 9 | """Specific details of a Teams meeting end event. 10 | 11 | :param end_time: Timestamp for meeting end, in UTC. 12 | :type end_time: str 13 | """ 14 | 15 | end_time: str = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_event_details.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class MeetingEventDetails(AgentsModel): 9 | """Base class for Teams meeting start and end events. 10 | 11 | :param meeting_type: The meeting's type. 12 | :type meeting_type: str 13 | """ 14 | 15 | meeting_type: str = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | from .meeting_details import MeetingDetails 7 | from .teams_channel_account import TeamsChannelAccount 8 | from ..conversation_account import ConversationAccount 9 | 10 | 11 | class MeetingInfo(AgentsModel): 12 | """General information about a Teams meeting. 13 | 14 | :param details: The specific details of a Teams meeting. 15 | :type details: MeetingDetails 16 | :param conversation: The Conversation Account for the meeting. 17 | :type conversation: ConversationAccount 18 | :param organizer: The meeting's organizer details. 19 | :type organizer: TeamsChannelAccount 20 | """ 21 | 22 | details: MeetingDetails = None 23 | conversation: ConversationAccount = None 24 | organizer: TeamsChannelAccount = None 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_notification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .meeting_notification_base import MeetingNotificationBase 5 | from .targeted_meeting_notification_value import TargetedMeetingNotificationValue 6 | 7 | 8 | class MeetingNotification(MeetingNotificationBase): 9 | """Specifies Bot meeting notification including meeting notification value. 10 | 11 | :param value: Teams Bot meeting notification value. 12 | :type value: TargetedMeetingNotificationValue 13 | """ 14 | 15 | value: TargetedMeetingNotificationValue = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_notification_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class MeetingNotificationBase(AgentsModel): 8 | """Specifies Bot meeting notification base including channel data and type. 9 | 10 | :param type: Type of Bot meeting notification. 11 | :type type: str 12 | """ 13 | 14 | type: str = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_notification_channel_data.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List 6 | from .on_behalf_of import OnBehalfOf 7 | 8 | 9 | class MeetingNotificationChannelData(AgentsModel): 10 | """Specify Teams Bot meeting notification channel data. 11 | 12 | :param on_behalf_of_list: The Teams Bot meeting notification's OnBehalfOf list. 13 | :type on_behalf_of_list: list[OnBehalfOf] 14 | """ 15 | 16 | on_behalf_of_list: List[OnBehalfOf] = None 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_notification_recipient_failure_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class MeetingNotificationRecipientFailureInfo(AgentsModel): 8 | """Information regarding failure to notify a recipient of a meeting notification. 9 | 10 | :param recipient_mri: The MRI for a recipient meeting notification failure. 11 | :type recipient_mri: str 12 | :param error_code: The error code for a meeting notification. 13 | :type error_code: str 14 | :param failure_reason: The reason why a participant meeting notification failed. 15 | :type failure_reason: str 16 | """ 17 | 18 | recipient_mri: str = None 19 | error_code: str = None 20 | failure_reason: str = None 21 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_notification_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List 6 | from .meeting_notification_recipient_failure_info import ( 7 | MeetingNotificationRecipientFailureInfo, 8 | ) 9 | 10 | 11 | class MeetingNotificationResponse(AgentsModel): 12 | """Specifies Bot meeting notification response. 13 | 14 | Contains list of MeetingNotificationRecipientFailureInfo. 15 | 16 | :param recipients_failure_info: The list of MeetingNotificationRecipientFailureInfo. 17 | :type recipients_failure_info: list[MeetingNotificationRecipientFailureInfo] 18 | """ 19 | 20 | recipients_failure_info: List[MeetingNotificationRecipientFailureInfo] = None 21 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_participant_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class MeetingParticipantInfo(AgentsModel): 9 | """Information about a meeting participant. 10 | 11 | :param role: The role of the participant in the meeting. 12 | :type role: str 13 | :param in_meeting: Indicates whether the participant is currently in the meeting. 14 | :type in_meeting: bool 15 | """ 16 | 17 | role: str = None 18 | in_meeting: bool = None 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_participants_event_details.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List 6 | from .teams_meeting_member import TeamsMeetingMember 7 | 8 | 9 | class MeetingParticipantsEventDetails(AgentsModel): 10 | """Data about the meeting participants. 11 | 12 | :param members: The members involved in the meeting event. 13 | :type members: list[TeamsMeetingMember] 14 | """ 15 | 16 | members: List[TeamsMeetingMember] = None 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_stage_surface.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from enum import Enum 5 | 6 | from .surface import Surface, SurfaceType 7 | 8 | 9 | class ContentType(int, Enum): 10 | UNKNOWN = 0 11 | TASK = 1 12 | 13 | 14 | class MeetingStageSurface(Surface): 15 | """Specifies meeting stage surface. 16 | 17 | :param content_type: The content type of this MeetingStageSurface. 18 | :type content_type: ContentType 19 | :param content: The content of this MeetingStageSurface. 20 | :type content: Any 21 | """ 22 | 23 | type: SurfaceType = SurfaceType.MEETING_STAGE 24 | content_type: ContentType = ContentType.TASK 25 | content: object = None 26 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_start_event_details.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class MeetingStartEventDetails(AgentsModel): 9 | """Specific details of a Teams meeting start event. 10 | 11 | :param start_time: Timestamp for meeting start, in UTC. 12 | :type start_time: str 13 | """ 14 | 15 | start_time: str = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/meeting_tab_icon_surface.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .surface import Surface, SurfaceType 5 | 6 | 7 | class MeetingTabIconSurface(Surface): 8 | """Specifies meeting tab icon surface. 9 | 10 | :param tab_entity_id: The tab entity Id of this MeetingTabIconSurface. 11 | :type tab_entity_id: str 12 | """ 13 | 14 | type: SurfaceType = SurfaceType.MEETING_TAB_ICON 15 | tab_entity_id: str = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/message_actions_payload_app.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | from typing import Annotated, Optional 7 | 8 | 9 | class MessageActionsPayloadApp(AgentsModel): 10 | """Represents an application entity. 11 | 12 | :param application_identity_type: The type of application. Possible values include: 'aadApplication', 'bot', 'tenantBot', 'office365Connector', 'webhook' 13 | :type application_identity_type: Optional[str] 14 | :param id: The id of the application. 15 | :type id: Optional[str] 16 | :param display_name: The plaintext display name of the application. 17 | :type display_name: Optional[str] 18 | """ 19 | 20 | application_identity_type: Optional[ 21 | Annotated[ 22 | str, 23 | Field( 24 | pattern=r"^(aadApplication|bot|tenantBot|office365Connector|webhook)$" 25 | ), 26 | ] 27 | ] 28 | id: Optional[str] 29 | display_name: Optional[str] 30 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/message_actions_payload_attachment.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Any, Optional 6 | 7 | 8 | class MessageActionsPayloadAttachment(AgentsModel): 9 | """Represents the attachment in a message. 10 | 11 | :param id: The id of the attachment. 12 | :type id: Optional[str] 13 | :param content_type: The type of the attachment. 14 | :type content_type: Optional[str] 15 | :param content_url: The url of the attachment, in case of an external link. 16 | :type content_url: Optional[str] 17 | :param content: The content of the attachment, in case of a code snippet, email, or file. 18 | :type content: Optional[Any] 19 | :param name: The plaintext display name of the attachment. 20 | :type name: Optional[str] 21 | :param thumbnail_url: The url of a thumbnail image that might be embedded in the attachment, in case of a card. 22 | :type thumbnail_url: Optional[str] 23 | """ 24 | 25 | id: Optional[str] 26 | content_type: Optional[str] 27 | content_url: Optional[str] 28 | content: Optional[Any] 29 | name: Optional[str] 30 | thumbnail_url: Optional[str] 31 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/message_actions_payload_body.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class MessageActionsPayloadBody(AgentsModel): 8 | """Plaintext/HTML representation of the content of the message. 9 | 10 | :param content_type: Type of the content. Possible values include: 'html', 'text' 11 | :type content_type: str 12 | :param content: The content of the body. 13 | :type content: str 14 | """ 15 | 16 | content_type: str = None 17 | content: str = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/message_actions_payload_conversation.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class MessageActionsPayloadConversation(AgentsModel): 8 | """Represents a team or channel entity. 9 | 10 | :param conversation_identity_type: The type of conversation, whether a team or channel. 11 | :type conversation_identity_type: str 12 | :param id: The id of the team or channel. 13 | :type id: str 14 | :param display_name: The plaintext display name of the team or channel entity. 15 | :type display_name: str 16 | """ 17 | 18 | conversation_identity_type: str = None 19 | id: str = None 20 | display_name: str = None 21 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/message_actions_payload_from.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | from .message_actions_payload_user import MessageActionsPayloadUser 8 | from .message_actions_payload_app import MessageActionsPayloadApp 9 | from .message_actions_payload_conversation import MessageActionsPayloadConversation 10 | 11 | 12 | class MessageActionsPayloadFrom(AgentsModel): 13 | """Represents a user, application, or conversation type that either sent or was referenced in a message. 14 | 15 | :param user: Represents details of the user. 16 | :type user: Optional["MessageActionsPayloadUser"] 17 | :param application: Represents details of the app. 18 | :type application: Optional["MessageActionsPayloadApp"] 19 | :param conversation: Represents details of the conversation. 20 | :type conversation: Optional["MessageActionsPayloadConversation"] 21 | """ 22 | 23 | user: Optional[MessageActionsPayloadUser] 24 | application: Optional[MessageActionsPayloadApp] 25 | conversation: Optional[MessageActionsPayloadConversation] 26 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/message_actions_payload_mention.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | from .message_actions_payload_from import MessageActionsPayloadFrom 8 | 9 | 10 | class MessageActionsPayloadMention(AgentsModel): 11 | """Represents the entity that was mentioned in the message. 12 | 13 | :param id: The id of the mentioned entity. 14 | :type id: Optional[int] 15 | :param mention_text: The plaintext display name of the mentioned entity. 16 | :type mention_text: Optional[str] 17 | :param mentioned: Provides more details on the mentioned entity. 18 | :type mentioned: Optional["MessageActionsPayloadFrom"] 19 | """ 20 | 21 | id: Optional[int] 22 | mention_text: Optional[str] 23 | mentioned: Optional[MessageActionsPayloadFrom] 24 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/message_actions_payload_reaction.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | from .message_actions_payload_from import MessageActionsPayloadFrom 8 | 9 | 10 | class MessageActionsPayloadReaction(AgentsModel): 11 | """Represents the reaction of a user to a message. 12 | 13 | :param reaction_type: The type of reaction given to the message. Possible values include: 'like', 'heart', 'laugh', 'surprised', 'sad', 'angry' 14 | :type reaction_type: Optional[str] 15 | :param created_date_time: Timestamp of when the user reacted to the message. 16 | :type created_date_time: Optional[str] 17 | :param user: The user with which the reaction is associated. 18 | :type user: Optional["MessageActionsPayloadFrom"] 19 | """ 20 | 21 | reaction_type: Optional[str] 22 | created_date_time: Optional[str] 23 | user: Optional[MessageActionsPayloadFrom] 24 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/message_actions_payload_user.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | from typing import Annotated, Optional 7 | 8 | 9 | class MessageActionsPayloadUser(AgentsModel): 10 | """Represents a user entity. 11 | 12 | :param user_identity_type: The identity type of the user. Possible values include: 'aadUser', 'onPremiseAadUser', 'anonymousGuest', 'federatedUser' 13 | :type user_identity_type: Optional[str] 14 | :param id: The id of the user. 15 | :type id: Optional[str] 16 | :param display_name: The plaintext display name of the user. 17 | :type display_name: Optional[str] 18 | """ 19 | 20 | user_identity_type: Optional[ 21 | Annotated[ 22 | str, 23 | Field(pattern=r"^(aadUser|onPremiseAadUser|anonymousGuest|federatedUser)$"), 24 | ] 25 | ] 26 | id: Optional[str] 27 | display_name: Optional[str] 28 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/messaging_extension_action_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | from .task_module_response_base import TaskModuleResponseBase 7 | from .messaging_extension_result import MessagingExtensionResult 8 | from .cache_info import CacheInfo 9 | 10 | 11 | class MessagingExtensionActionResponse(AgentsModel): 12 | """Response of messaging extension action. 13 | 14 | :param task: The JSON for the Adaptive card to appear in the task module. 15 | :type task: "TaskModuleResponseBase" 16 | :param compose_extension: The compose extension result. 17 | :type compose_extension: "MessagingExtensionResult" 18 | :param cache_info: CacheInfo for this MessagingExtensionActionResponse. 19 | :type cache_info: "CacheInfo" 20 | """ 21 | 22 | task: TaskModuleResponseBase = None 23 | compose_extension: MessagingExtensionResult = None 24 | cache_info: CacheInfo = None 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/messaging_extension_attachment.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | from ..attachment import Attachment 8 | 9 | 10 | class MessagingExtensionAttachment(AgentsModel): 11 | """Messaging extension attachment. 12 | 13 | :param content_type: mimetype/Contenttype for the file 14 | :type content_type: str 15 | :param content_url: Content Url 16 | :type content_url: str 17 | :param content: Embedded content 18 | :type content: object 19 | :param name: (OPTIONAL) The name of the attachment 20 | :type name: str 21 | :param thumbnail_url: (OPTIONAL) Thumbnail associated with attachment 22 | :type thumbnail_url: str 23 | :param preview: Preview attachment 24 | :type preview: "Attachment" 25 | """ 26 | 27 | content_type: str 28 | content_url: str 29 | content: object = None 30 | name: Optional[str] = None 31 | thumbnail_url: Optional[str] = None 32 | preview: Attachment = None 33 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/messaging_extension_parameter.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class MessagingExtensionParameter(AgentsModel): 8 | """Messaging extension query parameters. 9 | 10 | :param name: Name of the parameter 11 | :type name: str 12 | :param value: Value of the parameter 13 | :type value: Any 14 | """ 15 | 16 | name: str = None 17 | value: object = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/messaging_extension_query.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List, Optional 6 | 7 | from .messaging_extension_parameter import MessagingExtensionParameter 8 | from .messaging_extension_query_options import MessagingExtensionQueryOptions 9 | 10 | 11 | class MessagingExtensionQuery(AgentsModel): 12 | """Messaging extension query. 13 | 14 | :param command_id: Id of the command assigned by Bot 15 | :type command_id: str 16 | :param parameters: Parameters for the query 17 | :type parameters: List["MessagingExtensionParameter"] 18 | :param query_options: Query options for the extension 19 | :type query_options: Optional["MessagingExtensionQueryOptions"] 20 | :param state: State parameter passed back to the bot after authentication/configuration flow 21 | :type state: str 22 | """ 23 | 24 | command_id: str = None 25 | parameters: List[MessagingExtensionParameter] = None 26 | query_options: Optional[MessagingExtensionQueryOptions] = None 27 | state: str = None 28 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/messaging_extension_query_options.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class MessagingExtensionQueryOptions(AgentsModel): 8 | """Messaging extension query options. 9 | 10 | :param skip: Number of entities to skip 11 | :type skip: int 12 | :param count: Number of entities to fetch 13 | :type count: int 14 | """ 15 | 16 | skip: int = None 17 | count: int = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/messaging_extension_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | from .messaging_extension_result import MessagingExtensionResult 8 | from .cache_info import CacheInfo 9 | 10 | 11 | class MessagingExtensionResponse(AgentsModel): 12 | """Messaging extension response. 13 | 14 | :param compose_extension: The compose extension result. 15 | :type compose_extension: Optional["MessagingExtensionResult"] 16 | :param cache_info: CacheInfo for this MessagingExtensionResponse. 17 | :type cache_info: Optional["CacheInfo"] 18 | """ 19 | 20 | compose_extension: Optional[MessagingExtensionResult] = None 21 | cache_info: Optional[CacheInfo] = None 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/messaging_extension_suggested_action.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List 6 | 7 | from ..card_action import CardAction 8 | 9 | 10 | class MessagingExtensionSuggestedAction(AgentsModel): 11 | """Messaging extension suggested actions. 12 | 13 | :param actions: List of suggested actions. 14 | :type actions: List["CardAction"] 15 | """ 16 | 17 | actions: List[CardAction] = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/notification_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class NotificationInfo(AgentsModel): 9 | """Specifies if a notification is to be sent for the mentions. 10 | 11 | :param alert: True if notification is to be sent to the user, false otherwise. 12 | :type alert: bool 13 | :param alert_in_meeting: True if notification is to be sent in a meeting context. 14 | :type alert_in_meeting: Optional[bool] 15 | :param external_resource_url: URL for external resources related to the notification. 16 | :type external_resource_url: Optional[str] 17 | """ 18 | 19 | alert: bool = None 20 | alert_in_meeting: Optional[bool] = None 21 | external_resource_url: Optional[str] = None 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List, Optional 6 | from .o365_connector_card_section import O365ConnectorCardSection 7 | from .o365_connector_card_action_base import O365ConnectorCardActionBase 8 | 9 | 10 | class O365ConnectorCard(AgentsModel): 11 | """O365 connector card. 12 | 13 | :param title: Title of the item 14 | :type title: str 15 | :param text: Text for the card 16 | :type text: Optional[str] 17 | :param summary: Summary for the card 18 | :type summary: Optional[str] 19 | :param theme_color: Theme color for the card 20 | :type theme_color: Optional[str] 21 | :param sections: Set of sections for the current card 22 | :type sections: Optional[List["O365ConnectorCardSection"]] 23 | :param potential_action: Set of actions for the current card 24 | :type potential_action: Optional[List["O365ConnectorCardActionBase"]] 25 | """ 26 | 27 | title: str = None 28 | text: Optional[str] = None 29 | summary: Optional[str] = None 30 | theme_color: Optional[str] = None 31 | sections: Optional[List[O365ConnectorCardSection]] = None 32 | potential_action: Optional[List[O365ConnectorCardActionBase]] = None 33 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_action_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | 7 | 8 | class O365ConnectorCardActionBase(AgentsModel): 9 | """O365 connector card action base. 10 | 11 | :param type: Type of the action. Possible values include: 'ViewAction', 'OpenUri', 'HttpPOST', 'ActionCard' 12 | :type type: str 13 | :param name: Name of the action that will be used as button title 14 | :type name: str 15 | :param id: Action Id 16 | :type id: str 17 | """ 18 | 19 | type: str = Field(None, alias="@type") 20 | name: str = None 21 | id: str = Field(None, alias="@id") 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_action_card.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | from typing import List 7 | from .o365_connector_card_input_base import O365ConnectorCardInputBase 8 | from .o365_connector_card_action_base import O365ConnectorCardActionBase 9 | 10 | 11 | class O365ConnectorCardActionCard(AgentsModel): 12 | """O365 connector card ActionCard action. 13 | 14 | :param type: Type of the action. Possible values include: 'ViewAction', 'OpenUri', 'HttpPOST', 'ActionCard' 15 | :type type: str 16 | :param name: Name of the action that will be used as button title 17 | :type name: str 18 | :param id: Action Id 19 | :type id: str 20 | :param inputs: Set of inputs contained in this ActionCard 21 | :type inputs: List["O365ConnectorCardInputBase"] 22 | :param actions: Set of actions contained in this ActionCard 23 | :type actions: List["O365ConnectorCardActionBase"] 24 | """ 25 | 26 | type: str = Field(None, alias="@type") 27 | name: str = None 28 | id: str = Field(None, alias="@id") 29 | inputs: List[O365ConnectorCardInputBase] = None 30 | actions: List[O365ConnectorCardActionBase] = None 31 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_action_query.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class O365ConnectorCardActionQuery(AgentsModel): 8 | """O365 connector card action query. 9 | 10 | :param body: Body of the action query. 11 | :type body: str 12 | """ 13 | 14 | body: str = None 15 | action_id: str = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_date_input.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | 7 | 8 | class O365ConnectorCardDateInput(AgentsModel): 9 | """O365 connector card date input. 10 | 11 | :param type: Input type name. Possible values include: 'textInput', 'dateInput', 'multichoiceInput' 12 | :type type: str 13 | :param id: Input Id. It must be unique per entire O365 connector card. 14 | :type id: str 15 | :param is_required: Define if this input is a required field. Default value is false. 16 | :type is_required: bool 17 | :param title: Input title that will be shown as the placeholder 18 | :type title: str 19 | :param value: Default value for this input field 20 | :type value: str 21 | :param include_time: Include time input field. Default value is false (date only). 22 | :type include_time: bool 23 | """ 24 | 25 | type: str = Field(None, alias="@type") 26 | id: str = None 27 | is_required: bool = None 28 | title: str = None 29 | value: str = None 30 | include_time: bool = None 31 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_fact.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class O365ConnectorCardFact(AgentsModel): 8 | """O365 connector card fact. 9 | 10 | :param name: Display name of the fact 11 | :type name: str 12 | :param value: Display value for the fact 13 | :type value: str 14 | """ 15 | 16 | name: str = None 17 | value: str = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_http_post.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | from typing import Optional 7 | 8 | 9 | class O365ConnectorCardHttpPOST(AgentsModel): 10 | """O365 connector card HttpPOST action. 11 | 12 | :param type: Type of the action. Default is 'HttpPOST'. 13 | :type type: str 14 | :param name: Name of the HttpPOST action. 15 | :type name: str 16 | :param id: Id of the HttpPOST action. 17 | :type id: str 18 | :param body: Content of the HttpPOST action. 19 | :type body: Optional[str] 20 | """ 21 | 22 | type: str = Field(None, alias="@type") 23 | name: str = None 24 | id: str = Field(None, alias="@id") 25 | body: Optional[str] = None 26 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_image.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class O365ConnectorCardImage(AgentsModel): 9 | """O365 connector card image. 10 | 11 | :param image: URL for the image. 12 | :type image: str 13 | :param title: Title of the image. 14 | :type title: Optional[str] 15 | """ 16 | 17 | image: str = None 18 | title: Optional[str] = None 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_input_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | from typing import Optional 7 | 8 | 9 | class O365ConnectorCardInputBase(AgentsModel): 10 | """Base class for O365 connector card inputs. 11 | 12 | :param type: Input type name. Possible values include: 'textInput', 'dateInput', 'multichoiceInput' 13 | :type type: str 14 | :param id: Input Id. It must be unique per entire O365 connector card. 15 | :type id: str 16 | :param is_required: Define if this input is a required field. Default value is false. 17 | :type is_required: Optional[bool] 18 | :param title: Input title that will be shown as the placeholder 19 | :type title: Optional[str] 20 | :param value: Default value for this input field 21 | :type value: Optional[str] 22 | """ 23 | 24 | type: str = Field(None, alias="@type") 25 | id: str = None 26 | is_required: Optional[bool] = None 27 | title: Optional[str] = None 28 | value: Optional[str] = None 29 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_multichoice_input_choice.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class O365ConnectorCardMultichoiceInputChoice(AgentsModel): 8 | """O365 connector card multichoice input choice. 9 | 10 | :param display: Display text for the choice. 11 | :type display: str 12 | :param value: Value for the choice. 13 | :type value: str 14 | """ 15 | 16 | display: str = None 17 | value: str = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_open_uri.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | from typing import List 7 | from .o365_connector_card_open_uri_target import O365ConnectorCardOpenUriTarget 8 | 9 | 10 | class O365ConnectorCardOpenUri(AgentsModel): 11 | """O365 connector card OpenUri action. 12 | 13 | :param type: Type of the action. Default is 'OpenUri'. 14 | :type type: str 15 | :param name: Name of the OpenUri action. 16 | :type name: str 17 | :param id: Id of the OpenUri action. 18 | :type id: str 19 | :param targets: List of targets for the OpenUri action. 20 | :type targets: List["O365ConnectorCardOpenUriTarget"] 21 | """ 22 | 23 | type: str = Field(None, alias="@type") 24 | name: str = None 25 | id: str = Field(None, alias="@id") 26 | targets: List[O365ConnectorCardOpenUriTarget] = None 27 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_open_uri_target.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class O365ConnectorCardOpenUriTarget(AgentsModel): 8 | """O365 connector card OpenUri target. 9 | 10 | :param os: Target operating system. Possible values include: 'default', 'iOS', 'android', 'windows' 11 | :type os: str 12 | :param uri: Target URI. 13 | :type uri: str 14 | """ 15 | 16 | os: str = None 17 | uri: str = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_text_input.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | from typing import Optional 7 | 8 | 9 | class O365ConnectorCardTextInput(AgentsModel): 10 | """O365 connector card text input. 11 | 12 | :param type: Input type name. Default is 'textInput'. 13 | :type type: str 14 | :param id: Input Id. It must be unique per entire O365 connector card. 15 | :type id: str 16 | :param is_required: Define if this input is a required field. Default value is false. 17 | :type is_required: Optional[bool] 18 | :param title: Input title that will be shown as the placeholder 19 | :type title: Optional[str] 20 | :param value: Default value for this input field 21 | :type value: Optional[str] 22 | :param is_multiline: Define if this input field allows multiple lines of text. Default value is false. 23 | :type is_multiline: Optional[bool] 24 | """ 25 | 26 | type: str = Field(None, alias="@type") 27 | id: str = None 28 | is_required: Optional[bool] = None 29 | title: Optional[str] = None 30 | value: Optional[str] = None 31 | is_multiline: Optional[bool] = None 32 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/o365_connector_card_view_action.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | from typing import Optional 7 | 8 | 9 | class O365ConnectorCardViewAction(AgentsModel): 10 | """O365 connector card ViewAction action. 11 | 12 | :param type: Type of the action. Default is 'ViewAction'. 13 | :type type: str 14 | :param name: Name of the ViewAction action. 15 | :type name: str 16 | :param id: Id of the ViewAction action. 17 | :type id: str 18 | :param target: Target URL for the ViewAction action. 19 | :type target: Optional[str] 20 | """ 21 | 22 | type: str = Field(None, alias="@type") 23 | name: str = None 24 | id: str = Field(None, alias="@id") 25 | target: Optional[str] = None 26 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/on_behalf_of.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class OnBehalfOf(AgentsModel): 8 | """Specifies the OnBehalfOf entity for meeting notifications. 9 | 10 | :param item_id: The item id of the OnBehalfOf entity. 11 | :type item_id: str 12 | :param mention_type: The mention type. Default is "person". 13 | :type mention_type: str 14 | :param display_name: The display name of the OnBehalfOf entity. 15 | :type display_name: str 16 | :param mri: The MRI of the OnBehalfOf entity. 17 | :type mri: str 18 | """ 19 | 20 | item_id: str = None 21 | mention_type: str = None 22 | display_name: str = None 23 | mri: str = None 24 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/signin_state_verification_query.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class SigninStateVerificationQuery(AgentsModel): 8 | """Represents the state verification query for sign-in. 9 | 10 | :param state: The state value used for verification. 11 | :type state: str 12 | """ 13 | 14 | state: str = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/surface.py: -------------------------------------------------------------------------------- 1 | from ..agents_model import AgentsModel 2 | from enum import Enum 3 | 4 | 5 | class SurfaceType(int, Enum): 6 | UNKNOWN = 0 7 | MEETING_STAGE = 1 8 | MEETING_TAB_ICON = 2 9 | 10 | 11 | class Surface(AgentsModel): 12 | """Specifies where the notification will be rendered in the meeting UX. 13 | 14 | :param type: The value indicating where the notification will be rendered in the meeting UX. 15 | :type type: SurfaceType 16 | """ 17 | 18 | type: SurfaceType 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_context.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class TabContext(AgentsModel): 8 | """Current tab request context, i.e., the current theme. 9 | 10 | :param theme: Gets or sets the current user's theme. 11 | :type theme: str 12 | """ 13 | 14 | theme: str = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_entity_context.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class TabEntityContext(AgentsModel): 8 | """ 9 | Current TabRequest entity context, or 'tabEntityId'. 10 | 11 | :param tab_entity_id: Gets or sets the entity id of the tab. 12 | :type tab_entity_id: str 13 | """ 14 | 15 | tab_entity_id: str 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_request.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from .tab_entity_context import TabEntityContext 6 | from .tab_context import TabContext 7 | 8 | 9 | class TabRequest(AgentsModel): 10 | """Invoke ('tab/fetch') request value payload. 11 | 12 | :param tab_entity_context: Gets or sets current tab entity request context. 13 | :type tab_entity_context: TabEntityContext 14 | :param context: Gets or sets current tab entity request context. 15 | :type context: TabContext 16 | :param state: Gets or sets state, which is the magic code for OAuth Flow. 17 | :type state: str 18 | """ 19 | 20 | tab_entity_context: TabEntityContext = None 21 | context: TabContext = None 22 | state: str = None 23 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | from .tab_response_payload import TabResponsePayload 7 | 8 | 9 | class TabResponse(AgentsModel): 10 | """Envelope for Card Tab Response Payload. 11 | 12 | :param tab: Possible values include: 'continue', 'auth' or 'silentAuth' 13 | :type type: TabResponsePayload 14 | """ 15 | 16 | tab: TabResponsePayload = None 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_response_card.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class TabResponseCard(AgentsModel): 8 | """Envelope for cards for a Tab request. 9 | 10 | :param card: Gets or sets adaptive card for this card tab response. 11 | :type card: object 12 | """ 13 | 14 | card: object = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_response_cards.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License.from ..agents_model import AgentsModel 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List 6 | 7 | from .tab_response_card import TabResponseCard 8 | 9 | 10 | class TabResponseCards(AgentsModel): 11 | """Envelope for cards for a TabResponse. 12 | 13 | :param cards: Gets or sets adaptive card for this card tab response. 14 | :type cards: list[TabResponseCard] 15 | """ 16 | 17 | cards: List[TabResponseCard] = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_response_payload.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | from .tab_response_cards import TabResponseCards 7 | from .tab_suggested_actions import TabSuggestedActions 8 | 9 | 10 | class TabResponsePayload(AgentsModel): 11 | """Initializes a new instance of the TabResponsePayload class. 12 | 13 | :param type: Gets or sets choice of action options when responding to the 14 | tab/fetch message. Possible values include: 'continue', 'auth' or 'silentAuth' 15 | :type type: str 16 | :param value: Gets or sets the TabResponseCards when responding to 17 | tab/fetch activity with type of 'continue'. 18 | :type value: TabResponseCards 19 | :param suggested_actions: Gets or sets the Suggested Actions for this card tab. 20 | :type suggested_actions: TabSuggestedActions 21 | """ 22 | 23 | type: str = None 24 | value: TabResponseCards = None 25 | suggested_actions: TabSuggestedActions = None 26 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_submit.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from .tab_entity_context import TabEntityContext 6 | from .tab_context import TabContext 7 | from .tab_submit_data import TabSubmitData 8 | 9 | 10 | class TabSubmit(AgentsModel): 11 | """Initializes a new instance of the TabSubmit class. 12 | 13 | :param tab_entity_context: Gets or sets current tab entity request context. 14 | :type tab_entity_context: TabEntityContext 15 | :param context: Gets or sets current user context, i.e., the current theme. 16 | :type context: TabContext 17 | :param data: User input data. Free payload containing properties of key-value pairs. 18 | :type data: TabSubmitData 19 | """ 20 | 21 | tab_entity_context: TabEntityContext = None 22 | context: TabContext = None 23 | data: TabSubmitData = None 24 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_submit_data.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class TabSubmitData(AgentsModel): 8 | """Invoke ('tab/submit') request value payload data. 9 | 10 | :param type: Currently, 'tab/submit'. 11 | :type type: str 12 | :param properties: Gets or sets properties that are not otherwise defined by the TabSubmit 13 | type but that might appear in the serialized REST JSON object. 14 | :type properties: object 15 | """ 16 | 17 | type: str = None 18 | properties: object = None 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tab_suggested_actions.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List 6 | 7 | from ..card_action import CardAction 8 | 9 | 10 | class TabSuggestedActions(AgentsModel): 11 | """Tab SuggestedActions (Only when type is 'auth' or 'silentAuth'). 12 | 13 | :param actions: Gets or sets adaptive card for this card tab response. 14 | :type actions: list[CardAction] 15 | """ 16 | 17 | actions: List[CardAction] = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/targeted_meeting_notification.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .meeting_notification import MeetingNotification 5 | from .targeted_meeting_notification_value import TargetedMeetingNotificationValue 6 | from .meeting_notification_channel_data import MeetingNotificationChannelData 7 | 8 | 9 | class TargetedMeetingNotification(MeetingNotification): 10 | """Specifies Teams targeted meeting notification. 11 | 12 | :param value: The value of the TargetedMeetingNotification. 13 | :type value: TargetedMeetingNotificationValue 14 | :param channel_data: Teams Bot meeting notification channel data. 15 | :type channel_data: MeetingNotificationChannelData 16 | """ 17 | 18 | value: TargetedMeetingNotificationValue = None 19 | channel_data: MeetingNotificationChannelData = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/targeted_meeting_notification_value.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List 6 | from .surface import Surface 7 | 8 | 9 | class TargetedMeetingNotificationValue(AgentsModel): 10 | """Specifies the value for targeted meeting notifications. 11 | 12 | :param recipients: List of recipient MRIs for the notification. 13 | :type recipients: List[str] 14 | :param message: The message content of the notification. 15 | :type message: str 16 | """ 17 | 18 | recipients: List[str] = None 19 | surfaces: List[Surface] = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/task_module_card_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from .tab_response import TabResponse 6 | 7 | 8 | class TaskModuleCardResponse(AgentsModel): 9 | """Tab Response to 'task/submit' from a tab. 10 | 11 | :param value: The JSON for the Adaptive cards to appear in the tab. 12 | :type value: TabResponse 13 | """ 14 | 15 | value: TabResponse = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/task_module_continue_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | from .task_module_task_info import TaskModuleTaskInfo 7 | 8 | 9 | class TaskModuleContinueResponse(AgentsModel): 10 | """Response to continue a task module. 11 | 12 | :param type: The type of response. Default is 'continue'. 13 | :type type: str 14 | :param value: The task module task info. 15 | :type value: Optional["TaskModuleTaskInfo"] 16 | """ 17 | 18 | type: str = None 19 | value: Optional[TaskModuleTaskInfo] = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/task_module_message_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class TaskModuleMessageResponse(AgentsModel): 9 | """Response to display a message in a task module. 10 | 11 | :param type: The type of response. Default is 'message'. 12 | :type type: str 13 | :param value: The message to display. 14 | :type value: Optional[str] 15 | """ 16 | 17 | type: str = None 18 | value: Optional[str] = None 19 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/task_module_request.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import Field 5 | from ..agents_model import AgentsModel 6 | from typing import Any, Optional 7 | 8 | from .task_module_request_context import TaskModuleRequestContext 9 | from .tab_entity_context import TabEntityContext 10 | 11 | 12 | class TaskModuleRequest(AgentsModel): 13 | """Task module invoke request value payload. 14 | 15 | :param data: User input data. Free payload with key-value pairs. 16 | :type data: object 17 | :param context: Current user context, i.e., the current theme 18 | :type context: Optional[Any] 19 | :param tab_entity_context: Gets or sets current tab request context. 20 | :type tab_entity_context: Optional[TabEntityContext] 21 | """ 22 | 23 | data: Optional[Any] 24 | context: Optional[TaskModuleRequestContext] 25 | tab_entity_context: Optional[TabEntityContext] = Field(None, alias="tabContext") 26 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/task_module_request_context.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import Optional 6 | 7 | 8 | class TaskModuleRequestContext(AgentsModel): 9 | """Context for a task module request. 10 | 11 | :param theme: The current user's theme. 12 | :type theme: Optional[str] 13 | """ 14 | 15 | theme: Optional[str] = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/task_module_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | from .task_module_response_base import TaskModuleResponseBase 7 | from .cache_info import CacheInfo 8 | 9 | 10 | class TaskModuleResponse(TaskModuleResponseBase): 11 | """Envelope for Task Module Response. 12 | 13 | :param task: The JSON for the Adaptive card to appear in the task module. 14 | :task task: ~botframework.connector.teams.models.TaskModuleResponseBase 15 | :param cache_info: CacheInfo for this TaskModuleResponse. 16 | :task cache_info: ~botframework.connector.teams.models.CacheInfo 17 | """ 18 | 19 | task: TaskModuleResponseBase = None 20 | cache_info: CacheInfo = None 21 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/task_module_response_base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from pydantic import ConfigDict 5 | from ..agents_model import AgentsModel 6 | 7 | 8 | class TaskModuleResponseBase(AgentsModel): 9 | """Base class for task module responses. 10 | 11 | :param type: The type of response. 12 | :type type: str 13 | """ 14 | 15 | model_config = ConfigDict(extra="allow") 16 | 17 | type: str = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/task_module_task_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | from ..attachment import Attachment 7 | 8 | 9 | class TaskModuleTaskInfo(AgentsModel): 10 | """Information about a task module task. 11 | 12 | :param title: The title of the task module. 13 | :type title: str 14 | :param height: The height of the task module. 15 | :type height: int 16 | :param width: The width of the task module. 17 | :type width: int 18 | :param url: The URL of the task module. 19 | :type url: str 20 | :param card: The adaptive card for the task module. 21 | :type card: object 22 | """ 23 | 24 | title: str = None 25 | height: object = None 26 | width: object = None 27 | url: str = None 28 | card: Attachment = None 29 | fallback_url: str = None 30 | completion_bot_id: str = None 31 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/team_details.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class TeamDetails(AgentsModel): 8 | """Details related to a team. 9 | 10 | :param id: Unique identifier representing a team 11 | :type id: str 12 | :param name: Name of team. 13 | :type name: str 14 | :param aad_group_id: Azure Active Directory (AAD) Group Id for the team. 15 | :type aad_group_id: str 16 | :param channel_count: The count of channels in the team. 17 | :type channel_count: int 18 | :param member_count: The count of members in the team. 19 | :type member_count: int 20 | :param type: The team type 21 | :type type: str 22 | """ 23 | 24 | id: str = None 25 | name: str = None 26 | aad_group_id: str = None 27 | channel_count: int = None 28 | member_count: int = None 29 | type: str = None 30 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/team_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class TeamInfo(AgentsModel): 8 | """Describes a team. 9 | 10 | :param id: Unique identifier representing a team 11 | :type id: str 12 | :param name: Name of team. 13 | :type name: str 14 | :param aad_group_id: Azure AD Teams group ID. 15 | :type aad_group_id: str 16 | """ 17 | 18 | id: str = None 19 | name: str = None 20 | aad_group_id: str = None 21 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/teams_batch_operation_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .batch_operation_response import BatchOperationResponse 5 | 6 | 7 | class TeamsBatchOperationResponse(BatchOperationResponse): 8 | """ 9 | :param operation_id: Unique identifier of the batch operation. 10 | :type operation_id: str 11 | :param body_as_text: The body of the request as text. 12 | :type body_as_text: str 13 | :param parsed_body: The parsed body of the request. 14 | :type parsed_body: BatchOperationResponse 15 | """ 16 | 17 | operation_id: str = None 18 | body_as_text: str = None 19 | parsed_body: BatchOperationResponse = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/teams_channel_data_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from .channel_info import ChannelInfo 6 | 7 | 8 | class TeamsChannelDataSettings(AgentsModel): 9 | """Represents the settings information for a Teams channel data. 10 | 11 | :param selected_channel: Information about the selected Teams channel. 12 | :type selected_channel: ChannelInfo 13 | """ 14 | 15 | selected_channel: ChannelInfo = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/teams_meeting_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class TeamsMeetingInfo(AgentsModel): 8 | """Describes a Teams Meeting. 9 | 10 | :param id: Unique identifier representing a meeting 11 | :type id: str 12 | """ 13 | 14 | id: str = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/teams_meeting_member.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from .teams_channel_account import TeamsChannelAccount 6 | from .user_meeting_details import UserMeetingDetails 7 | 8 | 9 | class TeamsMeetingMember(AgentsModel): 10 | """Data about the meeting participants. 11 | 12 | :param user: The channel user data. 13 | :type user: TeamsChannelAccount 14 | :param meeting: The user meeting details. 15 | :type meeting: UserMeetingDetails 16 | """ 17 | 18 | user: TeamsChannelAccount = None 19 | meeting: UserMeetingDetails = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/teams_meeting_participant.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | from .teams_channel_account import TeamsChannelAccount 7 | from .meeting_participant_info import MeetingParticipantInfo 8 | from ..conversation_account import ConversationAccount 9 | 10 | 11 | class TeamsMeetingParticipant(AgentsModel): 12 | """Teams participant channel account detailing user Azure Active Directory and meeting participant details. 13 | 14 | :param user: Teams Channel Account information for this meeting participant 15 | :type user: TeamsChannelAccount 16 | :param meeting: Information specific to this participant in the specific meeting. 17 | :type meeting: MeetingParticipantInfo 18 | :param conversation: Conversation Account for the meeting. 19 | :type conversation: ConversationAccount 20 | """ 21 | 22 | user: TeamsChannelAccount = None 23 | meeting: MeetingParticipantInfo = None 24 | conversation: ConversationAccount = None 25 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/teams_member.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class TeamsMember(AgentsModel): 8 | """Describes a member. 9 | 10 | :param id: Unique identifier representing a member (user or channel). 11 | :type id: str 12 | """ 13 | 14 | id: str = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/teams_paged_members_result.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | from typing import List 6 | from .teams_channel_account import TeamsChannelAccount 7 | 8 | 9 | class TeamsPagedMembersResult(AgentsModel): 10 | """Page of members for Teams. 11 | 12 | :param continuation_token: Paging token 13 | :type continuation_token: str 14 | :param members: The Teams Channel Accounts. 15 | :type members: list[TeamsChannelAccount] 16 | """ 17 | 18 | continuation_token: str = None 19 | members: List[TeamsChannelAccount] = None 20 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/tenant_info.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class TenantInfo(AgentsModel): 8 | """Describes a tenant. 9 | 10 | :param id: Unique identifier representing a tenant 11 | :type id: str 12 | """ 13 | 14 | id: str = None 15 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/teams/user_meeting_details.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from ..agents_model import AgentsModel 5 | 6 | 7 | class UserMeetingDetails(AgentsModel): 8 | """Specific details of a user in a Teams meeting. 9 | 10 | :param role: Role of the participant in the current meeting. 11 | :type role: str 12 | :param in_meeting: True, if the participant is in the meeting. 13 | :type in_meeting: bool 14 | """ 15 | 16 | role: str = None 17 | in_meeting: bool = None 18 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/text_format_types.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class TextFormatTypes(str, Enum): 5 | markdown = "markdown" 6 | plain = "plain" 7 | xml = "xml" 8 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/text_highlight.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class TextHighlight(AgentsModel): 6 | """Refers to a substring of content within another field. 7 | 8 | :param text: Defines the snippet of text to highlight 9 | :type text: str 10 | :param occurrence: Occurrence of the text field within the referenced 11 | text, if multiple exist. 12 | :type occurrence: int 13 | """ 14 | 15 | text: NonEmptyString 16 | occurrence: int 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/thing.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class Thing(AgentsModel): 6 | """Thing (entity type: "https://schema.org/Thing"). 7 | 8 | :param type: The type of the thing 9 | :type type: str 10 | :param name: The name of the thing 11 | :type name: str 12 | """ 13 | 14 | type: NonEmptyString = None 15 | name: NonEmptyString = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/thumbnail_card.py: -------------------------------------------------------------------------------- 1 | from .card_image import CardImage 2 | from .card_action import CardAction 3 | from .agents_model import AgentsModel 4 | from ._type_aliases import NonEmptyString 5 | 6 | 7 | class ThumbnailCard(AgentsModel): 8 | """A thumbnail card (card with a single, small thumbnail image). 9 | 10 | :param title: Title of the card 11 | :type title: str 12 | :param subtitle: Subtitle of the card 13 | :type subtitle: str 14 | :param text: Text for the card 15 | :type text: str 16 | :param images: Array of images for the card 17 | :type images: list[~microsoft.agents.protocols.models.CardImage] 18 | :param buttons: Set of actions applicable to the current card 19 | :type buttons: list[~microsoft.agents.protocols.models.CardAction] 20 | :param tap: This action will be activated when user taps on the card 21 | itself 22 | :type tap: ~microsoft.agents.protocols.models.CardAction 23 | """ 24 | 25 | title: NonEmptyString = None 26 | subtitle: NonEmptyString = None 27 | text: NonEmptyString = None 28 | images: list[CardImage] = None 29 | buttons: list[CardAction] = None 30 | tap: CardAction = None 31 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/thumbnail_url.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class ThumbnailUrl(AgentsModel): 6 | """Thumbnail URL. 7 | 8 | :param url: URL pointing to the thumbnail to use for media content 9 | :type url: str 10 | :param alt: HTML alt text to include on this thumbnail image 11 | :type alt: str 12 | """ 13 | 14 | url: NonEmptyString = None 15 | alt: NonEmptyString = None 16 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/token_exchange_invoke_request.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class TokenExchangeInvokeRequest(AgentsModel): 6 | """TokenExchangeInvokeRequest. 7 | 8 | :param id: The id from the OAuthCard. 9 | :type id: str 10 | :param connection_name: The connection name. 11 | :type connection_name: str 12 | :param token: The user token that can be exchanged. 13 | :type token: str 14 | :param properties: Extension data for overflow of properties. 15 | :type properties: dict[str, object] 16 | """ 17 | 18 | id: NonEmptyString = None 19 | connection_name: NonEmptyString = None 20 | token: NonEmptyString = None 21 | properties: dict = None 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/token_exchange_invoke_response.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class TokenExchangeInvokeResponse(AgentsModel): 6 | """TokenExchangeInvokeResponse. 7 | 8 | :param id: The id from the OAuthCard. 9 | :type id: str 10 | :param connection_name: The connection name. 11 | :type connection_name: str 12 | :param failure_detail: The details of why the token exchange failed. 13 | :type failure_detail: str 14 | :param properties: Extension data for overflow of properties. 15 | :type properties: dict[str, object] 16 | """ 17 | 18 | id: NonEmptyString = None 19 | connection_name: NonEmptyString = None 20 | failure_detail: NonEmptyString = None 21 | properties: dict = None 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/token_exchange_resource.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class TokenExchangeResource(AgentsModel): 7 | """ 8 | A type containing information for token exchange. 9 | """ 10 | 11 | id: NonEmptyString = None 12 | uri: NonEmptyString = None 13 | provider_id: NonEmptyString = None 14 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/token_post_resource.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | 3 | from ._type_aliases import NonEmptyString 4 | 5 | 6 | class TokenPostResource(AgentsModel): 7 | """ 8 | A type containing information for token posting. 9 | """ 10 | 11 | sas_url: NonEmptyString = None 12 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/token_request.py: -------------------------------------------------------------------------------- 1 | from .agents_model import AgentsModel 2 | from ._type_aliases import NonEmptyString 3 | 4 | 5 | class TokenRequest(AgentsModel): 6 | """A request to receive a user token. 7 | 8 | :param provider: The provider to request a user token from 9 | :type provider: str 10 | :param settings: A collection of settings for the specific provider for 11 | this request 12 | :type settings: dict[str, object] 13 | """ 14 | 15 | provider: NonEmptyString = None 16 | settings: dict = None 17 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/token_response.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .agents_model import AgentsModel 5 | from ._type_aliases import NonEmptyString 6 | 7 | 8 | class TokenResponse(AgentsModel): 9 | """A response that includes a user token. 10 | 11 | :param connection_name: The connection name 12 | :type connection_name: str 13 | :param token: The user token 14 | :type token: str 15 | :param expiration: Expiration for the token, in ISO 8601 format (e.g. 16 | "2007-04-05T14:30Z") 17 | :type expiration: str 18 | :param channel_id: The channelId of the TokenResponse 19 | :type channel_id: str 20 | """ 21 | 22 | connection_name: NonEmptyString = None 23 | token: NonEmptyString = None 24 | expiration: NonEmptyString = None 25 | channel_id: NonEmptyString = None 26 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/token_status.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | """Models for token status operations.""" 5 | 6 | from typing import Optional 7 | from pydantic import Field 8 | 9 | from .agents_model import AgentsModel 10 | from ._type_aliases import NonEmptyString 11 | 12 | 13 | class TokenStatus(AgentsModel): 14 | """ 15 | The status of a user token. 16 | 17 | :param channel_id: The channelId of the token status pertains to. 18 | :type channel_id: str 19 | :param connection_name: The name of the connection the token status pertains to. 20 | :type connection_name: str 21 | :param has_token: True if a token is stored for this ConnectionName. 22 | :type has_token: bool 23 | :param service_provider_display_name: The display name of the service provider for which this Token belongs to. 24 | :type service_provider_display_name: str 25 | """ 26 | 27 | channel_id: Optional[NonEmptyString] = Field(None, alias="channelId") 28 | connection_name: Optional[NonEmptyString] = Field(None, alias="connectionName") 29 | has_token: Optional[bool] = Field(None, alias="hasToken") 30 | service_provider_display_name: Optional[NonEmptyString] = Field( 31 | None, alias="serviceProviderDisplayName" 32 | ) 33 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/microsoft/agents/core/models/transcript.py: -------------------------------------------------------------------------------- 1 | from .activity import Activity 2 | from .agents_model import AgentsModel 3 | 4 | 5 | class Transcript(AgentsModel): 6 | """Transcript. 7 | 8 | :param activities: A collection of Activities that conforms to the 9 | Transcript schema. 10 | :type activities: list[~microsoft.agents.protocols.models.Activity] 11 | """ 12 | 13 | activities: list[Activity] = None 14 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-core" 7 | version = "0.0.0a1" 8 | description = "A protocol library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "pydantic>=2.10.4", 18 | ] 19 | 20 | [project.urls] 21 | "Homepage" = "https://github.com/microsoft/microsoft-agents-protocol" 22 | -------------------------------------------------------------------------------- /libraries/Core/microsoft-agents-core/tests/test_activity_types.py: -------------------------------------------------------------------------------- 1 | def test_placeholder(): 2 | pass 3 | -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/__init__.py: -------------------------------------------------------------------------------- 1 | from ._start_agent_process import start_agent_process 2 | from .agent_http_adapter import AgentHttpAdapter 3 | from .channel_service_route_table import channel_service_route_table 4 | from .cloud_adapter import CloudAdapter 5 | from .jwt_authorization_middleware import ( 6 | jwt_authorization_middleware, 7 | jwt_authorization_decorator, 8 | ) 9 | from .app.streaming import ( 10 | Citation, 11 | CitationUtil, 12 | StreamingResponse, 13 | ) 14 | 15 | __all__ = [ 16 | "start_agent_process", 17 | "AgentHttpAdapter", 18 | "CloudAdapter", 19 | "jwt_authorization_middleware", 20 | "jwt_authorization_decorator", 21 | "channel_service_route_table", 22 | "Citation", 23 | "CitationUtil", 24 | "StreamingResponse", 25 | ] 26 | -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/_start_agent_process.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | from aiohttp.web import Request, Response 3 | from microsoft.agents.builder.app import AgentApplication 4 | from .cloud_adapter import CloudAdapter 5 | 6 | 7 | async def start_agent_process( 8 | request: Request, 9 | agent_application: AgentApplication, 10 | adapter: CloudAdapter, 11 | ) -> Optional[Response]: 12 | """Starts the agent host with the provided adapter and agent application. 13 | Args: 14 | adapter (CloudAdapter): The adapter to use for the agent host. 15 | agent_application (AgentApplication): The agent application to run. 16 | """ 17 | if not adapter: 18 | raise TypeError("start_agent_process: adapter can't be None") 19 | if not agent_application: 20 | raise TypeError("start_agent_process: agent_application can't be None") 21 | 22 | # Start the agent application with the provided adapter 23 | return await adapter.process( 24 | request, 25 | agent_application, 26 | ) 27 | -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/agent_http_adapter.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from abc import abstractmethod 5 | from typing import Optional, Protocol 6 | 7 | from aiohttp.web import ( 8 | Request, 9 | Response, 10 | ) 11 | 12 | from microsoft.agents.builder import Agent 13 | 14 | 15 | class AgentHttpAdapter(Protocol): 16 | @abstractmethod 17 | async def process(self, request: Request, agent: Agent) -> Optional[Response]: 18 | raise NotImplementedError() 19 | -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .streaming import ( 5 | Citation, 6 | CitationUtil, 7 | StreamingResponse, 8 | ) 9 | 10 | __all__ = [ 11 | "Citation", 12 | "CitationUtil", 13 | "StreamingResponse", 14 | ] 15 | -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from .citation import Citation 5 | from .citation_util import CitationUtil 6 | from .streaming_response import StreamingResponse 7 | 8 | __all__ = [ 9 | "Citation", 10 | "CitationUtil", 11 | "StreamingResponse", 12 | ] 13 | -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/app/streaming/citation.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | from typing import Optional 5 | from dataclasses import dataclass 6 | 7 | 8 | @dataclass 9 | class Citation: 10 | """Citations returned by the model.""" 11 | 12 | content: str 13 | """The content of the citation.""" 14 | 15 | title: Optional[str] = None 16 | """The title of the citation.""" 17 | 18 | url: Optional[str] = None 19 | """The URL of the citation.""" 20 | 21 | filepath: Optional[str] = None 22 | """The filepath of the document.""" 23 | -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-aiohttp/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-hosting-aiohttp" 7 | version = "0.0.0a1" 8 | description = "A protocol library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "microsoft-agents-connector", 18 | "microsoft-agents-builder", 19 | "aiohttp>=3.11.11", 20 | ] 21 | 22 | [project.urls] 23 | "Homepage" = "https://github.com/microsoft/Agents-for-python" 24 | -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/__init__.py: -------------------------------------------------------------------------------- 1 | from .teams_activity_handler import TeamsActivityHandler 2 | from .teams_info import TeamsInfo 3 | 4 | __all__ = ["TeamsActivityHandler", "TeamsInfo"] 5 | -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_cloud_adapter.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Agents-for-python/b367489e023e2c734d93da01098ae138bc16ee5b/libraries/Hosting/microsoft-agents-hosting-teams/microsoft/agents/hosting/teams/teams_cloud_adapter.py -------------------------------------------------------------------------------- /libraries/Hosting/microsoft-agents-hosting-teams/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-hosting-teams" 7 | version = "0.0.0a1" 8 | description = "A protocol library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "microsoft-agents-connector", 18 | "microsoft-agents-builder", 19 | "aiohttp>=3.11.11", 20 | ] 21 | 22 | [project.urls] 23 | "Homepage" = "https://github.com/microsoft/Agents-for-python" 24 | -------------------------------------------------------------------------------- /libraries/Storage/microsoft-agents-blob/microsoft/agents/blob/__init__.py: -------------------------------------------------------------------------------- 1 | from .blob_storage import BlobStorage 2 | from .blob_storage_config import BlobStorageConfig 3 | 4 | __all__ = ["BlobStorage", "BlobStorageConfig"] 5 | -------------------------------------------------------------------------------- /libraries/Storage/microsoft-agents-blob/microsoft/agents/blob/blob_storage_config.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from azure.core.credentials import TokenCredential 4 | 5 | 6 | class BlobStorageConfig: 7 | """Configuration settings for BlobStorage.""" 8 | 9 | def __init__( 10 | self, 11 | container_name: str, 12 | connection_string: str = "", 13 | url: str = "", 14 | credential: Union[TokenCredential, None] = None, 15 | ): 16 | """Configuration settings for BlobStorage. 17 | 18 | container_name: The name of the blob container. 19 | connection_string: The connection string to the storage account. 20 | url: The URL of the blob service. If provided, credential must also be provided. 21 | credential: The TokenCredential to use for authentication when using a custom URL. 22 | 23 | credential-based authentication is prioritized over connection string authentication. 24 | """ 25 | self.container_name: str = container_name 26 | self.connection_string: str = connection_string 27 | self.url: str = url 28 | self.credential: Union[TokenCredential, None] = credential 29 | -------------------------------------------------------------------------------- /libraries/Storage/microsoft-agents-blob/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-blob" 7 | version = "0.0.0a1" 8 | description = "A blob storage library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | "microsoft.agents.storage", 18 | "azure-core", 19 | "azure-storage-blob", 20 | ] 21 | 22 | [project.urls] 23 | "Homepage" = "https://github.com/microsoft/microsoft-agents-protocol" 24 | -------------------------------------------------------------------------------- /libraries/Storage/microsoft-agents-storage/microsoft/agents/storage/__init__.py: -------------------------------------------------------------------------------- 1 | from .store_item import StoreItem 2 | from .storage import Storage 3 | from .memory_storage import MemoryStorage 4 | 5 | __all__ = ["StoreItem", "Storage", "MemoryStorage"] 6 | -------------------------------------------------------------------------------- /libraries/Storage/microsoft-agents-storage/microsoft/agents/storage/_type_aliases.py: -------------------------------------------------------------------------------- 1 | from typing import MutableMapping, Any 2 | 3 | JSON = MutableMapping[str, Any] 4 | -------------------------------------------------------------------------------- /libraries/Storage/microsoft-agents-storage/microsoft/agents/storage/error_handling.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Callable, Awaitable 2 | from typing import TypeVar 3 | 4 | error_filter = TypeVar("error_filter", bound=Callable[[Exception], bool]) 5 | 6 | 7 | async def ignore_error(promise: Awaitable, ignore_error_filter: error_filter): 8 | """ 9 | Ignores errors based on the provided filter function. 10 | promise: the awaitable to execute 11 | ignore_error_filter: a function that takes an Exception and returns True if the error should be 12 | """ 13 | try: 14 | return await promise 15 | except Exception as err: 16 | if ignore_error_filter(err): 17 | return None 18 | raise err 19 | 20 | 21 | def is_status_code_error(*ignored_codes: list[int]) -> error_filter: 22 | """ 23 | Creates an error filter function that ignores errors with specific status codes. 24 | """ 25 | 26 | def func(err: Exception) -> bool: 27 | if hasattr(err, "status_code") and err.status_code in ignored_codes: 28 | return True 29 | return False 30 | 31 | return func 32 | -------------------------------------------------------------------------------- /libraries/Storage/microsoft-agents-storage/microsoft/agents/storage/store_item.py: -------------------------------------------------------------------------------- 1 | from abc import ABC 2 | from typing import Protocol, runtime_checkable 3 | 4 | from ._type_aliases import JSON 5 | 6 | 7 | class StoreItem(ABC): 8 | def store_item_to_json(self) -> JSON: 9 | pass 10 | 11 | @staticmethod 12 | def from_json_to_store_item(json_data: JSON) -> "StoreItem": 13 | pass 14 | -------------------------------------------------------------------------------- /libraries/Storage/microsoft-agents-storage/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "microsoft-agents-storage" 7 | version = "0.0.0a1" 8 | description = "A storage library for Microsoft Agents" 9 | authors = [{name = "Microsoft Corporation"}] 10 | requires-python = ">=3.9" 11 | classifiers = [ 12 | "Programming Language :: Python :: 3", 13 | "License :: OSI Approved :: MIT License", 14 | "Operating System :: OS Independent", 15 | ] 16 | dependencies = [ 17 | ] 18 | 19 | [project.urls] 20 | "Homepage" = "https://github.com/microsoft/microsoft-agents-protocol" 21 | -------------------------------------------------------------------------------- /libraries/Storage/microsoft-agents-storage/tests/test_memory_storage.py: -------------------------------------------------------------------------------- 1 | from microsoft.agents.storage.memory_storage import MemoryStorage 2 | from microsoft.agents.storage.storage_test_utils import CRUDStorageTests, StorageMock 3 | 4 | 5 | class MemoryStorageMock(StorageMock): 6 | 7 | def __init__(self, initial_data: dict = None): 8 | 9 | data = { 10 | key: value.store_item_to_json() 11 | for key, value in (initial_data or {}).items() 12 | } 13 | self.storage = MemoryStorage(data) 14 | 15 | def get_backing_store(self): 16 | return self.storage 17 | 18 | 19 | class TestMemoryStorage(CRUDStorageTests): 20 | 21 | async def storage(self, initial_state=None): 22 | return MemoryStorageMock(initial_state) 23 | -------------------------------------------------------------------------------- /test_samples/agent_to_agent/agent_1/env.TEMPLATE: -------------------------------------------------------------------------------- 1 | # Rename to .env 2 | TENANT_ID= 3 | CLIENT_ID= 4 | CLIENT_SECRET= 5 | TARGET_APP_ID= -------------------------------------------------------------------------------- /test_samples/agent_to_agent/agent_2/agent2.py: -------------------------------------------------------------------------------- 1 | from microsoft.agents.builder import ActivityHandler, TurnContext 2 | from microsoft.agents.core.models import ( 3 | ChannelAccount, 4 | Activity, 5 | EndOfConversationCodes, 6 | ) 7 | 8 | 9 | class Agent2(ActivityHandler): 10 | async def on_members_added_activity( 11 | self, members_added: list[ChannelAccount], turn_context: TurnContext 12 | ): 13 | for member in members_added: 14 | if member.id != turn_context.activity.recipient.id: 15 | await turn_context.send_activity("Hi, This is Agent2") 16 | 17 | async def on_message_activity(self, turn_context: TurnContext): 18 | if any( 19 | stop_message in turn_context.activity.text 20 | for stop_message in ["stop", "end"] 21 | ): 22 | await turn_context.send_activity("(Agent2) Ending conversation from Agent2") 23 | end_of_conversation = Activity.create_end_of_conversation_activity() 24 | end_of_conversation.code = EndOfConversationCodes.completed_successfully 25 | await turn_context.send_activity(end_of_conversation) 26 | else: 27 | await turn_context.send_activity( 28 | f"Echo(Agent2): {turn_context.activity.text}" 29 | ) 30 | await turn_context.send_activity( 31 | 'Echo(Agent2): Say "end" or "stop" and I\'ll end the conversation and return to the parent.' 32 | ) 33 | 34 | async def on_end_of_conversation_activity(self, turn_context): 35 | return 36 | -------------------------------------------------------------------------------- /test_samples/agent_to_agent/agent_2/config.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | from microsoft.agents.authentication.msal import AuthTypes, MsalAuthConfiguration 3 | 4 | 5 | class DefaultConfig(MsalAuthConfiguration): 6 | """Agent Configuration""" 7 | 8 | def __init__(self) -> None: 9 | self.AUTH_TYPE = AuthTypes.client_secret 10 | self.TENANT_ID = "" or environ.get("TENANT_ID") 11 | self.CLIENT_ID = "" or environ.get("CLIENT_ID") 12 | self.CLIENT_SECRET = "" or environ.get("CLIENT_SECRET") 13 | self.PORT = 3999 14 | -------------------------------------------------------------------------------- /test_samples/agent_to_agent/agent_2/env.TEMPLATE: -------------------------------------------------------------------------------- 1 | # Rename to .env 2 | TENANT_ID= 3 | CLIENT_ID= 4 | CLIENT_SECRET= -------------------------------------------------------------------------------- /test_samples/app_style/auto_auth.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/Agents-for-python/b367489e023e2c734d93da01098ae138bc16ee5b/test_samples/app_style/auto_auth.py -------------------------------------------------------------------------------- /test_samples/app_style/env.TEMPLATE: -------------------------------------------------------------------------------- 1 | CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID=client-id 2 | CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET=client-secret 3 | CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID=tenant-id 4 | 5 | CONNECTIONS__MCS__SETTINGS__CLIENTID=client-id 6 | CONNECTIONS__MCS__SETTINGS__CLIENTSECRET=client-secret 7 | CONNECTIONS__MCS__SETTINGS__TENANTID=tenant-id 8 | 9 | AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__GRAPH__SETTINGS__AZUREBOTOAUTHCONNECTIONNAME=connection-name 10 | AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__GRAPH__SETTINGS__OBOCONNECTIONNAME=connection-name 11 | AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__GITHUB__SETTINGS__AZUREBOTOAUTHCONNECTIONNAME=connection-name 12 | AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__GITHUB__SETTINGS__OBOCONNECTIONNAME=connection-name 13 | AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__MCS__SETTINGS__AZUREBOTOAUTHCONNECTIONNAME=connection-name 14 | AGENTAPPLICATION__USERAUTHORIZATION__HANDLERS__MCS__SETTINGS__OBOCONNECTIONNAME=connection-name 15 | 16 | COPILOTSTUDIOAGENT__ENVIRONMENTID=environment-id 17 | COPILOTSTUDIOAGENT__SCHEMANAME=schema-name 18 | COPILOTSTUDIOAGENT__TENANTID=tenant-id 19 | COPILOTSTUDIOAGENT__AGENTAPPID=agent-app-id -------------------------------------------------------------------------------- /test_samples/app_style/shared/__init__.py: -------------------------------------------------------------------------------- 1 | from .user_graph_client import GraphClient 2 | from .github_api_client import GitHubClient 3 | from .start_server import start_server 4 | 5 | __all__ = ["GraphClient", "GitHubClient", "start_server"] 6 | -------------------------------------------------------------------------------- /test_samples/app_style/shared/start_server.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | from microsoft.agents.authorization import AgentAuthConfiguration 3 | from microsoft.agents.builder.app import AgentApplication 4 | from microsoft.agents.hosting.aiohttp import ( 5 | jwt_authorization_middleware, 6 | start_agent_process, 7 | CloudAdapter, 8 | ) 9 | from aiohttp.web import Request, Response, Application, run_app 10 | from microsoft.agents.hosting.aiohttp._start_agent_process import start_agent_process 11 | 12 | 13 | def start_server( 14 | agent_application: AgentApplication, auth_configuration: AgentAuthConfiguration 15 | ): 16 | async def entry_point(req: Request) -> Response: 17 | agent: AgentApplication = req.app["agent_app"] 18 | adapter: CloudAdapter = req.app["adapter"] 19 | return await start_agent_process( 20 | req, 21 | agent, 22 | adapter, 23 | ) 24 | 25 | APP = Application(middlewares=[jwt_authorization_middleware]) 26 | APP.router.add_post("/api/messages", entry_point) 27 | APP["agent_configuration"] = auth_configuration 28 | APP["agent_app"] = agent_application 29 | APP["adapter"] = agent_application.adapter 30 | 31 | try: 32 | run_app(APP, host="localhost", port=environ.get("PORT", 3978)) 33 | except Exception as error: 34 | raise error 35 | -------------------------------------------------------------------------------- /test_samples/app_style/shared/user_graph_client.py: -------------------------------------------------------------------------------- 1 | import aiohttp 2 | 3 | 4 | class GraphClient: 5 | """ 6 | A simple Microsoft Graph client using aiohttp. 7 | """ 8 | 9 | @staticmethod 10 | async def get_me(token: str): 11 | """ 12 | Get information about the current user. 13 | """ 14 | async with aiohttp.ClientSession() as session: 15 | headers = { 16 | "Authorization": f"Bearer {token}", 17 | "Content-Type": "application/json", 18 | } 19 | async with session.get( 20 | f"https://graph.microsoft.com/v1.0/me", headers=headers 21 | ) as response: 22 | if response.status == 200: 23 | return await response.json() 24 | else: 25 | error_text = await response.text() 26 | raise Exception( 27 | f"Error from Graph API: {response.status} - {error_text}" 28 | ) 29 | -------------------------------------------------------------------------------- /test_samples/copilot_studio_client_sample/env.TEMPLATE: -------------------------------------------------------------------------------- 1 | # Rename to .env 2 | ENVIRONMENT_ID= 3 | AGENT_IDENTIFIER= 4 | TENANT_ID= 5 | APP_CLIENT_ID= 6 | TOKEN_CACHE_PATH= -------------------------------------------------------------------------------- /test_samples/copilot_studio_client_sample/msal_cache_plugin.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from msal_extensions import ( 4 | build_encrypted_persistence, 5 | FilePersistence, 6 | PersistedTokenCache, 7 | ) 8 | 9 | 10 | def get_msal_token_cache( 11 | cache_path: str, fallback_to_plaintext=True 12 | ) -> PersistedTokenCache: 13 | 14 | persistence = None 15 | 16 | # Note: This sample stores both encrypted persistence and plaintext persistence 17 | # into same location, therefore their data would likely override with each other. 18 | try: 19 | persistence = build_encrypted_persistence(cache_path) 20 | except: # pylint: disable=bare-except 21 | # On Linux, encryption exception will be raised during initialization. 22 | # On Windows and macOS, they won't be detected here, 23 | # but will be raised during their load() or save(). 24 | if not fallback_to_plaintext: 25 | raise 26 | logging.warning("Encryption unavailable. Opting in to plain text.") 27 | persistence = FilePersistence(cache_path) 28 | 29 | return PersistedTokenCache(persistence) 30 | -------------------------------------------------------------------------------- /test_samples/empty_agent/config.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | from microsoft.agents.authentication.msal import AuthTypes, MsalAuthConfiguration 3 | 4 | 5 | class DefaultConfig(MsalAuthConfiguration): 6 | """Agent Configuration""" 7 | 8 | def __init__(self) -> None: 9 | self.AUTH_TYPE = AuthTypes.client_secret 10 | self.TENANT_ID = "" or environ.get("TENANT_ID") 11 | self.CLIENT_ID = "" or environ.get("CLIENT_ID") 12 | self.CLIENT_SECRET = "" or environ.get("CLIENT_SECRET") 13 | self.PORT = 3978 14 | -------------------------------------------------------------------------------- /test_samples/empty_agent/empty_agent.py: -------------------------------------------------------------------------------- 1 | from microsoft.agents.builder import ActivityHandler, MessageFactory, TurnContext 2 | from microsoft.agents.core.models import ChannelAccount 3 | 4 | 5 | class EmptyAgent(ActivityHandler): 6 | async def on_members_added_activity( 7 | self, members_added: list[ChannelAccount], turn_context: TurnContext 8 | ): 9 | for member in members_added: 10 | if member.id != turn_context.activity.recipient.id: 11 | await turn_context.send_activity("Hello and welcome!") 12 | 13 | async def on_message_activity(self, turn_context: TurnContext): 14 | return await turn_context.send_activity( 15 | MessageFactory.text(f"Echo: {turn_context.activity.text}") 16 | ) 17 | -------------------------------------------------------------------------------- /test_samples/empty_agent/env.TEMPLATE: -------------------------------------------------------------------------------- 1 | # Rename to .env 2 | TENANT_ID= 3 | CLIENT_ID= 4 | CLIENT_SECRET= -------------------------------------------------------------------------------- /test_samples/empty_agent/requirements.txt: -------------------------------------------------------------------------------- 1 | python-dotenv -------------------------------------------------------------------------------- /test_samples/teams_agent/cards/AdaptiveCard.json: -------------------------------------------------------------------------------- 1 |  2 | { 3 | "version": "1.0", 4 | "type": "AdaptiveCard", 5 | "body": [ 6 | { 7 | "type": "TextBlock", 8 | "text": "Enter Text Here", 9 | "weight": "bolder", 10 | "isSubtle": false 11 | }, 12 | { 13 | "type": "Input.Text", 14 | "id": "usertext", 15 | "spacing": "none", 16 | "isMultiLine": "true", 17 | "placeholder": "add some text and submit" 18 | } 19 | ], 20 | "actions": [ 21 | { 22 | "type": "Action.Submit", 23 | "title": "Submit" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /test_samples/teams_agent/config.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | from microsoft.agents.authentication.msal import AuthTypes, MsalAuthConfiguration 3 | 4 | 5 | class DefaultConfig(MsalAuthConfiguration): 6 | """Teams Agent Configuration""" 7 | 8 | def __init__(self) -> None: 9 | self.AUTH_TYPE = AuthTypes.client_secret 10 | self.TENANT_ID = "" or environ.get("TENANT_ID") 11 | self.CLIENT_ID = "" or environ.get("CLIENT_ID") 12 | self.CLIENT_SECRET = "" or environ.get("CLIENT_SECRET") 13 | self.CONNECTION_NAME = "" or environ.get("CONNECTION_NAME") 14 | self.AGENT_TYPE = environ.get( 15 | "AGENT_TYPE", "TeamsHandler" 16 | ) # Default to TeamsHandler 17 | self.PORT = 3978 18 | -------------------------------------------------------------------------------- /test_samples/teams_agent/env.TEMPLATE: -------------------------------------------------------------------------------- 1 | # Rename to .env 2 | TENANT_ID= 3 | CLIENT_ID= 4 | CLIENT_SECRET= 5 | AGENT_TYPE=TeamsSso 6 | BASE_URL= 7 | CONNECTION_NAME= -------------------------------------------------------------------------------- /test_samples/teams_agent/helpers/task_module_ids.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | """Task Module ID constants.""" 5 | 6 | 7 | from enum import Enum 8 | 9 | 10 | class TaskModuleIds(str, Enum): 11 | """ 12 | Class containing constants for Task Module IDs. 13 | """ 14 | 15 | AdaptiveCard = "AdaptiveCard" 16 | YouTube = "YouTube" 17 | CustomForm = "CustomForm" 18 | -------------------------------------------------------------------------------- /test_samples/teams_agent/helpers/task_module_ui_constants.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | """Task Module UI constants for Teams applications.""" 5 | 6 | from .task_module_ids import TaskModuleIds 7 | from .ui_settings import UISettings 8 | 9 | 10 | class TaskModuleUIConstants: 11 | """ 12 | Class containing UI settings constants for various Task Modules. 13 | """ 14 | 15 | AdaptiveCard: UISettings = UISettings( 16 | width=400, 17 | height=200, 18 | title="Adaptive Card: Inputs", 19 | id=TaskModuleIds.AdaptiveCard, 20 | button_title="Adaptive Card", 21 | ) 22 | 23 | YouTube: UISettings = UISettings( 24 | width=1000, 25 | height=700, 26 | title="You Tube Video", 27 | id=TaskModuleIds.YouTube, 28 | button_title="You Tube", 29 | ) 30 | 31 | CustomForm: UISettings = UISettings( 32 | width=510, 33 | height=450, 34 | title="Custom Form", 35 | id=TaskModuleIds.CustomForm, 36 | button_title="Custom Form", 37 | ) 38 | -------------------------------------------------------------------------------- /test_samples/teams_agent/helpers/ui_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Microsoft Corporation. All rights reserved. 2 | # Licensed under the MIT License. 3 | 4 | """UI Settings model for Teams task modules.""" 5 | 6 | from typing import Optional 7 | 8 | 9 | class UISettings: 10 | """ 11 | Settings for configuring UI elements in Teams task modules. 12 | 13 | Attributes: 14 | height: The height of the UI element. 15 | width: The width of the UI element. 16 | title: The title to display. 17 | button_title: The text to display on the button. 18 | id: The identifier for the UI element. 19 | """ 20 | 21 | def __init__( 22 | self, 23 | height: Optional[int] = None, 24 | width: Optional[int] = None, 25 | title: Optional[str] = None, 26 | button_title: Optional[str] = None, 27 | id: Optional[str] = None, 28 | ): 29 | """ 30 | Initialize UISettings with optional parameters. 31 | Args: 32 | height: The height of the UI element. 33 | width: The width of the UI element. 34 | title: The title to display. 35 | button_title: The text to display on the button. 36 | id: The identifier for the UI element. 37 | """ 38 | self.height = height 39 | self.width = width 40 | self.title = title 41 | self.button_title = button_title 42 | self.id = id 43 | -------------------------------------------------------------------------------- /test_samples/weather-agent-open-ai/config.py: -------------------------------------------------------------------------------- 1 | from os import environ 2 | from microsoft.agents.authentication.msal import AuthTypes, MsalAuthConfiguration 3 | 4 | 5 | class DefaultConfig(MsalAuthConfiguration): 6 | """Agent Configuration""" 7 | 8 | def __init__(self) -> None: 9 | self.AUTH_TYPE = AuthTypes.client_secret 10 | self.TENANT_ID = "" or environ.get("TENANT_ID") 11 | self.CLIENT_ID = "" or environ.get("CLIENT_ID") 12 | self.CLIENT_SECRET = "" or environ.get("CLIENT_SECRET") 13 | self.AZURE_OPENAI_API_KEY = "" or environ.get("AZURE_OPENAI_API_KEY") 14 | self.AZURE_OPENAI_ENDPOINT = "" or environ.get("AZURE_OPENAI_ENDPOINT") 15 | self.AZURE_OPENAI_API_VERSION = "" or environ.get( 16 | "AZURE_OPENAI_API_VERSION", "2024-06-01" 17 | ) 18 | self.PORT = 3978 19 | -------------------------------------------------------------------------------- /test_samples/weather-agent-open-ai/env.TEMPLATE: -------------------------------------------------------------------------------- 1 | # Rename to .env 2 | TENANT_ID= 3 | CLIENT_ID= 4 | CLIENT_SECRET= 5 | AZURE_OPENAI_API_KEY= 6 | AZURE_OPENAI_API_VERSION= 7 | AZURE_OPENAI_ENDPOINT= -------------------------------------------------------------------------------- /test_samples/weather-agent-open-ai/requirements.txt: -------------------------------------------------------------------------------- 1 | openai 2 | openai-agents -------------------------------------------------------------------------------- /test_samples/weather-agent-open-ai/tools/date_time_tool.py: -------------------------------------------------------------------------------- 1 | from agents import function_tool 2 | from datetime import datetime 3 | 4 | 5 | @function_tool 6 | def get_date() -> str: 7 | """ 8 | A function tool that returns the current date and time. 9 | """ 10 | return datetime.now().isoformat() 11 | -------------------------------------------------------------------------------- /test_samples/weather-agent-open-ai/tools/get_weather_tool.py: -------------------------------------------------------------------------------- 1 | import random 2 | from pydantic import BaseModel 3 | 4 | from agents import function_tool 5 | 6 | 7 | class Weather(BaseModel): 8 | city: str 9 | temperature: str 10 | conditions: str 11 | date: str 12 | 13 | 14 | @function_tool 15 | def get_weather(city: str, date: str) -> Weather: 16 | print("[debug] get_weather called") 17 | temperature = random.randint(8, 21) 18 | return Weather( 19 | city=city, 20 | temperature=f"{temperature}C", 21 | conditions="Sunny with wind.", 22 | date=date, 23 | ) 24 | --------------------------------------------------------------------------------